use of org.jboss.tools.hibernate.runtime.common.AbstractExporterFacade in project jbosstools-hibernate by jbosstools.
the class ExporterFacadeTest method setUp.
@Before
public void setUp() throws Exception {
exporter = (Exporter) Proxy.newProxyInstance(FACADE_FACTORY.getClassLoader(), new Class[] { Exporter.class }, new TestInvocationHandler());
exporterFacade = new AbstractExporterFacade(FACADE_FACTORY, exporter) {
};
}
use of org.jboss.tools.hibernate.runtime.common.AbstractExporterFacade 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);
}
use of org.jboss.tools.hibernate.runtime.common.AbstractExporterFacade in project jbosstools-hibernate by jbosstools.
the class ExporterFacadeTest method testGetHbm2DDLExporter.
@Test
public void testGetHbm2DDLExporter() {
IHbm2DDLExporter hbm2DDLExporter = exporterFacade.getHbm2DDLExporter();
Assert.assertNull(hbm2DDLExporter);
exporter = new Hbm2DDLExporter();
exporterFacade = new AbstractExporterFacade(FACADE_FACTORY, exporter) {
};
hbm2DDLExporter = exporterFacade.getHbm2DDLExporter();
Assert.assertNotNull(hbm2DDLExporter);
Assert.assertSame(exporter, ((IFacade) hbm2DDLExporter).getTarget());
}
use of org.jboss.tools.hibernate.runtime.common.AbstractExporterFacade in project jbosstools-hibernate by jbosstools.
the class ExporterFacadeTest method setUp.
@Before
public void setUp() throws Exception {
exporter = (Exporter) Proxy.newProxyInstance(FACADE_FACTORY.getClassLoader(), new Class[] { Exporter.class }, new TestInvocationHandler());
exporterFacade = new AbstractExporterFacade(FACADE_FACTORY, exporter) {
};
}
use of org.jboss.tools.hibernate.runtime.common.AbstractExporterFacade in project jbosstools-hibernate by jbosstools.
the class ExporterFacadeTest method testGetQueryExporter.
@Test
public void testGetQueryExporter() {
IQueryExporter queryExporter = exporterFacade.getQueryExporter();
Assert.assertNull(queryExporter);
exporter = new QueryExporter();
exporterFacade = new AbstractExporterFacade(FACADE_FACTORY, exporter) {
};
queryExporter = exporterFacade.getQueryExporter();
Assert.assertNotNull(queryExporter);
Assert.assertSame(exporter, ((IFacade) queryExporter).getTarget());
}
Aggregations