File path: /columba-1.4-src/calendar/src/test/java/org/columba/calendar/store/LocalCalendarStoreTest.java | File path: /columba-1.4-src/calendar/src/test/java/org/columba/calendar/store/LocalXMLFileStoreTest.java | |||
Method name: void testRemove()
|
Method name: void testRemove()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | storage.remove(uuid);↵ | 1 | storage.remove(uuid);↵ | |
2 | try {↵ | 2 | try {↵ | |
3 | IComponentInfo result = storage.get(uuid);↵ | 3 | Document result = storage.load(uuid);↵ | |
4 | } catch (StoreException e) {↵ | 4 | } catch (StoreException e) {↵ | |
5 | // that is the expected case↵ | 5 | // this is the expected cases↵ | |
6 | return;↵ | 6 | return;↵ | |
7 | } catch (Exception e) {↵ | 7 | } catch (Exception e) {↵ | |
8 | fail("Expected a StoreException, not " + e.getMessage());↵ | 8 | fail("Expected StoreException, not " + e.getMessage());↵ | |
9 | }↵ | 9 | }↵ | |
10 | ↵ | |||
11 | fail("Expected a StoreException"); | 10 | fail("Expected StoreException, got no exception"); | |
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.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 8 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | storage.remove(uuid); |
| 4 | storage.remove(uuid); | |||||||||||
8 | try |
| 5 | try | |||||||||||
|
| 6 | Document result = storage.load(uuid); | ||||||||||||
9 | IComponentInfo result = storage.get(uuid); |
| | ||||||||||||
10 | fail("Expected a StoreException"); |
| 7 | fail("Expected StoreException, got no exception"); |
Row | Violation |
---|---|
1 | Type org.columba.calendar.store.LocalCalendarStore of variable storage does not match with type org.columba.calendar.store.LocalXMLFileStore of variable storage |
2 | Unmatched statement Document result=storage.load(uuid); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
3 | Unmatched statement IComponentInfo result=storage.get(uuid); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |