use of org.hibernate.tool.hbm2x.Exporter in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateExporter.
@Test
public void testCreateExporter() {
Exporter exporter = (Exporter) Proxy.newProxyInstance(facadeFactory.getClassLoader(), new Class[] { Exporter.class }, new TestInvocationHandler());
IExporter facade = facadeFactory.createExporter(exporter);
assertSame(exporter, ((IFacade) facade).getTarget());
}
use of org.hibernate.tool.hbm2x.Exporter in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateExporter.
@Test
public void testCreateExporter() {
Exporter exporter = (Exporter) Proxy.newProxyInstance(facadeFactory.getClassLoader(), new Class[] { Exporter.class }, new TestInvocationHandler());
IExporter facade = facadeFactory.createExporter(exporter);
assertTrue(facade instanceof ExporterFacadeImpl);
assertSame(exporter, ((IFacade) facade).getTarget());
}
use of org.hibernate.tool.hbm2x.Exporter 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.hibernate.tool.hbm2x.Exporter 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);
}
use of org.hibernate.tool.hbm2x.Exporter in project jbosstools-hibernate by jbosstools.
the class ExporterFacadeImpl method setConfiguration.
@Override
public void setConfiguration(IConfiguration configuration) {
Exporter exporter = (Exporter) getTarget();
setCustomProperties(configuration.getProperties());
exporter.setMetadataDescriptor(new ConfigurationMetadataDescriptor(configuration));
}
Aggregations