db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1506310 - in /db/torque/torque4/trunk/torque-generator/src: main/java/org/apache/torque/generator/configuration/ main/java/org/apache/torque/generator/configuration/outlet/ test/java/org/apache/torque/generator/configuration/ test/property...
Date Tue, 23 Jul 2013 21:51:49 GMT
Author: tfischer
Date: Tue Jul 23 21:51:49 2013
New Revision: 1506310

URL: http://svn.apache.org/r1506310
Log:
TORQUE-296 fix auto-defining outlets

Added:
    db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/src/main/torque-gen/outlets/velocityPropertiesCopy.xml
      - copied, changed from r1504272, db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/src/main/torque-gen/outlets/velocityPropertiesCopy.xml
    db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/src/main/torque-gen/outlets/velocityPropertiesOutlet.xml
      - copied unchanged from r1470232, db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/src/main/torque-gen/outlets/velocityPropertiesOutlet.xml
    db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/src/main/torque-gen/templates/propertyCopy/
    db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/src/main/torque-gen/templates/propertyCopy/propertiesCopy.vm
      - copied unchanged from r1470232, db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/src/main/torque-gen/templates/propertiesCopy.vm
    db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/src/main/torque-gen/templates/propertyCopy/propertyCopy.vm
      - copied unchanged from r1470232, db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/src/main/torque-gen/templates/propertyCopy.vm
Removed:
    db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/src/main/torque-gen/templates/propertiesCopy.vm
    db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/src/main/torque-gen/templates/propertyCopy.vm
Modified:
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/PackageResources.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/OutletConfigurationXmlParser.java
    db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/configuration/PackageResourcesTest.java
    db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/expectedPropertiesDebugOutput.properties
    db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/src/main/torque-gen/conf/control.xml

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/PackageResources.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/PackageResources.java?rev=1506310&r1=1506309&r2=1506310&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/PackageResources.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/PackageResources.java
Tue Jul 23 21:51:49 2013
@@ -246,7 +246,7 @@ public class PackageResources
         }
         for (String filename : filenames)
         {
-            File file = new File(filename);
+            File file = new File(directoryToScan, filename);
             if (file.isDirectory())
             {
                 if (recurse)
@@ -254,7 +254,7 @@ public class PackageResources
                     result.addAll(getFilesInDirectoryWithSuffix(
                             file,
                             suffix,
-                            prefixToResult + "/" + filename,
+                            prefixToResult + filename + "/" ,
                             recurse));
                 }
                 continue;
@@ -313,21 +313,17 @@ public class PackageResources
                 continue;
             }
             String rawName = jarEntry.getName();
-            if (!rawName.startsWith(directory))
+            if (!rawName.startsWith(directory + '/'))
             {
                 continue;
             }
-            if (suffix != null && !rawName.endsWith(suffix))
+            String name = rawName.substring(directory.length() + 1);
+            if (suffix != null && !name.endsWith(suffix))
             {
                 continue;
             }
-            String name = rawName.substring(rawName.lastIndexOf('/') + 1);
 
-            int expectedRawNameLength
-                    = directory.length()
-                        + name.length()
-                        + 1;
-            if (rawName.length() != expectedRawNameLength
+            if (name.indexOf("/") != -1
                     && !searchSubdirectories)
             {
                 continue;

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/OutletConfigurationXmlParser.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/OutletConfigurationXmlParser.java?rev=1506310&r1=1506309&r2=1506310&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/OutletConfigurationXmlParser.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/OutletConfigurationXmlParser.java
Tue Jul 23 21:51:49 2013
@@ -282,6 +282,7 @@ public class OutletConfigurationXmlParse
                         if (!outletNames.contains(outletName))
                         {
                             outlets.add(outlet);
+                            outletNames.add(outletName);
                             continue;
                         }
                     }

Modified: db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/configuration/PackageResourcesTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/configuration/PackageResourcesTest.java?rev=1506310&r1=1506309&r2=1506310&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/configuration/PackageResourcesTest.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/configuration/PackageResourcesTest.java
Tue Jul 23 21:51:49 2013
@@ -192,10 +192,10 @@ public class PackageResourcesTest
                 ".vm",
                 false));
         HashSet<String> expected = new HashSet<String>();
-        expected.add("propertiesCopy.vm");
+        expected.add("propertyCopy/propertiesCopy.vm");
         expected.add("propertiesExtendedToJava.vm");
         expected.add("propertiesToJava.vm");
-        expected.add("propertyCopy.vm");
+        expected.add("propertyCopy/propertyCopy.vm");
         expected.add("variableAssignment.vm");
         expected.add("variableDefinition.vm");
         assertEquals(expected, actual);

