bzr branch
http://gegoxaren.bato24.eu/bzr/magstudentportal/trunk
18
by Gustav Hartvigsson
* Added vim modelines |
1 |
/* c-basic-offset: 2; tab-width: 2; indent-tabs-mode: nil
|
2 |
* vi: set shiftwidth=2 tabstop=2 expandtab:
|
|
3 |
* :indentSize=2:tabSize=2:noTabs=true:
|
|
4 |
*/
|
|
5 |
||
15.2.2
by Gustav Hartvigsson
* Added JUnit and javax.faces dependancies to the pom.xml. |
6 |
import org.junit.*; |
7 |
||
8 |
import common.Utils; |
|
9 |
||
24
by Gustav Hartvigsson
* making sure that the hash function works as expedted |
10 |
import javax.rmi.CORBA.Util; |
11 |
import java.util.Objects; |
|
12 |
||
15.2.2
by Gustav Hartvigsson
* Added JUnit and javax.faces dependancies to the pom.xml. |
13 |
public class TestHash { |
14 |
@Test |
|
24
by Gustav Hartvigsson
* making sure that the hash function works as expedted |
15 |
public void |
16 |
test1 () { |
|
15.2.2
by Gustav Hartvigsson
* Added JUnit and javax.faces dependancies to the pom.xml. |
17 |
System.out.println(Utils.hash_func("Hello World")); |
18 |
} |
|
19 |
||
24
by Gustav Hartvigsson
* making sure that the hash function works as expedted |
20 |
@Test |
21 |
public void |
|
22 |
test2 () { |
|
23 |
String s0 = Utils.hash_func("Hello World"); |
|
24 |
String s1 = Utils.hash_func("hello World"); |
|
25 |
assert (! Objects.equals (s0, s1)); |
|
26 |
System.out.println ("Hello World: " + s0); |
|
27 |
System.out.println ("hello World: " + s1); |
|
28 |
} |
|
29 |
||
30 |
@Test public void |
|
31 |
test3 () { |
|
32 |
String s0 = new String ("Hello World!"); |
|
33 |
String s1 = "Hello World!"; |
|
34 |
||
35 |
String h0 = Utils.hash_func (s0); |
|
36 |
String h1 = Utils.hash_func (s1); |
|
37 |
||
38 |
assert (Objects.equals (h0, h1)); |
|
39 |
} |
|
40 |
||
15.2.2
by Gustav Hartvigsson
* Added JUnit and javax.faces dependancies to the pom.xml. |
41 |
}
|