
BasicApplicationImpl app = (BasicApplicationImpl) factory.createEntity(spec);
</BUG>
Entity proxy = app.getProxy();
assertTrue(proxy instanceof Application, "proxy="+app);
<BUG>assertFalse(proxy instanceof BasicApplicationImpl, "proxy="+app);
</BUG>
assertEquals(proxy.getParent(), null);
assertSame(proxy.getApplication(), proxy);
}

public void tearDown() throws Exception {
if (managementContext instanceof AbstractManagementContext) ((AbstractManagementContext)managementContext).terminate();
}
@Test
public void testCreatesEntity() throws Exception {
EntitySpec<TestApplication> spec = BasicEntitySpec.newInstance(TestApplication.class);
TestApplicationImpl app = (TestApplicationImpl) factory.createEntity(spec);
Entity proxy = app.getProxy();
assertTrue(proxy instanceof Application, "proxy="+app);
assertFalse(proxy instanceof TestApplicationImpl, "proxy="+app);
assertEquals(proxy.getParent(), null);
assertSame(proxy.getApplication(), proxy);
}
