Author: mbenson Date: Wed Jan 10 14:45:44 2007 New Revision: 495021 URL: http://svn.apache.org/viewvc?view=rev&rev=495021 Log: [JXPATH-20] tests
Modified: jakarta/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/BeanModelTestCase.java Modified: jakarta/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/BeanModelTestCase.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/BeanModelTestCase.java?view=diff&rev=495021&r1=495020&r2=495021 ============================================================================== --- jakarta/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/BeanModelTestCase.java (original) +++ jakarta/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/BeanModelTestCase.java Wed Jan 10 14:45:44 2007 @@ -17,6 +17,7 @@ package org.apache.commons.jxpath.ri.model; import java.util.ArrayList; +import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Locale; @@ -32,6 +33,7 @@ import org.apache.commons.jxpath.ri.compiler.TestFunctions; import org.apache.commons.jxpath.ri.model.beans.PropertyOwnerPointer; import org.apache.commons.jxpath.ri.model.beans.PropertyPointer; +import org.apache.commons.jxpath.ri.model.dynabeans.DynaBeanModelTest; /** * Abstract superclass for Bean access with JXPath. @@ -915,6 +917,30 @@ "Remove array element", "String 2", context.getValue("nestedBean/strings[1]")); + } + + public void testRemoveAllArrayElements() { + context.removeAll("nestedBean/strings"); + assertXPathValueIterator( + context, + "nestedBean/strings", + list()); + } + + public void testRemoveAllListElements() { + context.removeAll("list"); + assertXPathValueIterator( + context, + "list", + this instanceof DynaBeanModelTest ? list(null, null, null) : list()); + } + + public void testRemoveAllMapEntries() { + context.removeAll("map/*"); + assertXPathValue( + context, + "map", + Collections.EMPTY_MAP); } public void testRemovePathBeanValue() { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]