use of java.io.ObjectStreamClass in project j2objc by google.
the class ObjectStreamClassTest method test_toString.
/**
* java.io.ObjectStreamClass#toString()
*/
public void test_toString() {
ObjectStreamClass osc = ObjectStreamClass.lookup(DummyClass.class);
String oscString = osc.toString();
// The previous test was more specific than the spec so it was replaced
// with the test below
assertTrue("toString returned incorrect string: " + osc.toString(), oscString.indexOf("serialVersionUID") >= 0 && oscString.indexOf("999999999999999L") >= 0);
}
use of java.io.ObjectStreamClass in project j2objc by google.
the class ObjectStreamClassTest method test_specialTypes.
public void test_specialTypes() {
Class<?> proxyClass = Proxy.getProxyClass(this.getClass().getClassLoader(), new Class[] { Runnable.class });
ObjectStreamClass proxyStreamClass = ObjectStreamClass.lookup(proxyClass);
assertEquals("Proxy classes should have zero serialVersionUID", 0, proxyStreamClass.getSerialVersionUID());
ObjectStreamField[] proxyFields = proxyStreamClass.getFields();
assertEquals("Proxy classes should have no serialized fields", 0, proxyFields.length);
ObjectStreamClass enumStreamClass = ObjectStreamClass.lookup(Thread.State.class);
assertEquals("Enum classes should have zero serialVersionUID", 0, enumStreamClass.getSerialVersionUID());
ObjectStreamField[] enumFields = enumStreamClass.getFields();
assertEquals("Enum classes should have no serialized fields", 0, enumFields.length);
}
use of java.io.ObjectStreamClass in project j2objc by google.
the class ObjectStreamClassTest method test_lookupAnyLjava_lang_Class.
/**
* java.io.ObjectStreamClass#lookupAny(java.lang.Class)
* @since 1.6
*/
public void test_lookupAnyLjava_lang_Class() {
// Test for method java.io.ObjectStreamClass
// java.io.ObjectStreamClass.lookupAny(java.lang.Class)
ObjectStreamClass osc = ObjectStreamClass.lookupAny(DummyClass.class);
assertEquals("lookup returned wrong class: " + osc.getName(), "org.apache.harmony.tests.java.io.ObjectStreamClassTest$DummyClass", osc.getName());
osc = ObjectStreamClass.lookupAny(NonSerialzableClass.class);
assertEquals("lookup returned wrong class: " + osc.getName(), "org.apache.harmony.tests.java.io.ObjectStreamClassTest$NonSerialzableClass", osc.getName());
osc = ObjectStreamClass.lookupAny(ExternalizableClass.class);
assertEquals("lookup returned wrong class: " + osc.getName(), "org.apache.harmony.tests.java.io.ObjectStreamClassTest$ExternalizableClass", osc.getName());
osc = ObjectStreamClass.lookup(NonSerialzableClass.class);
assertNull(osc);
}
use of java.io.ObjectStreamClass in project j2objc by google.
the class ObjectStreamClassTest method test_getName.
/**
* java.io.ObjectStreamClass#getName()
*/
public void test_getName() {
ObjectStreamClass osc = ObjectStreamClass.lookup(DummyClass.class);
assertEquals("getName returned incorrect name: " + osc.getName(), "org.apache.harmony.tests.java.io.ObjectStreamClassTest$DummyClass", osc.getName());
}
use of java.io.ObjectStreamClass in project j2objc by google.
the class ObjectStreamClassTest method testSerialization.
public void testSerialization() {
ObjectStreamClass osc = ObjectStreamClass.lookup(ObjectStreamClass.class);
assertEquals(0, osc.getFields().length);
}
Aggregations