db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@jpox.org
Subject Patch to allow running GETPMF tests from IDE
Date Tue, 27 Sep 2005 16:49:57 GMT
This path permits to launch GETPMF tests from something other than maven.


Index:
C:/jdo/root/tck20/test/java/org/apache/jdo/tck/api/persistencemanagerfactory/AbstractGetPMF.java
===================================================================
---
C:/jdo/root/tck20/test/java/org/apache/jdo/tck/api/persistencemanagerfactory/AbstractGetPMF.java
(revision
291420)
+++
C:/jdo/root/tck20/test/java/org/apache/jdo/tck/api/persistencemanagerfactory/AbstractGetPMF.java
(working
copy)
@@ -16,6 +16,7 @@

 package org.apache.jdo.tck.api.persistencemanagerfactory;

+import java.io.File;
 import java.lang.reflect.Method;

 import java.util.Iterator;
@@ -43,7 +44,7 @@
      * The variable is set to test/conf/jdori.properties.
      * This file contains valid JDO properties.
      */
-    protected static final String validPropertiesFile = PMFProperties;
+    protected static String validPropertiesFile = PMFProperties;

     /**
      * Used as the PMF name in negative tests.
@@ -63,7 +64,13 @@
             System.out.println ("******************************");
         //we use '/' instead of File.separatorChar because
         //this character is passed by maven
-        invalidPropertiesFile = validPropertiesFile.substring(0,
validPropertiesFile.lastIndexOf('/')+1) +
+
+        int fileSeparatorIndex = validPropertiesFile.lastIndexOf('/');
+        if( fileSeparatorIndex == -1 )
+        {
+            fileSeparatorIndex =
validPropertiesFile.lastIndexOf(File.separatorChar);
+        }
+        invalidPropertiesFile = validPropertiesFile.substring(0,
fileSeparatorIndex+1) +
         "logging.properties";
     }



Mime
View raw message