File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/interceptor/InterceptorTest.java | File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/legacy/FumTest.java | |||
Method name: void testPropertyIntercept()
|
Method name: void testCompositeIDOneToOne()
|
|||
Number of AST nodes: 15 | Number of AST nodes: 15 | |||
1 | Session s = openSession( new PropertyInterceptor() );↵ | 1 | Session s = openSession();↵ | |
2 | Transaction t = s.beginTransaction();↵ | 2 | Transaction txn = s.beginTransaction();↵ | |
3 | User u = new User("Gavin", "nivag");↵ | 3 | ↵ | |
4 | s.persist(u);↵ | |||
5 | u.setPassword("vagni"↵ | 4 | Fum fum = new Fum( fumKey("fum") );↵ | |
5 | fum.setFum("fee fi fo");↵ | |||
6 | //s.save(fum);↵ | |||
7 | Fumm fumm = new Fumm();↵ | |||
8 | fumm.setFum(fum);↵ | |||
6 | );↵ | 9 | s.save(fumm);↵ | |
7 | t.commit();↵ | 10 | txn.commit();↵ | |
8 | s.close();↵ | 11 | s.close();↵ | |
9 | s = openSession();↵ | 12 | s = openSession();↵ | |
10 | t = s.beginTransaction();↵ | 13 | txn = s.beginTransaction();↵ | |
11 | u = (User) s.get(User.class, "Gavin");↵ | 14 | ↵ | |
12 | assertNotNull( u.getCreated() );↵ | |||
13 | assertNotNull( u.getLastUpdated↵ | 15 | fumm = (Fumm) s.load( Fumm.class, fumKey("fum") );↵ | |
14 | () );↵ | 16 | //s.delete( fumm.getFum() );↵ | |
15 | s.delete(u);↵ | 17 | s.delete(fumm);↵ | |
16 | t.commit();↵ | 18 | txn.commit();↵ | |
17 | s.close(); | 19 |
| |
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 in different classes having the same super class |
Number of node comparisons | 125 |
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 8 |
Number of unmapped statements in the second code fragment | 8 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Session s = openSession(); | ||||||||||||||||||||
1 | Session s = openSession(new PropertyInterceptor()); | | ||||||||||||||||||||
2 | Transaction t = s.beginTransaction(); |
| 2 | Transaction txn = s.beginTransaction(); | ||||||||||||||||||
| 3 | Fum fum = new Fum(fumKey("fum")); | ||||||||||||||||||||
3 | User u = new User("Gavin", "nivag"); | | ||||||||||||||||||||
| 4 | fum.setFum("fee fi fo"); | ||||||||||||||||||||
4 | s.persist(u); | | ||||||||||||||||||||
| 5 | Fumm fumm = new Fumm(); | ||||||||||||||||||||
5 | u.setPassword("vagni"); | | ||||||||||||||||||||
| 6 | fumm.setFum(fum); | ||||||||||||||||||||
| 7 | s.save(fumm); | ||||||||||||||||||||
6 | t.commit(); |
| 8 | txn.commit(); | ||||||||||||||||||
7 | s.close(); |
| 9 | s.close(); | ||||||||||||||||||
8 | s = openSession(); |
| | |||||||||||||||||||
|
| 10 | s = openSession(); | |||||||||||||||||||
9 | t = s.beginTransaction(); |
| 11 | txn = s.beginTransaction(); | ||||||||||||||||||
10 | u = (User)s.get(User.class, "Gavin"); | | ||||||||||||||||||||
11 | assertNotNull(u.getCreated()); | | ||||||||||||||||||||
| 12 | fumm = (Fumm)s.load(Fumm.class, fumKey("fum")); | ||||||||||||||||||||
12 | assertNotNull(u.getLastUpdated()); | | ||||||||||||||||||||
13 | s.delete(u); |
| 13 | s.delete(fumm); | ||||||||||||||||||
14 | t.commit(); |
| 14 | txn.commit(); | ||||||||||||||||||
15 | s.close(); |
| 15 | s.close(); |
Row | Violation |
---|---|
1 | Type org.hibernate.Session of variable s does not match with type org.hibernate.classic.Session of variable s |
2 | Type org.hibernate.Session of variable s does not match with type org.hibernate.classic.Session of variable s |
3 | Unmatched statement s=openSession(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement s=openSession(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Type org.hibernate.Session of variable s does not match with type org.hibernate.classic.Session of variable s |
6 | Type org.hibernate.test.interceptor.User of variable u does not match with type org.hibernate.test.legacy.Fumm of variable fumm |
7 | Type org.hibernate.Session of variable s does not match with type org.hibernate.classic.Session of variable s |
8 | Type org.hibernate.Session of variable s does not match with type org.hibernate.classic.Session of variable s |