Search in sources :

Example 6 with CodeGenXMLFactory

use of org.hibernate.eclipse.launch.CodeGenXMLFactory in project jbosstools-hibernate by jbosstools.

the class CodeGenXMLFactoryTest method testCodeGenXMLFactoryInternalPropertiesAll.

@Test
public void testCodeGenXMLFactoryInternalPropertiesAll() {
    TestLaunchConfig testLaunchConfig = createTestLaunchConfig(false, true, 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_test1.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)

Example 7 with CodeGenXMLFactory

use of org.hibernate.eclipse.launch.CodeGenXMLFactory in project jbosstools-hibernate by jbosstools.

the class CodeGenXMLFactoryTest method testCodeGenXMLFactoryPropertiesAll.

@Test
public void testCodeGenXMLFactoryPropertiesAll() {
    TestLaunchConfig testLaunchConfig = createTestLaunchConfig(false, true, 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_test1.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 8 with CodeGenXMLFactory

use of org.hibernate.eclipse.launch.CodeGenXMLFactory in project jbosstools-hibernate by jbosstools.

the class CodeGenXMLFactoryTest method testCodeGenXMLFactoryRevengOne.

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

use of org.hibernate.eclipse.launch.CodeGenXMLFactory in project jbosstools-hibernate by jbosstools.

the class CodeGenXMLFactoryTest method testCodeGenXMLFactoryNullableOne.

@Test
public void testCodeGenXMLFactoryNullableOne() {
    TestLaunchConfig testLaunchConfig = createTestLaunchConfig(false, false, 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_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 10 with CodeGenXMLFactory

use of org.hibernate.eclipse.launch.CodeGenXMLFactory 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)

Aggregations

CodeGenXMLFactory (org.hibernate.eclipse.launch.CodeGenXMLFactory)13 TestLaunchConfig (org.jboss.tools.hibernate.orm.test.utils.TestLaunchConfig)12 Test (org.junit.Test)12 ByteArrayInputStream (java.io.ByteArrayInputStream)1 IWorkspace (org.eclipse.core.resources.IWorkspace)1 ILaunchConfiguration (org.eclipse.debug.core.ILaunchConfiguration)1