ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gin...@apache.org
Subject [10/22] ant git commit: Normalise tabulation and line breaks (cf master)
Date Wed, 29 Nov 2017 22:06:06 GMT
http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/apache/tools/ant/types/resources/MultiRootFileSetTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/types/resources/MultiRootFileSetTest.java b/src/tests/junit/org/apache/tools/ant/types/resources/MultiRootFileSetTest.java
index c11ba73..6c05963 100644
--- a/src/tests/junit/org/apache/tools/ant/types/resources/MultiRootFileSetTest.java
+++ b/src/tests/junit/org/apache/tools/ant/types/resources/MultiRootFileSetTest.java
@@ -1,131 +1,131 @@
-/*
- *  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.
- *
- */
-
-package org.apache.tools.ant.types.resources;
-
-import java.io.File;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.types.AbstractFileSet;
-import org.apache.tools.ant.types.AbstractFileSetTest;
-import org.apache.tools.ant.types.Reference;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-/**
- * This doesn't actually test much, mainly reference handling.
- */
-public class MultiRootFileSetTest extends AbstractFileSetTest {
-
-
-    protected AbstractFileSet getInstance() {
-        return new MultiRootFileSet() {
-            // overriding so set/getDir works as expected by the base test class
-            private File dir;
-            public void setDir(File dir) {
-                if (isReference()) {
-                    throw tooManyAttributes();
-                }
-                this.dir = dir;
-            }
-
-            public synchronized File getDir(Project p) {
-                if (isReference()) {
-                    return getRef(p).getDir(p);
-                }
-                dieOnCircularReference();
-                return dir;
-            }
-        };
-    }
-
-    @Test
-    public void testEmptyElementIfIsReferenceAdditionalAttributes() {
-        MultiRootFileSet f = new MultiRootFileSet();
-        f.setProject(getProject());
-        f.setBaseDirs("a");
-        try {
-            f.setRefid(new Reference(getProject(), "dummyref"));
-            fail("Can add reference to multirootfileset "
-                 + " with elements from setBasedirs");
-        } catch (BuildException be) {
-            assertEquals("You must not specify more than one attribute "
-                         + "when using refid", be.getMessage());
-        }
-        f = new MultiRootFileSet();
-        f.addConfiguredBaseDir(new FileResource(new File(".")));
-        try {
-            f.setRefid(new Reference(getProject(), "dummyref"));
-            fail("Can add reference to multirootfileset"
-                 + " with elements from addConfiguredBaseDir");
-        } catch (BuildException be) {
-            assertEquals("You must not specify more than one attribute "
-                         + "when using refid", be.getMessage());
-        }
-
-        f = new MultiRootFileSet();
-        f.setRefid(new Reference(getProject(), "dummyref"));
-        try {
-            f.setBaseDirs("a");
-            fail("Can set basedirs in multirootfileset"
-                 + " that is a reference.");
-        } catch (BuildException be) {
-            assertEquals("You must not specify more than one attribute "
-                         + "when using refid", be.getMessage());
-        }
-        try {
-            f.setCache(true);
-            fail("Can set cache in multirootfileset"
-                 + " that is a reference.");
-        } catch (BuildException be) {
-            assertEquals("You must not specify more than one attribute "
-                         + "when using refid", be.getMessage());
-        }
-        try {
-            f.setType(MultiRootFileSet.SetType.file);
-            fail("Can set type in multirootfileset"
-                 + " that is a reference.");
-        } catch (BuildException be) {
-            assertEquals("You must not specify more than one attribute "
-                         + "when using refid", be.getMessage());
-        }
-        try {
-            f.addConfiguredBaseDir(new FileResource(new File(".")));
-            fail("Can add nested basedir in multirootfileset "
-                 + " that is a reference.");
-        } catch (BuildException be) {
-            assertEquals("You must not specify nested elements when using "
-                         + "refid", be.getMessage());
-        }
-    }
-
-    @Test
-    public void testDirCannotBeSet() {
-        try {
-            new MultiRootFileSet().setDir(new File("."));
-            fail("Can set dir in a multirootfileset");
-        } catch (BuildException e) {
-            assertTrue(e.getMessage()
-                       .endsWith(" doesn't support the dir attribute"));
-        }
-    }
-}
+/*
+ *  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.
+ *
+ */
+
+package org.apache.tools.ant.types.resources;
+
+import java.io.File;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.types.AbstractFileSet;
+import org.apache.tools.ant.types.AbstractFileSetTest;
+import org.apache.tools.ant.types.Reference;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+/**
+ * This doesn't actually test much, mainly reference handling.
+ */
+public class MultiRootFileSetTest extends AbstractFileSetTest {
+
+
+    protected AbstractFileSet getInstance() {
+        return new MultiRootFileSet() {
+            // overriding so set/getDir works as expected by the base test class
+            private File dir;
+            public void setDir(File dir) {
+                if (isReference()) {
+                    throw tooManyAttributes();
+                }
+                this.dir = dir;
+            }
+
+            public synchronized File getDir(Project p) {
+                if (isReference()) {
+                    return getRef(p).getDir(p);
+                }
+                dieOnCircularReference();
+                return dir;
+            }
+        };
+    }
+
+    @Test
+    public void testEmptyElementIfIsReferenceAdditionalAttributes() {
+        MultiRootFileSet f = new MultiRootFileSet();
+        f.setProject(getProject());
+        f.setBaseDirs("a");
+        try {
+            f.setRefid(new Reference(getProject(), "dummyref"));
+            fail("Can add reference to multirootfileset "
+                 + " with elements from setBasedirs");
+        } catch (BuildException be) {
+            assertEquals("You must not specify more than one attribute "
+                         + "when using refid", be.getMessage());
+        }
+        f = new MultiRootFileSet();
+        f.addConfiguredBaseDir(new FileResource(new File(".")));
+        try {
+            f.setRefid(new Reference(getProject(), "dummyref"));
+            fail("Can add reference to multirootfileset"
+                 + " with elements from addConfiguredBaseDir");
+        } catch (BuildException be) {
+            assertEquals("You must not specify more than one attribute "
+                         + "when using refid", be.getMessage());
+        }
+
+        f = new MultiRootFileSet();
+        f.setRefid(new Reference(getProject(), "dummyref"));
+        try {
+            f.setBaseDirs("a");
+            fail("Can set basedirs in multirootfileset"
+                 + " that is a reference.");
+        } catch (BuildException be) {
+            assertEquals("You must not specify more than one attribute "
+                         + "when using refid", be.getMessage());
+        }
+        try {
+            f.setCache(true);
+            fail("Can set cache in multirootfileset"
+                 + " that is a reference.");
+        } catch (BuildException be) {
+            assertEquals("You must not specify more than one attribute "
+                         + "when using refid", be.getMessage());
+        }
+        try {
+            f.setType(MultiRootFileSet.SetType.file);
+            fail("Can set type in multirootfileset"
+                 + " that is a reference.");
+        } catch (BuildException be) {
+            assertEquals("You must not specify more than one attribute "
+                         + "when using refid", be.getMessage());
+        }
+        try {
+            f.addConfiguredBaseDir(new FileResource(new File(".")));
+            fail("Can add nested basedir in multirootfileset "
+                 + " that is a reference.");
+        } catch (BuildException be) {
+            assertEquals("You must not specify nested elements when using "
+                         + "refid", be.getMessage());
+        }
+    }
+
+    @Test
+    public void testDirCannotBeSet() {
+        try {
+            new MultiRootFileSet().setDir(new File("."));
+            fail("Can set dir in a multirootfileset");
+        } catch (BuildException e) {
+            assertTrue(e.getMessage()
+                       .endsWith(" doesn't support the dir attribute"));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/apache/tools/ant/types/resources/ResourceListTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/types/resources/ResourceListTest.java b/src/tests/junit/org/apache/tools/ant/types/resources/ResourceListTest.java
index a45e184..f020178 100644
--- a/src/tests/junit/org/apache/tools/ant/types/resources/ResourceListTest.java
+++ b/src/tests/junit/org/apache/tools/ant/types/resources/ResourceListTest.java
@@ -1,134 +1,134 @@
-/*
- *  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.
- *
- */
-package org.apache.tools.ant.types.resources;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.BuildFileRule;
-import org.apache.tools.ant.types.FilterChain;
-import org.apache.tools.ant.types.Reference;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-public class ResourceListTest {
-
-    @Rule
-    public BuildFileRule buildRule = new BuildFileRule();
-
-    @Before
-    public void setUp() throws Exception {
-        buildRule.configureProject("src/etc/testcases/types/resources/resourcelist.xml");
-    }
-
-    @After
-    public void tearDown() throws Exception {
-        buildRule.executeTarget("tearDown");
-    }
-
-    @Test
-    public void testEmptyElementWithReference() {
-        ResourceList rl = new ResourceList();
-        rl.setEncoding("foo");
-        try {
-            rl.setRefid(new Reference(buildRule.getProject(), "dummyref"));
-            fail("Can add reference to ResourceList with encoding attribute set.");
-        } catch (BuildException be) {
-            assertEquals("You must not specify more than one attribute when using refid",
-                         be.getMessage());
-        }
-
-        rl = new ResourceList();
-        rl.setRefid(new Reference(buildRule.getProject(), "dummyref"));
-        try {
-            rl.setEncoding("foo");
-            fail("Can set encoding in ResourceList that is a reference");
-        } catch (BuildException be) {
-            assertEquals("You must not specify more than one attribute when using refid",
-                         be.getMessage());
-        }
-
-        rl = new ResourceList();
-        rl.add(new FileResource(buildRule.getProject(), "."));
-        try {
-            rl.setRefid(new Reference(buildRule.getProject(), "dummyref"));
-            fail("Can add reference to ResourceList with nested resource collection.");
-        } catch (BuildException be) {
-            assertEquals("You must not specify nested elements when using refid",
-                         be.getMessage());
-        }
-
-        rl = new ResourceList();
-        rl.setRefid(new Reference(buildRule.getProject(), "dummyref"));
-        try {
-            rl.add(new FileResource(buildRule.getProject(), "."));
-            fail("Can add reference to ResourceList with nested resource collection.");
-        } catch (BuildException be) {
-            assertEquals("You must not specify nested elements when using refid",
-                         be.getMessage());
-        }
-
-        rl = new ResourceList();
-        rl.addFilterChain(new FilterChain());
-        try {
-            rl.setRefid(new Reference(buildRule.getProject(), "dummyref"));
-            fail("Can add reference to ResourceList with nested filter chain.");
-        } catch (BuildException be) {
-            assertEquals("You must not specify nested elements when using refid",
-                         be.getMessage());
-        }
-
-        rl = new ResourceList();
-        rl.setRefid(new Reference(buildRule.getProject(), "dummyref"));
-        try {
-            rl.addFilterChain(new FilterChain());
-            fail("Can add reference to ResourceList with nested filter chain.");
-        } catch (BuildException be) {
-            assertEquals("You must not specify nested elements when using refid",
-                         be.getMessage());
-        }
-    }
-
-    @Test
-    public void testCircularReference() throws Exception {
-        ResourceList rl1 = new ResourceList();
-        rl1.setProject(buildRule.getProject());
-        rl1.setRefid(new Reference(buildRule.getProject(), "foo"));
-
-        ResourceList rl2 = new ResourceList();
-        rl2.setProject(buildRule.getProject());
-        buildRule.getProject().addReference("foo", rl2);
-
-        Union u = new Union();
-        u.add(rl1);
-        u.setProject(buildRule.getProject());
-
-        rl2.add(u);
-
-        try {
-            rl2.size();
-            fail("Can make ResourceList a Reference to itself.");
-        } catch (BuildException be) {
-            assertEquals("This data type contains a circular reference.",
-                         be.getMessage());
-        }
-    }
-}
+/*
+ *  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.
+ *
+ */
+package org.apache.tools.ant.types.resources;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.BuildFileRule;
+import org.apache.tools.ant.types.FilterChain;
+import org.apache.tools.ant.types.Reference;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+public class ResourceListTest {
+
+    @Rule
+    public BuildFileRule buildRule = new BuildFileRule();
+
+    @Before
+    public void setUp() throws Exception {
+        buildRule.configureProject("src/etc/testcases/types/resources/resourcelist.xml");
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        buildRule.executeTarget("tearDown");
+    }
+
+    @Test
+    public void testEmptyElementWithReference() {
+        ResourceList rl = new ResourceList();
+        rl.setEncoding("foo");
+        try {
+            rl.setRefid(new Reference(buildRule.getProject(), "dummyref"));
+            fail("Can add reference to ResourceList with encoding attribute set.");
+        } catch (BuildException be) {
+            assertEquals("You must not specify more than one attribute when using refid",
+                         be.getMessage());
+        }
+
+        rl = new ResourceList();
+        rl.setRefid(new Reference(buildRule.getProject(), "dummyref"));
+        try {
+            rl.setEncoding("foo");
+            fail("Can set encoding in ResourceList that is a reference");
+        } catch (BuildException be) {
+            assertEquals("You must not specify more than one attribute when using refid",
+                         be.getMessage());
+        }
+
+        rl = new ResourceList();
+        rl.add(new FileResource(buildRule.getProject(), "."));
+        try {
+            rl.setRefid(new Reference(buildRule.getProject(), "dummyref"));
+            fail("Can add reference to ResourceList with nested resource collection.");
+        } catch (BuildException be) {
+            assertEquals("You must not specify nested elements when using refid",
+                         be.getMessage());
+        }
+
+        rl = new ResourceList();
+        rl.setRefid(new Reference(buildRule.getProject(), "dummyref"));
+        try {
+            rl.add(new FileResource(buildRule.getProject(), "."));
+            fail("Can add reference to ResourceList with nested resource collection.");
+        } catch (BuildException be) {
+            assertEquals("You must not specify nested elements when using refid",
+                         be.getMessage());
+        }
+
+        rl = new ResourceList();
+        rl.addFilterChain(new FilterChain());
+        try {
+            rl.setRefid(new Reference(buildRule.getProject(), "dummyref"));
+            fail("Can add reference to ResourceList with nested filter chain.");
+        } catch (BuildException be) {
+            assertEquals("You must not specify nested elements when using refid",
+                         be.getMessage());
+        }
+
+        rl = new ResourceList();
+        rl.setRefid(new Reference(buildRule.getProject(), "dummyref"));
+        try {
+            rl.addFilterChain(new FilterChain());
+            fail("Can add reference to ResourceList with nested filter chain.");
+        } catch (BuildException be) {
+            assertEquals("You must not specify nested elements when using refid",
+                         be.getMessage());
+        }
+    }
+
+    @Test
+    public void testCircularReference() throws Exception {
+        ResourceList rl1 = new ResourceList();
+        rl1.setProject(buildRule.getProject());
+        rl1.setRefid(new Reference(buildRule.getProject(), "foo"));
+
+        ResourceList rl2 = new ResourceList();
+        rl2.setProject(buildRule.getProject());
+        buildRule.getProject().addReference("foo", rl2);
+
+        Union u = new Union();
+        u.add(rl1);
+        u.setProject(buildRule.getProject());
+
+        rl2.add(u);
+
+        try {
+            rl2.size();
+            fail("Can make ResourceList a Reference to itself.");
+        } catch (BuildException be) {
+            assertEquals("This data type contains a circular reference.",
+                         be.getMessage());
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/apache/tools/ant/types/resources/TarResourceTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/types/resources/TarResourceTest.java b/src/tests/junit/org/apache/tools/ant/types/resources/TarResourceTest.java
index d0a0fe3..a9593f0 100644
--- a/src/tests/junit/org/apache/tools/ant/types/resources/TarResourceTest.java
+++ b/src/tests/junit/org/apache/tools/ant/types/resources/TarResourceTest.java
@@ -1,54 +1,54 @@
-/*
- *  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.
- *
- */
-package org.apache.tools.ant.types.resources;
-
-import org.apache.tools.ant.BuildFileRule;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-
-import java.io.File;
-
-import static org.apache.tools.ant.FileUtilities.getFileContents;
-import static org.junit.Assert.assertEquals;
-
-
-public class TarResourceTest {
-
-    @Rule
-    public BuildFileRule buildRule = new BuildFileRule();
-
-    @Before
-    public void setUp() throws Exception {
-        buildRule.configureProject("src/etc/testcases/types/resources/tarentry.xml");
-    }
-
-
-    @After
-    public void tearDown() throws Exception {
-        buildRule.executeTarget("tearDown");
-    }
-
-    @Test
-    public void testUncompressSource() throws java.io.IOException {
-        buildRule.executeTarget("uncompressSource");
-        assertEquals(getFileContents(buildRule.getProject().resolveFile("../../asf-logo.gif")),
-                getFileContents(new File(buildRule.getProject().getProperty("output"), "asf-logo.gif")));
-    }
-}
+/*
+ *  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.
+ *
+ */
+package org.apache.tools.ant.types.resources;
+
+import org.apache.tools.ant.BuildFileRule;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+import java.io.File;
+
+import static org.apache.tools.ant.FileUtilities.getFileContents;
+import static org.junit.Assert.assertEquals;
+
+
+public class TarResourceTest {
+
+    @Rule
+    public BuildFileRule buildRule = new BuildFileRule();
+
+    @Before
+    public void setUp() throws Exception {
+        buildRule.configureProject("src/etc/testcases/types/resources/tarentry.xml");
+    }
+
+
+    @After
+    public void tearDown() throws Exception {
+        buildRule.executeTarget("tearDown");
+    }
+
+    @Test
+    public void testUncompressSource() throws java.io.IOException {
+        buildRule.executeTarget("uncompressSource");
+        assertEquals(getFileContents(buildRule.getProject().resolveFile("../../asf-logo.gif")),
+                getFileContents(new File(buildRule.getProject().getProperty("output"), "asf-logo.gif")));
+    }
+}

http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/apache/tools/ant/types/selectors/BaseSelectorRule.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/types/selectors/BaseSelectorRule.java b/src/tests/junit/org/apache/tools/ant/types/selectors/BaseSelectorRule.java
index 8862cb1..d5613b2 100644
--- a/src/tests/junit/org/apache/tools/ant/types/selectors/BaseSelectorRule.java
+++ b/src/tests/junit/org/apache/tools/ant/types/selectors/BaseSelectorRule.java
@@ -1,125 +1,125 @@
-/*
- *  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.
- *
- */
-
-package org.apache.tools.ant.types.selectors;
-
-import java.io.File;
-
-
-import org.apache.tools.ant.BuildFileRule;
-
-
-/**
- * Base test case for Selectors. Provides a shared test as well as
- * a test bed for selecting on, and a helper method for determining
- * whether selections are correct.
- *
- */
-public class BaseSelectorRule extends BuildFileRule {
-
-    private File beddir;
-    private File mirrordir;
-    private final String[] filenames = {".","asf-logo.gif.md5","asf-logo.gif.bz2",
-            "asf-logo.gif.gz","copy.filterset.filtered","zip/asf-logo.gif.zip",
-            "tar/asf-logo.gif.tar","tar/asf-logo-huge.tar.gz",
-            "tar/gz/asf-logo.gif.tar.gz","tar/bz2/asf-logo.gif.tar.bz2",
-            "tar/bz2/asf-logo-huge.tar.bz2","tar/bz2"};
-    private File[] files = new File[filenames.length];
-    private File[] mirrorfiles = new File[filenames.length];
-
-    @Override
-    public void before() throws Throwable {
-        super.before();
-        configureProject("src/etc/testcases/types/selectors.xml");
-        executeTarget("setUp");
-
-        executeTarget("setupfiles");
-        executeTarget("mirrorfiles");
-
-        beddir = new File(super.getProject().getProperty("test.dir"));
-        mirrordir = new File(super.getProject().getProperty("mirror.dir"));
-
-        for (int x = 0; x < files.length; x++) {
-            files[x] = new File(beddir,filenames[x]);
-            mirrorfiles[x] = new File(mirrordir,filenames[x]);
-        }
-    }
-
-    @Override
-    public void after() {
-        super.after();
-        executeTarget("tearDown");
-    }
-
-    public File getBeddir() {
-        return beddir;
-    }
-
-    public File[] getMirrorFiles() {
-        return mirrorfiles;
-    }
-
-    public File[] getFiles() {
-        return files;
-    }
-
-    public String[] getFilenames() {
-        return filenames;
-    }
-
-
-    /**
-     * This is a helper method that takes a selector and calls its
-     * isSelected() method on each file in the testbed. It returns
-     * a string of "T"s amd "F"s
-     */
-    public String selectionString(FileSelector selector) {
-        return selectionString(beddir,files,selector);
-    }
-
-    /**
-     * This is a helper method that takes a selector and calls its
-     * isSelected() method on each file in the mirror testbed. This
-     * variation is used for dependency checks and to get around the
-     * limitations in the touch task when running JDK 1.1. It returns
-     * a string of "T"s amd "F"s.
-     */
-    public String mirrorSelectionString(FileSelector selector) {
-        return selectionString(mirrordir,mirrorfiles,selector);
-    }
-
-    /**
-     * Worker method for the two convenience methods above. Applies a
-     * selector on a set of files passed in and returns a string of
-     * "T"s amd "F"s from applying the selector to each file.
-     */
-    public String selectionString(File basedir, File[] files, FileSelector selector) {
-        StringBuilder buf = new StringBuilder();
-        for (int x = 0; x < files.length; x++) {
-            if (selector.isSelected(basedir,filenames[x],files[x])) {
-                buf.append('T');
-            }
-            else {
-                buf.append('F');
-            }
-        }
-        return buf.toString();
-    }
-
-
-}
+/*
+ *  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.
+ *
+ */
+
+package org.apache.tools.ant.types.selectors;
+
+import java.io.File;
+
+
+import org.apache.tools.ant.BuildFileRule;
+
+
+/**
+ * Base test case for Selectors. Provides a shared test as well as
+ * a test bed for selecting on, and a helper method for determining
+ * whether selections are correct.
+ *
+ */
+public class BaseSelectorRule extends BuildFileRule {
+
+    private File beddir;
+    private File mirrordir;
+    private final String[] filenames = {".","asf-logo.gif.md5","asf-logo.gif.bz2",
+            "asf-logo.gif.gz","copy.filterset.filtered","zip/asf-logo.gif.zip",
+            "tar/asf-logo.gif.tar","tar/asf-logo-huge.tar.gz",
+            "tar/gz/asf-logo.gif.tar.gz","tar/bz2/asf-logo.gif.tar.bz2",
+            "tar/bz2/asf-logo-huge.tar.bz2","tar/bz2"};
+    private File[] files = new File[filenames.length];
+    private File[] mirrorfiles = new File[filenames.length];
+
+    @Override
+    public void before() throws Throwable {
+        super.before();
+        configureProject("src/etc/testcases/types/selectors.xml");
+        executeTarget("setUp");
+
+        executeTarget("setupfiles");
+        executeTarget("mirrorfiles");
+
+        beddir = new File(super.getProject().getProperty("test.dir"));
+        mirrordir = new File(super.getProject().getProperty("mirror.dir"));
+
+        for (int x = 0; x < files.length; x++) {
+            files[x] = new File(beddir,filenames[x]);
+            mirrorfiles[x] = new File(mirrordir,filenames[x]);
+        }
+    }
+
+    @Override
+    public void after() {
+        super.after();
+        executeTarget("tearDown");
+    }
+
+    public File getBeddir() {
+        return beddir;
+    }
+
+    public File[] getMirrorFiles() {
+        return mirrorfiles;
+    }
+
+    public File[] getFiles() {
+        return files;
+    }
+
+    public String[] getFilenames() {
+        return filenames;
+    }
+
+
+    /**
+     * This is a helper method that takes a selector and calls its
+     * isSelected() method on each file in the testbed. It returns
+     * a string of "T"s amd "F"s
+     */
+    public String selectionString(FileSelector selector) {
+        return selectionString(beddir,files,selector);
+    }
+
+    /**
+     * This is a helper method that takes a selector and calls its
+     * isSelected() method on each file in the mirror testbed. This
+     * variation is used for dependency checks and to get around the
+     * limitations in the touch task when running JDK 1.1. It returns
+     * a string of "T"s amd "F"s.
+     */
+    public String mirrorSelectionString(FileSelector selector) {
+        return selectionString(mirrordir,mirrorfiles,selector);
+    }
+
+    /**
+     * Worker method for the two convenience methods above. Applies a
+     * selector on a set of files passed in and returns a string of
+     * "T"s amd "F"s from applying the selector to each file.
+     */
+    public String selectionString(File basedir, File[] files, FileSelector selector) {
+        StringBuilder buf = new StringBuilder();
+        for (int x = 0; x < files.length; x++) {
+            if (selector.isSelected(basedir,filenames[x],files[x])) {
+                buf.append('T');
+            }
+            else {
+                buf.append('F');
+            }
+        }
+        return buf.toString();
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/apache/tools/ant/types/selectors/BaseSelectorTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/types/selectors/BaseSelectorTest.java b/src/tests/junit/org/apache/tools/ant/types/selectors/BaseSelectorTest.java
index 1cc38d4..2332778 100644
--- a/src/tests/junit/org/apache/tools/ant/types/selectors/BaseSelectorTest.java
+++ b/src/tests/junit/org/apache/tools/ant/types/selectors/BaseSelectorTest.java
@@ -1,295 +1,295 @@
-/*
- *  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.
- *
- */
-
-package org.apache.tools.ant.types.selectors;
-
-import java.io.File;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.BuildFileTest;
-import org.apache.tools.ant.Project;
-
-/**
- * Base test case for Selectors. Provides a shared test as well as
- * a test bed for selecting on, and a helper method for determining
- * whether selections are correct.
- *
- * @deprecated as of 1.9.4. Use {@link org.apache.tools.ant.types.selectors.BaseSelectorRule} instead.
- */
-@Deprecated
-public abstract class BaseSelectorTest extends BuildFileTest {
-
-    private Project project;
-    private TaskdefForMakingBed tbed = null;
-    protected File basedir;
-    protected File beddir;
-    protected File mirrordir;
-    protected String[] filenames = {".","asf-logo.gif.md5","asf-logo.gif.bz2",
-            "asf-logo.gif.gz","copy.filterset.filtered","zip/asf-logo.gif.zip",
-            "tar/asf-logo.gif.tar","tar/asf-logo-huge.tar.gz",
-            "tar/gz/asf-logo.gif.tar.gz","tar/bz2/asf-logo.gif.tar.bz2",
-            "tar/bz2/asf-logo-huge.tar.bz2","tar/bz2"};
-    protected File[] files = new File[filenames.length];
-    protected File[] mirrorfiles = new File[filenames.length];
-
-    public BaseSelectorTest(String name) {
-        super(name);
-    }
-
-    public void setUp() {
-        configureProject("src/etc/testcases/types/selectors.xml");
-        executeTarget("setUp");
-        beddir = new File(super.getProject().getProperty("test.dir"));
-        mirrordir = new File(super.getProject().getProperty("mirror.dir"));
-        basedir = getProjectDir();
-        project = new Project();
-        project.init();
-        project.setBaseDir(basedir);
-        for (int x = 0; x < files.length; x++) {
-            files[x] = new File(beddir,filenames[x]);
-            mirrorfiles[x] = new File(mirrordir,filenames[x]);
-        }
-    }
-
-    /**
-     * Override this in child classes to return a specific Selector
-     */
-    public abstract BaseSelector getInstance();
-
-
-    /**
-     * Return a preconfigured selector (with a set reference to
-     * project instance).
-     * @return the selector
-     */
-    public BaseSelector getSelector() {
-        BaseSelector selector = getInstance();
-        selector.setProject( getProject() );
-        return selector;
-    }
-
-
-    public Project getProject() {
-        return project;
-    }
-
-    /**
-     * This is a test that all Selectors derived from BaseSelector can
-     * use. It calls the setError() method and checks to ensure that a
-     * BuildException is thrown as a result.
-     */
-    public void testRespondsToError() {
-        BaseSelector s = getInstance();
-        if (s == null) {
-            return;
-        }
-        s.setError("test error");
-        try {
-            s.isSelected(beddir,filenames[0],files[0]);
-            fail("Cannot cause BuildException when setError() is called");
-        } catch (BuildException be) {
-            assertEquals("test error",
-                         be.getMessage());
-        }
-    }
-
-
-    /**
-     * This is a helper method that takes a selector and calls its
-     * isSelected() method on each file in the testbed. It returns
-     * a string of "T"s amd "F"s
-     */
-    public String selectionString(FileSelector selector) {
-        return selectionString(beddir,files,selector);
-    }
-
-    /**
-     * This is a helper method that takes a selector and calls its
-     * isSelected() method on each file in the mirror testbed. This
-     * variation is used for dependency checks and to get around the
-     * limitations in the touch task when running JDK 1.1. It returns
-     * a string of "T"s amd "F"s.
-     */
-    public String mirrorSelectionString(FileSelector selector) {
-        return selectionString(mirrordir,mirrorfiles,selector);
-    }
-
-    /**
-     * Worker method for the two convenience methods above. Applies a
-     * selector on a set of files passed in and returns a string of
-     * "T"s amd "F"s from applying the selector to each file.
-     */
-    public String selectionString(File basedir, File[] files, FileSelector selector) {
-        StringBuffer buf = new StringBuffer();
-        for (int x = 0; x < files.length; x++) {
-            if (selector.isSelected(basedir,filenames[x],files[x])) {
-                buf.append('T');
-            }
-            else {
-                buf.append('F');
-            }
-        }
-        return buf.toString();
-    }
-
-    /**
-     * Does the selection test for a given selector and prints the
-     * filenames of the differing files (selected but shouldn't,
-     * not selected but should).
-     * @param selector  The selector to test
-     * @param expected  The expected result
-     */
-    public void performTests(FileSelector selector, String expected) {
-        String result = selectionString(selector);
-        String diff = diff(expected, result);
-        String resolved = resolve(diff);
-        assertEquals("Differing files: " + resolved, result, expected);
-    }
-
-    /**
-     *  Checks which files are selected and shouldn't be or which
-     *  are not selected but should.
-     *  @param expected    String containing 'F's and 'T's
-     *  @param result      String containing 'F's and 'T's
-     *  @return Difference as String containing '-' (equal) and
-     *          'X' (difference).
-     */
-    public String diff(String expected, String result) {
-        int length1 = expected.length();
-        int length2 = result.length();
-        int min = (length1 > length2) ? length2 : length1;
-        StringBuffer sb = new StringBuffer();
-        for (int i=0; i<min; i++) {
-            sb.append(
-                  (expected.charAt(i) == result.charAt(i))
-                ? "-"
-                : "X"
-            );
-        }
-        return sb.toString();
-    }
-
-
-    /**
-     * Resolves a diff-String (@see diff()) against the (inherited) filenames-
-     * and files arrays.
-     * @param filelist    Diff-String
-     * @return String containing the filenames for all differing files,
-     *         separated with semicolons ';'
-     */
-    public String resolve(String filelist) {
-        StringBuffer sb = new StringBuffer();
-        int min = (filenames.length > filelist.length())
-                ? filelist.length()
-                : filenames.length;
-        for (int i=0; i<min; i++) {
-            if ('X'==filelist.charAt(i)) {
-                sb.append(filenames[i]);
-                sb.append(";");
-            }
-        }
-        return sb.toString();
-    }
-
-
-    /**
-     * <p>Creates a testbed. We avoid the dreaded "test" word so that we
-     * don't falsely identify this as a test to be run. The actual
-     * setting up of the testbed is done in the
-     * <code>src/etc/testcases/types/selectors.xml</code> build file.</p>
-     *
-     * <p>Note that the right way to call this is within a try block,
-     * with a finally clause that calls cleanupBed(). You place tests of
-     * the isSelected() method within the try block.</p>
-     */
-    protected void makeBed() {
-        tbed = new TaskdefForMakingBed("setupfiles");
-        tbed.setUp();
-        tbed.makeTestbed();
-    }
-
-    /**
-     * Cleans up the testbed by calling a target in the
-     * <code>src/etc/testcases/types/selectors.xml</code> file.
-     */
-    protected void cleanupBed() {
-        if (tbed != null) {
-           tbed.tearDown();
-            tbed = null;
-        }
-    }
-
-
-    /**
-     * <p>Creates a mirror of the testbed for use in dependency checks.</p>
-     *
-     * <p>Note that the right way to call this is within a try block,
-     * with a finally clause that calls cleanupMirror(). You place tests of
-     * the isSelected() method within the try block.</p>
-     */
-    protected void makeMirror() {
-        tbed = new TaskdefForMakingBed("mirrorfiles");
-        tbed.setUp();
-        tbed.makeMirror();
-    }
-
-    /**
-     * Cleans up the mirror testbed by calling a target in the
-     * <code>src/etc/testcases/types/selectors.xml</code> file.
-     */
-    protected void cleanupMirror() {
-        if (tbed != null) {
-            tbed.deleteMirror();
-            tbed = null;
-        }
-    }
-
-    private class TaskdefForMakingBed extends BuildFileTest {
-
-        TaskdefForMakingBed(String name) {
-            super(name);
-        }
-
-        public void setUp() {
-            configureProject("src/etc/testcases/types/selectors.xml");
-        }
-
-        public void tearDown() {
-            try {
-                super.tearDown();
-            } catch (Exception exc) {
-                // ignore
-            }
-        }
-
-        public void makeTestbed() {
-            executeTarget("setupfiles");
-        }
-
-        public void makeMirror() {
-            executeTarget("mirrorfiles");
-        }
-
-        public void deleteMirror() {
-            executeTarget("tearDown");
-        }
-    }
-
-
-
-}
+/*
+ *  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.
+ *
+ */
+
+package org.apache.tools.ant.types.selectors;
+
+import java.io.File;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.BuildFileTest;
+import org.apache.tools.ant.Project;
+
+/**
+ * Base test case for Selectors. Provides a shared test as well as
+ * a test bed for selecting on, and a helper method for determining
+ * whether selections are correct.
+ *
+ * @deprecated as of 1.9.4. Use {@link org.apache.tools.ant.types.selectors.BaseSelectorRule} instead.
+ */
+@Deprecated
+public abstract class BaseSelectorTest extends BuildFileTest {
+
+    private Project project;
+    private TaskdefForMakingBed tbed = null;
+    protected File basedir;
+    protected File beddir;
+    protected File mirrordir;
+    protected String[] filenames = {".","asf-logo.gif.md5","asf-logo.gif.bz2",
+            "asf-logo.gif.gz","copy.filterset.filtered","zip/asf-logo.gif.zip",
+            "tar/asf-logo.gif.tar","tar/asf-logo-huge.tar.gz",
+            "tar/gz/asf-logo.gif.tar.gz","tar/bz2/asf-logo.gif.tar.bz2",
+            "tar/bz2/asf-logo-huge.tar.bz2","tar/bz2"};
+    protected File[] files = new File[filenames.length];
+    protected File[] mirrorfiles = new File[filenames.length];
+
+    public BaseSelectorTest(String name) {
+        super(name);
+    }
+
+    public void setUp() {
+        configureProject("src/etc/testcases/types/selectors.xml");
+        executeTarget("setUp");
+        beddir = new File(super.getProject().getProperty("test.dir"));
+        mirrordir = new File(super.getProject().getProperty("mirror.dir"));
+        basedir = getProjectDir();
+        project = new Project();
+        project.init();
+        project.setBaseDir(basedir);
+        for (int x = 0; x < files.length; x++) {
+            files[x] = new File(beddir,filenames[x]);
+            mirrorfiles[x] = new File(mirrordir,filenames[x]);
+        }
+    }
+
+    /**
+     * Override this in child classes to return a specific Selector
+     */
+    public abstract BaseSelector getInstance();
+
+
+    /**
+     * Return a preconfigured selector (with a set reference to
+     * project instance).
+     * @return the selector
+     */
+    public BaseSelector getSelector() {
+        BaseSelector selector = getInstance();
+        selector.setProject( getProject() );
+        return selector;
+    }
+
+
+    public Project getProject() {
+        return project;
+    }
+
+    /**
+     * This is a test that all Selectors derived from BaseSelector can
+     * use. It calls the setError() method and checks to ensure that a
+     * BuildException is thrown as a result.
+     */
+    public void testRespondsToError() {
+        BaseSelector s = getInstance();
+        if (s == null) {
+            return;
+        }
+        s.setError("test error");
+        try {
+            s.isSelected(beddir,filenames[0],files[0]);
+            fail("Cannot cause BuildException when setError() is called");
+        } catch (BuildException be) {
+            assertEquals("test error",
+                         be.getMessage());
+        }
+    }
+
+
+    /**
+     * This is a helper method that takes a selector and calls its
+     * isSelected() method on each file in the testbed. It returns
+     * a string of "T"s amd "F"s
+     */
+    public String selectionString(FileSelector selector) {
+        return selectionString(beddir,files,selector);
+    }
+
+    /**
+     * This is a helper method that takes a selector and calls its
+     * isSelected() method on each file in the mirror testbed. This
+     * variation is used for dependency checks and to get around the
+     * limitations in the touch task when running JDK 1.1. It returns
+     * a string of "T"s amd "F"s.
+     */
+    public String mirrorSelectionString(FileSelector selector) {
+        return selectionString(mirrordir,mirrorfiles,selector);
+    }
+
+    /**
+     * Worker method for the two convenience methods above. Applies a
+     * selector on a set of files passed in and returns a string of
+     * "T"s amd "F"s from applying the selector to each file.
+     */
+    public String selectionString(File basedir, File[] files, FileSelector selector) {
+        StringBuffer buf = new StringBuffer();
+        for (int x = 0; x < files.length; x++) {
+            if (selector.isSelected(basedir,filenames[x],files[x])) {
+                buf.append('T');
+            }
+            else {
+                buf.append('F');
+            }
+        }
+        return buf.toString();
+    }
+
+    /**
+     * Does the selection test for a given selector and prints the
+     * filenames of the differing files (selected but shouldn't,
+     * not selected but should).
+     * @param selector  The selector to test
+     * @param expected  The expected result
+     */
+    public void performTests(FileSelector selector, String expected) {
+        String result = selectionString(selector);
+        String diff = diff(expected, result);
+        String resolved = resolve(diff);
+        assertEquals("Differing files: " + resolved, result, expected);
+    }
+
+    /**
+     *  Checks which files are selected and shouldn't be or which
+     *  are not selected but should.
+     *  @param expected    String containing 'F's and 'T's
+     *  @param result      String containing 'F's and 'T's
+     *  @return Difference as String containing '-' (equal) and
+     *          'X' (difference).
+     */
+    public String diff(String expected, String result) {
+        int length1 = expected.length();
+        int length2 = result.length();
+        int min = (length1 > length2) ? length2 : length1;
+        StringBuffer sb = new StringBuffer();
+        for (int i=0; i<min; i++) {
+            sb.append(
+                  (expected.charAt(i) == result.charAt(i))
+                ? "-"
+                : "X"
+            );
+        }
+        return sb.toString();
+    }
+
+
+    /**
+     * Resolves a diff-String (@see diff()) against the (inherited) filenames-
+     * and files arrays.
+     * @param filelist    Diff-String
+     * @return String containing the filenames for all differing files,
+     *         separated with semicolons ';'
+     */
+    public String resolve(String filelist) {
+        StringBuffer sb = new StringBuffer();
+        int min = (filenames.length > filelist.length())
+                ? filelist.length()
+                : filenames.length;
+        for (int i=0; i<min; i++) {
+            if ('X'==filelist.charAt(i)) {
+                sb.append(filenames[i]);
+                sb.append(";");
+            }
+        }
+        return sb.toString();
+    }
+
+
+    /**
+     * <p>Creates a testbed. We avoid the dreaded "test" word so that we
+     * don't falsely identify this as a test to be run. The actual
+     * setting up of the testbed is done in the
+     * <code>src/etc/testcases/types/selectors.xml</code> build file.</p>
+     *
+     * <p>Note that the right way to call this is within a try block,
+     * with a finally clause that calls cleanupBed(). You place tests of
+     * the isSelected() method within the try block.</p>
+     */
+    protected void makeBed() {
+        tbed = new TaskdefForMakingBed("setupfiles");
+        tbed.setUp();
+        tbed.makeTestbed();
+    }
+
+    /**
+     * Cleans up the testbed by calling a target in the
+     * <code>src/etc/testcases/types/selectors.xml</code> file.
+     */
+    protected void cleanupBed() {
+        if (tbed != null) {
+           tbed.tearDown();
+            tbed = null;
+        }
+    }
+
+
+    /**
+     * <p>Creates a mirror of the testbed for use in dependency checks.</p>
+     *
+     * <p>Note that the right way to call this is within a try block,
+     * with a finally clause that calls cleanupMirror(). You place tests of
+     * the isSelected() method within the try block.</p>
+     */
+    protected void makeMirror() {
+        tbed = new TaskdefForMakingBed("mirrorfiles");
+        tbed.setUp();
+        tbed.makeMirror();
+    }
+
+    /**
+     * Cleans up the mirror testbed by calling a target in the
+     * <code>src/etc/testcases/types/selectors.xml</code> file.
+     */
+    protected void cleanupMirror() {
+        if (tbed != null) {
+            tbed.deleteMirror();
+            tbed = null;
+        }
+    }
+
+    private class TaskdefForMakingBed extends BuildFileTest {
+
+        TaskdefForMakingBed(String name) {
+            super(name);
+        }
+
+        public void setUp() {
+            configureProject("src/etc/testcases/types/selectors.xml");
+        }
+
+        public void tearDown() {
+            try {
+                super.tearDown();
+            } catch (Exception exc) {
+                // ignore
+            }
+        }
+
+        public void makeTestbed() {
+            executeTarget("setupfiles");
+        }
+
+        public void makeMirror() {
+            executeTarget("mirrorfiles");
+        }
+
+        public void deleteMirror() {
+            executeTarget("tearDown");
+        }
+    }
+
+
+
+}

http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/apache/tools/ant/types/selectors/ContainsRegexpTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/types/selectors/ContainsRegexpTest.java b/src/tests/junit/org/apache/tools/ant/types/selectors/ContainsRegexpTest.java
index 6dc8d72..4928e76 100644
--- a/src/tests/junit/org/apache/tools/ant/types/selectors/ContainsRegexpTest.java
+++ b/src/tests/junit/org/apache/tools/ant/types/selectors/ContainsRegexpTest.java
@@ -1,56 +1,55 @@
-/*
- *  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.
- *
- */
-
-package org.apache.tools.ant.types.selectors;
-
-import java.io.File;
-
-import org.apache.tools.ant.BuildFileRule;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-
-
-public class ContainsRegexpTest {
-
-    @Rule
-    public BuildFileRule buildRule = new BuildFileRule();
-
-    @Before
-    public void setUp() {
-        buildRule.configureProject("src/etc/testcases/types/selectors.xml");
-    }
-
-    @Test
-    public void testContainsRegexp() {
-        buildRule.executeTarget("containsregexp");
-        File dir = new File(buildRule.getOutputDir(), "regexpseltestdest");
-        File[] files = dir.listFiles();
-        int filecount = files.length;
-
-        if (filecount != 1)  {
-            assertEquals("ContainsRegexp test should have copied 1 file",
-                         1, files.length);
-
-        }
-    }
-
-}
-
+/*
+ *  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.
+ *
+ */
+
+package org.apache.tools.ant.types.selectors;
+
+import java.io.File;
+
+import org.apache.tools.ant.BuildFileRule;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+
+public class ContainsRegexpTest {
+
+    @Rule
+    public BuildFileRule buildRule = new BuildFileRule();
+
+    @Before
+    public void setUp() {
+        buildRule.configureProject("src/etc/testcases/types/selectors.xml");
+    }
+
+    @Test
+    public void testContainsRegexp() {
+        buildRule.executeTarget("containsregexp");
+        File dir = new File(buildRule.getOutputDir(), "regexpseltestdest");
+        File[] files = dir.listFiles();
+        int filecount = files.length;
+
+        if (filecount != 1)  {
+            assertEquals("ContainsRegexp test should have copied 1 file",
+                         1, files.length);
+
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/apache/tools/ant/types/selectors/ContainsSelectorTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/types/selectors/ContainsSelectorTest.java b/src/tests/junit/org/apache/tools/ant/types/selectors/ContainsSelectorTest.java
index 822bf3e..e964e84 100644
--- a/src/tests/junit/org/apache/tools/ant/types/selectors/ContainsSelectorTest.java
+++ b/src/tests/junit/org/apache/tools/ant/types/selectors/ContainsSelectorTest.java
@@ -1,114 +1,114 @@
-/*
- *  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.
- *
- */
-
-package org.apache.tools.ant.types.selectors;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.Parameter;
-import org.junit.Rule;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-/**
- * Tests Contains Selectors.
- *
- */
-public class ContainsSelectorTest {
-
-    @Rule
-    public final BaseSelectorRule selectorRule = new BaseSelectorRule();
-
-
-    /**
-     * Test the code that validates the selector.
-     */
-    @Test
-    public void testValidate() {
-        ContainsSelector s = new ContainsSelector();
-        try {
-            s.isSelected(selectorRule.getProject().getBaseDir(),selectorRule.getFilenames()[0],selectorRule.getFiles()[0]);
-            fail("ContainsSelector did not check for required field 'text'");
-        } catch (BuildException be1) {
-            assertEquals("The text attribute is required", be1.getMessage());
-        }
-
-        s = new ContainsSelector();
-        Parameter param = new Parameter();
-        param.setName("garbage in");
-        param.setValue("garbage out");
-        Parameter[] params = {param};
-        s.setParameters(params);
-        try {
-            s.isSelected(selectorRule.getProject().getBaseDir(),selectorRule.getFilenames()[0],selectorRule.getFiles()[0]);
-            fail("ContainsSelector did not check for valid parameter element");
-        } catch (BuildException be2) {
-            assertEquals("Invalid parameter garbage in", be2.getMessage());
-        }
-
-    }
-
-    /**
-     * Tests to make sure that the selector is selecting files correctly.
-     */
-    @Test
-    public void testSelectionBehaviour() {
-        ContainsSelector s;
-        String results;
-
-
-        s = new ContainsSelector();
-        s.setText("no such string in test files");
-        results = selectorRule.selectionString(s);
-        assertEquals("TFFFFFFFFFFT", results);
-
-        s = new ContainsSelector();
-        s.setText("Apache Ant");
-        results = selectorRule.selectionString(s);
-        assertEquals("TFFFTFFFFFFT", results);
-
-        s = new ContainsSelector();
-        s.setText("apache ant");
-        s.setCasesensitive(true);
-        results = selectorRule.selectionString(s);
-        assertEquals("TFFFFFFFFFFT", results);
-
-        s = new ContainsSelector();
-        s.setText("apache ant");
-        s.setCasesensitive(false);
-        results = selectorRule.selectionString(s);
-        assertEquals("TFFFTFFFFFFT", results);
-
-        s = new ContainsSelector();
-        s.setText("ApacheAnt");
-        s.setIgnorewhitespace(true);
-        results = selectorRule.selectionString(s);
-        assertEquals("TFFFTFFFFFFT", results);
-
-        s = new ContainsSelector();
-        s.setText("A p a c h e    A n t");
-        s.setIgnorewhitespace(true);
-        results = selectorRule.selectionString(s);
-        assertEquals("TFFFTFFFFFFT", results);
-
-        
-
-    }
-
-}
+/*
+ *  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.
+ *
+ */
+
+package org.apache.tools.ant.types.selectors;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.types.Parameter;
+import org.junit.Rule;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+/**
+ * Tests Contains Selectors.
+ *
+ */
+public class ContainsSelectorTest {
+
+    @Rule
+    public final BaseSelectorRule selectorRule = new BaseSelectorRule();
+
+
+    /**
+     * Test the code that validates the selector.
+     */
+    @Test
+    public void testValidate() {
+        ContainsSelector s = new ContainsSelector();
+        try {
+            s.isSelected(selectorRule.getProject().getBaseDir(),selectorRule.getFilenames()[0],selectorRule.getFiles()[0]);
+            fail("ContainsSelector did not check for required field 'text'");
+        } catch (BuildException be1) {
+            assertEquals("The text attribute is required", be1.getMessage());
+        }
+
+        s = new ContainsSelector();
+        Parameter param = new Parameter();
+        param.setName("garbage in");
+        param.setValue("garbage out");
+        Parameter[] params = {param};
+        s.setParameters(params);
+        try {
+            s.isSelected(selectorRule.getProject().getBaseDir(),selectorRule.getFilenames()[0],selectorRule.getFiles()[0]);
+            fail("ContainsSelector did not check for valid parameter element");
+        } catch (BuildException be2) {
+            assertEquals("Invalid parameter garbage in", be2.getMessage());
+        }
+
+    }
+
+    /**
+     * Tests to make sure that the selector is selecting files correctly.
+     */
+    @Test
+    public void testSelectionBehaviour() {
+        ContainsSelector s;
+        String results;
+
+
+        s = new ContainsSelector();
+        s.setText("no such string in test files");
+        results = selectorRule.selectionString(s);
+        assertEquals("TFFFFFFFFFFT", results);
+
+        s = new ContainsSelector();
+        s.setText("Apache Ant");
+        results = selectorRule.selectionString(s);
+        assertEquals("TFFFTFFFFFFT", results);
+
+        s = new ContainsSelector();
+        s.setText("apache ant");
+        s.setCasesensitive(true);
+        results = selectorRule.selectionString(s);
+        assertEquals("TFFFFFFFFFFT", results);
+
+        s = new ContainsSelector();
+        s.setText("apache ant");
+        s.setCasesensitive(false);
+        results = selectorRule.selectionString(s);
+        assertEquals("TFFFTFFFFFFT", results);
+
+        s = new ContainsSelector();
+        s.setText("ApacheAnt");
+        s.setIgnorewhitespace(true);
+        results = selectorRule.selectionString(s);
+        assertEquals("TFFFTFFFFFFT", results);
+
+        s = new ContainsSelector();
+        s.setText("A p a c h e    A n t");
+        s.setIgnorewhitespace(true);
+        results = selectorRule.selectionString(s);
+        assertEquals("TFFFTFFFFFFT", results);
+
+
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/ant/blob/0ed7f4ab/src/tests/junit/org/apache/tools/ant/types/selectors/DependSelectorTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/types/selectors/DependSelectorTest.java b/src/tests/junit/org/apache/tools/ant/types/selectors/DependSelectorTest.java
index 078052f..ec95878 100644
--- a/src/tests/junit/org/apache/tools/ant/types/selectors/DependSelectorTest.java
+++ b/src/tests/junit/org/apache/tools/ant/types/selectors/DependSelectorTest.java
@@ -1,185 +1,185 @@
-/*
- *  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.
- *
- */
-
-package org.apache.tools.ant.types.selectors;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.Mapper;
-import org.junit.Rule;
-import org.junit.Test;
-
-import java.io.File;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-
-/**
- * Tests Depend Selectors
- *
- */
-public class DependSelectorTest {
-
-    @Rule
-    public final BaseSelectorRule selectorRule = new BaseSelectorRule();
-
-    @Test
-    public void testValidateSingleMapper() {
-        try {
-            DependSelector s = new DependSelector();
-            s.createMapper();
-            s.createMapper();
-            fail("DependSelector allowed more than one nested mapper.");
-        } catch (BuildException be1) {
-            assertEquals("Cannot define more than one mapper",
-                    be1.getMessage());
-        }
-    }
-
-
-    @Test
-     public void testValidateRequiredFields() {
-        try {
-            DependSelector s = new DependSelector();
-            s.isSelected(selectorRule.getProject().getBaseDir(), selectorRule.getFilenames()[0], selectorRule.getFiles()[0]);
-            fail("DependSelector did not check for required fields");
-        } catch (BuildException be2) {
-            assertEquals("The targetdir attribute is required.",
-                    be2.getMessage());
-        }
-
-    }
-
-    @Test
-    public void testNoMapper() {
-        DependSelector s = new DependSelector();
-        s.setTargetdir(selectorRule.getBeddir());
-
-        String results = selectorRule.selectionString(s);
-        assertEquals("FFFFFFFFFFFF", results);
-    }
-
-    @Test
-    public void testIdentityMapper() {
-        DependSelector s = new DependSelector();
-        s.setTargetdir(selectorRule.getBeddir());
-
-        Mapper.MapperType identity = new Mapper.MapperType();
-        identity.setValue("identity");
-
-        Mapper m = s.createMapper();
-        m.setType(identity);
-
-        String results = selectorRule.selectionString(s);
-        assertEquals("FFFFFFFFFFFF", results);
-    }
-
-    @Test
-    public void testMergeMapper() {
-        DependSelector s = new DependSelector();
-        s.setTargetdir(selectorRule.getBeddir());
-
-        Mapper.MapperType merge = new Mapper.MapperType();
-        merge.setValue("merge");
-
-        Mapper m = s.createMapper();
-        m.setType(merge);
-        m.setTo("asf-logo.gif.gz");
-
-        String results = selectorRule.selectionString(s);
-        assertEquals("TFFFFTTTFFF", results.substring(0,11));
-    }
-
-    @Test
-    public void testMergeMapper2() {
-        DependSelector s = new DependSelector();
-        s.setTargetdir(selectorRule.getBeddir());
-
-        Mapper.MapperType merge = new Mapper.MapperType();
-        merge.setValue("merge");
-
-        Mapper m = s.createMapper();
-        m.setType(merge);
-        m.setTo("asf-logo.gif.bz2");
-        String results = selectorRule.selectionString(s);
-        assertEquals("TTFTTTTTTTTT", results);
-    }
-
-    @Test
-    public void testGlobMapperRelativePath() {
-        DependSelector s = new DependSelector();
-        File subdir = new File("selectortest/tar/bz2");
-        s.setTargetdir(subdir);
-
-        Mapper.MapperType glob = new Mapper.MapperType();
-        glob.setValue("glob");
-
-        Mapper m = s.createMapper();
-        m.setType(glob);
-        m.setFrom("*.bz2");
-        m.setTo("*.tar.bz2");
-
-        String results = selectorRule.selectionString(s);
-        assertEquals("FFTFFFFFFTTF", results);
-    }
-
-    @Test
-    public void testRestrictedGlobMapper() {
-        DependSelector s = new DependSelector();
-        File subdir = new File(selectorRule.getBeddir(), "tar/bz2");
-        s.setTargetdir(subdir);
-
-        Mapper.MapperType glob = new Mapper.MapperType();
-        glob.setValue("glob");
-
-        Mapper m = s.createMapper();
-        m.setType(glob);
-        m.setFrom("*.bz2");
-        m.setTo("*.tar.bz2");
-        String results = selectorRule.selectionString(s);
-        assertEquals("FFFFFFFFFTTF", results);
-    }
-
-    @Test
-    public void testSelectionNoMapper() {
-        DependSelector s = new DependSelector();
-        s.setTargetdir(new File(selectorRule.getOutputDir(), "selectortest2"));
-        String results = selectorRule.selectionString(s);
-        assertEquals("FFFTTFFFFFFF", results);
-    }
-
-
-    @Test
-    public void testMirroredSelection() {
-        DependSelector s = new DependSelector();
-        s.setTargetdir(new File(selectorRule.getOutputDir(), "selectortest2/tar/bz2"));
-
-        Mapper.MapperType glob = new Mapper.MapperType();
-        glob.setValue("glob");
-
-        Mapper m = s.createMapper();
-        m.setType(glob);
-        m.setFrom("*.bz2");
-        m.setTo("*.tar.bz2");
-        String results = selectorRule.mirrorSelectionString(s);
-        assertEquals("FFFFFFFFFTTF", results);
-        results = selectorRule.selectionString(s);
-        assertEquals("FFFFFFFFFTTF", results);
-    }
-
-}
+/*
+ *  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.
+ *
+ */
+
+package org.apache.tools.ant.types.selectors;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.types.Mapper;
+import org.junit.Rule;
+import org.junit.Test;
+
+import java.io.File;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+
+/**
+ * Tests Depend Selectors
+ *
+ */
+public class DependSelectorTest {
+
+    @Rule
+    public final BaseSelectorRule selectorRule = new BaseSelectorRule();
+
+    @Test
+    public void testValidateSingleMapper() {
+        try {
+            DependSelector s = new DependSelector();
+            s.createMapper();
+            s.createMapper();
+            fail("DependSelector allowed more than one nested mapper.");
+        } catch (BuildException be1) {
+            assertEquals("Cannot define more than one mapper",
+                    be1.getMessage());
+        }
+    }
+
+
+    @Test
+     public void testValidateRequiredFields() {
+        try {
+            DependSelector s = new DependSelector();
+            s.isSelected(selectorRule.getProject().getBaseDir(), selectorRule.getFilenames()[0], selectorRule.getFiles()[0]);
+            fail("DependSelector did not check for required fields");
+        } catch (BuildException be2) {
+            assertEquals("The targetdir attribute is required.",
+                    be2.getMessage());
+        }
+
+    }
+
+    @Test
+    public void testNoMapper() {
+        DependSelector s = new DependSelector();
+        s.setTargetdir(selectorRule.getBeddir());
+
+        String results = selectorRule.selectionString(s);
+        assertEquals("FFFFFFFFFFFF", results);
+    }
+
+    @Test
+    public void testIdentityMapper() {
+        DependSelector s = new DependSelector();
+        s.setTargetdir(selectorRule.getBeddir());
+
+        Mapper.MapperType identity = new Mapper.MapperType();
+        identity.setValue("identity");
+
+        Mapper m = s.createMapper();
+        m.setType(identity);
+
+        String results = selectorRule.selectionString(s);
+        assertEquals("FFFFFFFFFFFF", results);
+    }
+
+    @Test
+    public void testMergeMapper() {
+        DependSelector s = new DependSelector();
+        s.setTargetdir(selectorRule.getBeddir());
+
+        Mapper.MapperType merge = new Mapper.MapperType();
+        merge.setValue("merge");
+
+        Mapper m = s.createMapper();
+        m.setType(merge);
+        m.setTo("asf-logo.gif.gz");
+
+        String results = selectorRule.selectionString(s);
+        assertEquals("TFFFFTTTFFF", results.substring(0,11));
+    }
+
+    @Test
+    public void testMergeMapper2() {
+        DependSelector s = new DependSelector();
+        s.setTargetdir(selectorRule.getBeddir());
+
+        Mapper.MapperType merge = new Mapper.MapperType();
+        merge.setValue("merge");
+
+        Mapper m = s.createMapper();
+        m.setType(merge);
+        m.setTo("asf-logo.gif.bz2");
+        String results = selectorRule.selectionString(s);
+        assertEquals("TTFTTTTTTTTT", results);
+    }
+
+    @Test
+    public void testGlobMapperRelativePath() {
+        DependSelector s = new DependSelector();
+        File subdir = new File("selectortest/tar/bz2");
+        s.setTargetdir(subdir);
+
+        Mapper.MapperType glob = new Mapper.MapperType();
+        glob.setValue("glob");
+
+        Mapper m = s.createMapper();
+        m.setType(glob);
+        m.setFrom("*.bz2");
+        m.setTo("*.tar.bz2");
+
+        String results = selectorRule.selectionString(s);
+        assertEquals("FFTFFFFFFTTF", results);
+    }
+
+    @Test
+    public void testRestrictedGlobMapper() {
+        DependSelector s = new DependSelector();
+        File subdir = new File(selectorRule.getBeddir(), "tar/bz2");
+        s.setTargetdir(subdir);
+
+        Mapper.MapperType glob = new Mapper.MapperType();
+        glob.setValue("glob");
+
+        Mapper m = s.createMapper();
+        m.setType(glob);
+        m.setFrom("*.bz2");
+        m.setTo("*.tar.bz2");
+        String results = selectorRule.selectionString(s);
+        assertEquals("FFFFFFFFFTTF", results);
+    }
+
+    @Test
+    public void testSelectionNoMapper() {
+        DependSelector s = new DependSelector();
+        s.setTargetdir(new File(selectorRule.getOutputDir(), "selectortest2"));
+        String results = selectorRule.selectionString(s);
+        assertEquals("FFFTTFFFFFFF", results);
+    }
+
+
+    @Test
+    public void testMirroredSelection() {
+        DependSelector s = new DependSelector();
+        s.setTargetdir(new File(selectorRule.getOutputDir(), "selectortest2/tar/bz2"));
+
+        Mapper.MapperType glob = new Mapper.MapperType();
+        glob.setValue("glob");
+
+        Mapper m = s.createMapper();
+        m.setType(glob);
+        m.setFrom("*.bz2");
+        m.setTo("*.tar.bz2");
+        String results = selectorRule.mirrorSelectionString(s);
+        assertEquals("FFFFFFFFFTTF", results);
+        results = selectorRule.selectionString(s);
+        assertEquals("FFFFFFFFFTTF", results);
+    }
+
+}


Mime
View raw message