You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by tf...@apache.org on 2013/10/07 09:32:29 UTC
svn commit: r1529776 -
/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/map/DatabaseMapTest.java
Author: tfischer
Date: Mon Oct 7 07:32:28 2013
New Revision: 1529776
URL: http://svn.apache.org/r1529776
Log:
Fix test for running with java 7
Modified:
db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/map/DatabaseMapTest.java
Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/map/DatabaseMapTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/map/DatabaseMapTest.java?rev=1529776&r1=1529775&r2=1529776&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/map/DatabaseMapTest.java (original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/map/DatabaseMapTest.java Mon Oct 7 07:32:28 2013
@@ -49,13 +49,30 @@ public class DatabaseMapTest extends Bas
"id", "one", "two", "three"
};
+ // Hack to store exception thrown by test in static initializer
+ private static Throwable testDatabaseMapInitializeResult = null;
+
+ static
+ {
+ // make sure this is the first test running,
+ // as it will fail if another test method runs before
+ try
+ {
+ doTestDatabaseMapInitialize();
+ }
+ catch (Throwable t)
+ {
+ testDatabaseMapInitializeResult = t;
+ }
+ }
+
/**
* Test initializing the default database. <p> Assumptions: <ul> A table
* called NotUsedBeforeMapInit table exists in the default schema
* (bookstore)<br> This table has not been used by any other test prior to
* this test.<br> </ul>
*/
- public void testDatabaseMapInitialize() throws Exception
+ private static void doTestDatabaseMapInitialize() throws Exception
{
// Get default schema DB
DatabaseMap map = Torque.getDatabaseMap(DATABASE_NAME);
@@ -73,6 +90,19 @@ public class DatabaseMapTest extends Bas
}
/**
+ * Reports the result of the testDatabaseMapInitialize Test.
+ *
+ * @throws Throwable if the test has failed.
+ */
+ public void testDatabaseMapInitialize() throws Throwable
+ {
+ if (testDatabaseMapInitializeResult != null)
+ {
+ throw testDatabaseMapInitializeResult;
+ }
+ }
+
+ /**
* Test that XML column order is preserved in TableMap objects.
* <p>
* Assumptions:
@@ -349,9 +379,9 @@ public class DatabaseMapTest extends Bas
* Validate that the attribute value matches
* @param name
*/
- protected void validateAttribute(String name,
- String expected,
- String result)
+ protected void validateAttribute(final String name,
+ final String expected,
+ final String result)
{
assertTrue(name + " attribute not set correctly!\n Expected '"
+ expected + "' and got '" + result + "'", expected
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org