From 63a845ef77260fc2c09a356addc51368d42efdd2 Mon Sep 17 00:00:00 2001 From: Jan Materne Date: Wed, 20 Dec 2006 14:21:25 +0000 Subject: [PATCH] Make the tests runnable on systems without regexp matchers (e.g. JDK 1.2 without ORO). git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@489097 13f79535-47bb-0310-9956-ffa450edef68 --- src/tests/antunit/taskdefs/jar-spi-test.xml | 15 ++++++++--- .../antunit/types/conditions/matches-test.xml | 25 +++++++++++++------ .../types/resources/selectors/test.xml | 11 +++++++- .../taskdefs/optional/EchoPropertiesTest.java | 5 ++++ 4 files changed, 44 insertions(+), 12 deletions(-) diff --git a/src/tests/antunit/taskdefs/jar-spi-test.xml b/src/tests/antunit/taskdefs/jar-spi-test.xml index 90131d680..656f0dc6a 100644 --- a/src/tests/antunit/taskdefs/jar-spi-test.xml +++ b/src/tests/antunit/taskdefs/jar-spi-test.xml @@ -3,6 +3,15 @@ + + + + + + + + + @@ -12,7 +21,7 @@ - + @@ -32,7 +41,7 @@ - + @@ -54,7 +63,7 @@ - + diff --git a/src/tests/antunit/types/conditions/matches-test.xml b/src/tests/antunit/types/conditions/matches-test.xml index 9728d6a62..4bb483782 100644 --- a/src/tests/antunit/types/conditions/matches-test.xml +++ b/src/tests/antunit/types/conditions/matches-test.xml @@ -3,7 +3,16 @@ - + + + + + + + + + + @@ -11,19 +20,19 @@ - + - + - + @@ -34,7 +43,7 @@ - + @@ -55,13 +64,13 @@ - + - + - + diff --git a/src/tests/antunit/types/resources/selectors/test.xml b/src/tests/antunit/types/resources/selectors/test.xml index 78dccf4ab..26f3429aa 100755 --- a/src/tests/antunit/types/resources/selectors/test.xml +++ b/src/tests/antunit/types/resources/selectors/test.xml @@ -2,6 +2,15 @@ xmlns:rsel="antlib:org.apache.tools.ant.types.resources.selectors" xmlns:rcmp="antlib:org.apache.tools.ant.types.resources.comparators"> + + + + + + + + + @@ -343,7 +352,7 @@ - + diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java index c5c430205..8e51c6140 100644 --- a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java +++ b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java @@ -19,6 +19,7 @@ package org.apache.tools.ant.taskdefs.optional; import org.apache.tools.ant.BuildFileTest; +import org.apache.tools.ant.util.regexp.RegexpMatcherFactory; import java.io.IOException; import java.io.File; @@ -172,6 +173,10 @@ public class EchoPropertiesTest extends BuildFileTest { } public void testWithRegex() throws Exception { + if (!RegexpMatcherFactory.regexpMatcherPresent(project)) { + System.out.println("Test 'testWithRegex' skipped because no regexp matcher is present."); + return; + } executeTarget("testWithRegex"); assertDebuglogContaining("ant.home="); }