File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/collection/CollectionRegionImplTestCase.java | File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/entity/EntityRegionImplTestCase.java | |||
Method name: void supportedAccessTypeTest(RegionFactory, Properties)
|
Method name: void supportedAccessTypeTest(RegionFactory, Properties)
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | CollectionRegion region = regionFactory.buildCollectionRegion("test", properties, null);↵ | 1 | EntityRegion region = regionFactory.buildEntityRegion("test", properties, null);↵ | |
2 | ↵ | 2 | ↵ | |
3 | assertNull("Got TRANSACTIONAL", region.buildAccessStrategy(AccessType.TRANSACTIONAL).lockRegion());↵ | 3 | assertNull("Got TRANSACTIONAL", region.buildAccessStrategy(AccessType.TRANSACTIONAL).lockRegion());↵ | |
4 | ↵ | 4 | ↵ | |
5 | try↵ | 5 | try↵ | |
6 | {↵ | 6 | {↵ | |
7 | region.buildAccessStrategy(AccessType.READ_ONLY).lockRegion();↵ | 7 | region.buildAccessStrategy(AccessType.READ_ONLY).lockRegion();↵ | |
8 | fail("Did not get READ_ONLY");↵ | 8 | fail("Did not get READ_ONLY");↵ | |
9 | }↵ | 9 | }↵ | |
10 | catch (UnsupportedOperationException good) {}↵ | 10 | catch (UnsupportedOperationException good) {}↵ | |
11 | ↵ | 11 | ↵ | |
12 | try↵ | 12 | try↵ | |
13 | {↵ | 13 | {↵ | |
14 | region.buildAccessStrategy(AccessType.NONSTRICT_READ_WRITE);↵ | 14 | region.buildAccessStrategy(AccessType.NONSTRICT_READ_WRITE);↵ | |
15 | fail("Incorrectly got NONSTRICT_READ_WRITE");↵ | 15 | fail("Incorrectly got NONSTRICT_READ_WRITE");↵ | |
16 | }↵ | 16 | }↵ | |
17 | catch (CacheException good) {}↵ | 17 | catch (CacheException good) {}↵ | |
18 | ↵ | 18 | ↵ | |
19 | try↵ | 19 | try↵ | |
20 | {↵ | 20 | {↵ | |
21 | region.buildAccessStrategy(AccessType.READ_WRITE);↵ | 21 | region.buildAccessStrategy(AccessType.READ_WRITE);↵ | |
22 | fail("Incorrectly got READ_WRITE");↵ | 22 | fail("Incorrectly got READ_WRITE");↵ | |
23 | }↵ | 23 | }↵ | |
24 | catch (CacheException good) {} | 24 |
| |
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 | 61 |
Number of mapped statements | 8 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 5.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | EntityRegion region = regionFactory.buildEntityRegion("test", properties, null); | |||||||||||||||||||
1 | CollectionRegion region = regionFactory.buildCollectionRegion("test", properties, null); | | |||||||||||||||||||
2 | assertNull("Got TRANSACTIONAL", region.buildAccessStrategy(AccessType.TRANSACTIONAL).lockRegion()); |
| 2 | assertNull("Got TRANSACTIONAL", region.buildAccessStrategy(AccessType.TRANSACTIONAL).lockRegion()); | |||||||||||||||||
3 | try | 3 | try | ||||||||||||||||||
4 | region.buildAccessStrategy(AccessType.READ_ONLY).lockRegion(); |
| 4 | region.buildAccessStrategy(AccessType.READ_ONLY).lockRegion(); | |||||||||||||||||
5 | fail("Did not get READ_ONLY"); | 5 | fail("Did not get READ_ONLY"); | ||||||||||||||||||
6 | try | 6 | try | ||||||||||||||||||
|
| 7 | region.buildAccessStrategy(AccessType.NONSTRICT_READ_WRITE); | ||||||||||||||||||
7 | region.buildAccessStrategy(AccessType.NONSTRICT_READ_WRITE); |
| | ||||||||||||||||||
8 | fail("Incorrectly got NONSTRICT_READ_WRITE"); | 8 | fail("Incorrectly got NONSTRICT_READ_WRITE"); | ||||||||||||||||||
9 | try | 9 | try | ||||||||||||||||||
|
| 10 | region.buildAccessStrategy(AccessType.READ_WRITE); | ||||||||||||||||||
10 | region.buildAccessStrategy(AccessType.READ_WRITE); |
| | ||||||||||||||||||
11 | fail("Incorrectly got READ_WRITE"); | 11 | fail("Incorrectly got READ_WRITE"); |
Row | Violation |
---|---|
1 | Type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable region.buildAccessStrategy(AccessType.TRANSACTIONAL) does not match with type org.hibernate.cache.access.EntityRegionAccessStrategy of variable region.buildAccessStrategy(AccessType.TRANSACTIONAL) |
2 | Type org.hibernate.cache.CollectionRegion of variable region does not match with type org.hibernate.cache.EntityRegion of variable region |
3 | Expression region.buildAccessStrategy(AccessType.READ_ONLY) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
4 | Expression region.buildAccessStrategy(AccessType.READ_ONLY) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
5 | Type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable region.buildAccessStrategy(AccessType.READ_ONLY) does not match with type org.hibernate.cache.access.EntityRegionAccessStrategy of variable region.buildAccessStrategy(AccessType.READ_ONLY) |
6 | Type org.hibernate.cache.CollectionRegion of variable region does not match with type org.hibernate.cache.EntityRegion of variable region |
7 | Unmatched statement region.buildAccessStrategy(AccessType.NONSTRICT_READ_WRITE); 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 |
8 | Unmatched statement region.buildAccessStrategy(AccessType.NONSTRICT_READ_WRITE); 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 |
9 | Unmatched statement region.buildAccessStrategy(AccessType.READ_WRITE); 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 |
10 | Unmatched statement region.buildAccessStrategy(AccessType.READ_WRITE); 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 |