Search in sources :

Example 1 with ObjectClonerFactory

use of org.jboss.marshalling.cloner.ObjectClonerFactory in project eap-additional-testsuite by jboss-set.

the class MarshallingTestCase method testNoDefaultConstructor.

@Test
public void testNoDefaultConstructor() throws Throwable {
    final SerializableWithNonSerializableChildWithNoPublicConstructor object = new SerializableWithNonSerializableChildWithNoPublicConstructor();
    final ObjectClonerFactory clonerFactory = ObjectCloners.getCloneableObjectClonerFactory();
    final ClonerConfiguration configuration = new ClonerConfiguration();
    final ObjectCloner cloner = clonerFactory.createCloner(configuration);
    try {
        cloner.clone(object);
    } catch (InvalidObjectException ioe) {
    // This is expected behavior
    } catch (Exception e) {
        Assert.assertTrue("testNoDefaultConstructor has failed.", false);
    }
}
Also used : ObjectClonerFactory(org.jboss.marshalling.cloner.ObjectClonerFactory) InvalidObjectException(java.io.InvalidObjectException) ObjectCloner(org.jboss.marshalling.cloner.ObjectCloner) InvalidObjectException(java.io.InvalidObjectException) ClonerConfiguration(org.jboss.marshalling.cloner.ClonerConfiguration) ATTest(org.jboss.eap.additional.testsuite.annotations.ATTest) Test(org.junit.Test)

Aggregations

InvalidObjectException (java.io.InvalidObjectException)1 ATTest (org.jboss.eap.additional.testsuite.annotations.ATTest)1 ClonerConfiguration (org.jboss.marshalling.cloner.ClonerConfiguration)1 ObjectCloner (org.jboss.marshalling.cloner.ObjectCloner)1 ObjectClonerFactory (org.jboss.marshalling.cloner.ObjectClonerFactory)1 Test (org.junit.Test)1