commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1370920 - /commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/aggregator/list/OwnListImplementationSample.java
Date Wed, 08 Aug 2012 19:51:18 GMT
Author: mbenson
Date: Wed Aug  8 19:51:17 2012
New Revision: 1370920

URL: http://svn.apache.org/viewvc?rev=1370920&view=rev
Log:
fix assertions

Modified:
    commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/aggregator/list/OwnListImplementationSample.java

Modified: commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/aggregator/list/OwnListImplementationSample.java
URL: http://svn.apache.org/viewvc/commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/aggregator/list/OwnListImplementationSample.java?rev=1370920&r1=1370919&r2=1370920&view=diff
==============================================================================
--- commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/aggregator/list/OwnListImplementationSample.java
(original)
+++ commons/proper/functor/trunk/src/test/java/org/apache/commons/functor/example/aggregator/list/OwnListImplementationSample.java
Wed Aug  8 19:51:17 2012
@@ -16,6 +16,9 @@
  */
 package org.apache.commons.functor.example.aggregator.list;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
 import java.util.LinkedList;
 import java.util.List;
 
@@ -23,7 +26,6 @@ import org.apache.commons.functor.UnaryF
 import org.apache.commons.functor.aggregator.AbstractListBackedAggregator;
 import org.apache.commons.functor.aggregator.functions.IntegerSumAggregatorFunction;
 import org.junit.Test;
-import static org.junit.Assert.assertEquals;
 
 /**
  * Class which shows how to provide a custom List implementation with an
@@ -34,11 +36,10 @@ public class OwnListImplementationSample
     @Test
     public void sampleCreateOwnList() {
         CustomListAggregator<Integer> agg = new CustomListAggregator<Integer>(new
IntegerSumAggregatorFunction());
-        int eval = agg.evaluate();
-        assertEquals(eval, 0);
+        assertNull(agg.evaluate());
         agg.add(2);
         agg.add(3);
-        eval = agg.evaluate();
+        int eval = agg.evaluate();
         assertEquals(eval, 5);
         assertEquals(agg.getDataSize(), 2); // 2 items added
     }



Mime
View raw message