001: /*
002:
003: Derby - Class org.apache.derbyTesting.functionTests.harness.j9_13
004:
005: Licensed to the Apache Software Foundation (ASF) under one or more
006: contributor license agreements. See the NOTICE file distributed with
007: this work for additional information regarding copyright ownership.
008: The ASF licenses this file to You under the Apache License, Version 2.0
009: (the "License"); you may not use this file except in compliance with
010: the License. You may obtain a copy of the License at
011:
012: http://www.apache.org/licenses/LICENSE-2.0
013:
014: Unless required by applicable law or agreed to in writing, software
015: distributed under the License is distributed on an "AS IS" BASIS,
016: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: See the License for the specific language governing permissions and
018: limitations under the License.
019:
020: */
021:
022: package org.apache.derbyTesting.functionTests.harness;
023:
024: import java.util.Vector;
025: import java.util.StringTokenizer;
026: import java.util.Properties;
027:
028: /**
029: <p>This class is for IBM's J9 jdk 1.3.
030:
031: @author ge
032: */
033: public class j9_13 extends jvm {
034:
035: public String getName() {
036: return "j9_13";
037: }
038:
039: public j9_13(boolean noasyncgc, boolean verbosegc,
040: boolean noclassgc, long ss, long oss, long ms, long mx,
041: String classpath, String prof, boolean verify,
042: boolean noverify, boolean nojit, Vector D) {
043: super (noasyncgc, verbosegc, noclassgc, ss, oss, ms, mx,
044: classpath, prof, verify, noverify, nojit, D);
045: }
046:
047: // more typical use:
048: public j9_13(String classpath, Vector D) {
049: super (classpath, D);
050: }
051:
052: // more typical use:
053: public j9_13(long ms, long mx, String classpath, Vector D) {
054: super (ms, mx, classpath, D);
055: }
056:
057: // actual use
058: public j9_13() {
059: Properties sp = System.getProperties();
060: String srvJvm = sp.getProperty("serverJvm");
061: if ((srvJvm != null)
062: && ((srvJvm.toUpperCase().startsWith("J9")) || (srvJvm
063: .equalsIgnoreCase("wsdd5.6")))) {
064: String wshome = guessWSHome();
065: // note, may have to switch to sep instead of hardcoding the slashes...
066: setJavaCmd(wshome + "/wsdd5.6/ive/bin/j9");
067: } else
068: setJavaCmd("j9");
069: }
070:
071: // return the command line to invoke this VM. The caller then adds
072: // the class and program arguments.
073: public Vector getCommandLine() {
074:
075: StringBuffer sb = new StringBuffer();
076: Vector v = super .getCommandLine();
077:
078: appendOtherFlags(sb);
079: String s = sb.toString();
080: StringTokenizer st = new StringTokenizer(s);
081: while (st.hasMoreTokens()) {
082: v.addElement(st.nextToken());
083: }
084: return v;
085: }
086:
087: public void appendOtherFlags(StringBuffer sb) {
088:
089: Properties sp = System.getProperties();
090: String bootcp = sp.getProperty("bootcp");
091: String srvJvm = sp.getProperty("serverJvm");
092: // if we're coming in to be the server jvm for networkserver testing on j9,
093: // bootcp is null, so we need to try to setup the bootclasspath from scratch
094: // for now, assume we're only interested in doing this for wsdd5.6, worry about
095: // newer versions, multiple class libraries, or multiple releases later.
096: if ((srvJvm != null)
097: && ((srvJvm.toUpperCase().startsWith("J9")) || (srvJvm
098: .equalsIgnoreCase("wsdd5.6")))) {
099: String pathsep = System.getProperty("path.separator");
100: String wshome = guessWSHome();
101: // note, may have to switch to sep instead of hardcoding the slashes...
102: sb.append(" -Xbootclasspath/a:" + wshome
103: + "/wsdd5.6/ive/lib/jclMax/classes.zip" + pathsep
104: + wshome + "/wsdd5.6/ive/lib/charconv.zip"
105: + pathsep + wshome + "/wsdd5.6/ive/lib/jclMax");
106: } else
107: sb.append(" -Xbootclasspath/a:" + bootcp);
108: if (noasyncgc)
109: warn("j9_13 does not support noasyncgc");
110: if (verbosegc)
111: sb.append(" -verbose:gc");
112: if (noclassgc)
113: warn("j9_13 does not support noclassgc");
114: if (ss >= 0)
115: warn("j9_13 does not support ss");
116: if (oss >= 0)
117: warn("j9_13 does not support oss");
118: if (ms >= 0) {
119: sb.append(" -Xss");
120: sb.append(ms);
121: //sb.append("k");
122: }
123: if (mx >= 0) {
124: sb.append(" -Xmx");
125: sb.append(mx);
126: //sb.append("k");
127: }
128: if (classpath != null)
129: warn("j9_13 does not support classpath, use -Xbootclasspath,-Xbootclasspath/p,-Xbootclasspath/a");
130: if (prof != null)
131: warn("j9_13 does not support prof");
132: if (verify)
133: sb.append(" -verify");
134: if (noverify)
135: warn("j9_13 does not support noverify");
136: if (nojit)
137: sb.append(" -Xnojit");
138: if (D != null)
139: for (int i = 0; i < D.size(); i++) {
140: sb.append(" -D");
141: sb.append((String) (D.elementAt(i)));
142: }
143: }
144:
145: public String getDintro() {
146: return "-D";
147: }
148:
149: protected void setSecurityProps() {
150: System.out
151: .println("Note: J9 tests do not run with security manager");
152: }
153: }
|