void test4() { executeTarget("test4"); } public void test5() { // should print "panic: Cannot find importVocab file 'JavaTokenTypes.txt'" // since it needs to run java.g first before java.tree.g expectBuildException("test5", "ANTLR returned: 1"); } public void test6() { executeTarget("test6"); } public void test7() { expectBuildException("test7", "Unable to determine generated class"); }
void testIso2022Jp() { executeTarget("testIso2022Jp"); } /** * utf-8.xml is invalid as it contains non-UTF-8 characters, but * would pass on systems with a native iso-8859-1 (or similar) * encoding. * * Bug 11279 */ public void testUtf8() { expectBuildException("testUtf8", "invalid characters in file"); } // Tests property element, using XML schema properties as an example. public void testPropertySchemaForValidXML() { executeTarget("testProperty.validXML"); } public void testPropertySchemaForInvalidXML() { expectBuildException( "testProperty.invalidXML", "XML file does not satisfy schema."); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/ANTLRTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/XmlValidateTest.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void test4() {
1
void testIso2022Jp() {
2
        executeTarget("test4");
2
        executeTarget("testIso2022Jp");
3
    }
3
    }
4
    public void test5() {
4
    
5
        // should print "panic: Cannot find importVocab file 'JavaTokenTypes.txt'"
6
        // since it needs to run java.g first before java.tree.g
7
        expectBuildException("test5", "ANTLR returned: 1");
8
    }
9
    public void test6
5
/**
6
     * utf-8.xml is invalid as it contains non-UTF-8 characters, but
7
     * would pass on systems with a native iso-8859-1 (or similar)
8
     * encoding.
9
     *
10
     * Bug 11279
11
     */
12
    public void testUtf8() {
13
        expectBuildException("testUtf8", "invalid characters in file");
14
    }
15
    // Tests property element, using XML schema properties as an example.
10
() {
16
    public void testPropertySchemaForValidXML() {
11
        executeTarget("test6");
17
        executeTarget("testProperty.validXML");
12
    }
18
    }
13
    public void test7() {
19
    public void testPropertySchemaForInvalidXML() {
14
        expectBuildException("test7", "Unable to determine generated class
20
        expectBuildException(
21
            "testProperty.invalidXML",
15
");
22
            "XML file does not satisfy schema.");
16
    }
23
    }
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0