Author: apetrelli
Date: Fri Jul 16 18:43:54 2010
New Revision: 964899
URL: http://svn.apache.org/viewvc?rev=964899&view=rev
Log:
VELOCITYSB-4
Using system properties instead of substitution variables.
Changed Velocity579TestCase because it fails.
Modified:
velocity/sandbox/maven-reorg/engine/trunk/velocity-engine-core/pom.xml
velocity/sandbox/maven-reorg/engine/trunk/velocity-engine-core/src/test/java/org/apache/velocity/test/TemplateTestBase.java
velocity/sandbox/maven-reorg/engine/trunk/velocity-engine-core/src/test/java/org/apache/velocity/test/issues/Velocity579TestCase.java
Modified: velocity/sandbox/maven-reorg/engine/trunk/velocity-engine-core/pom.xml
URL:
http://svn.apache.org/viewvc/velocity/sandbox/maven-reorg/engine/trunk/velocity-engine-core/pom.xml?rev=964899&r1=964898&r2=964899&view=diff
==============================================================================
--- velocity/sandbox/maven-reorg/engine/trunk/velocity-engine-core/pom.xml
(original)
+++ velocity/sandbox/maven-reorg/engine/trunk/velocity-engine-core/pom.xml Fri
Jul 16 18:43:54 2010
@@ -12,17 +12,6 @@
<name>Apache Velocity - Engine</name>
<build>
- <testResources>
- <testResource>
- <targetPath>../filtered-testsources/java</targetPath>
- <filtering>true</filtering>
- <directory>src/test/java</directory>
- </testResource>
- <testResource>
- <directory>src/test/resources</directory>
- </testResource>
- </testResources>
-
<testSourceDirectory>target/filtered-testsources/java</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -35,6 +24,22 @@
</delimiters>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>test.compare.dir</name>
+ <value>${project.build.testOutputDirectory}</value>
+ </property>
+ <property>
+ <name>test.result.dir</name>
+ <value>${project.build.directory}/results</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
</plugins>
</build>
<dependencies>
Modified:
velocity/sandbox/maven-reorg/engine/trunk/velocity-engine-core/src/test/java/org/apache/velocity/test/TemplateTestBase.java
URL:
http://svn.apache.org/viewvc/velocity/sandbox/maven-reorg/engine/trunk/velocity-engine-core/src/test/java/org/apache/velocity/test/TemplateTestBase.java?rev=964899&r1=964898&r2=964899&view=diff
==============================================================================
---
velocity/sandbox/maven-reorg/engine/trunk/velocity-engine-core/src/test/java/org/apache/velocity/test/TemplateTestBase.java
(original)
+++
velocity/sandbox/maven-reorg/engine/trunk/velocity-engine-core/src/test/java/org/apache/velocity/test/TemplateTestBase.java
Fri Jul 16 18:43:54 2010
@@ -32,13 +32,13 @@ public interface TemplateTestBase
* Directory relative to the distribution root, where the
* values to compare test results to are stored.
*/
- public static final String TEST_COMPARE_DIR =
"${project.build.testOutputDirectory}";
+ public static final String TEST_COMPARE_DIR =
System.getProperty("test.compare.dir");
/**
* Directory relative to the distribution root, where the
* test cases should put their output
*/
- public static final String TEST_RESULT_DIR =
"${project.build.directory}/results";
+ public static final String TEST_RESULT_DIR =
System.getProperty("test.result.dir");
/**
Modified:
velocity/sandbox/maven-reorg/engine/trunk/velocity-engine-core/src/test/java/org/apache/velocity/test/issues/Velocity579TestCase.java
URL:
http://svn.apache.org/viewvc/velocity/sandbox/maven-reorg/engine/trunk/velocity-engine-core/src/test/java/org/apache/velocity/test/issues/Velocity579TestCase.java?rev=964899&r1=964898&r2=964899&view=diff
==============================================================================
---
velocity/sandbox/maven-reorg/engine/trunk/velocity-engine-core/src/test/java/org/apache/velocity/test/issues/Velocity579TestCase.java
(original)
+++
velocity/sandbox/maven-reorg/engine/trunk/velocity-engine-core/src/test/java/org/apache/velocity/test/issues/Velocity579TestCase.java
Fri Jul 16 18:43:54 2010
@@ -16,7 +16,7 @@ package org.apache.velocity.test.issues;
* "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.
+ * under the License.
*/
import org.apache.velocity.test.BaseTestCase;
@@ -43,16 +43,9 @@ public class Velocity579TestCase extends
{
context.put("bar", new MyBar());
// ugly hack to avoid failed test when running JDK 1.5 or earlier
- try
- {
- Class.forName("java.util.Deque");
+ String javaVersion = System.getProperty("java.version");
+ if (javaVersion.startsWith("1.6"))
assertEvalEquals("bar", "$bar.bar()");
- }
- catch (ClassNotFoundException cnfe)
- {
- //ignore this test in jdk 1.5-
- System.out.println("Skipping
testPublicMethodInheritedFromPrivateClass for pre-1.6 JDK");
- }
}
public static interface Foo
@@ -78,6 +71,10 @@ public class Velocity579TestCase extends
public static class MyBar extends Foobar
{
+ public String bar()
+ {
+ return super.bar();
+ }
}
}