KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > hudson > util > CopyOnWriteListTest


1 package hudson.util;
2
3 import junit.framework.TestCase;
4
5 import java.util.ArrayList JavaDoc;
6 import java.util.List JavaDoc;
7
8 /**
9  * @author Kohsuke Kawaguchi
10  */

11 public class CopyOnWriteListTest extends TestCase {
12     public static final class TestData {
13         CopyOnWriteList list1 = new CopyOnWriteList();
14         List JavaDoc list2 = new ArrayList JavaDoc();
15     }
16
17     /**
18      * Verify that the serialization form of List and CopyOnWriteList are the same.
19      */

20     public void testSerialization() throws Exception JavaDoc {
21
22         XStream2 xs = new XStream2();
23         TestData td = new TestData();
24         td.list1.add("foobar1");
25         td.list2.add("foobar2");
26
27         xs.toXML(td,System.out);
28     }
29 }
30
Popular Tags