Modified: db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/expectedPropertiesDebugOutput.properties
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/expectedPropertiesDebugOutput.properties?rev=1506310&r1=1506309&r2=1506310&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/expectedPropertiesDebugOutput.properties
(original)
+++ db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/expectedPropertiesDebugOutput.properties
Tue Jul 23 21:51:49 2013
@@ -1,4 +1,4 @@
-# start output of outlet org.apache.torque.generator.velocity.propertiesCopy, current model
element is (name=properties,attributes=(),children=((name=entry,attributes=(key=propertyName1,null=propertyValue1),children=()),(name=entry,attributes=(key=propertyName2,null=propertyValue2),children=())))
+# start output of outlet propertyCopy.propertiesCopy, current model element is (name=properties,attributes=(),children=((name=entry,attributes=(key=propertyName1,null=propertyValue1),children=()),(name=entry,attributes=(key=propertyName2,null=propertyValue2),children=())))
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -16,10 +16,10 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-# start output of outlet propertyCopy, current model element is (name=entry,attributes=(key=propertyName1,null=propertyValue1),children=())
+# start output of outlet propertyCopy.propertyCopy, current model element is (name=entry,attributes=(key=propertyName1,null=propertyValue1),children=())
 propertyName1 = propertyValue1
-# end output of outlet propertyCopy, current model is (name=entry,attributes=(key=propertyName1,null=propertyValue1),children=())
-# start output of outlet propertyCopy, current model element is (name=entry,attributes=(key=propertyName2,null=propertyValue2),children=())
+# end output of outlet propertyCopy.propertyCopy, current model is (name=entry,attributes=(key=propertyName1,null=propertyValue1),children=())
+# start output of outlet propertyCopy.propertyCopy, current model element is (name=entry,attributes=(key=propertyName2,null=propertyValue2),children=())
 propertyName2 = propertyValue2
-# end output of outlet propertyCopy, current model is (name=entry,attributes=(key=propertyName2,null=propertyValue2),children=())
-# end output of outlet org.apache.torque.generator.velocity.propertiesCopy, current model
is (name=properties,attributes=(),children=((name=entry,attributes=(key=propertyName1,null=propertyValue1),children=()),(name=entry,attributes=(key=propertyName2,null=propertyValue2),children=())))
+# end output of outlet propertyCopy.propertyCopy, current model is (name=entry,attributes=(key=propertyName2,null=propertyValue2),children=())
+# end output of outlet propertyCopy.propertiesCopy, current model is (name=properties,attributes=(),children=((name=entry,attributes=(key=propertyName1,null=propertyValue1),children=()),(name=entry,attributes=(key=propertyName2,null=propertyValue2),children=())))

Modified: db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/src/main/torque-gen/conf/control.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/src/main/torque-gen/conf/control.xml?rev=1506310&r1=1506309&r2=1506310&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/src/main/torque-gen/conf/control.xml
(original)
+++ db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/src/main/torque-gen/conf/control.xml
Tue Jul 23 21:51:49 2013
@@ -58,7 +58,7 @@
     <source xsi:type="fileSource" elements="/">
       <include>propertiesData.properties</include>
     </source>
-    <outlet name="org.apache.torque.generator.velocity.propertiesCopy"/>
+    <outlet name="propertyCopy.propertiesCopy"/>
   </output>
   <output name="torqueImage" file="logo.png">
     <source xsi:type="fileSource" elements="/">

Copied: db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/src/main/torque-gen/outlets/velocityPropertiesCopy.xml
(from r1504272, db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/src/main/torque-gen/outlets/velocityPropertiesCopy.xml)
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/src/main/torque-gen/outlets/velocityPropertiesCopy.xml?p2=db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/src/main/torque-gen/outlets/velocityPropertiesCopy.xml&p1=db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/src/main/torque-gen/outlets/velocityPropertiesCopy.xml&r1=1504272&r2=1506310&rev=1506310&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/src/main/torque-gen/outlets/velocityPropertiesCopy.xml
(original)
+++ db/torque/torque4/trunk/torque-generator/src/test/propertyToJava/src/main/torque-gen/outlets/velocityPropertiesCopy.xml
Tue Jul 23 21:51:49 2013
@@ -21,13 +21,14 @@
 <outlets xmlns="http://db.apache.org/torque/4.0/generator/configuration"
     xsi:schemaLocation="http://db.apache.org/torque/4.0/generator/configuration http://db.apache.org/torque/4.0/generator/configuration.xsd"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-  <outlet name="org.apache.torque.generator.velocity.propertiesCopy"
+  <!-- outlet propertiesCopy auto-defined by template scan but overwritten here -->
+  <outlet name="propertyCopy.propertiesCopy"
       xsi:type="velocityOutlet" 
-      path="propertiesCopy.vm">
+      path="propertyCopy/propertiesCopy.vm">
     <mergepoint name="properties">
       <action xsi:type="traverseAllAction" element="entry" 
-          outlet="propertyCopy"/>
+          outlet="propertyCopy.propertyCopy"/>
     </mergepoint>
   </outlet>
-  <!-- outlet propertyCopy auto-defined by template scan -->
+  <!-- outlet propertyCopy.propertyCopy auto-defined by template scan -->
 </outlets>
\ No newline at end of file



---------------------------------------------------------------------
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