[jbosstools-commits] JBoss Tools SVN: r24107 - in trunk/hibernatetools/tests/org.hibernate.eclipse.console.test: src/org/hibernate/eclipse/console/test and 1 other directory.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Thu Aug 12 11:46:46 EDT 2010


Author: vyemialyanchyk
Date: 2010-08-12 11:46:46 -0400 (Thu, 12 Aug 2010)
New Revision: 24107

Modified:
   trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml
   trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test2.xml
   trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test1.xml
   trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_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-6809 - fixed

Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml	2010-08-12 15:24:02 UTC (rev 24106)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml	2010-08-12 15:46:46 UTC (rev 24107)
@@ -12,7 +12,7 @@
   <target name="hibernateAntCodeGeneration" depends="generateHibernatePropeties">
     <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
     <hibernatetool destdir="${build.dir}">
-      <configuration configurationFile="project\src\hibernate.cfg.xml" propertyFile="${hibernatePropFile}"/>
+      <configuration configurationFile="project/src/hibernate.cfg.xml" propertyFile="${hibernatePropFile}"/>
       <classpath>
         <path location="${build.dir}"/>
       </classpath>

Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test2.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test2.xml	2010-08-12 15:24:02 UTC (rev 24106)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test2.xml	2010-08-12 15:46:46 UTC (rev 24107)
@@ -12,7 +12,7 @@
   <target name="hibernateAntCodeGeneration" depends="generateHibernatePropeties">
     <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
     <hibernatetool destdir="${build.dir}">
-      <configuration configurationFile="project\src\hibernate.cfg.xml" propertyFile="${hibernatePropFile}"/>
+      <configuration configurationFile="project/src/hibernate.cfg.xml" propertyFile="${hibernatePropFile}"/>
       <classpath>
         <path location="${build.dir}"/>
       </classpath>

Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test1.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test1.xml	2010-08-12 15:24:02 UTC (rev 24106)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test1.xml	2010-08-12 15:46:46 UTC (rev 24107)
@@ -4,7 +4,7 @@
   <target name="hibernateAntCodeGeneration">
     <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
     <hibernatetool destdir="${build.dir}">
-      <configuration configurationFile="project\src\hibernate.cfg.xml" propertyFile="hibernate.properties"/>
+      <configuration configurationFile="project/src/hibernate.cfg.xml" propertyFile="hibernate.properties"/>
       <classpath>
         <path location="${build.dir}"/>
       </classpath>

Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test2.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test2.xml	2010-08-12 15:24:02 UTC (rev 24106)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test2.xml	2010-08-12 15:46:46 UTC (rev 24107)
@@ -4,7 +4,7 @@
   <target name="hibernateAntCodeGeneration">
     <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
     <hibernatetool destdir="${build.dir}">
-      <configuration configurationFile="project\src\hibernate.cfg.xml" propertyFile="hibernate.properties"/>
+      <configuration configurationFile="project/src/hibernate.cfg.xml" propertyFile="hibernate.properties"/>
       <classpath>
         <path location="${build.dir}"/>
       </classpath>

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-12 15:24:02 UTC (rev 24106)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test1.xml	2010-08-12 15:46:46 UTC (rev 24107)
@@ -4,7 +4,7 @@
   <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" propertyFile="project\src\hibernate.properties" detectManyToMany="true" detectOneToOne="true" detectOptimisticLock="true" revEngFile="reslocation/test"/>
+      <jdbcconfiguration configurationFile="project/src/hibernate.cfg.xml" propertyFile="project/src/hibernate.properties" detectManyToMany="true" detectOneToOne="true" detectOptimisticLock="true" revEngFile="reslocation/test"/>
       <classpath>
         <path location="${build.dir}"/>
       </classpath>

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-12 15:24:02 UTC (rev 24106)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test2.xml	2010-08-12 15:46:46 UTC (rev 24107)
@@ -4,7 +4,7 @@
   <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" propertyFile="project\src\hibernate.properties" detectManyToMany="true" detectOneToOne="true" detectOptimisticLock="true" revEngFile="reslocation/test"/>
+      <jdbcconfiguration configurationFile="project/src/hibernate.cfg.xml" propertyFile="project/src/hibernate.properties" detectManyToMany="true" detectOneToOne="true" detectOptimisticLock="true" revEngFile="reslocation/test"/>
       <classpath>
         <path location="${build.dir}"/>
       </classpath>

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-12 15:24:02 UTC (rev 24106)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test1.xml	2010-08-12 15:46:46 UTC (rev 24107)
@@ -1,10 +1,12 @@
 <project name="CodeGen" default="hibernateAntCodeGeneration">
-  <property name="build.dir" location="reslocation/test"/>
+  <property name="current.dir" location="project/src"/>
+  <property name="workspace.dir" location="project/src"/>
+  <property name="build.dir" location="12345678901234567890"/>
   <path id="toolslib"/>
   <target name="hibernateAntCodeGeneration">
     <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
     <hibernatetool destdir="${build.dir}">
-      <configuration configurationFile="project\src\hibernate.cfg.xml" propertyFile="project\src\hibernate.properties"/>
+      <configuration configurationFile="${current.dir}/hibernate.cfg.xml" propertyFile="${current.dir}/hibernate.properties"/>
       <classpath>
         <path location="${build.dir}"/>
       </classpath>

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-12 15:24:02 UTC (rev 24106)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test2.xml	2010-08-12 15:46:46 UTC (rev 24107)
@@ -1,10 +1,12 @@
 <project name="CodeGen" default="hibernateAntCodeGeneration">
