File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/selectors/BaseSelectorTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/selectors/DateSelectorTest.java | |||
Method name: void testRespondsToError()
|
Method name: void testValidate()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | s.setError("test error");↵ | 1 | s.setDatetime("this is not a date");↵ | |
2 | try {↵ | 2 | try {↵ | |
3 | s.isSelected(beddir,filenames[0],files[0]);↵ | 3 | s.isSelected(basedir,filenames[0],files[0]);↵ | |
4 | fail("Cannot cause BuildException when setError() is called↵ | 4 | fail("DateSelector did not check for Datetime being in a "↵ | |
5 | ");↵ | 5 | + "valid format");↵ | |
6 | } catch (BuildException be) {↵ | 6 | } catch (BuildException be3) {↵ | |
7 | assertEquals("test error",↵ | 7 | assertEquals("↵ | |
8 | ↵ | 8 | Date of this is not a date"↵ | |
9 | + " Cannot be parsed correctly. It should be in"↵ | |||
9 | be.getMessage());↵ | 10 | + " MM/DD/YYYY HH:MM AM_PM format.", be3.getMessage());↵ | |
10 | } | 11 |
| |
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.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 10 |
Number of mapped statements | 4 |
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) | 18.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | s.setError("test error"); |
| 11 | s.setDatetime("this is not a date"); | |||||||||||||||||||||
5 | try |
| 12 | try | |||||||||||||||||||||
6 | s.isSelected(beddir, filenames[0], files[0]); |
| 13 | s.isSelected(basedir, filenames[0], files[0]); | |||||||||||||||||||||
7 | fail("Cannot cause BuildException when setError() is called"); |
| 14 | fail("DateSelector did not check for Datetime being in a " + "valid format"); |
Row | Violation |
---|---|
1 | Expression s.setError("test error") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression s.setDatetime("this is not a date") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression s.setError("test error") is a void method call, and thus it cannot be parameterized |
4 | Expression s.setDatetime("this is not a date") is a void method call, and thus it cannot be parameterized |
5 | Expression s cannot be unified with expression s , because common superclass org.apache.tools.ant.types.selectors.BaseSelector does not declare member(s) public void setDatetime(java.lang.String) |