db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1704079 - in /db/torque/torque4/trunk/torque-generator: ./ src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/ src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/ src/test/existingTargetStrategy/mergeStr...
Date Sat, 19 Sep 2015 19:17:42 GMT
Author: tfischer
Date: Sat Sep 19 19:17:41 2015
New Revision: 1704079

URL: http://svn.apache.org/viewvc?rev=1704079&view=rev
Log:
TORQUE-226 fix problems of existing target mode "merge" with files without line break at end
of file by switching to a new vesrion of jgit (which also needs jdk 1.7)

Added:
    db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/
    db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/
    db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/
    db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/torque-gen/
    db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/torque-gen/conf/
    db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/torque-gen/conf/control.xml
    db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/torque-gen/outlets/
    db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/torque-gen/outlets/output.xml
    db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/torque-gen/src/
    db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/torque-gen/src/source1.properties
    db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/torque-gen/templates/
    db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/torque-gen/templates/simpleOutput.vm
Modified:
    db/torque/torque4/trunk/torque-generator/pom.xml
    db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/control/ExistingTargetStrategyTest.java

Modified: db/torque/torque4/trunk/torque-generator/pom.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/pom.xml?rev=1704079&r1=1704078&r2=1704079&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/pom.xml (original)
+++ db/torque/torque4/trunk/torque-generator/pom.xml Sat Sep 19 19:17:41 2015
@@ -41,7 +41,7 @@
     <dependency>
      <groupId>org.eclipse.jgit</groupId>
       <artifactId>org.eclipse.jgit</artifactId>
-      <version>2.1.0.201209190230-r</version>
+      <version>4.0.1.201506240215-r</version>
       <exclusions>
         <exclusion>
           <groupId>com.jcraft</groupId>
@@ -147,6 +147,14 @@
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.7</source>
+          <target>1.7</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <version>2.4.2</version>
         <configuration>

Added: db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/torque-gen/conf/control.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/torque-gen/conf/control.xml?rev=1704079&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/torque-gen/conf/control.xml
(added)
+++ db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/torque-gen/conf/control.xml
Sat Sep 19 19:17:41 2015
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<control
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://db.apache.org/torque/4.0/generator/configuration http://db.apache.org/torque/4.0/generator/configuration.xsd"
+    xmlns="http://db.apache.org/torque/4.0/generator/configuration"
+    loglevel="debug">
+  <output name="output1" file="output1.txt" existingTargetStrategy="merge">
+    <source xsi:type="fileSource" elements="/">
+      <include>source1.properties</include>
+    </source>
+    <outlet name="org.apache.torque.generator.velocity.simpleOutput" />
+  </output>
+</control>
+  
\ No newline at end of file

Added: db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/torque-gen/outlets/output.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/torque-gen/outlets/output.xml?rev=1704079&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/torque-gen/outlets/output.xml
(added)
+++ db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/torque-gen/outlets/output.xml
Sat Sep 19 19:17:41 2015
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<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.simpleOutput"
+      xsi:type="velocityOutlet" 
+      path="simpleOutput.vm">
+  </outlet>
+</outlets>
\ No newline at end of file

Added: db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/torque-gen/src/source1.properties
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/torque-gen/src/source1.properties?rev=1704079&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/torque-gen/src/source1.properties
(added)
+++ db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/torque-gen/src/source1.properties
Sat Sep 19 19:17:41 2015
@@ -0,0 +1,25 @@
+# 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
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+fileName = source1.properties
+fromDir = existingTargetStrategyTest.mergeStrategy
+propertyName1 = propertyValue1
+propertyWhichWasInsertedLater = insertedValue
+propertyName2 = propertyValue2
+propertyName3 = propertyValue3
+propertyWhichIsModifiedLater = modifiedValueInNormalSourceDir
+propertyName4 = propertyValue4

Added: db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/torque-gen/templates/simpleOutput.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/torque-gen/templates/simpleOutput.vm?rev=1704079&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/torque-gen/templates/simpleOutput.vm
(added)
+++ db/torque/torque4/trunk/torque-generator/src/test/existingTargetStrategy/mergeStrategyNoNewlinesAtEndOfFile/src/main/torque-gen/templates/simpleOutput.vm
Sat Sep 19 19:17:41 2015
@@ -0,0 +1,20 @@
+## 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
+## regarding copyright ownership.  The ASF licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License.  You may obtain a copy of the License at
+##
+##   http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing,
+## software distributed under the License is distributed on an
+## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+## KIND, either express or implied.  See the License for the
+## specific language governing permissions and limitations
+## under the License.
+##
+1
+2
+noNewlineAtEndOfFile
\ No newline at end of file

Modified: db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/control/ExistingTargetStrategyTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/control/ExistingTargetStrategyTest.java?rev=1704079&r1=1704078&r2=1704079&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/control/ExistingTargetStrategyTest.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/control/ExistingTargetStrategyTest.java
Sat Sep 19 19:17:41 2015
@@ -26,7 +26,6 @@ import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 import org.apache.commons.io.FileUtils;
@@ -196,6 +195,23 @@ public class ExistingTargetStrategyTest
         assertFile(new File(conflictSourceDir, "source2.properties"), workFile2);
     }
 
+    // TORQUE-226
+    @Test
+    public void testMergeStrategyNoNewlineAtEndOfFile() throws Exception
+    {
+        File configurationDirectory = new File(confRootDir, "mergeStrategyNoNewlinesAtEndOfFile");
+        File initialSourceDir
+                = new File(confRootDir, "/initial/src/main/torque-gen/src");
+        runGeneration(configurationDirectory, initialSourceDir);
+        assertFile(new File(configurationDirectory, "src/main/torque-gen/templates/simpleOutput.vm"),
targetFile1);
+        assertFile(new File(configurationDirectory, "src/main/torque-gen/templates/simpleOutput.vm"),
workFile1);
+
+        // rerun
+        runGeneration(configurationDirectory, initialSourceDir);
+        assertFile(new File(configurationDirectory, "src/main/torque-gen/templates/simpleOutput.vm"),
targetFile1);
+        assertFile(new File(configurationDirectory, "src/main/torque-gen/templates/simpleOutput.vm"),
workFile1);
+    }
+
     @Test
     public void testSkipStrategy() throws Exception
     {
@@ -243,7 +259,7 @@ public class ExistingTargetStrategyTest
         assertFile(expectedTargetFile2, targetFile2);
     }
 
-    private File runGeneration(File configurationDirectory, File sourceDir)
+    private File runGeneration(final File configurationDirectory, final File sourceDir)
             throws GeneratorException
     {
         Controller controller = new Controller();
@@ -265,7 +281,7 @@ public class ExistingTargetStrategyTest
         return configurationDirectory;
     }
 
-    private void assertFile(File expectedFile, File actualFile)
+    private void assertFile(final File expectedFile, final File actualFile)
             throws IOException
     {
         assertTrue(actualFile.exists());



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