Search in sources :

Example 11 with TestLaunchConfig

use of org.jboss.tools.hibernate.orm.test.utils.TestLaunchConfig in project jbosstools-hibernate by jbosstools.

the class CodeGenXMLFactoryTest method testCodeGenXMLFactoryPropertiesOne.

@Test
public void testCodeGenXMLFactoryPropertiesOne() {
    TestLaunchConfig testLaunchConfig = createTestLaunchConfig(false, false, false);
    CodeGenXMLFactory codeGenFactory = new CodeGenXMLFactory4TestProperties(testLaunchConfig);
    String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
    String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
    codeGen = updatePaths(codeGen);
    // $NON-NLS-1$
    String sample = getSample("AntCodeGenProps_test2.xml");
    // $NON-NLS-1$
    String sampleProperties = getSample("AntCodeGenProps.hibernate.properties");
    Assert.assertEquals(sample, codeGen);
    Assert.assertEquals(sampleProperties.trim(), codeGenProperties);
}
Also used : TestLaunchConfig(org.jboss.tools.hibernate.orm.test.utils.TestLaunchConfig) CodeGenXMLFactory(org.hibernate.eclipse.launch.CodeGenXMLFactory) Test(org.junit.Test)

Example 12 with TestLaunchConfig

use of org.jboss.tools.hibernate.orm.test.utils.TestLaunchConfig in project jbosstools-hibernate by jbosstools.

the class CodeGenXMLFactoryTest method createTestLaunchConfig.

private TestLaunchConfig createTestLaunchConfig(boolean reveng, boolean exportersAll, boolean jpa) {
    Map<String, Object> testLaunchConfigAttr = getTestLaunchConfigAttr(reveng, exportersAll, jpa);
    TestLaunchConfig testLaunchConfig = new TestLaunchConfig(testLaunchConfigAttr);
    return testLaunchConfig;
}
Also used : TestLaunchConfig(org.jboss.tools.hibernate.orm.test.utils.TestLaunchConfig)

Example 13 with TestLaunchConfig

use of org.jboss.tools.hibernate.orm.test.utils.TestLaunchConfig in project jbosstools-hibernate by jbosstools.

the class CodeGenXMLFactoryTest method testCodeGenXMLFactoryNullableAll.

@Test
public void testCodeGenXMLFactoryNullableAll() {
    TestLaunchConfig testLaunchConfig = createTestLaunchConfig(false, true, false);
    CodeGenXMLFactory codeGenFactory = new CodeGenXMLFactory4TestNullable(testLaunchConfig);
    String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
    String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
    codeGen = updatePaths(codeGen);
    // $NON-NLS-1$
    String sample = getSample("AntCodeGenNullable_test1.xml");
    Assert.assertEquals(sample, codeGen);
    Assert.assertEquals(codeGenProperties.length(), 0);
}
Also used : TestLaunchConfig(org.jboss.tools.hibernate.orm.test.utils.TestLaunchConfig) CodeGenXMLFactory(org.hibernate.eclipse.launch.CodeGenXMLFactory) Test(org.junit.Test)

Example 14 with TestLaunchConfig

use of org.jboss.tools.hibernate.orm.test.utils.TestLaunchConfig in project jbosstools-hibernate by jbosstools.

the class CodeGenXMLFactoryTest method testCodeGenXMLFactoryAll.

@Test
public void testCodeGenXMLFactoryAll() {
    TestLaunchConfig testLaunchConfig = createTestLaunchConfig(false, true, false);
    CodeGenXMLFactory codeGenFactory = new CodeGenXMLFactory4TestRelative(testLaunchConfig);
    // 
    // $NON-NLS-1$
    String strPlace = "project/src";
    codeGenFactory.setPlace2Generate(strPlace);
    codeGenFactory.setWorkspacePath(strPlace);
    // 
    String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
    String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
    // $NON-NLS-1$
    String sample = getSample("AntCodeGen_test1.xml");
    Assert.assertEquals(sample, codeGen);
    Assert.assertEquals(codeGenProperties.length(), 0);
}
Also used : TestLaunchConfig(org.jboss.tools.hibernate.orm.test.utils.TestLaunchConfig) CodeGenXMLFactory(org.hibernate.eclipse.launch.CodeGenXMLFactory) Test(org.junit.Test)

Aggregations

TestLaunchConfig (org.jboss.tools.hibernate.orm.test.utils.TestLaunchConfig)14 CodeGenXMLFactory (org.hibernate.eclipse.launch.CodeGenXMLFactory)12 Test (org.junit.Test)12 HashMap (java.util.HashMap)1 IJavaProject (org.eclipse.jdt.core.IJavaProject)1 DefaultProjectClasspathEntry (org.eclipse.jdt.internal.launching.DefaultProjectClasspathEntry)1 RuntimeClasspathEntry (org.eclipse.jdt.internal.launching.RuntimeClasspathEntry)1 IRuntimeClasspathEntry (org.eclipse.jdt.launching.IRuntimeClasspathEntry)1 SimpleTestProject (org.jboss.tools.hibernate.orm.test.utils.project.SimpleTestProject)1 Before (org.junit.Before)1