Formating.
This commit is contained in:
parent
c158713b66
commit
e830027629
|
@ -59,12 +59,11 @@ public class RangeTest {
|
||||||
doubleRange = Range.between((double) 10, (double) 20);
|
doubleRange = Range.between((double) 10, (double) 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||||
@Test
|
@Test
|
||||||
public void testComparableConstructors() {
|
public void testComparableConstructors() {
|
||||||
final Comparable c =
|
final Comparable c = new Comparable() {
|
||||||
new Comparable() {
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(final Object other) {
|
public int compareTo(final Object other) {
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -77,21 +76,21 @@ public class RangeTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testIsWithCompare(){
|
public void testIsWithCompare() {
|
||||||
final Comparator<Integer> c = new Comparator<Integer>(){
|
final Comparator<Integer> c = new Comparator<Integer>() {
|
||||||
@Override
|
@Override
|
||||||
public int compare(final Integer o1, final Integer o2) {
|
public int compare(final Integer o1, final Integer o2) {
|
||||||
return 0; // all integers are equal
|
return 0; // all integers are equal
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Range<Integer> ri = Range.is(10);
|
Range<Integer> ri = Range.is(10);
|
||||||
assertFalse("should not contain null",ri.contains(null));
|
assertFalse("should not contain null", ri.contains(null));
|
||||||
assertTrue("should contain 10",ri.contains(10));
|
assertTrue("should contain 10", ri.contains(10));
|
||||||
assertFalse("should not contain 11",ri.contains(11));
|
assertFalse("should not contain 11", ri.contains(11));
|
||||||
ri = Range.is(10,c);
|
ri = Range.is(10, c);
|
||||||
assertFalse("should not contain null",ri.contains(null));
|
assertFalse("should not contain null", ri.contains(null));
|
||||||
assertTrue("should contain 10",ri.contains(10));
|
assertTrue("should contain 10", ri.contains(10));
|
||||||
assertTrue("should contain 11",ri.contains(11));
|
assertTrue("should contain 11", ri.contains(11));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -134,7 +133,7 @@ public class RangeTest {
|
||||||
assertFalse("should not contain ''", rbstr.contains(""));
|
assertFalse("should not contain ''", rbstr.contains(""));
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
@Test
|
@Test
|
||||||
public void testRangeOfChars() {
|
public void testRangeOfChars() {
|
||||||
final Range<Character> chars = Range.between('a', 'z');
|
final Range<Character> chars = Range.between('a', 'z');
|
||||||
|
@ -142,7 +141,7 @@ public class RangeTest {
|
||||||
assertFalse(chars.contains('B'));
|
assertFalse(chars.contains('B'));
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
@Test
|
@Test
|
||||||
public void testEqualsObject() {
|
public void testEqualsObject() {
|
||||||
assertEquals(byteRange, byteRange);
|
assertEquals(byteRange, byteRange);
|
||||||
|
@ -180,7 +179,7 @@ public class RangeTest {
|
||||||
assertEquals("From 10 to 20", str);
|
assertEquals("From 10 to 20", str);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
@Test
|
@Test
|
||||||
public void testGetMinimum() {
|
public void testGetMinimum() {
|
||||||
assertEquals(10, (int) intRange.getMinimum());
|
assertEquals(10, (int) intRange.getMinimum());
|
||||||
|
@ -257,7 +256,7 @@ public class RangeTest {
|
||||||
try {
|
try {
|
||||||
intRange.elementCompareTo(null);
|
intRange.elementCompareTo(null);
|
||||||
fail("NullPointerException should have been thrown");
|
fail("NullPointerException should have been thrown");
|
||||||
} catch(final NullPointerException npe) {
|
} catch (final NullPointerException npe) {
|
||||||
// expected
|
// expected
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -268,7 +267,7 @@ public class RangeTest {
|
||||||
assertEquals(1, intRange.elementCompareTo(25));
|
assertEquals(1, intRange.elementCompareTo(25));
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
@Test
|
@Test
|
||||||
public void testContainsRange() {
|
public void testContainsRange() {
|
||||||
|
|
||||||
|
@ -386,7 +385,7 @@ public class RangeTest {
|
||||||
intRange.intersectionWith(Range.between(0, 9));
|
intRange.intersectionWith(Range.between(0, 9));
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
@Test
|
@Test
|
||||||
public void testSerializing() {
|
public void testSerializing() {
|
||||||
SerializationUtils.clone(intRange);
|
SerializationUtils.clone(intRange);
|
||||||
|
|
Loading…
Reference in New Issue