Author: vyemialyanchyk
Date: 2010-08-05 08:11:15 -0400 (Thu, 05 Aug 2010)
New Revision: 23935
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test1.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test2.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test1.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test2.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test1.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test2.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java
Log:
https://jira.jboss.org/browse/JBIDE-6723 - fixed - ant exporters attributes description in
xml
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test1.xml
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test1.xml 2010-08-05
11:33:21 UTC (rev 23934)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test1.xml 2010-08-05
12:11:15 UTC (rev 23935)
@@ -1,5 +1,5 @@
<project name="CodeGen" default="hibernateAntCodeGeneration">
- <property name="build.dir" location="ResLocation/test"/>
+ <property name="build.dir" location="reslocation/test"/>
<path id="toolslib">
<path location="ejb3-persistence.jar"/>
<path location="hibernate3.jar"/>
@@ -17,16 +17,29 @@
<classpath>
<path location="${build.dir}"/>
</classpath>
- <hbm2doc/>
- <hbm2cfgxml/>
- <hbm2hbmxml/>
+ <hbm2doc>
+ <property key="ejb3" value="true"/>
+ <property key="jdk5" value="true"/>
+ </hbm2doc>
+ <hbm2cfgxml ejb3="true">
+ <property key="jdk5" value="true"/>
+ </hbm2cfgxml>
+ <hbm2hbmxml>
+ <property key="ejb3" value="true"/>
+ <property key="jdk5" value="true"/>
+ </hbm2hbmxml>
<hbmtemplate>
+ <property key="ejb3" value="true"/>
<property key="jdk5" value="true"/>
+ </hbmtemplate>
+ <hbm2java destdir="outputdir/test" ejb3="true"
jdk5="true">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
+ <hbm2ddl>
<property key="ejb3" value="true"/>
- </hbmtemplate>
- <hbm2java jdk5="true" ejb3="true"/>
- <hbm2ddl/>
- <hbm2dao jdk5="true" ejb3="true"/>
+ <property key="jdk5" value="true"/>
+ </hbm2ddl>
+ <hbm2dao ejb3="true" jdk5="true"/>
</hibernatetool>
</target>
</project>
\ No newline at end of file
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test2.xml
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test2.xml 2010-08-05
11:33:21 UTC (rev 23934)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenJpa_test2.xml 2010-08-05
12:11:15 UTC (rev 23935)
@@ -1,5 +1,5 @@
<project name="CodeGen" default="hibernateAntCodeGeneration">
- <property name="build.dir" location="ResLocation/test"/>
+ <property name="build.dir" location="reslocation/test"/>
<path id="toolslib">
<path location="ejb3-persistence.jar"/>
<path location="hibernate3.jar"/>
@@ -17,7 +17,9 @@
<classpath>
<path location="${build.dir}"/>
</classpath>
- <hbm2java jdk5="true" ejb3="true"/>
+ <hbm2java destdir="outputdir/test" ejb3="true"
jdk5="true">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
</hibernatetool>
</target>
</project>
\ No newline at end of file
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test1.xml
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test1.xml 2010-08-05
11:33:21 UTC (rev 23934)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test1.xml 2010-08-05
12:11:15 UTC (rev 23935)
@@ -1,19 +1,35 @@
<project name="CodeGen" default="hibernateAntCodeGeneration">
- <property name="build.dir" location="ResLocation/test"/>
+ <property name="build.dir" location="reslocation/test"/>
<path id="toolslib"/>
<target name="hibernateAntCodeGeneration">
<taskdef name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="toolslib"/>
<hibernatetool destdir="${build.dir}">
- <jdbcconfiguration configurationFile="project\src\hibernate.cfg.xml"
detectManyToMany="true" detectOneToOne="true"
detectOptimisticLock="true" revEngFile="ResLocation/test"/>
+ <jdbcconfiguration configurationFile="project\src\hibernate.cfg.xml"
detectManyToMany="true" detectOneToOne="true"
detectOptimisticLock="true" revEngFile="reslocation/test"/>
<classpath>
<path location="${build.dir}"/>
</classpath>
- <hbm2doc/>
- <hbm2cfgxml/>
- <hbm2hbmxml/>
- <hbmtemplate/>
- <hbm2java/>
- <hbm2ddl/>
+ <hbm2doc>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2doc>
+ <hbm2cfgxml>
+ <property key="jdk5" value="false"/>
+ </hbm2cfgxml>
+ <hbm2hbmxml>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2hbmxml>
+ <hbmtemplate>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbmtemplate>
+ <hbm2java destdir="outputdir/test">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
+ <hbm2ddl>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2ddl>
<hbm2dao/>
</hibernatetool>
</target>
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test2.xml
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test2.xml 2010-08-05
11:33:21 UTC (rev 23934)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test2.xml 2010-08-05
12:11:15 UTC (rev 23935)
@@ -1,14 +1,16 @@
<project name="CodeGen" default="hibernateAntCodeGeneration">
- <property name="build.dir" location="ResLocation/test"/>
+ <property name="build.dir" location="reslocation/test"/>
<path id="toolslib"/>
<target name="hibernateAntCodeGeneration">
<taskdef name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="toolslib"/>
<hibernatetool destdir="${build.dir}">
- <jdbcconfiguration configurationFile="project\src\hibernate.cfg.xml"
detectManyToMany="true" detectOneToOne="true"
detectOptimisticLock="true" revEngFile="ResLocation/test"/>
+ <jdbcconfiguration configurationFile="project\src\hibernate.cfg.xml"
detectManyToMany="true" detectOneToOne="true"
detectOptimisticLock="true" revEngFile="reslocation/test"/>
<classpath>
<path location="${build.dir}"/>
</classpath>
- <hbm2java/>
+ <hbm2java destdir="outputdir/test">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
</hibernatetool>
</target>
</project>
\ No newline at end of file
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test1.xml
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test1.xml 2010-08-05
11:33:21 UTC (rev 23934)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test1.xml 2010-08-05
12:11:15 UTC (rev 23935)
@@ -1,5 +1,5 @@
<project name="CodeGen" default="hibernateAntCodeGeneration">
- <property name="build.dir" location="ResLocation/test"/>
+ <property name="build.dir" location="reslocation/test"/>
<path id="toolslib"/>
<target name="hibernateAntCodeGeneration">
<taskdef name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="toolslib"/>
@@ -8,12 +8,28 @@
<classpath>
<path location="${build.dir}"/>
</classpath>
- <hbm2doc/>
- <hbm2cfgxml/>
- <hbm2hbmxml/>
- <hbmtemplate/>
- <hbm2java/>
- <hbm2ddl/>
+ <hbm2doc>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2doc>
+ <hbm2cfgxml>
+ <property key="jdk5" value="false"/>
+ </hbm2cfgxml>
+ <hbm2hbmxml>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2hbmxml>
+ <hbmtemplate>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbmtemplate>
+ <hbm2java destdir="outputdir/test">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
+ <hbm2ddl>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2ddl>
<hbm2dao/>
</hibernatetool>
</target>
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test2.xml
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test2.xml 2010-08-05
11:33:21 UTC (rev 23934)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test2.xml 2010-08-05
12:11:15 UTC (rev 23935)
@@ -1,5 +1,5 @@
<project name="CodeGen" default="hibernateAntCodeGeneration">
- <property name="build.dir" location="ResLocation/test"/>
+ <property name="build.dir" location="reslocation/test"/>
<path id="toolslib"/>
<target name="hibernateAntCodeGeneration">
<taskdef name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="toolslib"/>
@@ -8,7 +8,9 @@
<classpath>
<path location="${build.dir}"/>
</classpath>
- <hbm2java/>
+ <hbm2java destdir="outputdir/test">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
</hibernatetool>
</target>
</project>
\ No newline at end of file
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java 2010-08-05
11:33:21 UTC (rev 23934)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java 2010-08-05
12:11:15 UTC (rev 23935)
@@ -30,9 +30,11 @@
import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
import org.hibernate.eclipse.console.ExtensionManager;
import org.hibernate.eclipse.console.model.impl.ExporterDefinition;
+import org.hibernate.eclipse.console.model.impl.ExporterFactoryStrings;
import org.hibernate.eclipse.console.test.launchcfg.TestConsoleConfigurationPreferences;
import org.hibernate.eclipse.console.test.launchcfg.TestLaunchConfig;
import org.hibernate.eclipse.launch.CodeGenXMLFactory;
+import org.hibernate.eclipse.launch.CodeGenerationStrings;
import org.hibernate.eclipse.launch.ExporterAttributes;
import org.hibernate.eclipse.launch.HibernateLaunchConstants;
@@ -126,11 +128,11 @@
}
public String getConnectionProfileDriverURL(String connectionProfile) {
- return "TestDriverPath.jar"; //$NON-NLS-1$
+ return "test-driver-path.jar"; //$NON-NLS-1$
}
public String getResLocation(String path) {
- return "ResLocation/test"; //$NON-NLS-1$
+ return "reslocation/test"; //$NON-NLS-1$
}
}
@@ -185,14 +187,14 @@
public String codeGenXMLFactory(boolean reveng, boolean exportersAll, boolean jpa) {
Map<String, ExporterDefinition> exDefinitions =
ExtensionManager.findExporterDefinitionsAsMap();
- Map<String, Object> testLCAttr = new HashMap<String, Object>();
+ Map<String, Object> testLaunchConfigAttr = new HashMap<String, Object>();
String tmp = "12345678901234567890"; //$NON-NLS-1$
- testLCAttr.put(HibernateLaunchConstants.ATTR_TEMPLATE_DIR, tmp);
- testLCAttr.put(HibernateLaunchConstants.ATTR_OUTPUT_DIR, tmp);
- testLCAttr.put(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER_SETTINGS, tmp);
+ testLaunchConfigAttr.put(HibernateLaunchConstants.ATTR_TEMPLATE_DIR, tmp);
+ testLaunchConfigAttr.put(HibernateLaunchConstants.ATTR_OUTPUT_DIR, tmp);
+ testLaunchConfigAttr.put(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER_SETTINGS,
tmp);
if (jpa) {
- testLCAttr.put(HibernateLaunchConstants.ATTR_ENABLE_EJB3_ANNOTATIONS, true);
- testLCAttr.put(HibernateLaunchConstants.ATTR_ENABLE_JDK5, true);
+ testLaunchConfigAttr.put(HibernateLaunchConstants.ATTR_ENABLE_EJB3_ANNOTATIONS,
true);
+ testLaunchConfigAttr.put(HibernateLaunchConstants.ATTR_ENABLE_JDK5, true);
}
List<String> exportersList = new ArrayList<String>();
if (exportersAll) {
@@ -203,20 +205,27 @@
for (Map.Entry<String, ExporterDefinition> exDef : exDefinitions.entrySet()) {
String tmp0 = exDef.getValue().getExporterTag();
String tmp1 = ExporterAttributes.getLaunchAttributePrefix(tmp0);
- testLCAttr.put(tmp1 + ".extension_id", //$NON-NLS-1$
+ testLaunchConfigAttr.put(tmp1 + ".extension_id", //$NON-NLS-1$
HibernateLaunchConstants.ATTR_PREFIX + tmp0);
- testLCAttr.put(tmp1, Boolean.TRUE);
+ testLaunchConfigAttr.put(tmp1, Boolean.TRUE);
if (exportersAll) {
exportersList.add(tmp0);
}
}
- testLCAttr.put(HibernateLaunchConstants.ATTR_EXPORTERS, exportersList);
+ testLaunchConfigAttr.put(HibernateLaunchConstants.ATTR_EXPORTERS, exportersList);
Map<String, String> expProps2 = new HashMap<String, String>();
- expProps2.put(HibernateLaunchConstants.ATTR_OUTPUT_DIR, OUTDIR_PATH);
- testLCAttr.put(HBMTEMPLATE0_PROPERTIES, expProps2);
- testLCAttr.put(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER, reveng);
- TestLaunchConfig testLC = new TestLaunchConfig(testLCAttr);
- CodeGenXMLFactory codeGenFactory = new CodeGenXMLFactory4Test(testLC, jpa);
+ // test properties overlap case:
+ // ExporterFactoryStrings.OUTPUTDIR & CodeGenerationStrings.DESTDIR - is a same
property
+ // ExporterFactoryStrings.OUTPUTDIR - is a GUI name for the property
+ // CodeGenerationStrings.DESTDIR - is Ant script name for the property
+ // GUI name is more preferable, i.e. "_test_suffix" should not be in
generated file
+ expProps2.put(ExporterFactoryStrings.OUTPUTDIR, OUTDIR_PATH);
+ expProps2.put(CodeGenerationStrings.DESTDIR, OUTDIR_PATH + "_test_suffix");
//$NON-NLS-1$
+ expProps2.put("keyXXX", "valueYYY"); //$NON-NLS-1$ //$NON-NLS-2$
+ testLaunchConfigAttr.put(HBMTEMPLATE0_PROPERTIES, expProps2);
+ testLaunchConfigAttr.put(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER, reveng);
+ TestLaunchConfig testLaunchConfig = new TestLaunchConfig(testLaunchConfigAttr);
+ CodeGenXMLFactory codeGenFactory = new CodeGenXMLFactory4Test(testLaunchConfig, jpa);
return codeGenFactory.createCodeGenXML();
}