01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: */
18:
19: package org.apache.tools.ant.filters;
20:
21: import java.io.File;
22: import java.io.IOException;
23:
24: import org.apache.tools.ant.BuildFileTest;
25: import org.apache.tools.ant.util.FileUtils;
26:
27: /**
28: */
29: public class StripJavaCommentsTest extends BuildFileTest {
30:
31: private static final FileUtils FILE_UTILS = FileUtils
32: .getFileUtils();
33:
34: public StripJavaCommentsTest(String name) {
35: super (name);
36: }
37:
38: public void setUp() {
39: configureProject("src/etc/testcases/filters/build.xml");
40: }
41:
42: public void tearDown() {
43: executeTarget("cleanup");
44: }
45:
46: public void testStripJavaComments() throws IOException {
47: executeTarget("testStripJavaComments");
48: File expected = FILE_UTILS.resolveFile(getProject()
49: .getBaseDir(), "expected/stripjavacomments.test");
50: File result = FILE_UTILS.resolveFile(getProject().getBaseDir(),
51: "result/stripjavacomments.test");
52: assertTrue(FILE_UTILS.contentEquals(expected, result));
53: }
54:
55: }
|