Update test to use full paths to data files so that it can work from an IDE too

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1407512 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2012-11-09 15:58:19 +00:00
parent a68916dcc5
commit e6bfc94fe2
1 changed files with 14 additions and 3 deletions

View File

@ -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;