On 5/26/05, Daniel John Debrunner <[EMAIL PROTECTED]> wrote:
Myrna, your changes to RunTest for WCTME 5.7 (J9) enabled me to get it
running with J9/JSR169 but RunSuite fails with errors parsing a version
number. The version being parsed and causing the exception in
JavaVersionHolder is
J2ME Foundation Specification v1.0
What should the field values be in JavaVersionHolder to match the
changes you made in RunTest? (ie. minor, major version)
2 , 2.
The thing is, the test harness uses java.version and assumes it actually gives the version. With j9, the java.version is not a number and it does not well reflect the current version. So, instead, we need to switch to use
java.vm.version which for j9 gives more helpful details.
And does this mean that RunTest and RunSuite have separate mechanisms to
determine the identity of a VM?
Well...I never said the test harness was pretty. :-)
Yes, RunTest and RunSuite both separately try to figure out what jvm is running. That code is duplicated. And worse, RunList and RunSuite both do the same thing also.
Try the attached patch. I had failed to duplicate some code in RunSuite and had only duplicated it in RunList. Also making the check for 'foun10' rather than 'foun' in both RunList and RunSuite.java
Of course, it really should be changed to pass the jvmversion on, hm? (unless serverjvm is set to run networkserver in a different jvm).
Myrna
Index: java/testing/org/apache/derbyTesting/functionTests/harness/RunList.java
===================================================================
--- java/testing/org/apache/derbyTesting/functionTests/harness/RunList.java
(revision 178655)
+++ java/testing/org/apache/derbyTesting/functionTests/harness/RunList.java
(working copy)
@@ -633,7 +633,7 @@
jvmName = suiteProperties.getProperty("jvm");
String j9config =
System.getProperty("com.ibm.oti.configuration");
if (j9config != null)
- if (j9config.equals("foun"))
+ if (j9config.equals("foun10"))
jvmName="j9_foundation";
else if (j9config.equals("max"))
jvmName="j9_13";
Index: java/testing/org/apache/derbyTesting/functionTests/harness/RunSuite.java
===================================================================
--- java/testing/org/apache/derbyTesting/functionTests/harness/RunSuite.java
(revision 178655)
+++ java/testing/org/apache/derbyTesting/functionTests/harness/RunSuite.java
(working copy)
@@ -94,7 +94,7 @@
}
String j9config =
System.getProperty("com.ibm.oti.configuration");
if (j9config != null)
- if (j9config.equals("foun"))
+ if (j9config.equals("foun10"))
jvmName="j9_foundation";
else if (j9config.equals("max"))
jvmName="j9_13";
@@ -286,8 +286,15 @@
}
else
javaVersion = jvmName;
+
+ // for j9, we cannot just use java.version.
+ String javavmVersion;
+ if (System.getProperty("java.vm.name").equals("J9"))
+ javavmVersion = (System.getProperty("java.vm.version"));
+ else
+ javavmVersion = javaVersion;
- JavaVersionHolder jvh = new JavaVersionHolder(javaVersion);
+ JavaVersionHolder jvh = new
JavaVersionHolder(javavmVersion);
String majorVersion = jvh.getMajorVersion();
String minorVersion = jvh.getMinorVersion();
int iminor = jvh.getMinorNumber();
