From fbd22b637c06e127c56dabdc225e537edb9419c6 Mon Sep 17 00:00:00 2001 From: Robert Davies Date: Tue, 13 Mar 2007 16:39:46 +0000 Subject: [PATCH] test for converting Properties to and from a String git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@517764 13f79535-47bb-0310-9956-ffa450edef68 --- .../activemq/util/MarshallingSupportTest.java | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 activemq-core/src/test/java/org/apache/activemq/util/MarshallingSupportTest.java diff --git a/activemq-core/src/test/java/org/apache/activemq/util/MarshallingSupportTest.java b/activemq-core/src/test/java/org/apache/activemq/util/MarshallingSupportTest.java new file mode 100644 index 0000000000..3ff0a88148 --- /dev/null +++ b/activemq-core/src/test/java/org/apache/activemq/util/MarshallingSupportTest.java @@ -0,0 +1,49 @@ +/** + * + */ + +package org.apache.activemq.util; + +import java.io.IOException; +import java.util.Properties; +import junit.framework.TestCase; + +/** + * @author rajdavies + * + */ +public class MarshallingSupportTest extends TestCase{ + + /** + * @throws java.lang.Exception + * @see junit.framework.TestCase#setUp() + */ + protected void setUp() throws Exception{ + super.setUp(); + } + + /** + * @throws java.lang.Exception + * @see junit.framework.TestCase#tearDown() + */ + protected void tearDown() throws Exception{ + super.tearDown(); + } + + /** + * Test method for {@link org.apache.activemq.util.MarshallingSupport#propertiesToString(java.util.Properties)}. + * + * @throws Exception + */ + public void testPropertiesToString() throws Exception{ + Properties props=new Properties(); + for(int i=0;i<10;i++){ + String key="key"+i; + String value="value"+i; + props.put(key,value); + } + String str=MarshallingSupport.propertiesToString(props); + Properties props2=MarshallingSupport.stringToProperties(str); + assertEquals(props,props2); + } +}