use of org.hibernate.tool.hbm2x.ArtifactCollector in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateArtifactCollector.
@Test
public void testCreateArtifactCollector() {
ArtifactCollector artifactCollector = new ArtifactCollector();
IArtifactCollector facade = facadeFactory.createArtifactCollector(artifactCollector);
Assert.assertSame(artifactCollector, ((IFacade) facade).getTarget());
}
use of org.hibernate.tool.hbm2x.ArtifactCollector in project jbosstools-hibernate by jbosstools.
the class ExporterFacadeTest method testSetArtifactCollector.
@Test
public void testSetArtifactCollector() {
ArtifactCollector ac = new ArtifactCollector();
IArtifactCollector artifactCollector = new AbstractArtifactCollectorFacade(FACADE_FACTORY, ac) {
};
exporterFacade.setArtifactCollector(artifactCollector);
Assert.assertEquals("setArtifactCollector", methodName);
Assert.assertArrayEquals(new Object[] { ac }, arguments);
}
use of org.hibernate.tool.hbm2x.ArtifactCollector in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateArtifactCollector.
@Test
public void testCreateArtifactCollector() {
ArtifactCollector artifactCollector = new ArtifactCollector();
IArtifactCollector facade = facadeFactory.createArtifactCollector(artifactCollector);
Assert.assertSame(artifactCollector, ((IFacade) facade).getTarget());
}
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 HibernateMappingExporterExtensionTest method testSuperExportPOJO.
@Test
public void testSuperExportPOJO() {
ArtifactCollector artifactCollector = new ArtifactCollector();
hibernateMappingExporterExtension.setArtifactCollector(artifactCollector);
File[] hbmXmlFiles = artifactCollector.getFiles("hbm.xml");
Assert.assertTrue(hbmXmlFiles.length == 0);
Assert.assertFalse(new File("foo" + File.separator + "Bar.hbm.xml").exists());
Map<String, Object> additionalContext = new HashMap<String, Object>();
Cfg2HbmTool c2h = new Cfg2HbmTool();
additionalContext.put("date", new Date().toString());
additionalContext.put("version", Version.getDefault().toString());
additionalContext.put("c2h", c2h);
hibernateMappingExporterExtension.superExportPOJO(additionalContext, pojoClass);
hbmXmlFiles = artifactCollector.getFiles("hbm.xml");
Assert.assertTrue(hbmXmlFiles.length == 1);
Assert.assertEquals("foo" + File.separator + "Bar.hbm.xml", hbmXmlFiles[0].getPath());
Assert.assertTrue(new File("foo" + File.separator + "Bar.hbm.xml").exists());
}
Aggregations