use of org.hibernate.tool.api.metadata.MetadataDescriptor in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testCreateExporter.
@Test
public void testCreateExporter() throws Exception {
IExporter exporter = service.createExporter(POJOExporter.class.getName());
assertNotNull(exporter);
Object target = ((IFacade) exporter).getTarget();
assertNotNull(target);
assertTrue(target instanceof POJOExporter);
Field metadataDescriptorField = AbstractExporter.class.getDeclaredField("metadataDescriptor");
metadataDescriptorField.setAccessible(true);
MetadataDescriptor metadataDescriptor = (MetadataDescriptor) metadataDescriptorField.get(target);
// Normal metadata descriptor
assertNotNull(metadataDescriptor.getProperties());
exporter = service.createExporter(HibernateConfigurationExporter.class.getName());
assertNotNull(exporter);
target = ((IFacade) exporter).getTarget();
assertNotNull(target);
assertTrue(target instanceof HibernateConfigurationExporter);
metadataDescriptor = (MetadataDescriptor) metadataDescriptorField.get(target);
// Dummy metadata descriptor
assertNull(metadataDescriptor.getProperties());
}
use of org.hibernate.tool.api.metadata.MetadataDescriptor in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testCreateExporter.
@Test
public void testCreateExporter() throws Exception {
IExporter exporter = service.createExporter(POJOExporter.class.getName());
assertNotNull(exporter);
Object target = ((IFacade) exporter).getTarget();
assertNotNull(target);
assertTrue(target instanceof POJOExporter);
Field metadataDescriptorField = AbstractExporter.class.getDeclaredField("metadataDescriptor");
metadataDescriptorField.setAccessible(true);
MetadataDescriptor metadataDescriptor = (MetadataDescriptor) metadataDescriptorField.get(target);
// Normal metadata descriptor
assertNotNull(metadataDescriptor.getProperties());
exporter = service.createExporter(HibernateConfigurationExporter.class.getName());
assertNotNull(exporter);
target = ((IFacade) exporter).getTarget();
assertNotNull(target);
assertTrue(target instanceof HibernateConfigurationExporter);
metadataDescriptor = (MetadataDescriptor) metadataDescriptorField.get(target);
// Dummy metadata descriptor
assertNull(metadataDescriptor.getProperties());
}
use of org.hibernate.tool.api.metadata.MetadataDescriptor in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testCreateExporter.
@Test
public void testCreateExporter() {
IExporter exporter = service.createExporter(JavaExporter.class.getName());
assertNotNull(exporter);
Object target = ((IFacade) exporter).getTarget();
assertNotNull(target);
assertTrue(target instanceof JavaExporter);
MetadataDescriptor metadataDescriptor = (MetadataDescriptor) ((JavaExporter) target).getProperties().get(ExporterConstants.METADATA_DESCRIPTOR);
// Normal metadata descriptor
assertNotNull(metadataDescriptor.getProperties());
exporter = service.createExporter(CfgExporter.class.getName());
assertNotNull(exporter);
target = ((IFacade) exporter).getTarget();
assertNotNull(target);
assertTrue(target instanceof CfgExporter);
metadataDescriptor = (MetadataDescriptor) ((CfgExporter) target).getProperties().get(ExporterConstants.METADATA_DESCRIPTOR);
// Dummy metadata descriptor
assertNull(metadataDescriptor.getProperties());
}
use of org.hibernate.tool.api.metadata.MetadataDescriptor in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testCreateExporter.
@Test
public void testCreateExporter() throws Exception {
IExporter exporter = service.createExporter(POJOExporter.class.getName());
assertNotNull(exporter);
Object target = ((IFacade) exporter).getTarget();
assertNotNull(target);
assertTrue(target instanceof POJOExporter);
Field metadataDescriptorField = AbstractExporter.class.getDeclaredField("metadataDescriptor");
metadataDescriptorField.setAccessible(true);
MetadataDescriptor metadataDescriptor = (MetadataDescriptor) metadataDescriptorField.get(target);
// Normal metadata descriptor
assertNotNull(metadataDescriptor.getProperties());
exporter = service.createExporter(HibernateConfigurationExporter.class.getName());
assertNotNull(exporter);
target = ((IFacade) exporter).getTarget();
assertNotNull(target);
assertTrue(target instanceof HibernateConfigurationExporter);
metadataDescriptor = (MetadataDescriptor) metadataDescriptorField.get(target);
// Dummy metadata descriptor
assertNull(metadataDescriptor.getProperties());
}
use of org.hibernate.tool.api.metadata.MetadataDescriptor in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testCreateExporter.
@Test
public void testCreateExporter() throws Exception {
IExporter exporter = service.createExporter(POJOExporter.class.getName());
assertNotNull(exporter);
Object target = ((IFacade) exporter).getTarget();
assertNotNull(target);
assertTrue(target instanceof POJOExporter);
Field metadataDescriptorField = AbstractExporter.class.getDeclaredField("metadataDescriptor");
metadataDescriptorField.setAccessible(true);
MetadataDescriptor metadataDescriptor = (MetadataDescriptor) metadataDescriptorField.get(target);
// Normal metadata descriptor
assertNotNull(metadataDescriptor.getProperties());
exporter = service.createExporter(HibernateConfigurationExporter.class.getName());
assertNotNull(exporter);
target = ((IFacade) exporter).getTarget();
assertNotNull(target);
assertTrue(target instanceof HibernateConfigurationExporter);
metadataDescriptor = (MetadataDescriptor) metadataDescriptorField.get(target);
// Dummy metadata descriptor
assertNull(metadataDescriptor.getProperties());
}
Aggregations