activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1407512 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/kahadb/KahaDBVersionTest.java
Date Fri, 09 Nov 2012 15:58:20 GMT
Author: chirino
Date: Fri Nov  9 15:58:19 2012
New Revision: 1407512

URL: http://svn.apache.org/viewvc?rev=1407512&view=rev
Log:
Update test to use full paths to data files so that it can work from an IDE too

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/kahadb/KahaDBVersionTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/kahadb/KahaDBVersionTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/kahadb/KahaDBVersionTest.java?rev=1407512&r1=1407511&r2=1407512&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/kahadb/KahaDBVersionTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/kahadb/KahaDBVersionTest.java
Fri Nov  9 15:58:19 2012
@@ -25,16 +25,27 @@ import javax.jms.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import java.io.File;
+import java.io.IOException;
+import java.security.ProtectionDomain;
 
 /**
  * @author chirino
  */
 public class KahaDBVersionTest extends TestCase {
+    static String basedir;
+    static {
+        try {
+            ProtectionDomain protectionDomain = KahaDBVersionTest.class.getProtectionDomain();
+            basedir = new File(new File(protectionDomain.getCodeSource().getLocation().getPath()),
"../..").getCanonicalPath();
+        } catch (IOException e) {
+            basedir = ".";
+        }
+    }
 
     static final Logger LOG = LoggerFactory.getLogger(KahaDBVersionTest.class);
-    final static File VERSION_1_DB= new File("src/test/resources/org/apache/activemq/store/kahadb/KahaDBVersion1");
-    final static File VERSION_2_DB= new File("src/test/resources/org/apache/activemq/store/kahadb/KahaDBVersion2");
-    final static File VERSION_3_DB= new File("src/test/resources/org/apache/activemq/store/kahadb/KahaDBVersion3");
+    final static File VERSION_1_DB= new File(basedir+"/src/test/resources/org/apache/activemq/store/kahadb/KahaDBVersion1");
+    final static File VERSION_2_DB= new File(basedir+"/src/test/resources/org/apache/activemq/store/kahadb/KahaDBVersion2");
+    final static File VERSION_3_DB= new File(basedir+"/src/test/resources/org/apache/activemq/store/kahadb/KahaDBVersion3");
 
     BrokerService broker = null;
 



Mime
View raw message