Revision: 1447
          http://svn.sourceforge.net/spring-rich-c/?rev=1447&view=rev
Author:   jhoskens
Date:     2006-09-26 00:55:37 -0700 (Tue, 26 Sep 2006)

Log Message:
-----------
Moved the core/closure test package from support to core

Modified Paths:
--------------
    
trunk/spring-richclient/core/src/test/java/org/springframework/core/closure/ClosureTests.java

Modified: 
trunk/spring-richclient/core/src/test/java/org/springframework/core/closure/ClosureTests.java
===================================================================
--- 
trunk/spring-richclient/core/src/test/java/org/springframework/core/closure/ClosureTests.java
       2006-09-26 07:55:25 UTC (rev 1446)
+++ 
trunk/spring-richclient/core/src/test/java/org/springframework/core/closure/ClosureTests.java
       2006-09-26 07:55:37 UTC (rev 1447)
@@ -6,16 +6,15 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.springframework.binding.value.ValueModel;
-import org.springframework.binding.value.support.ValueHolder;
+import junit.framework.TestCase;
+
 import org.springframework.core.closure.support.Block;
 import org.springframework.core.closure.support.IteratorTemplate;
-import org.springframework.richclient.test.SpringRichTestCase;
 
 /**
  * @author Keith Donald
  */
-public class ClosureTests extends SpringRichTestCase {
+public class ClosureTests extends TestCase {
        public void testIteratorProcessTemplateRunOnce() {
                List collection = new ArrayList();
                collection.add("Item 1");
@@ -132,6 +131,9 @@
                });
        }
 
+    // using a simple int instead of a ValueHolder to have no extra 
dependencies.
+    int runUntilCounter;
+    
        public void testRunUntil() {
                List collection = new ArrayList();
                collection.add("Item 1");
@@ -140,16 +142,16 @@
                collection.add("Item 4");
                collection.add("Item 5");
                IteratorTemplate template = new IteratorTemplate(collection);
-               final ValueModel countHolder = new ValueHolder(new Integer(0));
-               template.runUntil(new Block() {
-                       protected void handle(Object o) {
-                               countHolder.setValue(new 
Integer(((Integer)countHolder.getValue()).intValue() + 1));
-                       }
-               }, new Constraint() {
+        runUntilCounter = 0;
+        template.runUntil(new Block() {
+            protected void handle(Object o) {
+                runUntilCounter++;
+            }
+        }, new Constraint() {
                        public boolean test(Object o) {
                                return o.equals("Item 4");
                        }
                });
-               assertEquals(new Integer(3), countHolder.getValue());
+               assertEquals(3, runUntilCounter);
        }
 }
\ No newline at end of file


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
spring-rich-c-cvs mailing list
spring-rich-c-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spring-rich-c-cvs

Reply via email to