use of org.hibernate.metadata.ClassMetadata in project jbosstools-hibernate by jbosstools.
the class SessionFactoryFacadeTest method testGetClassMetadata.
@Ignore
@Test
public void testGetClassMetadata() {
Configuration configuration = new Configuration();
configuration.addClass(Foo.class);
SessionFactory sessionFactory = configuration.buildSessionFactory();
ClassMetadata classMetadata = sessionFactory.getClassMetadata(Foo.class);
ISessionFactory sessionFactoryFacade = FACADE_FACTORY.createSessionFactory(sessionFactory);
Assert.assertSame(classMetadata, ((IFacade) sessionFactoryFacade.getClassMetadata(Foo.class)).getTarget());
Assert.assertSame(classMetadata, ((IFacade) sessionFactoryFacade.getClassMetadata("org.jboss.tools.hibernate.runtime.v_3_5.internal.test.Foo")).getTarget());
}
use of org.hibernate.metadata.ClassMetadata in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateClassMetadata.
@Test
public void testCreateClassMetadata() {
ClassMetadata classMetadata = (ClassMetadata) Proxy.newProxyInstance(facadeFactory.getClassLoader(), new Class[] { ClassMetadata.class }, new TestInvocationHandler());
IClassMetadata facade = facadeFactory.createClassMetadata(classMetadata);
Assert.assertSame(classMetadata, ((IFacade) facade).getTarget());
}
use of org.hibernate.metadata.ClassMetadata in project jbosstools-hibernate by jbosstools.
the class ClassMetadataFacadeTest method setUp.
@Before
public void setUp() {
ClassMetadata target = (ClassMetadata) Proxy.newProxyInstance(FACADE_FACTORY.getClassLoader(), new Class[] { ClassMetadata.class }, new TestInvocationHandler());
classMetadata = new ClassMetadataFacadeImpl(FACADE_FACTORY, target) {
};
}
use of org.hibernate.metadata.ClassMetadata in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateClassMetadata.
@Test
public void testCreateClassMetadata() {
ClassMetadata classMetadata = (ClassMetadata) Proxy.newProxyInstance(facadeFactory.getClassLoader(), new Class[] { ClassMetadata.class }, new TestInvocationHandler());
IClassMetadata facade = facadeFactory.createClassMetadata(classMetadata);
assertTrue(facade instanceof ClassMetadataFacadeImpl);
assertSame(classMetadata, ((IFacade) facade).getTarget());
}
use of org.hibernate.metadata.ClassMetadata in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateClassMetadata.
@Test
public void testCreateClassMetadata() {
ClassMetadata classMetadata = (ClassMetadata) Proxy.newProxyInstance(facadeFactory.getClassLoader(), new Class[] { ClassMetadata.class }, new TestInvocationHandler());
IClassMetadata facade = facadeFactory.createClassMetadata(classMetadata);
assertTrue(facade instanceof ClassMetadataFacadeImpl);
assertSame(classMetadata, ((IFacade) facade).getTarget());
}
Aggregations