[hibernate-commits] Hibernate SVN: r10273 - trunk/Hibernate3/test/org/hibernate/test/instrument/buildtime

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Tue Aug 15 22:33:31 EDT 2006


Author: steve.ebersole at jboss.com
Date: 2006-08-15 22:33:16 -0400 (Tue, 15 Aug 2006)
New Revision: 10273

Modified:
   trunk/Hibernate3/test/org/hibernate/test/instrument/buildtime/InstrumentTest.java
Log:
corrected execution

Modified: trunk/Hibernate3/test/org/hibernate/test/instrument/buildtime/InstrumentTest.java
===================================================================
--- trunk/Hibernate3/test/org/hibernate/test/instrument/buildtime/InstrumentTest.java	2006-08-15 21:20:44 UTC (rev 10272)
+++ trunk/Hibernate3/test/org/hibernate/test/instrument/buildtime/InstrumentTest.java	2006-08-16 02:33:16 UTC (rev 10273)
@@ -14,6 +14,7 @@
 import org.hibernate.test.instrument.cases.TestInjectFieldInterceptorExecutable;
 import org.hibernate.test.instrument.cases.TestIsPropertyInitializedExecutable;
 import org.hibernate.test.instrument.cases.TestManyToOneProxyExecutable;
+import org.hibernate.test.instrument.cases.Executable;
 
 /**
  * @author Gavin King
@@ -25,33 +26,43 @@
 	}
 
 	public void testDirtyCheck() {
-		new TestDirtyCheckExecutable().execute();
+		execute( new TestDirtyCheckExecutable() );
 	}
 
 	public void testFetchAll() throws Exception {
-		new TestFetchAllExecutable().execute();
+		execute( new TestFetchAllExecutable() );
 	}
 
 	public void testLazy() throws Exception {
-		new TestLazyExecutable().execute();
+		execute( new TestLazyExecutable() );
 	}
 
 	public void testLazyManyToOne() {
-		new TestLazyManyToOneExecutable().execute();
+		execute( new TestLazyManyToOneExecutable() );
 	}
 
 	public void testSetFieldInterceptor() {
-		new TestInjectFieldInterceptorExecutable().execute();
+		execute( new TestInjectFieldInterceptorExecutable() );
 	}
 
 	public void testPropertyInitialized() {
-		new TestIsPropertyInitializedExecutable().execute();
+		execute( new TestIsPropertyInitializedExecutable() );
 	}
 
 	public void testManyToOneProxy() {
-		new TestManyToOneProxyExecutable().execute();
+		execute( new TestManyToOneProxyExecutable() );
 	}
 
+	private void execute(Executable executable) {
+		executable.prepare();
+		try {
+			executable.execute();
+		}
+		finally {
+			executable.complete();
+		}
+	}
+
 	protected String[] getMappings() {
 		return new String[] { "instrument/domain/Documents.hbm.xml" };
 	}




More information about the hibernate-commits mailing list