1 | /*
|
---|
2 | * Copyright 2003-2004 The Apache Software Foundation
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | *
|
---|
16 | */
|
---|
17 |
|
---|
18 | package org.apache.tools.ant.taskdefs;
|
---|
19 |
|
---|
20 | import java.lang.reflect.Method;
|
---|
21 |
|
---|
22 | import org.apache.tools.ant.BuildFileTest;
|
---|
23 | import org.apache.tools.ant.BuildException;
|
---|
24 | import org.apache.tools.ant.util.FileNameMapper;
|
---|
25 |
|
---|
26 |
|
---|
27 | /**
|
---|
28 | */
|
---|
29 | public class MultiMapTest extends BuildFileTest {
|
---|
30 |
|
---|
31 | public MultiMapTest(String name) {
|
---|
32 | super(name);
|
---|
33 | }
|
---|
34 |
|
---|
35 | public void setUp() {
|
---|
36 | configureProject("src/etc/testcases/taskdefs/multimap.xml");
|
---|
37 | }
|
---|
38 |
|
---|
39 | public void tearDown() {
|
---|
40 | executeTarget("cleanup");
|
---|
41 | }
|
---|
42 |
|
---|
43 | public void testMultiCopy() {
|
---|
44 | executeTarget("multicopy");
|
---|
45 | }
|
---|
46 |
|
---|
47 | public void testMultiMove() {
|
---|
48 | executeTarget("multimove");
|
---|
49 | }
|
---|
50 |
|
---|
51 | public void testSingleCopy() {
|
---|
52 | executeTarget("singlecopy");
|
---|
53 | }
|
---|
54 |
|
---|
55 | public void testSingleMove() {
|
---|
56 | executeTarget("singlemove");
|
---|
57 | }
|
---|
58 |
|
---|
59 | public void testCopyWithEmpty() {
|
---|
60 | executeTarget("copywithempty");
|
---|
61 | }
|
---|
62 |
|
---|
63 | public void testMoveWithEmpty() {
|
---|
64 | executeTarget("movewithempty");
|
---|
65 | }
|
---|
66 |
|
---|
67 | public static class TestMapper implements FileNameMapper {
|
---|
68 | public TestMapper() {}
|
---|
69 | public void setFrom(String from) {}
|
---|
70 | public void setTo(String to) {}
|
---|
71 | public String[] mapFileName(final String source_file_name) {
|
---|
72 | return new String[] {
|
---|
73 | source_file_name, source_file_name+".copy2" };
|
---|
74 | }
|
---|
75 | }
|
---|
76 | }
|
---|