void testDestDirFileset() { executeTarget("testDestDirFileset"); } public void testMapperFileset() { executeTarget("testMapperFileset"); } public void testDestDirPath() { executeTarget("testDestDirPath"); } public void testMapperPath() { executeTarget("testMapperPath"); } public 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); } public void testNoStorePass() { expectBuildExceptionContaining("testNoStorePass", "no password", SignJar.ERROR_NO_STOREPASS);
void testLocalhost() throws Exception { executeTarget("testLocalhost"); } public void testLocalhostURL() throws Exception { executeTarget("testLocalhostURL"); } public void testIpv4localhost() throws Exception { executeTarget("testIpv4localhost"); } public void testFTPURL() throws Exception { executeTarget("testFTPURL"); } public void testBoth() throws Exception { expectBuildExceptionContaining("testBoth", "error on two targets", IsReachable.ERROR_BOTH_TARGETS); } public void testNoTargets() throws Exception { expectBuildExceptionContaining("testNoTargets", "no params", IsReachable.ERROR_NO_HOSTNAME); } public void testBadTimeout() throws Exception { expectBuildExceptionContaining("testBadTimeout", "error on -ve timeout", IsReachable.ERROR_BAD_TIMEOUT); } public void NotestFile() throws Exception { expectBuildExceptionContaining("testFile", "error on file URL", IsReachable.ERROR_NO_HOST_IN_URL); } public void testBadURL() throws Exception { expectBuildExceptionContaining("testBadURL", "error in URL", IsReachable.ERROR_BAD_URL);
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/condition/IsReachableTest.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void testDestDirFileset() {
1
void testLocalhost() throws Exception {
2
        executeTarget("testDestDirFileset");
2
        executeTarget("testLocalhost");
3
    }
3
    }
4
    public void testMapperFileset() {
4
    public void testLocalhostURL() throws Exception {
5
        executeTarget("testMapperFileset");
5
        executeTarget("testLocalhostURL");
6
    }
6
    }
7
    public void testDestDirPath() {
7
    public void testIpv4localhost() throws Exception {
8
        executeTarget("testDestDirPath");
8
        executeTarget("testIpv4localhost");
9
    }
9
    }
10
    public void testMapperPath() {
10
    public void testFTPURL() throws Exception {
11
        executeTarget("testMapperPath");
11
        executeTarget("testFTPURL");
12
    }
12
    }
13
    public void testMapperNoDest() {
13
    public void testBoth() throws Exception {
14
        expectBuildExceptionContaining("testMapperNoDest",
14
        expectBuildExceptionContaining("testBoth",
15
                "two mappers",
15
                "error on two targets",
16
                SignJar.ERROR_MAPPER_WITHOUT_DEST);
16
                IsReachable.ERROR_BOTH_TARGETS);
17
    }
17
    }
18
    public void testTwoMappers() {
18
    public void testNoTargets() throws Exception {
19
        expectBuildExceptionContaining("testTwoMappers",
19
        expectBuildExceptionContaining("testNoTargets",
20
                "two mappers",
20
                "no params",
21
                SignJar.ERROR_TOO_MANY_MAPPERS);
21
                
22
    }
23
    public void testNoAlias()
22
IsReachable.ERROR_NO_HOSTNAME);
23
    }
24
 {
24
    public void testBadTimeout() throws Exception {
25
        expectBuildExceptionContaining("testNoAlias",
25
        expectBuildExceptionContaining("testBadTimeout",
26
                "no alias",
26
                "error on -ve timeout",
27
                SignJar.ERROR_NO_ALIAS);
27
                IsReachable.ERROR_BAD_TIMEOUT);
28
    }
28
    }
29
    public void testNoFiles() {
29
    public void NotestFile() throws Exception {
30
        expectBuildExceptionContaining("testNoFiles",
30
        expectBuildExceptionContaining("testFile",
31
                "no files",
31
                "error on file URL",
32
                SignJar.ERROR_NO_SOURCE);
32
                IsReachable.ERROR_NO_HOST_IN_URL);
33
    }
33
    }
34
    public void testNoStorePass() {
34
    public void testBadURL() throws Exception {
35
        expectBuildExceptionContaining("testNoStorePass",
35
        expectBuildExceptionContaining("testBadURL",
36
                "no password",
36
                "error in URL",
37
                SignJar.ERROR_NO_STOREPASS);
37
                IsReachable.ERROR_BAD_URL);
38
    
38
    
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