(true); sosGet.setNoCompress(false); sosGet.setVerbose(false); sosGet.setRecursive(true); commandline = sosGet.buildCmdLine(); checkCommandLines(sTestCmdLine, commandline.getCommandline()); } /** Tests SOSGet required attributes. */ public void testGetExceptions() { configureProject("src/etc/testcases/taskdefs/optional/sos/sos.xml"); expectSpecificBuildException("sosget.1", "some cause", "sosserverpath attribute must be set!"); expectSpecificBuildException("sosget.2", "some cause", "username attribute must be set!"); expectSpecificBuildException("sosget.3", "some cause", "vssserverpath attribute must be set!"); expectSpecificBuildException("sosget.4", "some cause", "projectpath attribute must be set!"); } /** Test CheckInFile option flags */ public 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.setPasswor
(true); sosCheckout.setNoCompress(false); sosCheckout.setVerbose(false); sosCheckout.setRecursive(true); commandline = sosCheckout.buildCmdLine(); checkCommandLines(sTestCmdLine, commandline.getCommandline()); } /** Test SOSCheckout required attributes. */ public void testCheckoutExceptions() { configureProject("src/etc/testcases/taskdefs/optional/sos/sos.xml"); expectSpecificBuildException("soscheckout.1", "some cause", "sosserverpath attribute must be set!"); expectSpecificBuildException("soscheckout.2", "some cause", "username attribute must be set!"); expectSpecificBuildException("soscheckout.3", "some cause", "vssserverpath attribute must be set!"); expectSpecificBuildException("soscheckout.4", "some cause", "projectpath attribute must be set!"); } /** Test Label option flags */ public void testLabelFlags() { String[] sTestCmdLine = {"soscmd", "-command", "AddLabel", "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME, "-password", "", "-database", VSS_SERVER_PATH, "-project", DS_VSS_PROJECT_PATH, "-label", SRC_LABEL, "-verbose", "-log", SRC_COMMENT}; // Set up a sosCheckout task SOSLabel sosLabel = new SOSLabel(); sosLabel.setVssServerPath(VSS_SERVER_PATH); sosLabel.setSosServerPath(SOS_SERVER_PATH); sosLabel.setProjectPath(DS_VSS_PROJECT_PATH); sosLabel.setUsername(SOS_USERNAME); sosLabel.setSosHome(SOS_HOME); sosLabel.setComment(SRC_COMMENT); sosLabel.setLabel(SRC_LABEL); sosLabel.setNoCach
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
(true);
1
(true);
2
        sosGet.setNoCompress(false);
2
        sosCheckout.setNoCompress(false);
3
        sosGet.setVerbose(false);
3
        sosCheckout.setVerbose(false);
4
        sosGet.setRecursive(true);
4
        sosCheckout.setRecursive(true);
5
        commandline = sosGet.buildCmdLine();
5
        commandline = sosCheckout.buildCmdLine();
6
        checkCommandLines(sTestCmdLine, commandline.getCommandline());
6
        checkCommandLines(sTestCmdLine, commandline.getCommandline());
7
    }
7
    }
8
    /**  Tests SOSGet required attributes.  */
8
    /**  Test SOSCheckout required attributes.  */
9
    public void testGetExceptions() {
9
    public void testCheckoutExceptions() {
10
        configureProject("src/etc/testcases/taskdefs/optional/sos/sos.xml");
10
        configureProject("src/etc/testcases/taskdefs/optional/sos/sos.xml");
11
        expectSpecificBuildException("sosget.1", "some cause", "sosserverpath attribute must be set!");
11
        expectSpecificBuildException("soscheckout.1", "some cause", "sosserverpath attribute must be set!");
12
        expectSpecificBuildException("sosget.2", "some cause", "username attribute must be set!");
12
        expectSpecificBuildException("soscheckout.2", "some cause", "username attribute must be set!");
13
        expectSpecificBuildException("sosget.3", "some cause", "vssserverpath attribute must be set!");
13
        expectSpecificBuildException("soscheckout.3", "some cause", "vssserverpath attribute must be set!");
14
        expectSpecificBuildException("sosget.4", "some cause", "projectpath attribute must be set!");
14
        expectSpecificBuildException("soscheckout.4", "some cause", "projectpath attribute must be set!");
15
    }
15
    }
16
    /**  Test CheckInFile option flags  */
16
    /**  Test Label option flags  */
17
    public void testCheckinFileFlags() {
17
    public void testLabelFlags() {
18
        String[] sTestCmdLine = {"soscmd", "-command", "CheckInFile", "-file",
18
        String[] sTestCmdLine = {"soscmd", "-command", "
19
                SRC_FILE, "-server",
19
AddLabel", "-server",
20
 SOS_SERVER_PATH, "-name", SOS_USERNAME,
20
                SOS_SERVER_PATH, "-name", SOS_USERNAME,
21
                "-password", SOS_PASSWORD, "-database",
21
 "-password", "", "-database",
22
 VSS_SERVER_PATH, "-project",
22
                VSS_SERVER_PATH, "-project",
23
                DS_VSS_PROJECT_PATH, "-verbose", "-nocompress", "-nocache",
23
 DS_VSS_PROJECT_PATH, "-
24
                "-workdir", project.getBaseDir().getAbsolutePath() + File.separator
25
                 + LOCAL_PATH
24
label",
26
, "-log", SRC_COMMENT};
25
                SRC_LABEL, "-verbose", "-log", SRC_COMMENT};
27
        // Set up a SOSCheckin task
26
        // Set up a sosCheckout task
28
        SOSCheckin sosCheckin = new SOSCheckin();
27
        SOSLabel sosLabel = new SOSLabel();
29
        sosCheckin.setProject(project);
28
        sos
30
        sosCheckin.setVssServerPath(VSS_SERVER_PATH);
29
Label.setVssServerPath(VSS_SERVER_PATH);
31
        sosCheckin.setSosServerPath(SOS_SERVER_PATH);
30
        sosLabel.setSosServerPath(SOS_SERVER_PATH);
32
        sosCheckin.setProjectPath(VSS_PROJECT_PATH);
31
        sosLabel.setProjectPath(DS_VSS_PROJECT_PATH);
33
        sosCheckin.setFile(SRC_FIL
32
        sosLabel.setUsername(SOS_USERNAME);
34
E);
33
        sosLabel.setSosHome(SOS_HOME);
35
        sosCheckin.setComment(SRC_COMMENT);
34
        sosLabel.setComment(SRC_COMMENT);
36
        sosCheckin.setUsername(SOS_USERNAME);
35
        sos
37
        sosCheckin.setPasswor
36
Label.setLabel(SRC_LABEL);
37
        sosLabel.setNoCach
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