void testMapperNoDest() { expectBuildExceptionContaining("testMapperNoDest", "two mappers", SignJar.ERROR_MAPPER_WITHOUT_DEST); } public void testTwoMappers() { expectBuildExceptionContaining("testTwoMappers", "two mappers", SignJar.ERROR_TOO_MANY_MAPPERS); } public void testNoAlias() { expectBuildExceptionContaining("testNoAlias", "no alias", SignJar.ERROR_NO_ALIAS); } public void testNoFiles() { expectBuildExceptionContaining("testNoFiles", "no files", SignJar.ERROR_NO_SOURCE);
void testNoEmptySchemaLocation() throws Exception { expectBuildExceptionContaining("testNoEmptySchemaLocation", "empty schema location", SchemaValidate.SchemaLocation.ERROR_NO_LOCATION); } public void testNoFile() throws Exception { expectBuildExceptionContaining("testNoFile", "no file at file attribute", SchemaValidate.SchemaLocation.ERROR_NO_FILE); } public void testNoDoubleSchemaLocation() throws Exception { expectBuildExceptionContaining("testNoDoubleSchemaLocation", "two locations for schemas", SchemaValidate.SchemaLocation.ERROR_TWO_LOCATIONS); } public void testNoDuplicateSchema() throws Exception { expectBuildExceptionContaining("testNoDuplicateSchema", "duplicate schemas with different values", SchemaValidate.ERROR_DUPLICATE_SCHEMA);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/SignJarTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/SchemaValidateTest.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void testMapperNoDest() {
1
void testNoEmptySchemaLocation() throws Exception {
2
        expectBuildExceptionContaining("testMapperNoDest",
2
        expectBuildExceptionContaining("test
3
                "two mappers",
4
                SignJar.ERROR_MAPPER_WITHOUT_DEST
3
NoEmptySchemaLocation",
4
                "empty schema location",
5
);
5
                SchemaValidate.SchemaLocation.ERROR_NO_LOCATION);
6
    }
6
    }
7
    public void testTwoMappers() {
7
    public void testNoFile() throws Exception {
8
        expectBuildExceptionContaining("testTwoMappers",
8
        expectBuildExceptionContaining("testNoFile",
9
                "two mappers",
9
                "
10
                SignJar.ERROR_TOO_MANY_MAPPERS);
11
    }
12
    public void testNoAlias()
10
no file at file attribute",
11
                SchemaValidate.SchemaLocation.ERROR_NO_FILE);
12
    }
13
 {
13
    public void testNoDoubleSchemaLocation() throws Exception {
14
        expectBuildExceptionContaining("testNoAlias",
14
        expectBuildExceptionContaining("testNo
15
                "no alias",
16
                SignJar.ERROR_NO_ALIA
15
DoubleSchemaLocation",
16
                "two locations for schemas",
17
S);
17
                SchemaValidate.SchemaLocation.ERROR_TWO_LOCATIONS);
18
    }
18
    }
19
    public void testNoFiles() {
19
    public void testNoDuplicateSchema() throws Exception {
20
        expectBuildExceptionContaining("testNoFiles",
20
        expectBuildExceptionContaining("testNoDuplicateSchema",
21
                "no files",
21
                "
22
                SignJar.ERROR_NO_SOURCE
22
duplicate schemas with different values",
23
);
23
                SchemaValidate.ERROR_DUPLICATE_SCHEMA);
24
    
24
    
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