public void testUpdateFailureWithExceptionChecking() { Session s = openSession(); s.beginTransaction(); ExceptionCheckingEntity e = new ExceptionCheckingEntity(); e.setId( new Long( 1 ) ); e.setName( "dummy" ); s.update( e ); try { s.flush(); fail( "expection flush failure!" ); } catch( JDBCException ex ) { // these should specifically be JDBCExceptions... } s.clear(); s.getTransaction().commit(); s.close();
public void testDeleteWithExceptionChecking() { Session s = openSession(); s.beginTransaction(); ExceptionCheckingEntity e = new ExceptionCheckingEntity(); e.setId( new Long( 1 ) ); e.setName( "dummy" ); s.delete( e ); try { s.flush(); fail( "expection flush failure!" ); } catch( JDBCException ex ) { // these should specifically be JDBCExceptions... } s.clear(); s.getTransaction().commit(); s.close();
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/sql/check/ResultCheckStyleTest.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/sql/check/ResultCheckStyleTest.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public void testUpdateFailureWithExceptionChecking() {
1
public void testDeleteWithExceptionChecking() {
2
		Session s = openSession();
2
		Session s = openSession();
3
		s.beginTransaction();
3
		s.beginTransaction();
4
		ExceptionCheckingEntity e = new ExceptionCheckingEntity();
4
		ExceptionCheckingEntity e = new ExceptionCheckingEntity();
5
		e.setId( new Long( 1 ) );
5
		e.setId( new Long( 1 ) );
6
		e.setName( "dummy" );
6
		e.setName( "dummy" );
7
		s.update( e );
7
		s.delete( e );
8
		try {
8
		try {
9
			s.flush();
9
			s.flush();
10
			fail( "expection flush failure!" );
10
			fail( "expection flush failure!" );
11
		}
11
		}
12
		catch( JDBCException ex ) {
12
		catch( JDBCException ex ) {
13
			// these should specifically be JDBCExceptions...
13
			// these should specifically be JDBCExceptions...
14
		}
14
		}
15
		s.clear();
15
		s.clear();
16
		s.getTransaction().commit();
16
		s.getTransaction().commit();
17
		s.close();
17
		s.close();
18
	
18
	
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0