/magstudentportal/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/magstudentportal/trunk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* c-basic-offset: 2; tab-width: 2; indent-tabs-mode: nil
 * vi: set shiftwidth=2 tabstop=2 expandtab:
 * :indentSize=2:tabSize=2:noTabs=true:
 */

import org.junit.*;

import common.Utils;

import javax.rmi.CORBA.Util;
import java.util.Objects;

public class TestHash {
  @Test
  public void
  test1 () {
    System.out.println(Utils.hash_func("Hello World"));
  }

  @Test
  public void
  test2 () {
    String s0 = Utils.hash_func("Hello World");
    String s1 = Utils.hash_func("hello World");
    assert (! Objects.equals (s0, s1));
    System.out.println ("Hello World: " + s0);
    System.out.println ("hello World: " + s1);
  }

  @Test public void
  test3 () {
    String s0 = new String ("Hello World!");
    String s1 = "Hello World!";

    String h0 = Utils.hash_func (s0);
    String h1 = Utils.hash_func (s1);

    assert (Objects.equals (h0, h1));
  }

}