public void testInjectedExtensionSerialisation() throws Exception
{
addExtension(new ExternalTestScopeExtension());
startContainer(BeanWithExtensionInjected.class);
BeanWithExtensionInjected instance = getInstance(BeanWithExtensionInjected.class);
Assert.assertNotNull(instance);
Assert.assertNotNull(instance.getExtension());
Bean<ExternalTestScopeExtension> extensionBean = getBean(ExternalTestScopeExtension.class);
Assert.assertNotNull(extensionBean);
Assert.assertTrue(extensionBean instanceof PassivationCapable);
Assert.assertNotNull(((PassivationCapable) extensionBean).getId());
byte[] ba = SerializationTest.serializeObject(instance);
Assert.assertNotNull(ba);
BeanWithExtensionInjected serializedInstance
= (BeanWithExtensionInjected) SerializationTest.deSerializeObject(ba);
Assert.assertNotNull(serializedInstance);
Assert.assertNotNull(serializedInstance.getExtension());
}