[hibernate-commits] Hibernate SVN: r10271 - branches/Branch_3_2/Hibernate3/test/org/hibernate/test/instrument/buildtime

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Tue Aug 15 17:18:26 EDT 2006


Author: steve.ebersole at jboss.com
Date: 2006-08-15 17:18:09 -0400 (Tue, 15 Aug 2006)
New Revision: 10271

Modified:
   branches/Branch_3_2/Hibernate3/test/org/hibernate/test/instrument/buildtime/InstrumentTest.java
Log:
HHH-2005 : port to 3.2 branch: new build script; build dir layout changes

Modified: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/instrument/buildtime/InstrumentTest.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/instrument/buildtime/InstrumentTest.java	2006-08-15 21:17:26 UTC (rev 10270)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/instrument/buildtime/InstrumentTest.java	2006-08-15 21:18:09 UTC (rev 10271)
@@ -14,12 +14,10 @@
 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;
 
 /**
- * Tests for build-time instrumentation
- *
  * @author Gavin King
- * @author Steve Ebersole
  */
 public class InstrumentTest extends TestCase {
 
@@ -28,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" };
 	}
@@ -75,4 +83,5 @@
 	public static boolean isRunnable() {
 		return FieldInterceptionHelper.isInstrumented( new Document() );
 	}
-}
\ No newline at end of file
+}
+




More information about the hibernate-commits mailing list