-  <property name="build.dir" location="reslocation/test"/>
+  <property name="current.dir" location="project/src"/>
+  <property name="workspace.dir" location="project/src"/>
+  <property name="build.dir" location="12345678901234567890"/>
   <path id="toolslib"/>
   <target name="hibernateAntCodeGeneration">
     <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
     <hibernatetool destdir="${build.dir}">
-      <configuration configurationFile="project\src\hibernate.cfg.xml" propertyFile="project\src\hibernate.properties"/>
+      <configuration configurationFile="${current.dir}/hibernate.cfg.xml" propertyFile="${current.dir}/hibernate.properties"/>
       <classpath>
         <path location="${build.dir}"/>
       </classpath>

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-12 15:24:02 UTC (rev 24106)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java	2010-08-12 15:46:46 UTC (rev 24107)
@@ -51,13 +51,13 @@
 	public static final String LN_1 = "\n"; //$NON-NLS-1$
 	public static final String LN_2 = "\r\n"; //$NON-NLS-1$
 
-	public static final String SAMPLE_PATH = "res/sample/".replaceAll("//", File.separator); //$NON-NLS-1$ //$NON-NLS-2$
-	public static final String PROJECT_LIB_PATH = "res/project/lib/".replaceAll("//", File.separator); //$NON-NLS-1$ //$NON-NLS-2$
+	public static final String SAMPLE_PATH = "res/sample/".replace('/', IPath.SEPARATOR); //$NON-NLS-1$
+	public static final String PROJECT_LIB_PATH = "res/project/lib/".replace('/', IPath.SEPARATOR); //$NON-NLS-1$
 
 	public static final String HBMTEMPLATE0 = "hbm2java"; //$NON-NLS-1$
 	public static final String HBMTEMPLATE0_PROPERTIES = HibernateLaunchConstants.ATTR_EXPORTERS
 			+ '.' + HBMTEMPLATE0 + ".properties"; //$NON-NLS-1$
-	public static final String OUTDIR_PATH = "outputdir/test"; //$NON-NLS-1$
+	public static final String OUTDIR_PATH = "outputdir/test".replace('/', IPath.SEPARATOR); //$NON-NLS-1$
 
 	public class TestConsoleConfigPref extends TestConsoleConfigurationPreferences {
 		public File getConfigXMLFile() {
@@ -131,6 +131,7 @@
 
 	public enum ETestCase {
 		simple,
+		relative,
 		jpa,
 		properties,
 		nullable,
@@ -149,6 +150,8 @@
 			ConsoleConfigurationPreferences pref = null;
 			if (testCase == ETestCase.simple) {
 				pref = new TestConsoleConfigPref();
+			} else if (testCase == ETestCase.relative) {
+				pref = new TestConsoleConfigPref();
 			} else if (testCase == ETestCase.jpa) {
 				pref = new TestConsoleConfigPref2();
 			} else if (testCase == ETestCase.properties) {
@@ -162,7 +165,10 @@
 		}
 
 		public String getResLocation(String path) {
-			return "reslocation/test"; //$NON-NLS-1$
+			if (testCase == ETestCase.relative) {
+				return super.getResLocation(path);
+			}
+			return new Path("reslocation/test").toString(); //$NON-NLS-1$
 		}
 
 		public IConnectionProfile getConnectionProfile(String connProfileName) {
@@ -189,17 +195,7 @@
 			return driverClass;
 		}
 	}
-	
-	public class CodeGenXMLFactory4Test2 extends CodeGenXMLFactory4Test {
-		public CodeGenXMLFactory4Test2(ILaunchConfiguration lc, ETestCase testCase) {
-			super(lc, testCase);
-		}
 
-		public ConsoleConfigurationPreferences getConsoleConfigPreferences(String consoleConfigName) {
-			return new TestConsoleConfigPref2();
-		}
-	}
-
 	public void testCodeGenXMLFactoryRevengAll() {
 		CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(true, true, ETestCase.simple);
 		String codeGen = codeGenFactory.createCodeGenXML();
@@ -219,7 +215,12 @@
 	}
 
 	public void testCodeGenXMLFactoryAll() {
-		CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, true, ETestCase.simple);
+		CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, true, ETestCase.relative);
+		//
+		String strPlace = "project/src".replace('/', IPath.SEPARATOR); //$NON-NLS-1$
+		codeGenFactory.setPlace2Generate(strPlace);
+		codeGenFactory.setWorkspacePath(strPlace);
+		//
 		String codeGen = codeGenFactory.createCodeGenXML();
 		String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
 		String sample = getSample("AntCodeGen_test1.xml"); //$NON-NLS-1$
@@ -228,7 +229,12 @@
 	}
 
 	public void testCodeGenXMLFactoryOne() {
-		CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, false, ETestCase.simple);
+		CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, false, ETestCase.relative);
+		//
+		String strPlace = "project/src".replace('/', IPath.SEPARATOR); //$NON-NLS-1$
+		codeGenFactory.setPlace2Generate(strPlace);
+		codeGenFactory.setWorkspacePath(strPlace);
+		//
 		String codeGen = codeGenFactory.createCodeGenXML();
 		String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
 		String sample = getSample("AntCodeGen_test2.xml"); //$NON-NLS-1$
@@ -327,10 +333,11 @@
 		try {
 			URI uri = new File("").toURL().toURI(); //$NON-NLS-1$
 			repl = (new File(uri)).getPath();
+			repl = (new Path(repl)).toString();
 		} catch (MalformedURLException e) {
 		} catch (URISyntaxException e) {
 		}
-		return codeGen.replace(repl + File.separator, ""); //$NON-NLS-1$
+		return codeGen.replace(repl + IPath.SEPARATOR, ""); //$NON-NLS-1$
 	}
 
 	public CodeGenXMLFactory codeGenXMLFactory(boolean reveng, boolean exportersAll, ETestCase testCase) {



More information about the jbosstools-commits mailing list