File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/collection/AbstractCollectionRegionAccessStrategyTestCase.java | File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/entity/AbstractEntityRegionAccessStrategyTestCase.java | |||
Method name: void evictOrRemoveTest(boolean)
|
Method name: void evictOrRemoveTest(boolean)
|
|||
Number of AST nodes: 13 | Number of AST nodes: 13 | |||
1 | final String KEY = KEY_BASE + testCount++;↵ | 1 | final String KEY = KEY_BASE + testCount++;↵ | |
2 | ↵ | 2 | ↵ | |
3 | assertNull("local is clean", localAccessStrategy.get(KEY, System.currentTimeMillis()));↵ | 3 | assertNull("local is clean", localAccessStrategy.get(KEY, System.currentTimeMillis()));↵ | |
4 | assertNull("remote is clean", remoteAccessStrategy.get(KEY, System.currentTimeMillis()));↵ | 4 | assertNull("remote is clean", remoteAccessStrategy.get(KEY, System.currentTimeMillis()));↵ | |
5 | ↵ | 5 | ↵ | |
6 | localAccessStrategy.putFromLoad(KEY, VALUE1, System.currentTimeMillis(), new Integer(1));↵ | 6 | localAccessStrategy.putFromLoad(KEY, VALUE1, System.currentTimeMillis(), new Integer(1));↵ | |
7 | assertEquals(VALUE1, localAccessStrategy.get(KEY, System.currentTimeMillis()));↵ | 7 | assertEquals(VALUE1, localAccessStrategy.get(KEY, System.currentTimeMillis()));↵ | |
8 | remoteAccessStrategy.putFromLoad(KEY, VALUE1, System.currentTimeMillis(), new Integer(1));↵ | 8 | remoteAccessStrategy.putFromLoad(KEY, VALUE1, System.currentTimeMillis(), new Integer(1));↵ | |
9 | assertEquals(VALUE1, remoteAccessStrategy.get(KEY, System.currentTimeMillis()));↵ | 9 | assertEquals(VALUE1, remoteAccessStrategy.get(KEY, System.currentTimeMillis()));↵ | |
10 | ↵ | 10 | ↵ | |
11 | // Wait for async propagation↵ | 11 | // Wait for async propagation↵ | |
12 | sleep(250);↵ | 12 | sleep(250);↵ | |
13 | ↵ | 13 | ↵ | |
14 | if (evict)↵ | 14 | if (evict)↵ | |
15 | localAccessStrategy.evict(KEY);↵ | 15 | localAccessStrategy.evict(KEY);↵ | |
16 | else↵ | 16 | else↵ | |
17 | localAccessStrategy.remove(KEY);↵ | 17 | localAccessStrategy.remove(KEY);↵ | |
18 | ↵ | 18 | ↵ | |
19 | assertEquals(null, localAccessStrategy.get(KEY, System.currentTimeMillis()));↵ | 19 | assertEquals(null, localAccessStrategy.get(KEY, System.currentTimeMillis()));↵ | |
20 | ↵ | 20 | ↵ | |
21 | // sleep(1000);↵ | |||
22 | ↵ | |||
21 | assertEquals(null, remoteAccessStrategy.get(KEY, System.currentTimeMillis())); | 23 |
| |
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 | 91 |
Number of mapped statements | 13 |
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) | 22.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | final String KEY = KEY_BASE + testCount++; | 1 | final String KEY = KEY_BASE + testCount++; | ||||||||||||||||||
2 | assertNull("local is clean", localAccessStrategy.get(KEY, System.currentTimeMillis())); |
| 3 | assertNull("remote is clean", remoteAccessStrategy.get(KEY, System.currentTimeMillis())); | |||||||||||||||||
3 | assertNull("remote is clean", remoteAccessStrategy.get(KEY, System.currentTimeMillis())); |
| 2 | assertNull("local is clean", localAccessStrategy.get(KEY, System.currentTimeMillis())); | |||||||||||||||||
4 | localAccessStrategy.putFromLoad(KEY, VALUE1, System.currentTimeMillis(), new Integer(1)); |
| 6 | remoteAccessStrategy.putFromLoad(KEY, VALUE1, System.currentTimeMillis(), new Integer(1)); | |||||||||||||||||
5 | assertEquals(VALUE1, localAccessStrategy.get(KEY, System.currentTimeMillis())); |
| 7 | assertEquals(VALUE1, remoteAccessStrategy.get(KEY, System.currentTimeMillis())); | |||||||||||||||||
6 | remoteAccessStrategy.putFromLoad(KEY, VALUE1, System.currentTimeMillis(), new Integer(1)); |
| 4 | localAccessStrategy.putFromLoad(KEY, VALUE1, System.currentTimeMillis(), new Integer(1)); | |||||||||||||||||
7 | assertEquals(VALUE1, remoteAccessStrategy.get(KEY, System.currentTimeMillis())); |
| 5 | assertEquals(VALUE1, localAccessStrategy.get(KEY, System.currentTimeMillis())); | |||||||||||||||||
8 | sleep(250); | 8 | sleep(250); | ||||||||||||||||||
9 | if (evict) | 9 | if (evict) | ||||||||||||||||||
10 | localAccessStrategy.evict(KEY); |
| 10 | localAccessStrategy.evict(KEY); | |||||||||||||||||
else | else | ||||||||||||||||||||
11 | localAccessStrategy.remove(KEY); |
| 11 | localAccessStrategy.remove(KEY); | |||||||||||||||||
12 | assertEquals(null, localAccessStrategy.get(KEY, System.currentTimeMillis())); |
| 13 | assertEquals(null, remoteAccessStrategy.get(KEY, System.currentTimeMillis())); | |||||||||||||||||
13 | assertEquals(null, remoteAccessStrategy.get(KEY, System.currentTimeMillis())); |
| 12 | assertEquals(null, localAccessStrategy.get(KEY, System.currentTimeMillis())); |
Row | Violation |
---|---|
1 | Type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable localAccessStrategy does not match with type org.hibernate.cache.access.EntityRegionAccessStrategy of variable remoteAccessStrategy |
2 | Type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable remoteAccessStrategy does not match with type org.hibernate.cache.access.EntityRegionAccessStrategy of variable localAccessStrategy |
3 | Expression localAccessStrategy cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression remoteAccessStrategy cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable localAccessStrategy does not match with type org.hibernate.cache.access.EntityRegionAccessStrategy of variable remoteAccessStrategy |
6 | Expression localAccessStrategy cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression remoteAccessStrategy cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable localAccessStrategy does not match with type org.hibernate.cache.access.EntityRegionAccessStrategy of variable remoteAccessStrategy |
9 | Expression remoteAccessStrategy cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression localAccessStrategy cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable remoteAccessStrategy does not match with type org.hibernate.cache.access.EntityRegionAccessStrategy of variable localAccessStrategy |
12 | Expression remoteAccessStrategy cannot be parameterized, because it has dependencies to/from statements that will be extracted |
13 | Expression localAccessStrategy cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable remoteAccessStrategy does not match with type org.hibernate.cache.access.EntityRegionAccessStrategy of variable localAccessStrategy |
15 | Type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable localAccessStrategy does not match with type org.hibernate.cache.access.EntityRegionAccessStrategy of variable localAccessStrategy |
16 | Type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable localAccessStrategy does not match with type org.hibernate.cache.access.EntityRegionAccessStrategy of variable localAccessStrategy |
17 | Expression localAccessStrategy cannot be parameterized, because it has dependencies to/from statements that will be extracted |
18 | Expression remoteAccessStrategy cannot be parameterized, because it has dependencies to/from statements that will be extracted |
19 | Type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable localAccessStrategy does not match with type org.hibernate.cache.access.EntityRegionAccessStrategy of variable remoteAccessStrategy |
20 | Expression remoteAccessStrategy cannot be parameterized, because it has dependencies to/from statements that will be extracted |
21 | Expression localAccessStrategy cannot be parameterized, because it has dependencies to/from statements that will be extracted |
22 | Type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable remoteAccessStrategy does not match with type org.hibernate.cache.access.EntityRegionAccessStrategy of variable localAccessStrategy |