activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1050345 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/jdbc/JDBCMessagePriorityTest.java
Date Fri, 17 Dec 2010 11:03:16 GMT
Author: gtully
Date: Fri Dec 17 11:03:15 2010
New Revision: 1050345

URL: http://svn.apache.org/viewvc?rev=1050345&view=rev
Log:
try and ensure derby shutsdown between tests

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/jdbc/JDBCMessagePriorityTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/jdbc/JDBCMessagePriorityTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/jdbc/JDBCMessagePriorityTest.java?rev=1050345&r1=1050344&r2=1050345&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/jdbc/JDBCMessagePriorityTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/jdbc/JDBCMessagePriorityTest.java
Fri Dec 17 11:03:15 2010
@@ -41,11 +41,12 @@ import org.apache.derby.jdbc.EmbeddedDat
 public class JDBCMessagePriorityTest extends MessagePriorityTest {
 
     private static final Log LOG = LogFactory.getLog(JDBCMessagePriorityTest.class);
+    EmbeddedDataSource dataSource;
 
     @Override
     protected PersistenceAdapter createPersistenceAdapter(boolean delete) throws Exception
{
         JDBCPersistenceAdapter jdbc = new JDBCPersistenceAdapter();
-        EmbeddedDataSource dataSource = new EmbeddedDataSource();
+        dataSource = new EmbeddedDataSource();
         dataSource.setDatabaseName("derbyDb");
         dataSource.setCreateDatabase("create");
         dataSource.setShutdownDatabase("false");
@@ -55,6 +56,17 @@ public class JDBCMessagePriorityTest ext
         return jdbc;
     }
 
+
+    protected void tearDown() throws Exception {
+       super.tearDown();
+       try {
+           dataSource.setShutdownDatabase("true");
+           dataSource.getConnection();
+       } catch (Exception ignored) {
+       }
+
+    }
+
     // this cannot be a general test as kahaDB just has support for 3 priority levels
     public void testDurableSubsReconnectWithFourLevels() throws Exception {
         ActiveMQTopic topic = (ActiveMQTopic) sess.createTopic("TEST");



Mime
View raw message