use of org.jboss.tools.hibernate.runtime.spi.ICollectionMetadata in project jbosstools-hibernate by jbosstools.
the class SessionFactoryFacadeTest method testGetAllCollectionMetadata.
@Test
public void testGetAllCollectionMetadata() {
Configuration configuration = new Configuration();
SessionFactory sessionFactory = configuration.buildSessionFactory();
ISessionFactory sessionFactoryFacade = FACADE_FACTORY.createSessionFactory(sessionFactory);
Assert.assertTrue(sessionFactoryFacade.getAllCollectionMetadata().isEmpty());
sessionFactory.close();
configuration.addClass(Foo.class);
sessionFactory = configuration.buildSessionFactory();
sessionFactoryFacade = FACADE_FACTORY.createSessionFactory(sessionFactory);
Map<String, ICollectionMetadata> allCollectionMetaData = sessionFactoryFacade.getAllCollectionMetadata();
Assert.assertNotNull(allCollectionMetaData.get("org.jboss.tools.hibernate.runtime.v_3_6.internal.test.Foo.bars"));
}
use of org.jboss.tools.hibernate.runtime.spi.ICollectionMetadata in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateCollectionMetadata.
@Test
public void testCreateCollectionMetadata() {
CollectionMetadata collectionMetadata = (CollectionMetadata) Proxy.newProxyInstance(facadeFactory.getClassLoader(), new Class[] { CollectionMetadata.class }, new TestInvocationHandler());
ICollectionMetadata facade = facadeFactory.createCollectionMetadata(collectionMetadata);
Assert.assertSame(collectionMetadata, ((IFacade) facade).getTarget());
}
use of org.jboss.tools.hibernate.runtime.spi.ICollectionMetadata in project jbosstools-hibernate by jbosstools.
the class SessionFactoryFacadeTest method testGetAllCollectionMetadata.
@Test
public void testGetAllCollectionMetadata() {
Configuration configuration = new Configuration();
ServiceRegistry serviceRegistry = new ServiceRegistryBuilder().buildServiceRegistry();
SessionFactory sessionFactory = configuration.buildSessionFactory(serviceRegistry);
ISessionFactory sessionFactoryFacade = FACADE_FACTORY.createSessionFactory(sessionFactory);
Assert.assertTrue(sessionFactoryFacade.getAllCollectionMetadata().isEmpty());
sessionFactory.close();
configuration.addClass(Foo.class);
sessionFactory = configuration.buildSessionFactory(serviceRegistry);
sessionFactoryFacade = FACADE_FACTORY.createSessionFactory(sessionFactory);
Map<String, ICollectionMetadata> allCollectionMetaData = sessionFactoryFacade.getAllCollectionMetadata();
Assert.assertNotNull(allCollectionMetaData.get("org.jboss.tools.hibernate.runtime.v_4_0.internal.test.Foo.bars"));
}
use of org.jboss.tools.hibernate.runtime.spi.ICollectionMetadata in project jbosstools-hibernate by jbosstools.
the class SessionFactoryFacadeTest method testGetAllCollectionMetadata.
@Test
public void testGetAllCollectionMetadata() {
Configuration configuration = new Configuration();
SessionFactory sessionFactory = configuration.buildSessionFactory(new StandardServiceRegistryBuilder().build());
ISessionFactory sessionFactoryFacade = FACADE_FACTORY.createSessionFactory(sessionFactory);
Assert.assertTrue(sessionFactoryFacade.getAllCollectionMetadata().isEmpty());
sessionFactory.close();
configuration.addClass(Foo.class);
sessionFactory = configuration.buildSessionFactory(new StandardServiceRegistryBuilder().build());
sessionFactoryFacade = FACADE_FACTORY.createSessionFactory(sessionFactory);
Map<String, ICollectionMetadata> allCollectionMetaData = sessionFactoryFacade.getAllCollectionMetadata();
Assert.assertNotNull(allCollectionMetaData.get("org.jboss.tools.hibernate.runtime.v_4_3.internal.test.Foo.bars"));
}
use of org.jboss.tools.hibernate.runtime.spi.ICollectionMetadata in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateCollectionMetadata.
@Test
public void testCreateCollectionMetadata() {
CollectionMetadata collectionMetadata = (CollectionMetadata) Proxy.newProxyInstance(facadeFactory.getClassLoader(), new Class[] { CollectionMetadata.class }, new TestInvocationHandler());
ICollectionMetadata facade = facadeFactory.createCollectionMetadata(collectionMetadata);
Assert.assertSame(collectionMetadata, ((IFacade) facade).getTarget());
}
Aggregations