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