use of org.hibernate.tool.hbm2x.ArtifactCollector 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.ArtifactCollector in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewArtifactCollector.
@Test
public void testNewArtifactCollector() {
IArtifactCollector artifactCollector = service.newArtifactCollector();
Assert.assertNotNull(artifactCollector);
Object target = ((IFacade) artifactCollector).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof ArtifactCollector);
}
use of org.hibernate.tool.hbm2x.ArtifactCollector in project jbosstools-hibernate by jbosstools.
the class ArtifactCollectorFacadeTest method setUp.
@Before
public void setUp() throws Exception {
ProxyFactory proxyFactory = new ProxyFactory();
proxyFactory.setSuperclass(ArtifactCollector.class);
Class<?> proxyClass = proxyFactory.createClass();
ProxyObject proxy = (ProxyObject) proxyClass.newInstance();
proxy.setHandler(new MethodHandler() {
@Override
public Object invoke(Object self, Method m, Method proceed, Object[] args) throws Throwable {
if (methodName == null) {
methodName = m.getName();
}
if (arguments == null) {
arguments = args;
}
return proceed.invoke(self, args);
}
});
artifactCollector = new AbstractArtifactCollectorFacade(FACADE_FACTORY, (ArtifactCollector) proxy) {
};
reset();
}
use of org.hibernate.tool.hbm2x.ArtifactCollector in project jbosstools-hibernate by jbosstools.
the class ArtifactCollectorFacadeTest method setUp.
@Before
public void setUp() throws Exception {
ProxyFactory proxyFactory = new ProxyFactory();
proxyFactory.setSuperclass(ArtifactCollector.class);
Class<?> proxyClass = proxyFactory.createClass();
ProxyObject proxy = (ProxyObject) proxyClass.newInstance();
proxy.setHandler(new MethodHandler() {
@Override
public Object invoke(Object self, Method m, Method proceed, Object[] args) throws Throwable {
if (methodName == null) {
methodName = m.getName();
}
if (arguments == null) {
arguments = args;
}
return proceed.invoke(self, args);
}
});
artifactCollector = new AbstractArtifactCollectorFacade(FACADE_FACTORY, (ArtifactCollector) proxy) {
};
reset();
}
Aggregations