Apache JDO Project - Patch to allow running GETPMF tests from IDE

This is Interesting: Free IT Magazines  
Home > Archive > Apache JDO Project > September 2005 > Patch to allow running GETPMF tests from IDE





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Patch to allow running GETPMF tests from IDE
erik@jpox.org

2005-09-27, 5:45 pm

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";
}



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com