You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by fu...@apache.org on 2006/05/18 23:33:44 UTC
svn commit: r407637 - in
/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests:
harness/ suites/ tests/jdbcapi/ util/
Author: fuzzylogic
Date: Thu May 18 14:33:43 2006
New Revision: 407637
URL: http://svn.apache.org/viewvc?rev=407637&view=rev
Log:
DERBY-1141: Improve usability of running tests with useprocess=false.
Committing patch dated 20060512.
Committed for Myrna Van Lunteren <m....@gmail.com>
Added:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClientUseprocess.exclude (with props)
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetUseprocess.exclude (with props)
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/embeddedUseprocess.exclude (with props)
Modified:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunList.java
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/build.xml
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/derbyStress.java
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/nullSQLText.java
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunList.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunList.java?rev=407637&r1=407636&r2=407637&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunList.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunList.java Thu May 18 14:33:43 2006
@@ -535,7 +535,20 @@
}
else
{
- String[] args = new String[6];
+ // if useprocess=false, we cannot pass properties on a commandline,
+ // instead we pass absolutely necessary properties directly to RunTest.
+ // At the very minimum, we need to know:
+ // 0. the test
+ // 1. resourcepackage - the base for loading functionTests Resources
+ // 2. whether or not to use a specific system & the usesystem flag (like for nist)
+ // 3. useprocess flag
+ // 4. shutdown url
+ // 5. name of the suite
+ // 6. the framework, or subsuites might default back to embedded
+ // if a test needs a jvm process started with more/other properties than these,
+ // it will not run well with useprocess=false or not in the same way as with
+ // useprocess=true
+ String[] args = new String[7];
args[0] = str; // the test name
if ( ijdefaultResourcePackage != null )
args[1] = ijdefaultResourcePackage;
@@ -551,6 +564,7 @@
else
args[4] = "";
args[5] = suite;
+ args[6] = framework;
org.apache.derbyTesting.functionTests.harness.RunTest.main(args);
// Write any diff to the suite's output
String tmp = str.substring(str.indexOf("/") + 1, str.lastIndexOf("."));
@@ -572,6 +586,22 @@
// when running with java threads
ManageSysProps.resetSysProps();
lastTest = str;
+ }
+
+ // If useprocess is false, and this is a networkserver test,
+ // we can speed up the test run by not starting and stopping networkserver
+ // for every test (and waiting for it to be up), as we're using the same
+ // directory for all test files (instead of creating each test's files in a new dir).
+ // NetworkServer will get started through RunTest if it's not running, but
+ // at the end of a suite run, we need to make sure we shutdown network server
+ if ((!useprocess) && ((framework !=null) && (framework.startsWith("DerbyNet"))))
+ {
+ try
+ {
+ String stopCmd = javaCmd +
+ " org.apache.derby.drda.NetworkServerControl shutdown";
+ Process prstop = Runtime.getRuntime().exec(stopCmd);
+ } catch (Exception e) {} // ignore
}
}
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java?rev=407637&r1=407636&r2=407637&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java Thu May 18 14:33:43 2006
@@ -55,6 +55,7 @@
import java.util.StringTokenizer;
import java.net.URL;
+import junit.framework.TestSuite;
public class RunTest
{
@@ -73,7 +74,7 @@
"DerbyNet","DerbyNetClient", "DB2jcc",
"DB2app"};
static NetServer ns;
- static boolean frameworkInitialized = false;
+ static boolean serverNeedsStopping = false; // used in controlling network server when useprocess=false:
static boolean jvmnet = false; // switch to see if we need have client & server in a different jvm
static String jvmnetjvm; // string for class name of server jvm if different from client jvm
static String driverName;
@@ -92,7 +93,7 @@
static boolean isjdk12test = false;
static String classpath = "";
static String classpathServer = "";
- static String framework = "embedded";
+ public static String framework = "embedded";
public static String J9_STATEMENTCACHESIZE = "20";
static String usesystem = "";
@@ -213,7 +214,8 @@
System.out.println("Null or blank test script name.");
System.exit(1);
}
- if (args.length == 6)
+ // If useprocess=false RunList calls this main method with 7 arguments...
+ if (args.length == 7)
{
defaultPackageName = args[1];
usesystem = args[2];
@@ -222,6 +224,10 @@
isSuiteRun = true;
suiteName = args[5];
//System.out.println("suiteName: " + suiteName);
+ framework=args[6];
+ // initializing startServer to true (which it would be if we'd
+ // run with useprocess=true) or network server will not get started
+ startServer=true;
}
testType = scriptName.substring(scriptName.lastIndexOf(".") + 1);
@@ -253,7 +259,6 @@
// Check for properties files, including derby.properties
// and if needed, build the -p string to pass to the test
String propString = createPropString();
-
if ( (isSuiteRun == false) && (useprocess) )
{
SysInfoLog sysLog = new SysInfoLog();
@@ -270,7 +275,7 @@
sb.append(startTime + " ***");
System.out.println(sb.toString());
pwDiff.println(sb.toString());
-
+
// Run the Server if needed
if ((driverName != null) && (!skiptest) )
{
@@ -291,9 +296,41 @@
else
ns = new NetServer(baseDir, jvmName, classpathServer,
javaCmd, jvmflags,framework, startServer);
- ns.start();
- frameworkInitialized = true;
- }
+
+ // With useprocess=true, we have a new dir for each test, and all files for
+ // the test, including a clean database, go in that directory. So, network server
+ // for each test runs in that dir, and stops when done. If the test's properties
+ // file has startServer=false the test will handle start/stop, otherwise the harness
+ // needs to start and stop the server.
+ // But with useprocess=false we're using the same directory and thus the same
+ // database, so there's little point in bouncing the server for each test in a suite,
+ // and it would slow the suite run.
+ // So, with useprocess=true, or if we're just running 1 test with useprocess=false,
+ // start network server and set serverNeedsStopping=true to have it stopped later;
+ // if useprocess=false and we're in a suite, start network server if it's not running
+ // and leave serverNeedsStopping=false, unless startServer=false, then,
+ // if network server is running, stop it.
+ if ((!useprocess) && (isSuiteRun))
+ {
+ boolean started = false;
+ try
+ {
+ started = ns.testNetworkServerConnection();
+ }
+ catch (Exception e) {} // ignore
+ if (!started && startServer)
+ ns.start(); // start but don't stop, so not setting serverNeedsStopping
+ if (started && !startServer)
+ ns.stop();
+ }
+ else
+ {
+ ns.start();
+ serverNeedsStopping = true;
+ }
+ }
+
+
// If the test has a jar file (such as upgrade) unjar it
if (jarfile != null)
@@ -318,7 +355,7 @@
}
// Stop the Network server if necessary
- if (frameworkInitialized)
+ if (serverNeedsStopping)
{
ns.stop();
}
@@ -443,7 +480,6 @@
String[] testCmd =
buildTestCommand(propString, systemHome, scriptPath);
execTestProcess(testCmd);
-
}
else
{
@@ -462,10 +498,10 @@
userdir = sp.getProperty("user.dir");
// reset defaultPackageName (for useprocess=false)
- //if (useprocess == false)
- //defaultPackageName = "/org/apache/derbyTesting/";
+ if (useprocess == false)
+ defaultPackageName = "/org/apache/derbyTesting/";
- // reset defaultPackageName (for useprocess=false)
+ // reset defaultPackageName (for useCommonDB=true)
if (useCommonDB == true)
{
defaultPackageName = "/org/apache/derbyTesting/";
@@ -536,9 +572,10 @@
// Define the outDir if not already defined from properties
File tmpoutDir;
String userdirWin = null;
+
if ( (outputdir == null) || (outputdir.length()==0) )
{
- if (File.separatorChar == '\\')
+ if (File.separatorChar == '\\')
{
//need to replace / in path with \ for windows
userdirWin = convertPathForWin(userdir);
@@ -549,7 +586,7 @@
tmpoutDir =
new File((new File(userdir)).getCanonicalPath());
}
- }
+ }
else
{
if (File.separatorChar == '\\')
@@ -699,6 +736,19 @@
baseDir = new File(userdir, commonDBHome);
}
}
+ else if ( (!useprocess) && isSuiteRun && ((usesystem==null) || (usesystem.length()<=0)) )
+ {
+ String suite = (suiteName.substring(0,suiteName.indexOf(':')));
+ if (File.separatorChar == '\\')
+ {
+ String useprWin = convertPathForWin(suite);
+ baseDir = new File(outDir, useprWin);
+ }
+ else
+ {
+ baseDir = new File(outDir, suite);
+ }
+ }
else if ( (usesystem != null) && (usesystem.length()>0) )
{
if (File.separatorChar == '\\')
@@ -840,7 +890,9 @@
{
// Get any properties specified on the command line
searchCP = sp.getProperty("ij.searchClassPath");
- framework = sp.getProperty("framework");
+ String frameworkp = sp.getProperty("framework");
+ if (frameworkp != null)
+ framework = frameworkp;
if (framework == null)
framework = "embedded";
if (!verifyFramework(framework))
@@ -1076,6 +1128,7 @@
else
useprocess = true;
+
// if the hostName is something other than localhost, we must
// be trying to connect to a remote server, and so,
// startServer should be false.
@@ -1143,16 +1196,43 @@
}
usesystem = sp.getProperty("usesystem");
}
+
+ // Some tests will not run well in a suite with use process false
+ // with some frameworks, so skip
+ if (!useprocess && !skiptest )
+ {
+ String tsuiteName = null;
+ if (suiteName != null)
+ tsuiteName = suiteName;
+ else
+ tsuiteName = sp.getProperty("suitename");
+ if ( (tsuiteName != null) && (tsuiteName.length()>0) )
+ {
+ skipFile = framework + "Useprocess.exclude";
+ if (!framework.equals(""))
+ {
+ skiptest = (SkipTest.skipIt(skipFile, scriptName));
+ if (skiptest)
+ {
+ skiptest=true;
+ addSkiptestReason("Test " + scriptName + " skipped, " +
+ "listed in " + framework + "Useprocess.exclude file.");
+ }
+ }
+ }
+ }
if ( (useprocess) || (suiteName == null) )
{
- suiteName = sp.getProperty("suitename");
+ if (useprocess)
+ suiteName = sp.getProperty("suitename");
if ( (suiteName != null) && (suiteName.length()>0) )
{
// This is a suite run
- isSuiteRun = true;
- // If a suite, it could be part of a top suite
- topsuiteName = sp.getProperty("topsuitename");
+ isSuiteRun = true;
+ if (useprocess)
+ // If a suite, it could be part of a top suite
+ topsuiteName = sp.getProperty("topsuitename");
topsuitedir = sp.getProperty("topsuitedir");
topreportdir = sp.getProperty("topreportdir");
}
@@ -1627,7 +1707,14 @@
if(copySupportFiles)
CopySuppFiles.copyFiles(copyOutDir, suppFiles);
}
-
+ else
+ {
+ // for useprocess false, set ext* (back) to null, or it
+ // later tries to delete files even though they don't exist
+ extInDir = null;
+ extOutDir = null;
+ extInOutDir = null;
+ }
}
return propString;
}
@@ -1886,7 +1973,7 @@
// were created
if (extInDir!=null) deleteFile(extInDir);
if (extOutDir!=null) deleteFile(extOutDir);
- if (extInDir!=null) deleteFile(extInOutDir);
+ if (extInOutDir!=null) deleteFile(extInOutDir);
}
}
// reset for next test
@@ -1914,6 +2001,12 @@
System.out.println(f.getName() + " is null");
return;
}
+ if (!f.exists())
+ {
+ System.out.println(f.getName() + " does not exist; harness error");
+ return;
+ }
+
//System.out.println("Trying to delete: " + f.getPath());
status = f.delete();
@@ -1922,6 +2015,11 @@
else
{
// Could not delete; this could be a non-empty directory
+ if (!f.isDirectory())
+ {
+ System.out.println("Could not delete file " + f.getName() + ", going on");
+ return;
+ }
//System.out.println("Recursively delete...");
String[] files = f.list();
for (int i = 0; i < files.length; i++)
@@ -1942,6 +2040,7 @@
status = sub.delete();
//System.out.println("Recurse delete status: " + status);
}
+ //else
// The file delete failed
//System.out.println("Failed to clean up file: " + sub.getPath());
}
@@ -2315,8 +2414,6 @@
if (framework.startsWith("DerbyNet"))
ptmp.put("hostName=", hostName);
System.setProperties(ptmp);
- PrintStream stdout = System.out;
- PrintStream stderr = System.err;
String pathStr = "";
@@ -2335,8 +2432,6 @@
PrintStream ps = new PrintStream(new FileOutputStream(pathStr), true);
- System.setOut(ps);
- System.setErr(ps);
// Install a security manager within this JVM for this test.
boolean installedSecurityManager = installSecurityManager();
@@ -2346,6 +2441,11 @@
ijarg[0] = "-p";
ijarg[1] = propString;
ijarg[2] = scriptPath;
+ // direct the standard output and error to the print stream for the .tmp file
+ PrintStream stdout = System.out;
+ PrintStream stderr = System.err;
+ System.setOut(ps);
+ System.setErr(ps);
RunIJ ij = new RunIJ(ijarg);
Thread ijThread = new Thread(ij);
try
@@ -2378,6 +2478,9 @@
ptmp.put("ij.defaultResourcePackage", "/org/apache/derbyTesting/");
ptmp.put("usesystem", "");
System.setProperties(ptmp);
+ // Reset System.out and System.err
+ System.setOut(stdout);
+ System.setErr(stderr);
}
else if (testType.equals("java"))
{
@@ -2391,6 +2494,10 @@
classArray[0] = args.getClass();
String testName = javaPath + "." + testBase;
Class JavaTest = Class.forName(testName);
+ PrintStream stdout = System.out;
+ PrintStream stderr = System.err;
+ System.setOut(ps);
+ System.setErr(ps);
// Get the tests's main method and invoke it
Method testMain = JavaTest.getMethod("main", classArray);
Object[] argObj = new Object[1];
@@ -2423,6 +2530,9 @@
{
// ignore the errors, they are expected.
}
+ // Reset System.out and System.err
+ System.setOut(stdout);
+ System.setErr(stderr);
}
else if (testType.equals("multi"))
{
@@ -2448,8 +2558,18 @@
}
else if (testType.equals("unit"))
{
+ // direct the standard output and error to the print stream for the .tmp file
+ PrintStream stdout = System.out;
+ PrintStream stderr = System.err;
+ System.setOut(ps);
+ System.setErr(ps);
System.out.println("Unit tests not implemented yet with useprocess=false");
- System.exit(1);
+ // Reset System.out and System.err
+ System.setOut(stdout);
+ System.setErr(stderr);
+ // repeat to stdout...
+ System.out.println("Unit tests not implemented yet with useprocess=false");
+ //System.exit(1);
/*
String[] args = new String[2];
args[0] = "-p";
@@ -2459,18 +2579,71 @@
}
else if (testType.equals("junit"))
{
- System.out.println("JUnit tests not implemented yet with useprocess=false");
- System.exit(1);
+ PrintStream stdout = System.out;
+ PrintStream stderr = System.err;
+ System.setOut(ps);
+ System.setErr(ps);
+ if (javaPath == null) {
+ javaPath = "org.apache.derbyTesting.functionTests.tests." + testDirName;
+ }
+ String testName = javaPath + "." + testBase;
+
+ // NOTE: This is most likely a temporary solution that will be
+ // replaced once we get our own TestRunner.
+
+ // Cannot use junit.textui.TestRunner.main() since it will exit
+ // the JVM when done.
+
+ // Extract/create a TestSuite object, which is either
+ // a) retreived from a static suite() method in the test class
+ //
+ // or, if a) fails
+ //
+ // b) containing all methods starting with "test" in the junit
+ // test class.
+ // This corresponds to what the junit.textui.TestRunner would
+ // do if invoked in a separate process (useprocess=true).
+
+ // Load the test class
+ Class testClass = Class.forName(testName);
+
+ TestSuite junitTestSuite = null;
+
+ try{
+ // Get the static suite() method if it exists.
+ Method suiteMethod = testClass.getMethod("suite", null);
+ // Get the TestSuite object returned by the suite() method
+ // by invoking it.
+ // Method is static, hence param1 is null
+ // Method has no formal parameters, hence param2 is null
+ junitTestSuite = (TestSuite) suiteMethod.invoke(null, null);
+ } catch(Exception ex){
+ // Not able to access static suite() method (with no params)
+ // returning a TestSuite object.
+ // Use JUnit to create a TestSuite with all methods in the test
+ // class starting with "test"
+ junitTestSuite = new TestSuite(testClass);
+ }
+
+ if(junitTestSuite != null){
+ // Now run the test suite
+ junit.textui.TestRunner.run(junitTestSuite);
+ }
+ else{
+ System.out.println("Not able to extract JUnit TestSuite from " +
+ "test class " + testName);
+ }
+
+ // Reset System.out and System.err
+ System.setOut(stdout);
+ System.setErr(stderr);
}
ps.close();
if (installedSecurityManager)
{
System.setSecurityManager(null);
- }
- // Reset System.out and System.err
- System.setOut(stdout);
- System.setErr(stderr);
+ }
}
static void addSkiptestReason(String reason) {
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/build.xml?rev=407637&r1=407636&r2=407637&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/build.xml (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/build.xml Thu May 18 14:33:43 2006
@@ -65,6 +65,7 @@
<classpath>
<pathelement location="${oro}"/>
<pathelement path="${compile.classpath}"/>
+ <pathelement path="${junit}"/>
</classpath>
<include name="${this.dir}/*.java"/>
</javac>
Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClientUseprocess.exclude
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClientUseprocess.exclude?rev=407637&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClientUseprocess.exclude (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClientUseprocess.exclude Thu May 18 14:33:43 2006
@@ -0,0 +1,74 @@
+# DerbyNetClientUseprocess.exclude
+# identifies tests that fail when run in a suite with useprocess=false with DerbyNetClient
+#
+# jdbcapi/HoldabilityTest.junit - test causes subsequent tests to fail because of missing
+# File permission
+# jdbcapi/bestrowidentifier.sql - test fails when db2jcc is in classpath, complaining about
+# java.lang.ExceptionInInitializerError
+# and access denied (java.lang.RuntimePermission loadLibrary.db2jcct2). (????!)
+# jdbcapi/checkDriver.java subtest createdbwithspaces fails, probably expecting different dir
+# jdbcapi/*sers* these tests log on to wombat with different permissions and users
+# test could possibly be rewritten to use another database
+# jdbcapi/Stream.java fails ?? don't know why this fails
+# junitTests/derbyNet/CompatibilityTest.java - exits the suite
+# jdbcapi/xaSimplePositive.sql - needs more props, getting nullPointer accessing derby.log
+# jdbcapi/xaStateTran.sql - needs more props, getting nullPointer accessing derby.log
+# jdbcapi/XATest.java - fails, needs to set up wombat differently, reflectionInvocation error
+# derbynet/DerbyNetAutoStart.java - exits the suite...
+# derbynet/NSinSameJVM.java - fails with different thread names. probably ok...
+# derbynet/dblook_test_net.java - expects different dir structure
+# stress/stress.multi - exits suite
+# derbynet/testij.java - sets up wombat connections in italian, causes later failures
+# derbynet/getCurrentProperties.java - fails, different sessions
+# derbynet/runtimeinfo.java - different sessions
+# derbynet/sysinfo.java - needs other properties
+# derbynet/sysinfo_withproperties.java - needs other properties
+# following fail for various reasons, many related to not being able to connect:
+# derbynet/badConnection.java
+# jdbcapi/odbc_metadata.java
+# lang/optimizerOverrides.sql
+# lang/big.sql
+# lang/bug5054.sql
+# lang/forupdate.sql
+# lang/wisconsin.java
+# jdbcapi/derbyStress.java
+# jdbcapi/maxfieldsize.java
+# lang/scrollCursors1.sql
+# jdbcapi/autoGeneratedJdbc30.java
+# jdbcapi/callable.java
+# jdbcapi/blobclob4BLOB.java - fails in blobTest8Trigger with container tmp/... not found error...
+#
+jdbcapi/HoldabilityTest.junit
+jdbcapi/bestrowidentifier.sql
+jdbcapi/checkDriver.java
+jdbcapi/users.sql
+jdbcapi/users2.sql
+jdbcapi/secureUsers.sql
+jdbcapi/secureUsers1.sql
+jdbcapi/Stream.java
+junitTests/derbyNet/CompatibilityTest.java
+jdbcapi/xaSimplePositive.sql
+jdbcapi/xaStateTran.sql
+jdbcapi/XATest.java
+derbynet/DerbyNetAutoStart.java
+derbynet/NSinSameJVM.java
+derbynet/dblook_test_net.java
+derbynet/testij.java
+derbynet/getCurrentProperties.java
+derbynet/runtimeinfo.java
+derbynet/sysinfo.java
+derbynet/sysinfo_withproperties.java
+stress/stress.multi
+derbynet/badConnection.java
+jdbcapi/odbc_metadata.java
+lang/optimizerOverrides.sql
+lang/big.sql
+lang/bug5054.sql
+lang/forupdate.sql
+lang/wisconsin.java
+jdbcapi/derbyStress.java
+jdbcapi/maxfieldsize.java
+lang/scrollCursors1.sql
+jdbcapi/autoGeneratedJdbc30.java
+jdbcapi/callable.java
+jdbcapi/blobclob4BLOB.java
Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClientUseprocess.exclude
------------------------------------------------------------------------------
svn:eol-style = native
Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetUseprocess.exclude
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetUseprocess.exclude?rev=407637&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetUseprocess.exclude (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetUseprocess.exclude Thu May 18 14:33:43 2006
@@ -0,0 +1,51 @@
+# DerbyNetUseprocess.exclude
+# identifies tests that fail when run in a suite with useprocess=false with DerbyNet
+#
+# jdbcapi/HoldabilityTest.junit - causes subsequent tests to fail because of missing
+# File permissions
+# jdbcapi/bestrowidentifier.sql - test fails when db2jcc is in classpath, complaining about
+# java.lang.ExceptionInInitializerError
+# and access denied (java.lang.RuntimePermission loadLibrary.db2jcct2). (????!)
+# jdbcapi/checkDriver.java - subtest createdbwithspaces fails, probably expecting different dir
+# jdbcapi/*sers* - these tests log on to wombat with different permissions and users
+# test could possibly be rewritten to use another database
+# derbynet/NSinSameJVM.java - diff between thread and main. kind of ok, but fails.
+# derbynet/DerbyNetAutoStart.java - exits suite...
+# derbynet/getCurrentProperties.java - fails with different sessions
+# derbynet/dblook_test_net.java - fails, test misses properties
+# derbynet/runtimeinfo.java - fails with already existing threads (maybe intermittent)
+# derbynet/testij.java - sets up wombat in italian, causing subsequent tests to fail.
+# derbynet/sysinfo.java - fails because not access to java.class.path
+# derbynet/sysinfo_withproperties.java - fails because not access to java.class.path
+# jdbcapi/odbc_metadata.java - fails...
+# lang/optimizerOverrides.sql - fails...
+# lang/big.sql - checks depend on dir structure
+# lang/wisconsin.java - checks depend on dir structure
+# jdbcapi/nullSQLText.java - fails...?? (but not when run by itself)
+# jdbcapi/maxfieldsize.java - fails...??? (but not when run by itself)
+# jdbcapi/autoGeneratedJdbc30.java - fails...??? (but not when run by itself)
+# lang/scrollCursors1.sql - fails...??? (but not when run by itself)
+# jdbcapi/blobclob4BLOB.java - fails in blobTest8Trigger with container tmp/... not found error...
+#
+jdbcapi/maxfieldsize.java
+jdbcapi/HoldabilityTest.junit
+jdbcapi/bestrowidentifier.sql
+jdbcapi/checkDriver.java
+jdbcapi/users.sql
+jdbcapi/users2.sql
+jdbcapi/secureUsers.sql
+jdbcapi/secureUsers1.sql
+derbynet/testij.java
+derbynet/NSinSameJVM.java
+derbynet/DerbyNetAutoStart.java
+derbynet/getCurrentProperties.java
+derbynet/dblook_test_net.java
+derbynet/runtimeinfo.java
+derbynet/sysinfo.java
+derbynet/sysinfo_withproperties.java
+jdbcapi/odbc_metadata.java
+lang/optimizerOverrides.sql
+lang/big.sql
+lang/wisconsin.java
+stress/stress.multi
+jdbcapi/blobclob4BLOB.java
Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetUseprocess.exclude
------------------------------------------------------------------------------
svn:eol-style = native
Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/embeddedUseprocess.exclude
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/embeddedUseprocess.exclude?rev=407637&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/embeddedUseprocess.exclude (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/embeddedUseprocess.exclude Thu May 18 14:33:43 2006
@@ -0,0 +1,30 @@
+# embeddedUseprocess.exclude
+# identifies tests that fail when run in a suite with useprocess=false with embedded
+#
+# jdbcapi/HoldabilityTest.junit - causes subsequent tests to fail
+# jdbcapi/bestrowidentifier.sql - test fails when db2jcc is in classpath, complaining about
+# java.lang.ExceptionInInitializerError
+# and access denied (java.lang.RuntimePermission loadLibrary.db2jcct2). (????!)
+# jdbcapi/getCurConnJdbc20.sql ditto.
+# jdbcapi/autoGeneratedJdbc30.java ditto.
+# jdbcapi/checkDataSource30.java problem using reflection (class not found)
+# lang/holdCursorJava.java ditto.
+# lang/procedureJdbc30.java ditto.
+# jdbcapi/SURQueryMixTest.junit - fails with severe errors.
+# jdbcapi/SURTest.junit - fails with severe errors.
+# jdbcapi/UpdateXXXTest.junit - fails with NullPointerExceptions
+# jdbcapi/rsgetXXXcolumnNames.java - fails with an error indicating wombat already exists
+# jdbcapi/Stream.java - fails with an error indicating wombat already exists
+#
+jdbcapi/HoldabilityTest.junit
+jdbcapi/bestrowidentifier.sql
+jdbcapi/getCurConnJdbc20.sql
+jdbcapi/autoGeneratedJdbc30.java
+jdbcapi/checkDataSource30.java
+lang/holdCursorJava.java
+lang/procedureJdbc30.java
+jdbcapi/SURQueryMixTest.junit
+jdbcapi/SURTest.junit
+jdbcapi/UpdateXXXTest.junit
+jdbcapi/rsgetXXXcolumnNames.java
+jdbcapi/Stream.java
Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/embeddedUseprocess.exclude
------------------------------------------------------------------------------
svn:eol-style = native
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/derbyStress.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/derbyStress.java?rev=407637&r1=407636&r2=407637&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/derbyStress.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/derbyStress.java Thu May 18 14:33:43 2006
@@ -132,6 +132,7 @@
// How silly! I forgot to close the result set.
}
TestUtil.cleanUpTest(stmt, testObjects);
+ conn.commit();
stmt.close();
conn.close();
System.out.println("PASSED");
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/nullSQLText.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/nullSQLText.java?rev=407637&r1=407636&r2=407637&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/nullSQLText.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/nullSQLText.java Thu May 18 14:33:43 2006
@@ -60,6 +60,14 @@
con.setAutoCommit(true); // make sure it is true
s = con.createStatement();
+ // Clean-up in case anything was left from previous tests.
+ try {
+ s.execute("drop table t1");
+ } catch (SQLException se) {}
+ try {
+ s.execute("drop procedure za");
+ } catch (SQLException se) {}
+
try
{
// test null String in prepared statement
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java?rev=407637&r1=407636&r2=407637&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java Thu May 18 14:33:43 2006
@@ -38,6 +38,7 @@
import org.apache.derby.iapi.reference.JDBC30Translation;
import org.apache.derby.iapi.services.info.JVMInfo;
+import org.apache.derbyTesting.functionTests.harness.RunTest;
@@ -176,6 +177,14 @@
}
}
);
+ // last attempt to get useprocess to do networkserver stuff.
+ // If a suite has useprocess, it's possible there was no property set.
+ if (frameworkString == null)
+ {
+ String useprocessFramework = RunTest.framework;
+ if (useprocessFramework != null)
+ frameworkString = useprocessFramework;
+ }
if (frameworkString == null ||
frameworkString.toUpperCase(Locale.ENGLISH).equals("EMBEDDED"))
framework = EMBEDDED_FRAMEWORK;