void testGetFileFlags() { String[] sTestCmdLine = {"soscmd", "-command", "GetFile", "-file", SRC_FILE, "-revision", "007", "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME, "-password", SOS_PASSWORD, "-database", VSS_SERVER_PATH, "-project", DS_VSS_PROJECT_PATH, "-verbose", "-nocompress", "-nocache", "-workdir", project.getBaseDir().getAbsolutePath() + File.separator + LOCAL_PATH}; // Set up a SOSGet task SOSGet sosGet = new SOSGet(); sosGet.setProject(project); sosGet.setVssServerPath(VSS_SERVER_PATH); sosGet.setSosServerPath(SOS_SERVER_PATH); sosGet.setProjectPath(VSS_PROJECT_PATH); sosGet.setFile(SRC_FILE); sosGet.setUsername(SOS_USERNAME); sosGet.setPassword(SOS_PASSWORD); sosGet.setVersion(VERSION); sosGet.setLocalPath(new Path(project, LOCAL_PATH)); sosGet.setNoCache(true); sosGet.setNoCompress(true); sosGet.setVerbose(true); sosGet.setRecursive(true); commandline = sosGet.buildCmdLine(); checkCommandLines(sTestCmdLine, commandline.getCommandline()); } /** Test SOSGetProject flags & commandline generation */ public void testGetProjectFlags() { String[] sTestCmdLine = {"soscmd", "-command", "GetProject", "-recursive", "-label", SRC_LABEL, "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME, "-password", "", "-database", VSS_SERVER_PATH, "-project", DS_VSS_PROJECT_PATH, "", "", "-soshome", SOS_HOME, "-workdir", project.getBaseDir().getAbsolutePath()}; // Set up a SOSGet task SOSGet sosGet = new SOSGet(); sosGet.setProject(project); sosGet.setVssServerPath(VSS_SERVER_PATH); sosGet.setSosServerPath(SOS_SERVER_PATH); sosGet.setProjectPath(DS_VSS_PROJECT_PATH); sosGet
void testCheckinFileFlags() { String[] sTestCmdLine = {"soscmd", "-command", "CheckInFile", "-file", SRC_FILE, "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME, "-password", SOS_PASSWORD, "-database", VSS_SERVER_PATH, "-project", DS_VSS_PROJECT_PATH, "-verbose", "-nocompress", "-nocache", "-workdir", project.getBaseDir().getAbsolutePath() + File.separator + LOCAL_PATH, "-log", SRC_COMMENT}; // Set up a SOSCheckin task SOSCheckin sosCheckin = new SOSCheckin(); sosCheckin.setProject(project); sosCheckin.setVssServerPath(VSS_SERVER_PATH); sosCheckin.setSosServerPath(SOS_SERVER_PATH); sosCheckin.setProjectPath(VSS_PROJECT_PATH); sosCheckin.setFile(SRC_FILE); sosCheckin.setComment(SRC_COMMENT); sosCheckin.setUsername(SOS_USERNAME); sosCheckin.setPassword(SOS_PASSWORD); sosCheckin.setLocalPath(new Path(project, LOCAL_PATH)); sosCheckin.setNoCache(true); sosCheckin.setNoCompress(true); sosCheckin.setVerbose(true); sosCheckin.setRecursive(true); commandline = sosCheckin.buildCmdLine(); checkCommandLines(sTestCmdLine, commandline.getCommandline()); } /** Test CheckInProject option flags */ public void testCheckinProjectFlags() { String[] sTestCmdLine = {"soscmd", "-command", "CheckInProject", "-recursive", "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME, "-password", "", "-database", VSS_SERVER_PATH, "-project", DS_VSS_PROJECT_PATH, "", "", "-soshome", SOS_HOME, "-workdir", project.getBaseDir().getAbsolutePath(), "-log", SRC_COMMENT,}; // Set up a SOSCheckin task SOSCheckin sosCheckin = new SOSCheckin(); sosCheckin.setProject(project); sosCheckin.setVssServerPath(VSS_SERVER_PATH); sosCheckin.setSosServerPath(SOS_SERVER_PATH); sosCheckin.setProjectPath(DS_VSS_PROJECT_PATH); sosCheckin
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/sos/SOSTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/sos/SOSTest.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void testGetFileFlags() {
1
void testCheckinFileFlags() {
2
        String[] sTestCmdLine = {"soscmd", "-command", "GetFile", "-file",
2
        String[] sTestCmdLine = {"soscmd", "-command", "CheckInFile", "-file",
3
                SRC_FILE, "-revision", "007", "-server", SOS_SERVER_PATH, "-name",
3
                SRC_FILE, "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME,
4
                SOS_USERNAME, "-password", SOS_PASSWORD, "-database", VSS_SERVER_PATH,
4
                "-password", SOS_PASSWORD, "-database", VSS_SERVER_PATH,
5
 
5
 "-project",
6
               "-project", DS_VSS_PROJECT_PATH, "-verbose", "-nocompress",
6
                DS_VSS_PROJECT_PATH, "-verbose", "-nocompress", "-nocache",
7
                "-nocache", "-workdir", project.getBaseDir().getAbsolutePath()
7
                "-workdir", project.getBaseDir().getAbsolutePath()
8
                 + File.separator + LOCAL_PATH
8
 + File.separator
9
};
9
                 + LOCAL_PATH, "-log", SRC_COMMENT};
10
        // Set up a SOSGet task
10
        // Set up a SOSCheckin task
11
        SOSGet sosGet = new SOSGet();
11
        SOSCheckin sosCheckin = new SOSCheckin();
12
        sosGet.setProject(project);
12
        sosCheckin.setProject(project);
13
        sosGet.setVssServerPath(VSS_SERVER_PATH);
13
        sosCheckin.setVssServerPath(VSS_SERVER_PATH);
14
        sosGet.setSosServerPath(SOS_SERVER_PATH);
14
        sosCheckin.setSosServerPath(SOS_SERVER_PATH);
15
        sosGet.setProjectPath(VSS_PROJECT_PATH);
15
        sosCheckin.setProjectPath(VSS_PROJECT_PATH);
16
        sosGet.setFile(SRC_FILE);
16
        sosCheckin.setFile(SRC_FILE);
17
        sosGet
17
        sosCheckin.setComment(SRC_COMMENT);
18
.setUsername(SOS_USERNAME);
18
        sosCheckin.setUsername(SOS_USERNAME);
19
        sosGet.setPassword(SOS_PASSWORD);
19
        sosCheckin.setPassword(SOS_PASSWORD);
20
        sosGet.setVersion(VERSION);
20
        sos
21
        sosGet.setLocalPath(new Path(project, LOCAL_PATH));
21
Checkin.setLocalPath(new Path(project, LOCAL_PATH));
22
        sosGet.setNoCache(true);
22
        sosCheckin.setNoCache(true);
23
        sosGet.setNoCompress(true);
23
        sosCheckin.setNoCompress(true);
24
        sosGet.setVerbose(true);
24
        sosCheckin.setVerbose(true);
25
        sosGet.setRecursive(true);
25
        sosCheckin.setRecursive(true);
26
        commandline = sosGet.buildCmdLine();
26
        commandline = sosCheckin.buildCmdLine();
27
        checkCommandLines(sTestCmdLine, commandline.getCommandline());
27
        checkCommandLines(sTestCmdLine, commandline.getCommandline());
28
    }
28
    }
29
    /**  Test SOSGetProject flags & commandline generation  */
29
    /**  Test CheckInProject option flags  */
30
    public void testGetProjectFlags() {
30
    public void testCheckinProjectFlags() {
31
        String[] sTestCmdLine = {"soscmd", "-command", "GetProject", "-recursive",
31
        String[] sTestCmdLine = {"soscmd", "-command", "CheckInProject",
32
                "-label", SRC_LABEL, "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME,
32
                "-recursive", "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME,
33
                "-password", "", "-database", VSS_SERVER_PATH, "-project",
33
                "-password", "", "-database", VSS_SERVER_PATH, "-project",
34
                DS_VSS_PROJECT_PATH, "", "", "-soshome", SOS_HOME, "-workdir",
34
                DS_VSS_PROJECT_PATH, "", "", "-soshome", SOS_HOME, "-workdir",
35
                project.getBaseDir().getAbsolutePath()};
35
                project.getBaseDir().getAbsolutePath(), "-log", SRC_COMMENT,};
36
        // Set up a SOSGet task
36
        // Set up a SOSCheckin task
37
        SOSGet sosGet = new SOSGet();
37
        SOSCheckin sosCheckin = new SOSCheckin();
38
        sosGet.setProject(project);
38
        sosCheckin.setProject(project);
39
        sosGet.setVssServerPath(VSS_SERVER_PATH);
39
        sosCheckin.setVssServerPath(VSS_SERVER_PATH);
40
        sosGet.setSosServerPath(SOS_SERVER_PATH);
40
        sosCheckin.setSosServerPath(SOS_SERVER_PATH);
41
        sosGet.setProjectPath(DS_VSS_PROJECT_PATH);
41
        sosCheckin.setProjectPath(DS_VSS_PROJECT_PATH);
42
        sosGet
42
        sosCheckin
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