File path: /columba-1.4-src/core/src/test/java/org/columba/core/context/ContextTest.java | File path: /columba-1.4-src/core/src/test/java/org/columba/core/context/ContextTest.java | |||
Method name: void test()
|
Method name: void testWithValue()
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | ContextFactory factory = new ContextFactory();↵ | 1 | ContextFactory factory = new ContextFactory();↵ | |
2 | // top-level structure↵ | 2 | // top-level structure↵ | |
3 | IStructureType type = factory.createStructure("userlist", "ns");↵ | 3 | IStructureType type = factory.createStructure("userlist", "ns");↵ | |
4 | type.setCardinality(MULTIPLICITY.ONE_TO_ONE);↵ | 4 | type.setCardinality(MULTIPLICITY.ONE_TO_ONE);↵ | |
5 | // mandatory String-based attribute↵ | 5 | // mandatory String-based attribute↵ | |
6 | IAttributeType attr = type.addAttribute("name", "ns");↵ | 6 | IAttributeType attr = type.addAttribute("name", "ns");↵ | |
7 | // optional String-based attribute↵ | 7 | // optional String-based attribute↵ | |
8 | IAttributeType attr2 = type.addAttribute("description", "ns");↵ | 8 | IAttributeType attr2 = type.addAttribute("description", "ns");↵ | |
9 | IAttributeType result1 = type.getAttribute("name", "ns");↵ | 9 | IAttributeType result1 = type.getAttribute("name", "ns");↵ | |
10 | assertEquals(attr, result1); | 10 |
| |
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 | 19 |
Number of mapped statements | 7 |
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 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
1 | ContextFactory factory = new ContextFactory(); | 1 | ContextFactory factory = new ContextFactory(); | |
2 | IStructureType type = factory.createStructure("userlist", "ns"); | 2 | IStructureType type = factory.createStructure("userlist", "ns"); | |
3 | type.setCardinality(MULTIPLICITY.ONE_TO_ONE); | 3 | type.setCardinality(MULTIPLICITY.ONE_TO_ONE); | |
4 | IAttributeType attr = type.addAttribute("name", "ns"); | 4 | IAttributeType attr = type.addAttribute("name", "ns"); | |
5 | IAttributeType attr2 = type.addAttribute("description", "ns"); | 5 | IAttributeType attr2 = type.addAttribute("description", "ns"); | |
6 | IAttributeType result1 = type.getAttribute("name", "ns"); | 6 | IAttributeType result1 = type.getAttribute("name", "ns"); | |
7 | assertEquals(attr, result1); | 7 | assertEquals(attr, result1); |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables , while Clone fragment #2 returns variables factory, type |