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