Attachment 'derby.patch'

Download

   1 Index: java/engine/org/apache/derby/iapi/services/info/JVMInfo.java
   2 ===================================================================
   3 --- java/engine/org/apache/derby/iapi/services/info/JVMInfo.java	(revision 464758)
   4 +++ java/engine/org/apache/derby/iapi/services/info/JVMInfo.java	(working copy)
   5 @@ -139,6 +139,13 @@
   6  				}
   7  			}
   8  		}
   9 +		
  10 +		// current workround for Harmony IBM VME since its java.version is still
  11 +		// 1.4.2
  12 +		if (System.getProperty("java.vm.name").equals("J9")
  13 +				&& System.getProperty("java.vm.version").equals("2.3")) {
  14 +			id = J2SE_15;
  15 +		}
  16  
  17  		JDK_ID = id;
  18  		J2ME = isJ2ME;
  19 Index: java/testing/org/apache/derbyTesting/functionTests/tests/lang/dbManagerLimits_app.properties
  20 ===================================================================
  21 --- java/testing/org/apache/derbyTesting/functionTests/tests/lang/dbManagerLimits_app.properties	(revision 464758)
  22 +++ java/testing/org/apache/derbyTesting/functionTests/tests/lang/dbManagerLimits_app.properties	(working copy)
  23 @@ -1,2 +1,2 @@
  24  usedefaults=true
  25 -jvmflags=-ms32M -mx128M
  26 +jvmflags=
  27 Index: java/testing/org/apache/derbyTesting/functionTests/tests/lang/wisconsin_app.properties
  28 ===================================================================
  29 --- java/testing/org/apache/derbyTesting/functionTests/tests/lang/wisconsin_app.properties	(revision 464758)
  30 +++ java/testing/org/apache/derbyTesting/functionTests/tests/lang/wisconsin_app.properties	(working copy)
  31 @@ -11,7 +11,7 @@
  32  
  33  # flags specific to this test: it runs out of memory on jdk118 sometimes
  34  # so give the JVM more memory always:
  35 -jvmflags=-ms32M^-mx128M
  36 +jvmflags=
  37  
  38  usedefaults=true
  39  
  40 Index: java/testing/org/apache/derbyTesting/functionTests/tests/lang/triggerStream_app.properties
  41 ===================================================================
  42 --- java/testing/org/apache/derbyTesting/functionTests/tests/lang/triggerStream_app.properties	(revision 464758)
  43 +++ java/testing/org/apache/derbyTesting/functionTests/tests/lang/triggerStream_app.properties	(working copy)
  44 @@ -1,2 +1,2 @@
  45  usedefaults=true
  46 -jvmflags=-ms32M^-mx128M
  47 +jvmflags=
  48 Index: java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java
  49 ===================================================================
  50 --- java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java	(revision 464758)
  51 +++ java/testing/org/apache/derbyTesting/functionTests/harness/RunTest.java	(working copy)
  52 @@ -433,6 +433,10 @@
  53      	boolean status;
  54  
  55      	// allow for server jvmName to be different from client jvmName
  56 +        if(Harmony.isHarmony())
  57 +        {
  58 +            jvmName = Harmony.getJvmName();
  59 +        }
  60      	if (jvmnet)
  61      	{
  62              // first check to see if properties were set to use a different jvm for server/client
  63 @@ -1003,9 +1007,11 @@
  64  		    {
  65                  if (System.getProperty("java.vm.vendor").startsWith("IBM"))
  66                  {
  67 -                    if (System.getProperty("java.vm.name").equals("J9"))
  68 +                    if (System.getProperty("java.vm.name").equals("J9"))                        
  69 +                        
  70                      {
  71 -                        if (System.getProperty("com.ibm.oti.configuration").equals("foun10"))
  72 +                        String configuration = System.getProperty("com.ibm.oti.configuration");
  73 +                        if (configuration!=null && configuration.equals("foun10"))
  74                          {
  75                              jvmName = "j9_foundation";
  76                          }
  77 Index: java/testing/org/apache/derbyTesting/functionTests/harness/RunSuite.java
  78 ===================================================================
  79 --- java/testing/org/apache/derbyTesting/functionTests/harness/RunSuite.java	(revision 464758)
  80 +++ java/testing/org/apache/derbyTesting/functionTests/harness/RunSuite.java	(working copy)
  81 @@ -90,7 +90,7 @@
  82  
  83  	public static void main(String[] args) throws Exception
  84  	{
  85 -		if ((System.getProperty("java.vm.name") != null) && System.getProperty("java.vm.name").equals("J9"))
  86 +		if (!Harmony.isHarmony() &&(System.getProperty("java.vm.name") != null) && System.getProperty("java.vm.name").equals("J9"))
  87  		{
  88  		 		javaCmd = "j9";
  89  				String javaHome = System.getProperty("java.home");
  90 @@ -377,7 +377,7 @@
  91  		    suiteProperties.put("jversion", j);
  92  		
  93  		String jcmd = sp.getProperty("javaCmd");
  94 -		if ((System.getProperty("java.vm.name") != null) && System.getProperty("java.vm.name").equals("J9"))
  95 +		if (!Harmony.isHarmony()&&(System.getProperty("java.vm.name") != null) && System.getProperty("java.vm.name").equals("J9"))
  96  			jcmd = "j9";
  97  		if (jcmd != null)
  98  		{
  99 Index: java/testing/org/apache/derbyTesting/functionTests/harness/SysInfoLog.java
 100 ===================================================================
 101 --- java/testing/org/apache/derbyTesting/functionTests/harness/SysInfoLog.java	(revision 464758)
 102 +++ java/testing/org/apache/derbyTesting/functionTests/harness/SysInfoLog.java	(working copy)
 103 @@ -56,7 +56,11 @@
 104                      jvmName = "jdk13";
 105                  else if (jvmName.startsWith("jdk13"))
 106                      jvmName = "jdk13";
 107 -
 108 +                    
 109 +                if(Harmony.isHarmony()) {
 110 +                   jvmName = Harmony.getJvmName();
 111 +                } 
 112 +                
 113  				javavm = jvm.getJvm(jvmName);
 114                  if (javaCmd != null)
 115                      javavm.setJavaCmd(javaCmd);
 116 Index: java/testing/org/apache/derbyTesting/functionTests/harness/Harmony.java
 117 ===================================================================
 118 --- java/testing/org/apache/derbyTesting/functionTests/harness/Harmony.java	(revision 0)
 119 +++ java/testing/org/apache/derbyTesting/functionTests/harness/Harmony.java	(revision 0)
 120 @@ -0,0 +1,33 @@
 121 +package org.apache.derbyTesting.functionTests.harness;
 122 +public class Harmony
 123 +{
 124 +    private static boolean isharmony = false;
 125 +    private static final String JAVA_VM_NAME="java.vm.name";
 126 +    private static final String JAVA_VM_VERSION="java.vm.version";
 127 +    private static final String HARMONY_VM_NAME_VALUE="J9";
 128 +    private static final String HARMONY_VM_VERSION="2.3";
 129 +    private static final String JVM_NAME="jdk15";
 130 +            
 131 +    static
 132 +    {
 133 +        if(System.getProperty(JAVA_VM_NAME).equals(HARMONY_VM_NAME_VALUE) && System.getProperty(JAVA_VM_VERSION).equals(HARMONY_VM_VERSION))
 134 +        {
 135 +            isharmony = true;
 136 +        }
 137 +    }
 138 +    
 139 +    public static boolean isHarmony()
 140 +    {
 141 +        return isharmony;
 142 +    } 
 143 +    
 144 +    public static String getJvmName()
 145 +    {
 146 +        return JVM_NAME;
 147 +    }
 148 +    
 149 +    public static jvm getJvm()
 150 +    {
 151 +       return new j9_23(); 
 152 +    }
 153 +}
 154 Index: java/testing/org/apache/derbyTesting/functionTests/harness/j9_23.java
 155 ===================================================================
 156 --- java/testing/org/apache/derbyTesting/functionTests/harness/j9_23.java	(revision 0)
 157 +++ java/testing/org/apache/derbyTesting/functionTests/harness/j9_23.java	(revision 0)
 158 @@ -0,0 +1,102 @@
 159 +/*
 160 +
 161 +   Derby - Class org.apache.derbyTesting.functionTests.harness.jdk15
 162 +
 163 +   Licensed to the Apache Software Foundation (ASF) under one or more
 164 +   contributor license agreements.  See the NOTICE file distributed with
 165 +   this work for additional information regarding copyright ownership.
 166 +   The ASF licenses this file to You under the Apache License, Version 2.0
 167 +   (the "License"); you may not use this file except in compliance with
 168 +   the License.  You may obtain a copy of the License at
 169 +
 170 +      http://www.apache.org/licenses/LICENSE-2.0
 171 +
 172 +   Unless required by applicable law or agreed to in writing, software
 173 +   distributed under the License is distributed on an "AS IS" BASIS,
 174 +   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 175 +   See the License for the specific language governing permissions and
 176 +   limitations under the License.
 177 +
 178 + */
 179 +
 180 +package org.apache.derbyTesting.functionTests.harness;
 181 +
 182 +import java.util.Vector;
 183 +import java.util.StringTokenizer;
 184 +
 185 +/**
 186 +  <p>This class is for JDK1.5.
 187 +
 188 +  @author ames
 189 + */
 190 +public class j9_23 extends jvm {
 191 +
 192 +	public String getName(){return "j9_23";}
 193 +    public j9_23(boolean noasyncgc, boolean verbosegc, boolean noclassgc,
 194 +    long ss, long oss, long ms, long mx, String classpath, String prof,
 195 +    boolean verify, boolean noverify, boolean nojit, Vector D) {
 196 +        super(noasyncgc,verbosegc,noclassgc,ss,oss,ms,mx,classpath,prof,
 197 +		verify,noverify,nojit,D);
 198 +    }
 199 +    // more typical use:
 200 +    public j9_23(String classpath, Vector D) {
 201 +        super(classpath,D);
 202 +    }
 203 +    // more typical use:
 204 +    public j9_23(long ms, long mx, String classpath, Vector D) {
 205 +        super(ms,mx,classpath,D);
 206 +    }
 207 +    // actual use
 208 +    public j9_23() { }
 209 +
 210 +    // return the command line to invoke this VM.  The caller then adds
 211 +    // the class and program arguments.
 212 +    public Vector getCommandLine() 
 213 +    {
 214 +        StringBuffer sb = new StringBuffer();
 215 +        Vector v = super.getCommandLine();
 216 +        appendOtherFlags(sb);
 217 +        String s = sb.toString();
 218 +        StringTokenizer st = new StringTokenizer(s);
 219 +        while (st.hasMoreTokens())
 220 +        {
 221 +            v.addElement(st.nextToken());
 222 +        }
 223 +        return v;
 224 +	}
 225 +
 226 +	public void appendOtherFlags(StringBuffer sb)
 227 +	{
 228 +        if (noasyncgc) warn("j9_23 does not support noasyncgc");
 229 +        if (verbosegc) sb.append(" -verbose:gc");
 230 +        if (noclassgc) sb.append(" -Xnoclassgc");
 231 +        if (ss>=0) warn("j9_23 does not support ss");
 232 +        if (oss>=0) warn("j9_23 does not support oss");
 233 +        if (ms>=0) {
 234 +          sb.append(" -ms");
 235 +          sb.append(ms);
 236 +        }
 237 +        if (mx>=0) {
 238 +          sb.append(" -mx");
 239 +          sb.append(mx);
 240 +        }
 241 +        if (classpath!=null) {
 242 +          sb.append(" -classpath ");
 243 +          sb.append(classpath);
 244 +        }
 245 +        if (prof!=null) warn("j9_23 does not support prof");
 246 +        if (verify) warn("j9_23 does not support verify");
 247 +        if (noverify) warn("j9_23 does not support noverify");
 248 +        if (nojit) sb.append(" -Djava.compiler=NONE");
 249 +        if (D != null)
 250 +          for (int i=0; i<D.size();i++) {
 251 +	        sb.append(" -D");
 252 +	        sb.append((String)(D.elementAt(i)));
 253 +          }
 254 +    }
 255 +	public String getDintro() { return "-D"; }
 256 +    protected void setSecurityProps()
 257 +    {
 258 +        System.out.println("Note: J9 tests do not run with security manager");      
 259 +    }
 260 +}
 261 Index: java/testing/org/apache/derbyTesting/functionTests/harness/jvm.java
 262 ===================================================================
 263 --- java/testing/org/apache/derbyTesting/functionTests/harness/jvm.java	(revision 464758)
 264 +++ java/testing/org/apache/derbyTesting/functionTests/harness/jvm.java	(working copy)
 265 @@ -211,7 +211,10 @@
 266  	also org.apache.derbyTesting.functionTests.harness.<jvmName>
 267       */
 268      public static jvm getJvm(String jvmName) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
 269 -	jvm result = null;
 270 +	    if(Harmony.isHarmony()){
 271 +            return Harmony.getJvm();
 272 +        }
 273 +        jvm result = null;
 274          try {
 275  		result = (jvm)Class.forName(jvmName).newInstance();
 276          } catch (ClassNotFoundException e) {
 277 Index: java/testing/org/apache/derbyTesting/functionTests/suites/derbyall.properties
 278 ===================================================================
 279 --- java/testing/org/apache/derbyTesting/functionTests/suites/derbyall.properties	(revision 464758)
 280 +++ java/testing/org/apache/derbyTesting/functionTests/suites/derbyall.properties	(working copy)
 281 @@ -1,3 +1,3 @@
 282 -suites=derbylang derbynetmats storeall xa derbytools jdbc20 jdbc40 jdk14 jdbcapi derbynetclientmats encryptionAll nist demo multi unit i18nTest upgrade
 283 +suites=derbylang derbynetmats storeall xa derbytools jdbc20 jdbc40 jdk14 jdbcapi encryptionAll nist demo multi unit i18nTest upgrade
 284  derby.debug.true=enableBtreeConsistencyCheck
 285  derby.stream.error.logSeverityLevel=0

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.

You are not allowed to attach a file to this page.