void testNoJarNoClassname(){ expectBuildExceptionContaining("testNoJarNoClassname", "parameter validation", "Classname must not be null."); } public 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");
void testContainsIncomplete1() { expectSpecificBuildException("contains-incomplete1", "Missing contains attribute", "both string and substring are required in contains"); } public void testContainsIncomplete2() { expectSpecificBuildException("contains-incomplete2", "Missing contains attribute", "both string and substring are required in contains"); } public void testIstrue() { expectPropertySet("istrue","istrue");
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/JavaTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/ConditionTest.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void testNoJarNoClassname(){
1
void testContainsIncomplete1() {
2
        expectBuildExceptionContaining("testNoJarNoClassname",
2
        expectSpecificBuildException("contain
3
            "parameter validation",
4
            "Classname must not be null.
3
s-incomplete1",
4
                    "Missing contains attribute",
5
");
5
                    "both string and substring are required in contains");
6
    }
6
    }
7
    public void testJarNoFork() {
7
    public void testContainsIncomplete2() {
8
        expectBuildExceptionContaining("testJarNoFork",
8
        expectSpecificBuildException("contain
9
            "parameter validation",
10
            "Cannot execute a jar in non-forked mode. "
9
s-incomplete2",
10
                    "Missing contains attribute",
11
                + "Please set fork='true'. ");
11
                    "both string and substring are required in contains");
12
    }
12
    }
13
    public void testJarAndClassName() {
13
    public void testIstrue() {
14
        expectBuildException("testJarAndClassName",
14
        expect
15
            "Should not be able to set both classname AND jar");
15
PropertySet("istrue","istrue");
16
    
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