KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > bridge > SerializableTest


1 /*
2
3 This software is OSI Certified Open Source Software.
4 OSI Certified is a certification mark of the Open Source Initiative.
5
6 The license (Mozilla version 1.0) can be read at the MMBase site.
7 See http://www.MMBase.org/license
8
9 */

10
11 package org.mmbase.bridge;
12
13 import org.mmbase.tests.*;
14 import java.io.*;
15
16 /**
17  */

18 public class SerializableTest extends BridgeTest {
19     Cloud cloud;
20
21     public SerializableTest(String JavaDoc name) {
22         super(name);
23     }
24
25     public void setUp() {
26         cloud = getCloud();
27     }
28
29     public void testSerialize() {
30         if (!cloud.getClass().getName().equals("org.mmbase.bridge.implementation.BasicCloud")){
31             return;
32         }
33         try {
34             ByteArrayOutputStream bos = new ByteArrayOutputStream();
35             ObjectOutputStream oos = new ObjectOutputStream(bos);
36             oos.writeObject(cloud);
37             assertTrue(bos.size() > 0);
38         } catch (Exception JavaDoc e) {
39             e.printStackTrace();
40             fail(e.getMessage());
41         }
42     }
43 }
44
Popular Tags