1 /*
2 * $Header: /cvsroot/jdbforms/dbforms/tests/test/org/dbforms/config/TestSerializable.java,v 1.2 2004/11/15 16:50:09 hkollmann Exp $
3 * $Revision: 1.2 $
4 * $Date: 2004/11/15 16:50:09 $
5 *
6 * DbForms - a Rapid Application Development Framework
7 * Copyright (C) 2001 Joachim Peer <joepeer@excite.com>
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23
24 package org.dbforms.config;
25
26 import java.io.Serializable;
27 import java.rmi.MarshalledObject;
28
29
30 public class TestSerializable extends org.dbforms.util.AbstractTestCase {
31
32
33 private void doIt(Serializable obj) {
34 assertNotNull(obj);
35 MarshalledObject mo = null;
36 try {
37 mo = new MarshalledObject(obj);
38 } catch (Exception e) {
39 assertTrue(obj.getClass().getName() + " " +e.getMessage(), false);
40 }
41 assertNotNull(obj.getClass().getName(), mo);
42 long i = mo.hashCode();
43 assertTrue(obj.getClass().getName(), i != 0);
44 }
45
46 public void testSerializable() throws Exception {
47 doIt(new Field());
48 doIt(new Table());
49 doIt(new ResultSetVector());
50 }
51
52 }