Search in sources :

Example 1 with AbstractExporter

use of org.hibernate.tool.hbm2x.AbstractExporter in project jbosstools-hibernate by jbosstools.

the class ExporterFacadeTest method testStart.

@Test
public void testStart() throws Exception {
    Exporter exporter = new AbstractExporter() {

        @Override
        protected void doStart() {
            methodName = "start";
        }
    };
    ArtifactCollector artifactCollector = new ArtifactCollector();
    File testFile = File.createTempFile("test", "xml");
    FileWriter writer = new FileWriter(testFile);
    writer.write("<test/>");
    writer.flush();
    writer.close();
    artifactCollector.addFile(testFile, "xml");
    exporter.setArtifactCollector(artifactCollector);
    exporterFacade = new AbstractExporterFacade(FACADE_FACTORY, exporter) {
    };
    exporterFacade.start();
    Assert.assertEquals("start", methodName);
}
Also used : AbstractExporter(org.hibernate.tool.hbm2x.AbstractExporter) ArtifactCollector(org.hibernate.tool.hbm2x.ArtifactCollector) IArtifactCollector(org.jboss.tools.hibernate.runtime.spi.IArtifactCollector) FileWriter(java.io.FileWriter) GenericExporter(org.hibernate.tool.hbm2x.GenericExporter) Exporter(org.hibernate.tool.hbm2x.Exporter) QueryExporter(org.hibernate.tool.hbm2x.QueryExporter) HibernateConfigurationExporter(org.hibernate.tool.hbm2x.HibernateConfigurationExporter) Hbm2DDLExporter(org.hibernate.tool.hbm2x.Hbm2DDLExporter) IQueryExporter(org.jboss.tools.hibernate.runtime.spi.IQueryExporter) AbstractExporter(org.hibernate.tool.hbm2x.AbstractExporter) IHbm2DDLExporter(org.jboss.tools.hibernate.runtime.spi.IHbm2DDLExporter) IExporter(org.jboss.tools.hibernate.runtime.spi.IExporter) IGenericExporter(org.jboss.tools.hibernate.runtime.spi.IGenericExporter) File(java.io.File) AbstractExporterFacade(org.jboss.tools.hibernate.runtime.common.AbstractExporterFacade) Test(org.junit.Test)

Example 2 with AbstractExporter

use of org.hibernate.tool.hbm2x.AbstractExporter in project jbosstools-hibernate by jbosstools.

the class ExporterFacadeTest method testStart.

@Test
public void testStart() throws Exception {
    Exporter exporter = new AbstractExporter() {

        @Override
        protected void doStart() {
            methodName = "start";
        }

        @Override
        protected Metadata buildMetadata() {
            return null;
        }
    };
    ArtifactCollector artifactCollector = new ArtifactCollector();
    File testFile = File.createTempFile("test", "xml");
    FileWriter writer = new FileWriter(testFile);
    writer.write("<test/>");
    writer.flush();
    writer.close();
    artifactCollector.addFile(testFile, "xml");
    exporter.setArtifactCollector(artifactCollector);
    exporterFacade = new ExporterFacadeImpl(FACADE_FACTORY, exporter);
    exporterFacade.start();
    Assert.assertEquals("start", methodName);
}
Also used : AbstractExporter(org.hibernate.tool.hbm2x.AbstractExporter) ArtifactCollector(org.hibernate.tool.hbm2x.ArtifactCollector) IArtifactCollector(org.jboss.tools.hibernate.runtime.spi.IArtifactCollector) FileWriter(java.io.FileWriter) GenericExporter(org.hibernate.tool.hbm2x.GenericExporter) Exporter(org.hibernate.tool.hbm2x.Exporter) QueryExporter(org.hibernate.tool.hbm2x.QueryExporter) HibernateConfigurationExporter(org.hibernate.tool.hbm2x.HibernateConfigurationExporter) Hbm2DDLExporter(org.hibernate.tool.hbm2x.Hbm2DDLExporter) IQueryExporter(org.jboss.tools.hibernate.runtime.spi.IQueryExporter) AbstractExporter(org.hibernate.tool.hbm2x.AbstractExporter) IHbm2DDLExporter(org.jboss.tools.hibernate.runtime.spi.IHbm2DDLExporter) IExporter(org.jboss.tools.hibernate.runtime.spi.IExporter) IGenericExporter(org.jboss.tools.hibernate.runtime.spi.IGenericExporter) File(java.io.File) Test(org.junit.Test)

Aggregations

File (java.io.File)2 FileWriter (java.io.FileWriter)2 AbstractExporter (org.hibernate.tool.hbm2x.AbstractExporter)2 ArtifactCollector (org.hibernate.tool.hbm2x.ArtifactCollector)2 Exporter (org.hibernate.tool.hbm2x.Exporter)2 GenericExporter (org.hibernate.tool.hbm2x.GenericExporter)2 Hbm2DDLExporter (org.hibernate.tool.hbm2x.Hbm2DDLExporter)2 HibernateConfigurationExporter (org.hibernate.tool.hbm2x.HibernateConfigurationExporter)2 QueryExporter (org.hibernate.tool.hbm2x.QueryExporter)2 IArtifactCollector (org.jboss.tools.hibernate.runtime.spi.IArtifactCollector)2 IExporter (org.jboss.tools.hibernate.runtime.spi.IExporter)2 IGenericExporter (org.jboss.tools.hibernate.runtime.spi.IGenericExporter)2 IHbm2DDLExporter (org.jboss.tools.hibernate.runtime.spi.IHbm2DDLExporter)2 IQueryExporter (org.jboss.tools.hibernate.runtime.spi.IQueryExporter)2 Test (org.junit.Test)2 AbstractExporterFacade (org.jboss.tools.hibernate.runtime.common.AbstractExporterFacade)1