proyal 2002/07/12 13:11:57
Modified: src/test/org/apache/avalon/framework/configuration/test
DefaultConfigurationTestCase.java
Log:
* Unit tests for new branching
Revision Changes Path
1.5 +16 -0
jakarta-avalon/src/test/org/apache/avalon/framework/configuration/test/DefaultConfigurationTestCase.java
Index: DefaultConfigurationTestCase.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon/src/test/org/apache/avalon/framework/configuration/test/DefaultConfigurationTestCase.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- DefaultConfigurationTestCase.java 12 Jul 2002 19:44:41 -0000 1.4
+++ DefaultConfigurationTestCase.java 12 Jul 2002 20:11:56 -0000 1.5
@@ -54,6 +54,7 @@
import junit.framework.TestCase;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.DefaultConfiguration;
+import org.apache.avalon.framework.configuration.ConfigurationUtil;
/**
* Test the basic public methods of DefaultConfiguration.
@@ -107,6 +108,21 @@
final boolean b = true;
m_configuration.setValue("TrUe");
assertEquals( b, m_configuration.getValueAsBoolean() );
+ }
+
+ public void testBranch()
+ throws Exception
+ {
+ m_configuration.setAttribute( "test", "test" );
+ m_configuration.setValue( "test" );
+ m_configuration.addChild( new DefaultConfiguration( "test", "test" ) );
+
+ final Configuration c = ConfigurationUtil.branch( m_configuration,
"branched" );
+
+ assertEquals( "branched", c.getName() );
+ assertEquals( "test", c.getAttribute( "test" ) );
+ assertEquals( "test", c.getValue() );
+ assertTrue( c.getChild( "test", false ) != null );
}
public void testGetAttribute()
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>