KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > thoughtworks > acceptance > JTableTest


1 package com.thoughtworks.acceptance;
2
3 import javax.swing.*;
4
5 public class JTableTest extends AbstractAcceptanceTest {
6
7     // JTable is one of the nastiest components to serialize. If this works, we're in good shape :)
8

9     public void testJTable() {
10         // Note: JTable does not have a sensible .equals() method, so we compare the XML instead.
11

12         JTable original = new JTable();
13         String JavaDoc originalXml = xstream.toXML(original);
14
15         JTable deserialized = (JTable) xstream.fromXML(originalXml);
16         String JavaDoc deserializedXml = xstream.toXML(deserialized);
17
18         assertEquals(originalXml, deserializedXml);
19     }
20
21 }
22
Popular Tags