use of org.jboss.tools.hibernate.runtime.v_5_6.internal.ConfigurationFacadeImpl in project jbosstools-hibernate by jbosstools.
the class ConfigurationFacadeTest method beforeEach.
@BeforeEach
public void beforeEach() {
configuration = new Configuration();
configuration.setProperty(AvailableSettings.DIALECT, MockDialect.class.getName());
configuration.setProperty(AvailableSettings.CONNECTION_PROVIDER, MockConnectionProvider.class.getName());
configurationFacade = new ConfigurationFacadeImpl(FACADE_FACTORY, configuration);
}
use of org.jboss.tools.hibernate.runtime.v_5_6.internal.ConfigurationFacadeImpl in project jbosstools-hibernate by jbosstools.
the class ConfigurationMetadataDescriptorTest method testCreateMetadata.
@Test
public void testCreateMetadata() {
MetadataSources metadataSources = new MetadataSources();
metadataSources.addInputStream(new ByteArrayInputStream(TEST_HBM_XML_STRING.getBytes()));
Configuration configuration = new Configuration(metadataSources);
configuration.setProperty(AvailableSettings.DIALECT, MockDialect.class.getName());
configuration.setProperty(AvailableSettings.CONNECTION_PROVIDER, MockConnectionProvider.class.getName());
configurationFacade = new ConfigurationFacadeImpl(FACADE_FACTORY, configuration);
PersistentClass persistentClass = new RootClass(null);
persistentClass.setEntityName("Bar");
IPersistentClass persistentClassFacade = FACADE_FACTORY.createPersistentClass(persistentClass);
configurationFacade.addClass(persistentClassFacade);
configurationMetadataDescriptor = new ConfigurationMetadataDescriptor(configurationFacade);
Metadata metadata = configurationMetadataDescriptor.createMetadata();
assertNotNull(metadata.getEntityBinding(Foo.class.getName()));
assertNotNull(metadata.getEntityBinding("Bar"));
}
use of org.jboss.tools.hibernate.runtime.v_5_6.internal.ConfigurationFacadeImpl in project jbosstools-hibernate by jbosstools.
the class ConfigurationMetadataDescriptorTest method beforeEach.
@BeforeEach
public void beforeEach() {
configurationTarget = new Configuration();
configurationFacade = new ConfigurationFacadeImpl(FACADE_FACTORY, configurationTarget);
configurationMetadataDescriptor = new ConfigurationMetadataDescriptor(configurationFacade);
}
use of org.jboss.tools.hibernate.runtime.v_5_6.internal.ConfigurationFacadeImpl in project jbosstools-hibernate by jbosstools.
the class ConfigurationFacadeTest method testGetClassMapping.
@Test
public void testGetClassMapping() throws Exception {
configuration.setProperty("hibernate.dialect", TestDialect.class.getName());
PersistentClass persistentClass = new RootClass(null);
persistentClass.setEntityName("Foo");
IPersistentClass persistentClassFacade = FACADE_FACTORY.createPersistentClass(persistentClass);
configurationFacade = new ConfigurationFacadeImpl(FACADE_FACTORY, configuration);
assertNull(configurationFacade.getClassMapping("Foo"));
configurationFacade = new ConfigurationFacadeImpl(FACADE_FACTORY, configuration);
Field addedClassesField = ConfigurationFacadeImpl.class.getDeclaredField("addedClasses");
addedClassesField.setAccessible(true);
@SuppressWarnings("unchecked") List<IPersistentClass> addedClasses = (List<IPersistentClass>) addedClassesField.get(configurationFacade);
addedClasses.add(persistentClassFacade);
assertSame(configurationFacade.getClassMapping("Foo"), persistentClassFacade);
}
use of org.jboss.tools.hibernate.runtime.v_5_6.internal.ConfigurationFacadeImpl in project jbosstools-hibernate by jbosstools.
the class ConfigurationMetadataDescriptorTest method beforeEach.
@BeforeEach
public void beforeEach() {
configurationTarget = new Configuration();
configurationFacade = new ConfigurationFacadeImpl(FACADE_FACTORY, configurationTarget);
configurationMetadataDescriptor = new ConfigurationMetadataDescriptor(configurationFacade);
}
Aggregations