Search in sources :

Example 1 with JavaExporter

use of org.hibernate.tool.internal.export.java.JavaExporter 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());
}
Also used : JavaExporter(org.hibernate.tool.internal.export.java.JavaExporter) CfgExporter(org.hibernate.tool.internal.export.cfg.CfgExporter) MetadataDescriptor(org.hibernate.tool.api.metadata.MetadataDescriptor) IExporter(org.jboss.tools.hibernate.runtime.spi.IExporter) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) Test(org.junit.jupiter.api.Test)

Aggregations

MetadataDescriptor (org.hibernate.tool.api.metadata.MetadataDescriptor)1 CfgExporter (org.hibernate.tool.internal.export.cfg.CfgExporter)1 JavaExporter (org.hibernate.tool.internal.export.java.JavaExporter)1 IFacade (org.jboss.tools.hibernate.runtime.common.IFacade)1 IExporter (org.jboss.tools.hibernate.runtime.spi.IExporter)1 Test (org.junit.jupiter.api.Test)1