Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6435510327 for ; Tue, 30 Apr 2013 14:28:14 +0000 (UTC) Received: (qmail 48089 invoked by uid 500); 30 Apr 2013 14:28:14 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 48021 invoked by uid 500); 30 Apr 2013 14:28:14 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 48014 invoked by uid 99); 30 Apr 2013 14:28:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Apr 2013 14:28:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Apr 2013 14:28:03 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 3C1E123888E4; Tue, 30 Apr 2013 14:27:41 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1477661 [2/3] - in /commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4: ./ bag/ bidimap/ collection/ comparators/ functors/ iterators/ keyvalue/ list/ map/ queue/ set/ trie/ Date: Tue, 30 Apr 2013 14:27:37 -0000 To: commits@commons.apache.org From: sebb@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130430142741.3C1E123888E4@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/FilterListIteratorTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/FilterListIteratorTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/FilterListIteratorTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/FilterListIteratorTest.java Tue Apr 30 14:27:35 2013 @@ -72,37 +72,37 @@ public class FilterListIteratorTest exte } truePred = new Predicate() { - public boolean evaluate(final Integer x) { + public boolean evaluate(final Integer x) { return true; } }; falsePred = new Predicate() { - public boolean evaluate(final Integer x) { + public boolean evaluate(final Integer x) { return true; } }; evenPred = new Predicate() { - public boolean evaluate(final Integer x) { + public boolean evaluate(final Integer x) { return x % 2 == 0; } }; oddPred = new Predicate() { - public boolean evaluate(final Integer x) { + public boolean evaluate(final Integer x) { return x % 2 != 0; //works for all numbers, not just >= 0 as is the case for "x % 2 == 1" } }; threePred = new Predicate() { - public boolean evaluate(final Integer x) { + public boolean evaluate(final Integer x) { return x % 3 == 0; } }; fourPred = new Predicate() { - public boolean evaluate(final Integer x) { + public boolean evaluate(final Integer x) { return x % 4 == 0; } }; @@ -133,7 +133,7 @@ public class FilterListIteratorTest exte public void testManual() { // do this one "by hand" as a sanity check final FilterListIterator filtered = new FilterListIterator(list.listIterator(), threePred); - + assertEquals(Integer.valueOf(0), filtered.next()); assertEquals(Integer.valueOf(3), filtered.next()); assertEquals(Integer.valueOf(6), filtered.next()); @@ -149,7 +149,7 @@ public class FilterListIteratorTest exte assertEquals(Integer.valueOf(6), filtered.previous()); assertEquals(Integer.valueOf(3), filtered.previous()); assertEquals(Integer.valueOf(0), filtered.previous()); - + assertTrue(!filtered.hasPrevious()); assertEquals(Integer.valueOf(0), filtered.next()); @@ -193,7 +193,7 @@ public class FilterListIteratorTest exte final FilterListIterator filtered = new FilterListIterator(list.listIterator(), truePred); walkLists(list, filtered); } - + public void testFalsePredicate() { final FilterListIterator filtered = new FilterListIterator(list.listIterator(), falsePred); walkLists(new ArrayList(), filtered); @@ -203,7 +203,7 @@ public class FilterListIteratorTest exte final FilterListIterator filtered = new FilterListIterator(list.listIterator(), evenPred); walkLists(evens, filtered); } - + public void testOdds() { final FilterListIterator filtered = new FilterListIterator(list.listIterator(), oddPred); walkLists(odds, filtered); @@ -235,7 +235,7 @@ public class FilterListIteratorTest exte walkLists(sixes, filtered); } - public void testNestedSixes3() { + public void testNestedSixes3() { final FilterListIterator filtered = new FilterListIterator( new FilterListIterator(list.listIterator(), threePred), evenPred @@ -248,7 +248,7 @@ public class FilterListIteratorTest exte final FilterListIterator filtered = new FilterListIterator(list.listIterator(), threePred); nextNextPrevious(threes.listIterator(), filtered); } - + { final FilterListIterator filtered = new FilterListIterator(list.listIterator(), truePred); nextNextPrevious(list.listIterator(), filtered); Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/IteratorChainTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/IteratorChainTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/IteratorChainTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/IteratorChainTest.java Tue Apr 30 14:27:35 2013 @@ -54,7 +54,7 @@ public class IteratorChainTest extends A list2.add("Four"); list3 = new ArrayList(); list3.add("Five"); - list3.add("Six"); + list3.add("Six"); } @Override @@ -86,7 +86,7 @@ public class IteratorChainTest extends A try { iter.next(); } catch (final Exception e) { - assertTrue("NoSuchElementException must be thrown", + assertTrue("NoSuchElementException must be thrown", e.getClass().equals(new NoSuchElementException().getClass())); } } @@ -118,7 +118,7 @@ public class IteratorChainTest extends A assertEquals(0, list1.size()); assertEquals(1, list2.size()); } - + @Override public void testRemove() { final Iterator iter = makeObject(); @@ -162,7 +162,7 @@ public class IteratorChainTest extends A assertEquals("C",chain.next()); assertTrue("should not have next",!chain.hasNext()); } - + public void testEmptyChain() { final IteratorChain chain = new IteratorChain(); assertEquals(false, chain.hasNext()); @@ -175,5 +175,5 @@ public class IteratorChainTest extends A fail(); } catch (final IllegalStateException ex) {} } - + } Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/IteratorIterableTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/IteratorIterableTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/IteratorIterableTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/IteratorIterableTest.java Tue Apr 30 14:27:35 2013 @@ -24,7 +24,7 @@ import org.apache.commons.collections4.i /** * Tests for IteratorIterable. - * + * * @version $Id$ */ public class IteratorIterableTest extends BulkTest { @@ -49,10 +49,10 @@ public class IteratorIterableTest extend public void testIterator() { final Iterator iter = createIterator(); final Iterable iterable = new IteratorIterable(iter); - + // first use verifyIteration(iterable); - + // second use for (@SuppressWarnings("unused") final Number actual : iterable) { fail("should not be able to iterate twice"); @@ -63,10 +63,10 @@ public class IteratorIterableTest extend final Iterator iter = createIterator(); final Iterable iterable = new IteratorIterable(iter, true); - + // first use verifyIteration(iterable); - + // second use verifyIteration(iterable); } Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/LazyIteratorChainTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/LazyIteratorChainTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/LazyIteratorChainTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/LazyIteratorChainTest.java Tue Apr 30 14:27:35 2013 @@ -54,7 +54,7 @@ public class LazyIteratorChainTest exten list2.add("Four"); list3 = new ArrayList(); list3.add("Five"); - list3.add("Six"); + list3.add("Six"); } @Override @@ -100,7 +100,7 @@ public class LazyIteratorChainTest exten try { iter.next(); } catch (final Exception e) { - assertTrue("NoSuchElementException must be thrown", + assertTrue("NoSuchElementException must be thrown", e.getClass().equals(new NoSuchElementException().getClass())); } } @@ -132,7 +132,7 @@ public class LazyIteratorChainTest exten assertEquals(0, list1.size()); assertEquals(1, list2.size()); } - + @Override public void testRemove() { final Iterator iter = makeObject(); @@ -185,7 +185,7 @@ public class LazyIteratorChainTest exten assertEquals("C",chain.next()); assertTrue("should not have next",!chain.hasNext()); } - + public void testEmptyChain() { final LazyIteratorChain chain = makeEmptyIterator(); assertEquals(false, chain.hasNext()); Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/LoopingIteratorTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/LoopingIteratorTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/LoopingIteratorTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/LoopingIteratorTest.java Tue Apr 30 14:27:35 2013 @@ -46,7 +46,7 @@ public class LoopingIteratorTest extends } catch (final NullPointerException ex) { } } - + /** * Tests whether an empty looping iterator works as designed. * @throws Exception If something unexpected occurs. @@ -176,7 +176,7 @@ public class LoopingIteratorTest extends assertEquals("b", loop.next()); assertEquals("c", loop.next()); } - + /** * Tests the size() method on a LoopingIterator wrapped ArrayList. * @throws Exception If something unexpected occurs. Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/LoopingListIteratorTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/LoopingListIteratorTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/LoopingListIteratorTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/LoopingListIteratorTest.java Tue Apr 30 14:27:35 2013 @@ -35,7 +35,7 @@ public class LoopingListIteratorTest ext public LoopingListIteratorTest(final String testName) { super(testName); } - + /** * Tests constructor exception. */ @@ -55,7 +55,7 @@ public class LoopingListIteratorTest ext final LoopingListIterator loop = new LoopingListIterator(list); assertFalse(loop.hasNext()); assertFalse(loop.hasPrevious()); - + try { loop.next(); fail(); @@ -133,7 +133,7 @@ public class LoopingListIteratorTest ext public void testJoggingNotOverBoundary() { final List list = Arrays.asList(new String[] { "a", "b" }); final LoopingListIterator loop = new LoopingListIterator(list); // b - + // Try jogging back and forth between the elements, but not // over the begin/end boundary. loop.reset(); @@ -153,7 +153,7 @@ public class LoopingListIteratorTest ext public void testJoggingOverBoundary() { final List list = Arrays.asList(new String[] { "a", "b" }); final LoopingListIterator loop = new LoopingListIterator(list); // b - + // Try jogging back and forth between the elements, but not // over the begin/end boundary. assertEquals("b", loop.previous()); // a @@ -270,7 +270,7 @@ public class LoopingListIteratorTest ext assertEquals("e", loop.previous()); // a b c f assertEquals("c", loop.previous()); // a b e f assertEquals("c", loop.next()); // a b c f - + loop.add("d"); // a b c d f loop.reset(); // b c d e f assertEquals("a", loop.next()); // a c d e f @@ -282,7 +282,7 @@ public class LoopingListIteratorTest ext assertEquals("a", loop.next()); // a c d e f list = new ArrayList(Arrays.asList(new String[] { "b", "e", "f" })); - loop = new LoopingListIterator(list); // e f + loop = new LoopingListIterator(list); // e f loop.add("a"); // a e f assertEquals("a", loop.previous()); // a b e @@ -350,7 +350,7 @@ public class LoopingListIteratorTest ext loop.reset(); // r c assertEquals("q", loop.next()); // q c loop.set("a"); // a c - + assertEquals("r", loop.next()); // a r loop.set("b"); // a b @@ -359,5 +359,5 @@ public class LoopingListIteratorTest ext assertEquals("b", loop.next()); // a b assertEquals("c", loop.next()); // b c } - + } Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/NodeListIteratorTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/NodeListIteratorTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/NodeListIteratorTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/NodeListIteratorTest.java Tue Apr 30 14:27:35 2013 @@ -32,36 +32,36 @@ import static org.easymock.EasyMock.repl */ public class NodeListIteratorTest extends AbstractIteratorTest { - // Node array to be filled with mocked Node instances + // Node array to be filled with mocked Node instances private Node[] nodes; - + // NodeListIterator supports two constructors. This flag allows to // control, which constructor to use in makeObject() and makeEmtpyIterator private boolean createIteratorWithStandardConstr = true; - + /** - * Constructor - * @param testName + * Constructor + * @param testName */ public NodeListIteratorTest(final String testName) { super(testName); } - + @Override protected void setUp() throws Exception { - super.setUp(); + super.setUp(); // Default: use standard constr. createIteratorWithStandardConstr = true; - - + + // create mocked Node Instances and fill Node[] to be used by test cases final Node node1 = createMock(Element.class); final Node node2 = createMock(Element.class); final Node node3 = createMock(Text.class); final Node node4 = createMock(Element.class); nodes = new Node[] {node1, node2, node3, node4}; - + replay(node1); replay(node2); replay(node3); @@ -78,14 +78,14 @@ public class NodeListIteratorTest extend return 0; } }; - + if (createIteratorWithStandardConstr) { return new NodeListIterator(emptyNodeList); } else { final Node parentNode = createMock(Node.class); expect(parentNode.getChildNodes()).andStubReturn(emptyNodeList); replay(parentNode); - + return new NodeListIterator(parentNode); } } @@ -108,7 +108,7 @@ public class NodeListIteratorTest extend public boolean supportsRemove() { return false; } - + //----------------------------------------------------------------------- public void testNullConstructor(){ try{ Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/PermutationIteratorTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/PermutationIteratorTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/PermutationIteratorTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/PermutationIteratorTest.java Tue Apr 30 14:27:35 2013 @@ -46,12 +46,12 @@ public class PermutationIteratorTest ext } //----------------------------------------------------------------------- - + @Override public boolean supportsRemove() { return false; } - + @Override public boolean supportsEmptyIterator() { return false; @@ -119,7 +119,7 @@ public class PermutationIteratorTest ext perm6.add('A'); List> results = new ArrayList>(); - + PermutationIterator it = makeObject(); while (it.hasNext()) { List next = it.next(); @@ -137,11 +137,11 @@ public class PermutationIteratorTest ext /** * test checking that all the permutations are returned only once. - */ + */ public void testPermutationUnicity() { List> resultsList = new ArrayList>(); Set> resultsSet = new HashSet>(); - + PermutationIterator it = makeObject(); while (it.hasNext()) { List permutation = it.next(); @@ -155,7 +155,7 @@ public class PermutationIteratorTest ext public void testPermutationException() { List> resultsList = new ArrayList>(); - + PermutationIterator it = makeObject(); while (it.hasNext()) { List permutation = it.next(); @@ -183,10 +183,10 @@ public class PermutationIteratorTest ext PermutationIterator it = makeEmptyIterator(); // there is one permutation for an empty set: 0! = 1 assertTrue(it.hasNext()); - + List nextPermutation = it.next(); assertEquals(0, nextPermutation.size()); - + assertFalse(it.hasNext()); } } \ No newline at end of file Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/SingletonListIteratorTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/SingletonListIteratorTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/SingletonListIteratorTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/iterators/SingletonListIteratorTest.java Tue Apr 30 14:27:35 2013 @@ -30,13 +30,13 @@ import org.apache.commons.collections4.i public class SingletonListIteratorTest extends AbstractListIteratorTest { private static final Object testValue = "foo"; - + public SingletonListIteratorTest(final String testName) { super(testName); } - + /** - * Returns a SingletonListIterator from which + * Returns a SingletonListIterator from which * the element has already been removed. */ @Override @@ -44,7 +44,7 @@ public class SingletonListIteratorTest iter = makeObject(); iter.next(); iter.remove(); - iter.reset(); + iter.reset(); return iter; } @@ -75,10 +75,10 @@ public class SingletonListIteratorTest it = makeObject(); - + assertEquals(true, it.hasNext()); assertEquals(false, it.hasPrevious()); assertEquals(testValue, it.next()); @@ -125,18 +125,18 @@ public class SingletonListIteratorTest extends TestCase { - + protected final String key = "name"; protected final String value = "duke"; /** * JUnit constructor. - * + * * @param testName the test name */ public AbstractMapEntryTest(final String testName) { Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/keyvalue/DefaultKeyValueTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/keyvalue/DefaultKeyValueTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/keyvalue/DefaultKeyValueTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/keyvalue/DefaultKeyValueTest.java Tue Apr 30 14:27:35 2013 @@ -30,13 +30,13 @@ import junit.framework.TestCase; * @version $Id$ */ public class DefaultKeyValueTest extends TestCase { - + private final String key = "name"; private final String value = "duke"; /** * JUnit constructor. - * + * * @param testName the test name */ public DefaultKeyValueTest(final String testName) { Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java Tue Apr 30 14:27:35 2013 @@ -218,7 +218,7 @@ public class MultiKeyTest extends TestCa @Override public boolean equals(final Object obj) { - return obj instanceof SystemHashCodeSimulatingKey + return obj instanceof SystemHashCodeSimulatingKey && name.equals(((SystemHashCodeSimulatingKey)obj).name); } @@ -233,7 +233,7 @@ public class MultiKeyTest extends TestCa return this; } } - + public void testEqualsAfterSerialization() throws IOException, ClassNotFoundException { SystemHashCodeSimulatingKey sysKey = new SystemHashCodeSimulatingKey("test"); @@ -258,6 +258,6 @@ public class MultiKeyTest extends TestCa assertEquals(2, sysKey.hashCode()); // different hashCode now final MultiKey mk2 = new MultiKey(ONE, sysKey); - assertEquals(TWO, map2.get(mk2)); + assertEquals(TWO, map2.get(mk2)); } } Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/list/SetUniqueListTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/list/SetUniqueListTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/list/SetUniqueListTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/list/SetUniqueListTest.java Tue Apr 30 14:27:35 2013 @@ -163,7 +163,7 @@ public class SetUniqueListTest extend 4, list.size()); assertEquals("Third new element should be at index 0", thirdNewElement, list.get(0)); } - + @Override @SuppressWarnings("unchecked") public void testListSetByIndex() { @@ -520,12 +520,12 @@ public class SetUniqueListTest extend for (int i = 0; i < 10; ++i) { uniqueList.add((E)Integer.valueOf(i)); } - + final Collection retained = new ArrayList(5); for (int i = 0; i < 5; ++i) { retained.add((E)Integer.valueOf(i * 2)); } - + assertTrue(uniqueList.retainAll(retained)); assertEquals(5, uniqueList.size()); assertTrue(uniqueList.contains(Integer.valueOf(0))); @@ -546,12 +546,12 @@ public class SetUniqueListTest extend for (int i = 5; i < 10; ++i) { uniqueList.add((E)Integer.valueOf(i)); } - + final Collection retained = new ArrayList(5); for (int i = 0; i < 5; ++i) { retained.add((E)Integer.valueOf(i * 2)); } - + assertTrue(uniqueList.retainAll(retained)); assertEquals(5, uniqueList.size()); assertTrue(uniqueList.contains(Integer.valueOf(0))); @@ -560,7 +560,7 @@ public class SetUniqueListTest extend assertTrue(uniqueList.contains(Integer.valueOf(6))); assertTrue(uniqueList.contains(Integer.valueOf(8))); } - + /* * test case for https://issues.apache.org/jira/browse/COLLECTIONS-427 */ @@ -579,13 +579,13 @@ public class SetUniqueListTest extend final long start = System.currentTimeMillis(); uniqueList.retainAll(toRetain); final long stop = System.currentTimeMillis(); - + // make sure retainAll completes under 5 seconds // TODO if test is migrated to JUnit 4, add a Timeout rule. // http://kentbeck.github.com/junit/javadoc/latest/org/junit/rules/Timeout.html assertTrue(stop - start < 5000); } - + public void testSetCollections444() { final SetUniqueList lset = new SetUniqueList(new ArrayList(), new HashSet()); @@ -614,7 +614,7 @@ public class SetUniqueListTest extend super(list, set); } } - + //----------------------------------------------------------------------- @Override public String getCompatibilityVersion() { Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/list/TransformedListTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/list/TransformedListTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/list/TransformedListTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/list/TransformedListTest.java Tue Apr 30 14:27:35 2013 @@ -124,7 +124,7 @@ public class TransformedListTest exte assertEquals(true, list.contains(Integer.valueOf((String) el))); assertEquals(false, list.contains(el)); } - + assertEquals(false, list.remove(els[0])); assertEquals(true, list.remove(Integer.valueOf((String) els[0]))); } Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/list/TreeListTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/list/TreeListTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/list/TreeListTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/list/TreeListTest.java Tue Apr 30 14:27:35 2013 @@ -247,27 +247,27 @@ public class TreeListTest extends Abs assertEquals(Integer.valueOf(4), li.next()); assertEquals(false, li.hasNext()); } - + public void testBugCollections447() { final List treeList = new TreeList(); treeList.add("A"); treeList.add("B"); treeList.add("C"); treeList.add("D"); - + final ListIterator li = treeList.listIterator(); assertEquals("A", li.next()); assertEquals("B", li.next()); - + assertEquals("B", li.previous()); - + li.remove(); // Deletes "B" - + // previous() after remove() should move to // the element before the one just removed assertEquals("A", li.previous()); } - + public void testIterationOrder() { // COLLECTIONS-433: // ensure that the iteration order of elements is correct @@ -285,12 +285,12 @@ public class TreeListTest extends Abs Integer val = it.next(); assertEquals(i++, val.intValue()); } - + while (it.hasPrevious()) { Integer val = it.previous(); assertEquals(--i, val.intValue()); } - } + } } public void testIterationOrderAfterAddAll() { @@ -300,7 +300,7 @@ public class TreeListTest extends Abs // to simulate different cases in addAll, do different runs where // the number of elements already in the list and being added by addAll differ - + int size = 1000; for (int i = 0; i < 100; i++) { List other = new ArrayList(size); @@ -311,7 +311,7 @@ public class TreeListTest extends Abs for (int j = 0; j < i; j++) { l.add(j); } - + l.addAll(other); ListIterator it = l.listIterator(); @@ -320,12 +320,12 @@ public class TreeListTest extends Abs Integer val = it.next(); assertEquals(cnt++, val.intValue()); } - + while (it.hasPrevious()) { Integer val = it.previous(); assertEquals(--cnt, val.intValue()); } - } + } } } Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java Tue Apr 30 14:27:35 2013 @@ -1998,13 +1998,13 @@ public abstract class AbstractMapTest known = new ArrayList(getConfirmed().values()); - + // bug in IBM JDK: IBM J9 VM build 2.4, JRE 1.6.0 IBM J9 2.4 Linux x86-32 jvmxi3260sr12-20121024_126067 // a call to values() on an empty map retrieved via TreeMap#headMap or tailMap // will render the values view unusable: resulting in NullPointerExceptions or missing values // it will also not recover, as the value view is cached internally values = getMap().values(); - + final List test = new ArrayList(values); final int size = getConfirmed().size(); Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/CompositeMapTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/CompositeMapTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/CompositeMapTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/CompositeMapTest.java Tue Apr 30 14:27:35 2013 @@ -23,7 +23,7 @@ import java.util.Collection; import org.apache.commons.collections4.map.CompositeMap; /** - * Extension of {@link AbstractMapTest} for exercising the + * Extension of {@link AbstractMapTest} for exercising the * {@link CompositeMap} implementation. * * @since 3.0 @@ -32,17 +32,17 @@ import org.apache.commons.collections4.m public class CompositeMapTest extends AbstractIterableMapTest { /** used as a flag in MapMutator tests */ private boolean pass = false; - + public CompositeMapTest(final String testName) { super(testName); } - + @Override public void setUp() throws Exception { super.setUp(); this.pass = false; } - + @Override public CompositeMap makeObject() { final CompositeMap map = new CompositeMap(); @@ -50,7 +50,7 @@ public class CompositeMapTest exte map.setMutator( new EmptyMapMutator() ); return map; } - + @SuppressWarnings("unchecked") private Map buildOne() { final HashMap map = new HashMap(); @@ -58,7 +58,7 @@ public class CompositeMapTest exte map.put((K) "2", (V) "two"); return map; } - + @SuppressWarnings("unchecked") public Map buildTwo() { final HashMap map = new HashMap(); @@ -66,13 +66,13 @@ public class CompositeMapTest exte map.put((K) "4", (V) "four"); return map; } - + public void testGet() { final CompositeMap map = new CompositeMap(buildOne(), buildTwo()); assertEquals("one", map.get("1")); assertEquals("four", map.get("4")); } - + @SuppressWarnings("unchecked") public void testAddComposited() { final CompositeMap map = new CompositeMap(buildOne(), buildTwo()); @@ -87,7 +87,7 @@ public class CompositeMapTest exte // expected } } - + @SuppressWarnings("unchecked") public void testRemoveComposited() { final CompositeMap map = new CompositeMap(buildOne(), buildTwo()); @@ -95,15 +95,15 @@ public class CompositeMapTest exte three.put((K) "5", (V) "five"); map.addComposited(three); assertTrue(map.containsKey("5")); - + map.removeComposited(three); assertFalse(map.containsKey("5")); - + map.removeComposited(buildOne()); assertFalse(map.containsKey("2")); - + } - + @SuppressWarnings("unchecked") public void testRemoveFromUnderlying() { final CompositeMap map = new CompositeMap(buildOne(), buildTwo()); @@ -111,12 +111,12 @@ public class CompositeMapTest exte three.put((K) "5", (V) "five"); map.addComposited(three); assertTrue(map.containsKey("5")); - + //Now remove "5" three.remove("5"); assertFalse(map.containsKey("5")); } - + @SuppressWarnings("unchecked") public void testRemoveFromComposited() { final CompositeMap map = new CompositeMap(buildOne(), buildTwo()); @@ -124,14 +124,14 @@ public class CompositeMapTest exte three.put((K) "5", (V) "five"); map.addComposited(three); assertTrue(map.containsKey("5")); - + //Now remove "5" map.remove("5"); assertFalse(three.containsKey("5")); } - + public void testResolveCollision() { - final CompositeMap map = new CompositeMap(buildOne(), buildTwo(), + final CompositeMap map = new CompositeMap(buildOne(), buildTwo(), new CompositeMap.MapMutator() { private static final long serialVersionUID = 1L; @@ -141,24 +141,24 @@ public class CompositeMapTest exte final Collection intersect) { pass = true; } - - public V put(final CompositeMap map, final Map[] composited, final K key, + + public V put(final CompositeMap map, final Map[] composited, final K key, final V value) { throw new UnsupportedOperationException(); } - + public void putAll(final CompositeMap map, final Map[] composited, final Map t) { throw new UnsupportedOperationException(); } }); - + map.addComposited(buildOne()); assertTrue(pass); } - + @SuppressWarnings("unchecked") public void testPut() { - final CompositeMap map = new CompositeMap(buildOne(), buildTwo(), + final CompositeMap map = new CompositeMap(buildOne(), buildTwo(), new CompositeMap.MapMutator() { private static final long serialVersionUID = 1L; public void resolveCollision(final CompositeMap composite, @@ -167,24 +167,24 @@ public class CompositeMapTest exte final Collection intersect) { throw new UnsupportedOperationException(); } - - public V put(final CompositeMap map, final Map[] composited, final K key, + + public V put(final CompositeMap map, final Map[] composited, final K key, final V value) { pass = true; return (V) "foo"; } - + public void putAll(final CompositeMap map, final Map[] composited, final Map t) { throw new UnsupportedOperationException(); } }); - + map.put((K) "willy", (V) "wonka"); assertTrue(pass); } - + public void testPutAll() { - final CompositeMap map = new CompositeMap(buildOne(), buildTwo(), + final CompositeMap map = new CompositeMap(buildOne(), buildTwo(), new CompositeMap.MapMutator() { private static final long serialVersionUID = 1L; public void resolveCollision(final CompositeMap composite, @@ -193,17 +193,17 @@ public class CompositeMapTest exte final Collection intersect) { throw new UnsupportedOperationException(); } - - public V put(final CompositeMap map, final Map[] composited, final K key, + + public V put(final CompositeMap map, final Map[] composited, final K key, final V value) { throw new UnsupportedOperationException(); } - + public void putAll(final CompositeMap map, final Map[] composited, final Map t) { pass = true; } }); - + map.putAll(null); assertTrue(pass); } Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/EmptyMapMutator.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/EmptyMapMutator.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/EmptyMapMutator.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/EmptyMapMutator.java Tue Apr 30 14:27:35 2013 @@ -22,9 +22,9 @@ import java.util.Collection; import org.apache.commons.collections4.map.CompositeMap; /** - * This class is used in TestCompositeMap. When testing serialization, - * the class has to be separate of TestCompositeMap, else the test - * class also has to be serialized. + * This class is used in TestCompositeMap. When testing serialization, + * the class has to be separate of TestCompositeMap, else the test + * class also has to be serialized. */ class EmptyMapMutator implements CompositeMap.MapMutator { /** Serialization version */ @@ -36,11 +36,11 @@ class EmptyMapMutator implements Co final Collection intersect) { // Do nothing } - + public V put(final CompositeMap map, final Map[] composited, final K key, final V value) { return composited[0].put(key, value); } - + public void putAll(final CompositeMap map, final Map[] composited, final Map t) { composited[0].putAll(t); } Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/LRUMapTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/LRUMapTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/LRUMapTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/LRUMapTest.java Tue Apr 30 14:27:35 2013 @@ -493,11 +493,11 @@ public class LRUMapTest extends Ab fail(); } catch (final IndexOutOfBoundsException ex) {} } - + public void testSynchronizedRemoveFromMapIterator() throws InterruptedException { final LRUMap map = new LRUMap(10000); - + final Map exceptions = new HashMap(); final ThreadGroup tg = new ThreadGroup(getName()) { @Override @@ -573,14 +573,14 @@ public class LRUMapTest extends Ab } assertEquals("Exceptions have been thrown: " + exceptions, 0, exceptions.size()); - assertTrue("Each thread should have put at least 1 element into the map, but only " + assertTrue("Each thread should have put at least 1 element into the map, but only " + counter[0] + " did succeed", counter[0] >= threads.length); } - + public void testSynchronizedRemoveFromEntrySet() throws InterruptedException { final Map map = new LRUMap(10000); - + final Map exceptions = new HashMap(); final ThreadGroup tg = new ThreadGroup(getName()) { @Override @@ -656,14 +656,14 @@ public class LRUMapTest extends Ab } assertEquals("Exceptions have been thrown: " + exceptions, 0, exceptions.size()); - assertTrue("Each thread should have put at least 1 element into the map, but only " + assertTrue("Each thread should have put at least 1 element into the map, but only " + counter[0] + " did succeed", counter[0] >= threads.length); } - + public void testSynchronizedRemoveFromKeySet() throws InterruptedException { final Map map = new LRUMap(10000); - + final Map exceptions = new HashMap(); final ThreadGroup tg = new ThreadGroup(getName()) { @Override @@ -739,14 +739,14 @@ public class LRUMapTest extends Ab } assertEquals("Exceptions have been thrown: " + exceptions, 0, exceptions.size()); - assertTrue("Each thread should have put at least 1 element into the map, but only " + assertTrue("Each thread should have put at least 1 element into the map, but only " + counter[0] + " did succeed", counter[0] >= threads.length); } - + public void testSynchronizedRemoveFromValues() throws InterruptedException { final Map map = new LRUMap(10000); - + final Map exceptions = new HashMap(); final ThreadGroup tg = new ThreadGroup(getName()) { @Override @@ -821,7 +821,7 @@ public class LRUMapTest extends Ab } assertEquals("Exceptions have been thrown: " + exceptions, 0, exceptions.size()); - assertTrue("Each thread should have put at least 1 element into the map, but only " + assertTrue("Each thread should have put at least 1 element into the map, but only " + counter[0] + " did succeed", counter[0] >= threads.length); } Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/LazySortedMapTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/LazySortedMapTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/LazySortedMapTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/LazySortedMapTest.java Tue Apr 30 14:27:35 2013 @@ -31,7 +31,7 @@ import org.apache.commons.collections4.m import org.junit.Test; /** - * Extension of {@link LazyMapTest} for exercising the + * Extension of {@link LazyMapTest} for exercising the * {@link LazySortedMap} implementation. * * @since 3.0 @@ -39,18 +39,18 @@ import org.junit.Test; */ @SuppressWarnings("boxing") public class LazySortedMapTest extends AbstractSortedMapTest { - + private static final Factory oneFactory = FactoryUtils.constantFactory(1); - + public LazySortedMapTest(final String testName) { super(testName); } - + @Override public SortedMap makeObject() { return lazySortedMap(new TreeMap(), FactoryUtils.nullFactory()); } - + @Override public boolean isSubMapViewsSerializable() { // TODO TreeMap sub map views have a bug in deserialization. @@ -68,7 +68,7 @@ public class LazySortedMapTest ext public void testMapGet() { //TODO eliminate need for this via superclass - see svn history. } - + @Test public void mapGet() { Map map = lazySortedMap(new TreeMap(), oneFactory); @@ -81,9 +81,9 @@ public class LazySortedMapTest ext final Number o = map.get(5); assertEquals(null,o); assertEquals(1, map.size()); - + } - + //----------------------------------------------------------------------- public void testSortOrder() { final SortedMap map = lazySortedMap(new TreeMap(), oneFactory); @@ -92,22 +92,22 @@ public class LazySortedMapTest ext map.put("C", 8); assertEquals("First key should be A", "A", map.firstKey()); assertEquals("Last key should be C", "C", map.lastKey()); - assertEquals("First key in tail map should be B", + assertEquals("First key in tail map should be B", "B", map.tailMap("B").firstKey()); - assertEquals("Last key in head map should be B", + assertEquals("Last key in head map should be B", "B", map.headMap("C").lastKey()); assertEquals("Last key in submap should be B", "B", map.subMap("A","C").lastKey()); - + final Comparator c = map.comparator(); - assertTrue("natural order, so comparator should be null", - c == null); - } - + assertTrue("natural order, so comparator should be null", + c == null); + } + public void testTransformerDecorate() { final Transformer transformer = TransformerUtils.asTransformer(oneFactory); - SortedMap map = lazySortedMap(new TreeMap(), transformer); - assertTrue(map instanceof LazySortedMap); + SortedMap map = lazySortedMap(new TreeMap(), transformer); + assertTrue(map instanceof LazySortedMap); try { map = lazySortedMap(new TreeMap(), (Transformer) null); fail("Expecting IllegalArgumentException for null transformer"); @@ -119,9 +119,9 @@ public class LazySortedMapTest ext fail("Expecting IllegalArgumentException for null map"); } catch (final IllegalArgumentException e) { // expected - } + } } - + @Override public String getCompatibilityVersion() { return "4"; Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/ListOrderedMapTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/ListOrderedMapTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/ListOrderedMapTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/ListOrderedMapTest.java Tue Apr 30 14:27:35 2013 @@ -346,13 +346,13 @@ public class ListOrderedMapTest ex } lom.putAll(3, map); - + final List orderedList = lom.asList(); for (int i = 0; i < size; i++) { assertEquals(i, orderedList.get(i)); } } - + //----------------------------------------------------------------------- public void testValueList_getByIndex() { resetFull(); Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/PassiveExpiringMapTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/PassiveExpiringMapTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/PassiveExpiringMapTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/PassiveExpiringMapTest.java Tue Apr 30 14:27:35 2013 @@ -65,7 +65,7 @@ public class PassiveExpiringMapTest exte // (java.io.Serializable) map, // "src/test/resources/data/test/ReferenceMap.fullCollection.version4.obj"); // } - + //----------------------------------------------------------------------- @SuppressWarnings("unchecked") public void testNullHandling() { Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/TransformedSortedMapTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/TransformedSortedMapTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/TransformedSortedMapTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/map/TransformedSortedMapTest.java Tue Apr 30 14:27:35 2013 @@ -51,10 +51,10 @@ public class TransformedSortedMapTest ex public void testGetIndex() { resetFull(); - + final CircularFifoQueue queue = getCollection(); final List confirmed = (List) getConfirmed(); for (int i = 0; i < confirmed.size(); i++) { @@ -418,10 +418,10 @@ public class CircularFifoQueueTest ex // remove the first two elements and check again queue.remove(); queue.remove(); - + for (int i = 0; i < queue.size(); i++) { assertEquals(confirmed.get(i + 2), queue.get(i)); - } + } } @Override Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/queue/PredicatedQueueTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/queue/PredicatedQueueTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/queue/PredicatedQueueTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/queue/PredicatedQueueTest.java Tue Apr 30 14:27:35 2013 @@ -51,7 +51,7 @@ public class PredicatedQueueTest exte public Queue makeObject() { return decorateCollection(new LinkedList(), truePredicate); } - + @Override public Queue makeFullCollection() { final Queue queue = new LinkedList(); Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/queue/TransformedQueueTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/queue/TransformedQueueTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/queue/TransformedQueueTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/queue/TransformedQueueTest.java Tue Apr 30 14:27:35 2013 @@ -32,7 +32,7 @@ import org.apache.commons.collections4.c * @version $Id$ */ public class TransformedQueueTest extends AbstractQueueTest { - + public TransformedQueueTest(final String testName) { super(testName); } @@ -77,10 +77,10 @@ public class TransformedQueueTest ext assertEquals(true, queue.contains(Integer.valueOf((String) els[i]))); assertEquals(false, queue.contains(els[i])); } - + assertEquals(false, queue.remove(els[0])); assertEquals(true, queue.remove(Integer.valueOf((String) els[0]))); - + } @SuppressWarnings({ "rawtypes", "unchecked" }) @@ -97,7 +97,7 @@ public class TransformedQueueTest ext assertEquals(true, queue.contains(Integer.valueOf((String) el))); assertEquals(false, queue.contains(el)); } - + assertEquals(false, queue.remove(els[0])); assertEquals(true, queue.remove(Integer.valueOf((String) els[0]))); } @@ -106,7 +106,7 @@ public class TransformedQueueTest ext public String getCompatibilityVersion() { return "4"; } - + // public void testCreate() throws Exception { // resetEmpty(); // writeExternalFormToDisk((java.io.Serializable) getCollection(), "src/test/resources/data/test/TransformedQueue.emptyCollection.version4.obj"); Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/set/AbstractSetTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/set/AbstractSetTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/set/AbstractSetTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/set/AbstractSetTest.java Tue Apr 30 14:27:35 2013 @@ -59,9 +59,9 @@ public abstract class AbstractSetTest @Override public void verify() { super.verify(); - + assertEquals("Sets should be equal", getConfirmed(), getCollection()); - assertEquals("Sets should have equal hashCodes", + assertEquals("Sets should have equal hashCodes", getConfirmed().hashCode(), getCollection().hashCode()); final Collection set = makeConfirmedCollection(); final Iterator iterator = getCollection().iterator(); @@ -126,7 +126,7 @@ public abstract class AbstractSetTest //----------------------------------------------------------------------- /** - * Return the {@link AbstractCollectionTest#collection} fixture, but cast as a Set. + * Return the {@link AbstractCollectionTest#collection} fixture, but cast as a Set. */ @Override public Set getCollection() { @@ -169,11 +169,11 @@ public abstract class AbstractSetTest */ public void testSetHashCode() { resetEmpty(); - assertEquals("Empty sets have equal hashCodes", + assertEquals("Empty sets have equal hashCodes", getCollection().hashCode(), getConfirmed().hashCode()); resetFull(); - assertEquals("Equal sets have equal hashCodes", + assertEquals("Equal sets have equal hashCodes", getCollection().hashCode(), getConfirmed().hashCode()); } Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/set/AbstractSortedSetTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/set/AbstractSortedSetTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/set/AbstractSortedSetTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/set/AbstractSortedSetTest.java Tue Apr 30 14:27:35 2013 @@ -52,7 +52,7 @@ public abstract class AbstractSortedSetT @Override public void verify() { super.verify(); - + // Check that iterator returns elements in order and first() and last() // are consistent final Iterator colliter = getCollection().iterator(); @@ -65,7 +65,7 @@ public abstract class AbstractSortedSetT last = first; } else { last = colliter.next(); - } + } assertEquals("Element appears to be out of order.", last, confiter.next()); } if (getCollection().size() > 0) { @@ -302,12 +302,12 @@ public abstract class AbstractSortedSetT public SortedSet makeFullCollection() { return getSubSet(AbstractSortedSetTest.this.makeFullCollection()); } - + @Override public boolean isTestSerialization() { return false; } - + @Override public BulkTest bulkTestSortedSetSubSet() { return null; // prevent infinite recursion Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/set/EmptySetMutator.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/set/EmptySetMutator.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/set/EmptySetMutator.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/set/EmptySetMutator.java Tue Apr 30 14:27:35 2013 @@ -21,9 +21,9 @@ import java.util.List; import java.util.Set; /** - * This class is used in CompositeSetTest. When testing serialization, - * the class has to be separate of CompositeSetTest, else the test - * class also has to be serialized. + * This class is used in CompositeSetTest. When testing serialization, + * the class has to be separate of CompositeSetTest, else the test + * class also has to be serialized. */ class EmptySetMutator implements CompositeSet.SetMutator { @@ -39,12 +39,12 @@ class EmptySetMutator implements Comp public void resolveCollision(final CompositeSet comp, final Set existing, final Set added, final Collection intersects) { throw new IllegalArgumentException(); } - + public boolean add(final CompositeSet composite, final List> collections, final E obj) { return contained.add(obj); } - + public boolean addAll(final CompositeSet composite, final List> collections, final Collection coll) { return contained.addAll(coll); - } + } } Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/set/TransformedSetTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/set/TransformedSetTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/set/TransformedSetTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/set/TransformedSetTest.java Tue Apr 30 14:27:35 2013 @@ -94,7 +94,7 @@ public class TransformedSetTest exten assertEquals(true, set.contains(Integer.valueOf((String) el))); assertEquals(false, set.contains(el)); } - + assertEquals(false, set.remove(els[0])); assertEquals(true, set.remove(Integer.valueOf((String) els[0]))); } Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/set/TransformedSortedSetTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/set/TransformedSortedSetTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/set/TransformedSortedSetTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/set/TransformedSortedSetTest.java Tue Apr 30 14:27:35 2013 @@ -86,7 +86,7 @@ public class TransformedSortedSetTest for (final Object el : els) { assertEquals(true, set.contains(Integer.valueOf((String) el))); } - + assertEquals(true, set.remove(Integer.valueOf((String) els[0]))); } Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/trie/ByteArrayKeyAnalyzerTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/trie/ByteArrayKeyAnalyzerTest.java?rev=1477661&r1=1477660&r2=1477661&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/trie/ByteArrayKeyAnalyzerTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/trie/ByteArrayKeyAnalyzerTest.java Tue Apr 30 14:27:35 2013 @@ -26,13 +26,13 @@ import org.junit.Test; public class ByteArrayKeyAnalyzerTest { private static final int SIZE = 20000; - + @Test public void bitSet() { final byte[] key = toByteArray("10100110", 2); final ByteArrayKeyAnalyzer ka = new ByteArrayKeyAnalyzer(key.length * 8); final int length = ka.lengthInBits(key); - + Assert.assertTrue(ka.isBitSet(key, 0, length)); Assert.assertFalse(ka.isBitSet(key, 1, length)); Assert.assertTrue(ka.isBitSet(key, 2, length)); @@ -42,67 +42,67 @@ public class ByteArrayKeyAnalyzerTest { Assert.assertTrue(ka.isBitSet(key, 6, length)); Assert.assertFalse(ka.isBitSet(key, 7, length)); } - + @Test public void keys() { final PatriciaTrie trie = new PatriciaTrie(ByteArrayKeyAnalyzer.INSTANCE); - - final Map map + + final Map map = new TreeMap(ByteArrayKeyAnalyzer.INSTANCE); - + for (int i = 0; i < SIZE; i++) { final BigInteger value = BigInteger.valueOf(i); final byte[] key = toByteArray(value); - + final BigInteger existing = trie.put(key, value); Assert.assertNull(existing); - + map.put(key, value); } - + Assert.assertEquals(map.size(), trie.size()); - + for (final byte[] key : map.keySet()) { final BigInteger expected = new BigInteger(1, key); final BigInteger value = trie.get(key); - + Assert.assertEquals(expected, value); } } - + @Test public void prefix() { final byte[] prefix = toByteArray("00001010", 2); final byte[] key1 = toByteArray("11001010", 2); final byte[] key2 = toByteArray("10101100", 2); - + final ByteArrayKeyAnalyzer keyAnalyzer = new ByteArrayKeyAnalyzer(key1.length * 8); - + final int prefixLength = keyAnalyzer.lengthInBits(prefix); - + Assert.assertFalse(keyAnalyzer.isPrefix(prefix, 4, prefixLength, key1)); Assert.assertTrue(keyAnalyzer.isPrefix(prefix, 4, prefixLength, key2)); } - + private static byte[] toByteArray(final String value, final int radix) { return toByteArray(Long.parseLong(value, radix)); } - + private static byte[] toByteArray(final long value) { return toByteArray(BigInteger.valueOf(value)); } - + private static byte[] toByteArray(final BigInteger value) { final byte[] src = value.toByteArray(); if (src.length <= 1) { return src; } - + if (src[0] != 0) { return src; } - + final byte[] dst = new byte[src.length-1]; System.arraycopy(src, 1, dst, 0, dst.length); return dst;