void testRunAdapterError() { expectBuildExceptionContaining( "runadaptererror", "xx", "No public run() method in"); } public void testDelay() { expectLogContaining("delay", "MyTask called"); } public void testOnErrorReport() { expectLogContaining("onerror.report", "MyTaskNotPresent cannot be found");
void testJarNoFork() { expectBuildExceptionContaining("testJarNoFork", "parameter validation", "Cannot execute a jar in non-forked mode. " + "Please set fork='true'. "); } public void testJarAndClassName() { expectBuildException("testJarAndClassName", "Should not be able to set both classname AND jar"); } public void testClassnameAndJar() { expectBuildException("testClassnameAndJar", "Should not be able to set both classname AND jar");
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/TypeAdapterTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/JavaTest.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void testRunAdapterError() {
1
void testJarNoFork() {
2
        expectBuildExceptionContaining(
2
        expectBuildExceptionContaining(
3
            "runadaptererror", "xx", "No public run() method in
3
"testJarNoFork",
4
            "parameter validation",
5
            "Cannot execute a jar in non-forked mode. "
4
");
6
                + "Please set fork='true'. ");
5
    }
7
    }
6
    public void testDelay() {
8
    public void testJarAndClassName() {
7
        expectLogContaining("delay", "MyTask called
9
        expectBuildException("testJarAndClassName",
8
");
10
            "Should not be able to set both classname AND jar");
9
    }
11
    }
10
    public void testOnErrorReport() {
12
    public void testClassnameAndJar() {
11
        expectLogContaining("onerror.report",
13
        expect
12
                            "MyTaskNotPresent cannot be found
14
BuildException("testClassnameAndJar",
13
");
15
            "Should not be able to set both classname AND jar");
14
    
16
    
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