Update of 
/var/cvs/applications/vpro-wizards/tests/org/mmbase/applications/vprowizards/spring/cache/modifiers
In directory 
james.mmbase.org:/tmp/cvs-serv32624/applications/vpro-wizards/tests/org/mmbase/applications/vprowizards/spring/cache/modifiers

Modified Files:
        TemplateCleanerModifierTest.java 
Log Message:
more tests 


See also: 
http://cvs.mmbase.org/viewcvs/applications/vpro-wizards/tests/org/mmbase/applications/vprowizards/spring/cache/modifiers


Index: TemplateCleanerModifierTest.java
===================================================================
RCS file: 
/var/cvs/applications/vpro-wizards/tests/org/mmbase/applications/vprowizards/spring/cache/modifiers/TemplateCleanerModifierTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- TemplateCleanerModifierTest.java    8 Dec 2008 15:59:26 -0000       1.1
+++ TemplateCleanerModifierTest.java    8 Dec 2008 19:37:08 -0000       1.2
@@ -4,7 +4,28 @@
 
 public class TemplateCleanerModifierTest extends TestCase {
 
-    public void test(){
-        //fail("implement");
+    public void test_simple_template_with_nodenr_is_removed(){
+        cleanAndCheck("users_[name:898]", "users_898");
+    }
+    
+    public void test_simle_template_without_nodenr_is_removed(){
+        cleanAndCheck("users_[name]", "users_");
+    }
+    
+    public void test_query_template_with_nodenr_is_removed(){
+        cleanAndCheck("users_[name.nogwat.disco:898]", "users_898");
+    }
+    
+    public void test_query_template_without_nodenr_is_removed(){
+        cleanAndCheck("users_[name.nogwat.disco]", "users_");
+    }
+    
+    public void test_multi_template_with_nodenr_is_removed(){
+        cleanAndCheck("users_[name.nogwat.disco:898]_nogwat_[user:10]", 
"users_898_nogwat_10");
+    }
+    
+    private void cleanAndCheck(String template, String expected){
+        TemplateCleanerModifier modifier = new TemplateCleanerModifier();
+        assertEquals(expected, modifier.modify(template));
     }
 }
_______________________________________________
Cvs mailing list
Cvs@lists.mmbase.org
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to