[jboss-cvs] JBoss Messaging SVN: r5396 - trunk/tests/src/org/jboss/messaging/tests/unit/util.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Nov 20 05:09:24 EST 2008
Author: jmesnil
Date: 2008-11-20 05:09:24 -0500 (Thu, 20 Nov 2008)
New Revision: 5396
Modified:
trunk/tests/src/org/jboss/messaging/tests/unit/util/TypedPropertiesTest.java
Log:
added tests for TypedProperties.putTypedProperties(TypedProperties otherProps)
Modified: trunk/tests/src/org/jboss/messaging/tests/unit/util/TypedPropertiesTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/util/TypedPropertiesTest.java 2008-11-20 09:47:13 UTC (rev 5395)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/util/TypedPropertiesTest.java 2008-11-20 10:09:24 UTC (rev 5396)
@@ -244,6 +244,42 @@
assertEquals(c, cc);
}
+ public void testTypedProperties() throws Exception
+ {
+ SimpleString longKey = randomSimpleString();
+ long longValue = randomLong();
+ SimpleString simpleStringKey = randomSimpleString();
+ SimpleString simpleStringValue = randomSimpleString();
+ TypedProperties otherProps = new TypedProperties();
+ otherProps.putLongProperty(longKey, longValue);
+ otherProps.putStringProperty(simpleStringKey, simpleStringValue);
+
+ props.putTypedProperties(otherProps);
+
+ long ll = (Long) props.getProperty(longKey);
+ assertEquals(longValue, ll);
+ SimpleString ss = (SimpleString) props.getProperty(simpleStringKey);
+ assertEquals(simpleStringValue, ss);
+ }
+
+ public void testEmptyTypedProperties() throws Exception
+ {
+ assertEquals(0, props.getPropertyNames().size());
+
+ props.putTypedProperties(new TypedProperties());
+
+ assertEquals(0, props.getPropertyNames().size());
+ }
+
+ public void testNullTypedProperties() throws Exception
+ {
+ assertEquals(0, props.getPropertyNames().size());
+
+ props.putTypedProperties(null);
+
+ assertEquals(0, props.getPropertyNames().size());
+ }
+
public void testEncodeDecode() throws Exception
{
props.putByteProperty(randomSimpleString(), randomByte());
More information about the jboss-cvs-commits
mailing list