KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > activemq > util > MarshallingSupportTest


1 /**
2  *
3  */

4
5 package org.apache.activemq.util;
6
7 import java.io.IOException JavaDoc;
8 import java.util.Properties JavaDoc;
9 import junit.framework.TestCase;
10
11 /**
12  * @author rajdavies
13  *
14  */

15 public class MarshallingSupportTest extends TestCase{
16
17     /**
18      * @throws java.lang.Exception
19      * @see junit.framework.TestCase#setUp()
20      */

21     protected void setUp() throws Exception JavaDoc{
22         super.setUp();
23     }
24
25     /**
26      * @throws java.lang.Exception
27      * @see junit.framework.TestCase#tearDown()
28      */

29     protected void tearDown() throws Exception JavaDoc{
30         super.tearDown();
31     }
32
33     /**
34      * Test method for {@link org.apache.activemq.util.MarshallingSupport#propertiesToString(java.util.Properties)}.
35      *
36      * @throws Exception
37      */

38     public void testPropertiesToString() throws Exception JavaDoc{
39         Properties JavaDoc props=new Properties JavaDoc();
40         for(int i=0;i<10;i++){
41             String JavaDoc key="key"+i;
42             String JavaDoc value="value"+i;
43             props.put(key,value);
44         }
45         String JavaDoc str=MarshallingSupport.propertiesToString(props);
46         Properties JavaDoc props2=MarshallingSupport.stringToProperties(str);
47         assertEquals(props,props2);
48     }
49 }
50
Popular Tags