db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r919745 - in /db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/gf: control/DeeplyNestedMergepointsTest.java control/PropertyToJavaGenerationTest.java example/gettingstarted/GettingStartedTest.java
Date Sat, 06 Mar 2010 11:34:26 GMT
Author: tfischer
Date: Sat Mar  6 11:34:26 2010
New Revision: 919745

URL: http://svn.apache.org/viewvc?rev=919745&view=rev
Log:
change output folder for test cases so output is produced in /target

Modified:
    db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/gf/control/DeeplyNestedMergepointsTest.java
    db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/gf/control/PropertyToJavaGenerationTest.java
    db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/gf/example/gettingstarted/GettingStartedTest.java

Modified: db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/gf/control/DeeplyNestedMergepointsTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/gf/control/DeeplyNestedMergepointsTest.java?rev=919745&r1=919744&r2=919745&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/gf/control/DeeplyNestedMergepointsTest.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/gf/control/DeeplyNestedMergepointsTest.java
Sat Mar  6 11:34:26 2010
@@ -30,6 +30,7 @@
 import org.apache.commons.io.FileUtils;
 import org.apache.torque.gf.BaseTest;
 import org.apache.torque.gf.configuration.UnitDescriptor;
+import org.apache.torque.gf.configuration.paths.CustomProjectPaths;
 import org.apache.torque.gf.configuration.paths.DefaultTorqueGfPaths;
 import org.apache.torque.gf.configuration.paths.Maven2DirectoryProjectPaths;
 import org.junit.Test;
@@ -43,18 +44,22 @@
     @Test
     public void testDeeplyNestedMergepointsGeneration() throws Exception
     {
-        File targetDir = new File("src/test/deeplyNestedMergepoints/target");
+        File targetDir = new File("target/test/deeplyNestedMergepoints");
         FileUtils.deleteDirectory(targetDir);
         Controller controller = new Controller();
         List<UnitDescriptor> unitDescriptors = new ArrayList<UnitDescriptor>();
+        CustomProjectPaths projectPaths = new CustomProjectPaths(
+                new Maven2DirectoryProjectPaths(
+                        new File("src/test/deeplyNestedMergepoints")));
+        projectPaths.setNewFileTargetDir(targetDir);
         unitDescriptors.add(new UnitDescriptor(
                 UnitDescriptor.Packaging.DIRECTORY,
-                new Maven2DirectoryProjectPaths(new File("src/test/deeplyNestedMergepoints")),
+                projectPaths,
                 new DefaultTorqueGfPaths()));
         controller.run(unitDescriptors);
 
         assertTrue(targetDir.exists());
-        File targetFile= new File(targetDir, "generated-sources/output.txt");
+        File targetFile = new File(targetDir, "output.txt");
         assertTrue(targetFile.exists());
 
         FileReader fileReader = new FileReader(targetFile);

Modified: db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/gf/control/PropertyToJavaGenerationTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/gf/control/PropertyToJavaGenerationTest.java?rev=919745&r1=919744&r2=919745&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/gf/control/PropertyToJavaGenerationTest.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/gf/control/PropertyToJavaGenerationTest.java
Sat Mar  6 11:34:26 2010
@@ -28,6 +28,7 @@
 import org.apache.commons.io.FileUtils;
 import org.apache.torque.gf.BaseTest;
 import org.apache.torque.gf.configuration.UnitDescriptor;
+import org.apache.torque.gf.configuration.paths.CustomProjectPaths;
 import org.apache.torque.gf.configuration.paths.DefaultTorqueGfPaths;
 import org.apache.torque.gf.configuration.paths.Maven2DirectoryProjectPaths;
 import org.junit.Test;
@@ -37,17 +38,20 @@
     @Test
     public void testPropertyToJavaGeneration() throws Exception
     {
-        File target = new File("src/test/propertyToJava/target");
-        FileUtils.deleteDirectory(target);
+        File targetDir = new File("target/test/propertyToJava");
+        FileUtils.deleteDirectory(targetDir);
         Controller controller = new Controller();
         List<UnitDescriptor> unitDescriptors = new ArrayList<UnitDescriptor>();
+        CustomProjectPaths projectPaths = new CustomProjectPaths(
+                new Maven2DirectoryProjectPaths(
+                        new File("src/test/propertyToJava")));
+        projectPaths.setNewFileTargetDir(targetDir);
         unitDescriptors.add(new UnitDescriptor(
                 UnitDescriptor.Packaging.DIRECTORY,
-                new Maven2DirectoryProjectPaths(new File("src/test/propertyToJava")),
+                projectPaths,
                 new DefaultTorqueGfPaths()));
         controller.run(unitDescriptors);
         // TODO: check outcome against reference file
-        assertTrue(target.exists());
-        // TODO: check generated-sources dir
+        assertTrue(targetDir.exists());
     }
 }

Modified: db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/gf/example/gettingstarted/GettingStartedTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/gf/example/gettingstarted/GettingStartedTest.java?rev=919745&r1=919744&r2=919745&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/gf/example/gettingstarted/GettingStartedTest.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/gf/example/gettingstarted/GettingStartedTest.java
Sat Mar  6 11:34:26 2010
@@ -28,6 +28,7 @@
 import org.apache.commons.io.FileUtils;
 import org.apache.torque.gf.BaseTest;
 import org.apache.torque.gf.configuration.UnitDescriptor;
+import org.apache.torque.gf.configuration.paths.CustomProjectPaths;
 import org.apache.torque.gf.configuration.paths.DefaultTorqueGfPaths;
 import org.apache.torque.gf.configuration.paths.Maven2DirectoryProjectPaths;
 import org.apache.torque.gf.control.Controller;
@@ -38,20 +39,23 @@
     @Test
     public void testGettingStarted() throws Exception
     {
-        File target = new File("src/test/site/gettingStarted/target");
-        FileUtils.deleteDirectory(target);
+        File targetDir = new File("target/test/site/gettingStarted");
+        FileUtils.deleteDirectory(targetDir);
         Controller controller = new Controller();
         List<UnitDescriptor> unitDescriptors = new ArrayList<UnitDescriptor>();
+        CustomProjectPaths projectPaths = new CustomProjectPaths(
+                new Maven2DirectoryProjectPaths(
+                        new File("src/test/site/gettingStarted")));
+        projectPaths.setNewFileTargetDir(targetDir);
         unitDescriptors.add(new UnitDescriptor(
                 UnitDescriptor.Packaging.DIRECTORY,
-                new Maven2DirectoryProjectPaths(
-                        new File("src/test/site/gettingStarted")),
+                projectPaths,
                 new DefaultTorqueGfPaths()));
         controller.run(unitDescriptors);
-        assertTrue(target.exists());
+        assertTrue(targetDir.exists());
         File generatedJavaFile = new File(
-                target,
-                "generated-sources/org/apache/torque/gf/example/gettingstarted/PropertyKeys.java");
+                targetDir,
+                "org/apache/torque/gf/example/gettingstarted/PropertyKeys.java");
         assertTrue(generatedJavaFile.exists());
         File expectedJavaFile = new File(
                 "src/test/resources/org/apache/torque/gf/example/gettingstarted/PropertyKeys.java");



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message