Skip to content
Gábor Szárnyas edited this page Apr 6, 2015 · 12 revisions

Running JUnit test in a specific order

From JUnit 4.11, the following works:

@FixMethodOrder(MethodSorters.NAME_ASCENDING)

Comparing integers

int vs. long

Long l = 1L;
Integer i = 1;
System.out.println(l.equals(i)); // false
System.out.println(1 == 1L); // true

Outputs:

false
true

See also http://cubussapiens.hu/2012/05/java-primitive-type-comparison-a-wat-look/.

Clone this wiki locally