Search in sources :

Example 1 with TestLaunchConfig

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

the class CodeGenXMLFactoryTest method testCodeGenXMLFactoryJpaAll.

@Test
public void testCodeGenXMLFactoryJpaAll() {
    TestLaunchConfig testLaunchConfig = createTestLaunchConfig(false, true, true);
    CodeGenXMLFactory codeGenFactory = new CodeGenXMLFactory4TestJpa(testLaunchConfig);
    String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
    String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
    codeGen = updatePaths(codeGen);
    // $NON-NLS-1$
    String sample = getSample("AntCodeGenJpa_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 2 with TestLaunchConfig

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

the class CodeGenXMLFactoryTest method testCodeGenXMLFactoryJpaOne.

@Test
public void testCodeGenXMLFactoryJpaOne() {
    TestLaunchConfig testLaunchConfig = createTestLaunchConfig(false, false, true);
    CodeGenXMLFactory codeGenFactory = new CodeGenXMLFactory4TestJpa(testLaunchConfig);
    String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
    String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
    codeGen = updatePaths(codeGen);
    // $NON-NLS-1$
    String sample = getSample("AntCodeGenJpa_test2.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 3 with TestLaunchConfig

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

the class CodeGenXMLFactoryTest method testCodeGenXMLFactoryRevengAll.

@Test
public void testCodeGenXMLFactoryRevengAll() {
    TestLaunchConfig testLaunchConfig = createTestLaunchConfig(true, true, false);
    CodeGenXMLFactory codeGenFactory = new CodeGenXMLFactory4TestSimple(testLaunchConfig);
    String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
    String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
    // $NON-NLS-1$
    String sample = getSample("AntCodeGenReveng_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 4 with TestLaunchConfig

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

the class CodeGenXMLFactoryTest method testCodeGenXMLFactoryOne.

@Test
public void testCodeGenXMLFactoryOne() {
    TestLaunchConfig testLaunchConfig = createTestLaunchConfig(false, false, 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_test2.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 5 with TestLaunchConfig

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

the class CodeGenXMLFactoryTest method testCodeGenXMLFactoryInternalPropertiesOne.

@Test
public void testCodeGenXMLFactoryInternalPropertiesOne() {
    TestLaunchConfig testLaunchConfig = createTestLaunchConfig(false, false, false);
    CodeGenXMLFactory codeGenFactory = new CodeGenXMLFactory4TestProperties(testLaunchConfig);
    codeGenFactory.setExternalPropFile(false);
    String codeGen = adjustXmlText(codeGenFactory.createCodeGenXML());
    String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
    codeGen = updatePaths(codeGen);
    // $NON-NLS-1$
    String sample = getSample("AntCodeGenInternalProps_test2.xml");
    // $NON-NLS-1$
    String sampleProperties = getSample("AntCodeGenPropsInternal.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)

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