@Test public void test02() throws Exception { SerialException e = new SerialException(); SerialJavaObject sjo = new SerialJavaObject(e); Field[] f = e.getClass().getFields(); assertTrue(Arrays.equals(f, sjo.getFields())); assertFalse(Arrays.equals("hello".getClass().getFields(), sjo.getFields())); }
/** * Validate that a SerialJavaObject that is serialized & deserialized is * equal to itself */ @Test public void test04() throws Exception { SerialJavaObject sjo = new SerialJavaObject("Hello"); SerialJavaObject sjo2 = serializeDeserializeObject(sjo); assertTrue(sjo.equals(sjo2)); }
@Test(expectedExceptions = NullPointerException.class) public void test() throws Exception { SerialJavaObject sjo = new SerialJavaObject(null); }
@Test(expectedExceptions = SerialException.class, enabled = false) public void test01() throws Exception { SerialJavaObject sjo = new SerialJavaObject(new RowSetMetaDataImpl()); }
@Test public void test03() throws Exception { SerialJavaObject sjo = new SerialJavaObject("Hello"); SerialJavaObject sjo2 = (SerialJavaObject) sjo.clone(); assertTrue(sjo.equals(sjo2)); }
@Test public void test05() throws Exception { String s = "Hello world"; SerialJavaObject sjo = new SerialJavaObject(s); assertTrue(s.equals(sjo.getObject())); }