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