File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/vss/MSVSSTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/vss/MSVSSTest.java | |||
Method name: void testHistoryCommandLine2()
|
Method name: void testCheckinCommandLine()
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
1 | String[] sTestCmdLine = {MSVSS.SS_EXE, MSVSS.COMMAND_HISTORY, DS_VSS_PROJECT_PATH,↵ | 1 | String[] sTestCmdLine = {MSVSS.SS_EXE, MSVSS.COMMAND_CHECKIN, DS_VSS_PROJECT_PATH,↵ | |
2 | MSVSS.FLAG_AUTORESPONSE_DEF, MSVSS.FLAG_VERSION_DATE + DATE + MSVSS.VALUE_FROMDATE↵ | 2 | MSVSS.FLAG_AUTORESPONSE_NO, MSVSS.FLAG_WRITABLE, MSVSS.FLAG_LOGIN + VSS_USERNAME,↵ | |
3 | + DATE2, MSVSS.FLAG_RECURSION, MSVSS.FLAG_LOGIN + VSS_USERNAME + "," + VSS_PASSWORD};↵ | 3 | MSVSS.FLAG_COMMENT + SRC_COMMENT};↵ | |
4 | // Set up a VSSHistory task↵ | 4 | // Set up a VSSCheckIn task↵ | |
5 | MSVSSHISTORY vssHistory = new MSVSSHISTORY();↵ | 5 | MSVSSCHECKIN vssCheckin = new MSVSSCHECKIN();↵ | |
6 | vssHistory.setProject(project);↵ | 6 | vssCheckin.setProject(project);↵ | |
7 | vssHistory.setLogin(VSS_USERNAME + "," + VSS_PASSWORD);↵ | 7 | vssCheckin.setComment(SRC_COMMENT);↵ | |
8 | vssHistory.setFromDate(DATE2);↵ | 8 | vssCheckin.setLogin(VSS_USERNAME);↵ | |
9 | vssHistory.setToDate(DATE);↵ | 9 | vssCheckin.setAutoresponse("N");↵ | |
10 | vssHistory.setVsspath(VSS_PROJECT_PATH);↵ | 10 | vssCheckin.setVsspath(VSS_PROJECT_PATH);↵ | |
11 | vssHistory.setRecursive(true);↵ | 11 | vssCheckin.setWritable(true);↵ | |
12 | commandline = vssHistory.buildCmdLine();↵ | 12 | commandline = vssCheckin.buildCmdLine();↵ | |
13 | checkCommandLines(sTestCmdLine, commandline.getCommandline()); | 13 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 61 |
Number of mapped statements | 10 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | String[] sTestCmdLine = {MSVSS.SS_EXE, MSVSS.COMMAND_HISTORY, DS_VSS_PROJECT_PATH, MSVSS.FLAG_AUTORESPONSE_DEF, MSVSS.FLAG_VERSION_DATE + DATE + MSVSS.VALUE_FROMDATE + DATE2, MSVSS.FLAG_RECURSION, MSVSS.FLAG_LOGIN + VSS_USERNAME + "," + VSS_PASSWORD}; |
| 1 | String[] sTestCmdLine = {MSVSS.SS_EXE, MSVSS.COMMAND_CHECKIN, DS_VSS_PROJECT_PATH, MSVSS.FLAG_AUTORESPONSE_NO, MSVSS.FLAG_WRITABLE, MSVSS.FLAG_LOGIN + VSS_USERNAME, MSVSS.FLAG_COMMENT + SRC_COMMENT}; | ||||||||||||||||||||||||||||
2 | MSVSSHISTORY vssHistory = new MSVSSHISTORY(); |
| 2 | MSVSSCHECKIN vssCheckin = new MSVSSCHECKIN(); | ||||||||||||||||||||||||||||
3 | vssHistory.setProject(project); |
| 3 | vssCheckin.setProject(project); | ||||||||||||||||||||||||||||
4 | vssHistory.setLogin(VSS_USERNAME + "," + VSS_PASSWORD); |
| 5 | vssCheckin.setLogin(VSS_USERNAME); | ||||||||||||||||||||||||||||
5 | vssHistory.setFromDate(DATE2); |
| 4 | vssCheckin.setComment(SRC_COMMENT); | ||||||||||||||||||||||||||||
6 | vssHistory.setToDate(DATE); |
| 6 | vssCheckin.setAutoresponse("N"); | ||||||||||||||||||||||||||||
7 | vssHistory.setVsspath(VSS_PROJECT_PATH); |
| 7 | vssCheckin.setVsspath(VSS_PROJECT_PATH); | ||||||||||||||||||||||||||||
8 | vssHistory.setRecursive(true); |
| 8 | vssCheckin.setWritable(true); | ||||||||||||||||||||||||||||
9 | commandline = vssHistory.buildCmdLine(); |
| 9 | commandline = vssCheckin.buildCmdLine(); | ||||||||||||||||||||||||||||
10 | checkCommandLines(sTestCmdLine, commandline.getCommandline()); | 10 | checkCommandLines(sTestCmdLine, commandline.getCommandline()); |
Row | Violation |
---|---|
1 | Expression vssHistory.setFromDate(DATE2) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression vssCheckin.setComment(SRC_COMMENT) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression vssHistory.setFromDate(DATE2) is a void method call, and thus it cannot be parameterized |
4 | Expression vssCheckin.setComment(SRC_COMMENT) is a void method call, and thus it cannot be parameterized |
5 | Expression vssHistory.setToDate(DATE) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression vssCheckin.setAutoresponse("N") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression vssHistory.setToDate(DATE) is a void method call, and thus it cannot be parameterized |
8 | Expression vssCheckin.setAutoresponse("N") is a void method call, and thus it cannot be parameterized |
9 | Expression vssHistory.setRecursive(true) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression vssCheckin.setWritable(true) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression vssHistory.setRecursive(true) is a void method call, and thus it cannot be parameterized |
12 | Expression vssCheckin.setWritable(true) is a void method call, and thus it cannot be parameterized |