@@ -18,6 +18,7 @@
package org.apache.tools.ant.util;
package org.apache.tools.ant.util;
import org.junit.Before;
import org.junit.Test;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertEquals;
@@ -30,9 +31,15 @@ import static org.junit.Assert.assertNull;
*/
*/
public class GlobPatternMapperTest {
public class GlobPatternMapperTest {
private GlobPatternMapper m;
@Before
public void setUp() {
m = new GlobPatternMapper();
}
@Test
@Test
public void testNoPatternAtAll() {
public void testNoPatternAtAll() {
GlobPatternMapper m = new GlobPatternMapper();
m.setFrom("foobar");
m.setFrom("foobar");
m.setTo("baz");
m.setTo("baz");
assertNull("Shouldn\'t match foobar", m.mapFileName("plonk"));
assertNull("Shouldn\'t match foobar", m.mapFileName("plonk"));
@@ -44,7 +51,6 @@ public class GlobPatternMapperTest {
@Test
@Test
public void testPostfixOnly() {
public void testPostfixOnly() {
GlobPatternMapper m = new GlobPatternMapper();
m.setFrom("*foo");
m.setFrom("*foo");
m.setTo("*plonk");
m.setTo("*plonk");
assertNull("Shouldn\'t match *foo", m.mapFileName("bar.baz"));
assertNull("Shouldn\'t match *foo", m.mapFileName("bar.baz"));
@@ -61,7 +67,6 @@ public class GlobPatternMapperTest {
@Test
@Test
public void testPrefixOnly() {
public void testPrefixOnly() {
GlobPatternMapper m = new GlobPatternMapper();
m.setFrom("foo*");
m.setFrom("foo*");
m.setTo("plonk*");
m.setTo("plonk*");
assertNull("Shouldn\'t match foo*", m.mapFileName("bar.baz"));
assertNull("Shouldn\'t match foo*", m.mapFileName("bar.baz"));
@@ -78,7 +83,6 @@ public class GlobPatternMapperTest {
@Test
@Test
public void testPreAndPostfix() {
public void testPreAndPostfix() {
GlobPatternMapper m = new GlobPatternMapper();
m.setFrom("foo*bar");
m.setFrom("foo*bar");
m.setTo("plonk*pling");
m.setTo("plonk*pling");
assertNull("Shouldn\'t match foo*bar", m.mapFileName("bar.baz"));
assertNull("Shouldn\'t match foo*bar", m.mapFileName("bar.baz"));