portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r385994 - /portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java
Date Wed, 15 Mar 2006 07:50:10 GMT
Author: rwatler
Date: Tue Mar 14 23:50:09 2006
New Revision: 385994

URL: http://svn.apache.org/viewcvs?rev=385994&view=rev
Log:
cleanup improperly terminated database connections in tests

Modified:
    portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java

Modified: portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java?rev=385994&r1=385993&r2=385994&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/test/org/apache/jetspeed/page/TestDatabasePageManager.java
Tue Mar 14 23:50:09 2006
@@ -60,6 +60,7 @@
     private String deepPagePath = deepFolderPath + "/default-page.psml";
 
     private static ClassPathXmlApplicationContext context;
+    private static boolean lastTestRun;
 
     private static PageManager pageManager;
 
@@ -83,6 +84,7 @@
             // new context
             super.setUp();
             context = ctx;
+            lastTestRun = false;
 
             // lookup page manager in context
             pageManager = (PageManager)context.getBean("pageManager");
@@ -98,6 +100,11 @@
 
     protected void tearDown() throws Exception
     {
+        // save context for reuse
+        if (!lastTestRun)
+        {
+            ctx = null;
+        }
         super.tearDown();
     }
     
@@ -933,5 +940,8 @@
         assertEquals(22, newNodeCount);
         assertEquals(4, updatedNodeCount);
         assertEquals(1, removedNodeCount);
+
+        // last test has been run
+        lastTestRun = true;
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message