use of org.jboss.tools.hibernate.runtime.spi.IClassMetadata in project jbosstools-hibernate by jbosstools.
the class SessionFactoryFacadeTest method testGetAllClassMetadata.
@Test
public void testGetAllClassMetadata() throws Exception {
Configuration configuration = new Configuration();
SessionFactory sessionFactory = configuration.buildSessionFactory();
ISessionFactory sessionFactoryFacade = FACADE_FACTORY.createSessionFactory(sessionFactory);
Assert.assertTrue(sessionFactoryFacade.getAllClassMetadata().isEmpty());
sessionFactory.close();
configuration.addClass(Foo.class);
sessionFactory = configuration.buildSessionFactory();
sessionFactoryFacade = FACADE_FACTORY.createSessionFactory(sessionFactory);
Map<String, IClassMetadata> allClassMetaData = sessionFactoryFacade.getAllClassMetadata();
Assert.assertNotNull(allClassMetaData.get("org.jboss.tools.hibernate.runtime.v_3_6.internal.test.Foo"));
}
use of org.jboss.tools.hibernate.runtime.spi.IClassMetadata 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.jboss.tools.hibernate.runtime.spi.IClassMetadata in project jbosstools-hibernate by jbosstools.
the class SessionFactoryFacadeTest method testGetAllClassMetadata.
@Test
public void testGetAllClassMetadata() throws Exception {
Configuration configuration = new Configuration();
SessionFactory sessionFactory = configuration.buildSessionFactory(new StandardServiceRegistryBuilder().build());
ISessionFactory sessionFactoryFacade = FACADE_FACTORY.createSessionFactory(sessionFactory);
Assert.assertTrue(sessionFactoryFacade.getAllClassMetadata().isEmpty());
sessionFactory.close();
configuration.addClass(Foo.class);
sessionFactory = configuration.buildSessionFactory(new StandardServiceRegistryBuilder().build());
sessionFactoryFacade = FACADE_FACTORY.createSessionFactory(sessionFactory);
Map<String, IClassMetadata> allClassMetaData = sessionFactoryFacade.getAllClassMetadata();
Assert.assertNotNull(allClassMetaData.get("org.jboss.tools.hibernate.runtime.v_4_3.internal.test.Foo"));
}
use of org.jboss.tools.hibernate.runtime.spi.IClassMetadata in project jbosstools-hibernate by jbosstools.
the class SessionFactoryFacadeTest method testGetAllClassMetadata.
@Test
public void testGetAllClassMetadata() throws Exception {
Configuration configuration = new Configuration();
SessionFactory sessionFactory = configuration.buildSessionFactory(new StandardServiceRegistryBuilder().build());
ISessionFactory sessionFactoryFacade = FACADE_FACTORY.createSessionFactory(sessionFactory);
Assert.assertTrue(sessionFactoryFacade.getAllClassMetadata().isEmpty());
sessionFactory.close();
configuration.addClass(Foo.class);
sessionFactory = configuration.buildSessionFactory(new StandardServiceRegistryBuilder().build());
sessionFactoryFacade = FACADE_FACTORY.createSessionFactory(sessionFactory);
Map<String, IClassMetadata> allClassMetaData = sessionFactoryFacade.getAllClassMetadata();
Assert.assertNotNull(allClassMetaData.get("org.jboss.tools.hibernate.runtime.v_5_2.internal.test.Foo"));
}
use of org.jboss.tools.hibernate.runtime.spi.IClassMetadata in project jbosstools-hibernate by jbosstools.
the class SessionFactoryFacadeTest method testGetAllClassMetadata.
@Test
public void testGetAllClassMetadata() throws Exception {
Configuration configuration = new Configuration();
SessionFactory sessionFactory = configuration.buildSessionFactory(new StandardServiceRegistryBuilder().build());
ISessionFactory sessionFactoryFacade = FACADE_FACTORY.createSessionFactory(sessionFactory);
Assert.assertTrue(sessionFactoryFacade.getAllClassMetadata().isEmpty());
sessionFactory.close();
configuration.addClass(Foo.class);
sessionFactory = configuration.buildSessionFactory(new StandardServiceRegistryBuilder().build());
sessionFactoryFacade = FACADE_FACTORY.createSessionFactory(sessionFactory);
Map<String, IClassMetadata> allClassMetaData = sessionFactoryFacade.getAllClassMetadata();
Assert.assertNotNull(allClassMetaData.get("org.jboss.tools.hibernate.runtime.v_5_1.internal.test.Foo"));
}
Aggregations