File path: /columba-1.4-src/core/src/test/java/org/columba/core/associations/AssociationStoreCases.java | File path: /columba-1.4-src/core/src/test/java/org/columba/core/associations/AssociationStoreCases.java | |||
Method name: void testAddAssociation()
|
Method name: void testGetAssociatedItems()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | store.addAssociation("serviceId1", "metaDataId1", "itemId1");↵ | 1 | store.addAssociation("serviceId1", "metaDataId1", "itemId1");↵ | |
2 | if ((store.getAssociatedItems("serviceId1", "metaDataId1") != null)↵ | 2 | if ((store.getAssociatedItems("serviceId1", "metaDataId1") != null)↵ | |
3 | && (store.getAssociatedItems("serviceId1", "metaDataId1")↵ | 3 | && (store.getAssociatedItems("serviceId1", "metaDataId1")↵ | |
4 | .size() == 1)↵ | 4 | .size() == 1)↵ | |
5 | && ((String) (store.getAssociatedItems("serviceId1",↵ | 5 | && ((String) (store.getAssociatedItems("serviceId1",↵ | |
6 | "metaDataId1").toArray()[0])).equals("itemId1"))↵ | 6 | "metaDataId1").toArray()[0])).equals("itemId1"))↵ | |
7 | System.out.println("Correct value 'itemId1' found");↵ | 7 | System.out.println("Correct value 'itemId1' found");↵ | |
8 | else↵ | 8 | else↵ | |
9 | fail("Associated item not found "↵ | 9 | fail("Associated item not found "↵ | |
10 | + store.getAssociatedItems("serviceId1", "metaDataId1")↵ | 10 | + store.getAssociatedItems("serviceId1", "metaDataId1")↵ | |
11 | .size());↵ | 11 | .size());↵ | |
12 | /*↵ | 12 | ↵ | |
13 | * for (IAssociation association: store.getAllAssociations("itemId1")) {↵ | |||
14 | * System.out.println(association.getItemId() +↵ | |||
15 | * association.getMetaDataId() + association.getServiceId()); }↵ | |||
16 | */↵ | |||
17 | store.removeAssociation("serviceId1", "metaDataId1", "itemId1"); | 13 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.7 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 13 |
Number of mapped statements | 5 |
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) | 1.2 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
1 | store.addAssociation("serviceId1", "metaDataId1", "itemId1"); | 1 | store.addAssociation("serviceId1", "metaDataId1", "itemId1"); | |
2 | if ((store.getAssociatedItems("serviceId1", "metaDataId1") != null) && (store.getAssociatedItems("serviceId1", "metaDataId1").size() == 1) && ((String)(store.getAssociatedItems("serviceId1", "metaDataId1").toArray()[0])).equals("itemId1")) | 2 | if ((store.getAssociatedItems("serviceId1", "metaDataId1") != null) && (store.getAssociatedItems("serviceId1", "metaDataId1").size() == 1) && ((String)(store.getAssociatedItems("serviceId1", "metaDataId1").toArray()[0])).equals("itemId1")) | |
3 | System.out.println("Correct value 'itemId1' found"); | 3 | System.out.println("Correct value 'itemId1' found"); | |
else | else | |||
4 | fail("Associated item not found " + store.getAssociatedItems("serviceId1", "metaDataId1").size()); | 4 | fail("Associated item not found " + store.getAssociatedItems("serviceId1", "metaDataId1").size()); | |
5 | store.removeAssociation("serviceId1", "metaDataId1", "itemId1"); | 5 | store.removeAssociation("serviceId1", "metaDataId1", "itemId1"); |
Row | Violation |
---|