001: /*
002:
003: Derby - Class org.apache.derbyTesting.functionTests.harness.j9_22
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.1 subset - 2.2
030:
031: @author myrna
032: */
033: public class j9_22 extends jvm {
034:
035: public String getName() {
036: return "j9_22";
037: }
038:
039: public j9_22(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_22(String classpath, Vector D) {
049: super (classpath, D);
050: }
051:
052: // more typical use:
053: public j9_22(long ms, long mx, String classpath, Vector D) {
054: super (ms, mx, classpath, D);
055: }
056:
057: // actual use
058: public j9_22() {
059: Properties sp = System.getProperties();
060: String srvJvm = sp.getProperty("serverJvm");
061: if ((srvJvm != null) && (srvJvm.toUpperCase().startsWith("J9"))) {
062: String wshome = guessWSHome();
063: // note, may have to switch to sep instead of hardcoding the slashes...
064: setJavaCmd(wshome + "/wctme5.7/ive/bin/j9");
065: } else
066: setJavaCmd("j9");
067: }
068:
069: // return the command line to invoke this VM. The caller then adds
070: // the class and program arguments.
071: public Vector getCommandLine() {
072:
073: StringBuffer sb = new StringBuffer();
074: Vector v = super .getCommandLine();
075:
076: appendOtherFlags(sb);
077: String s = sb.toString();
078: StringTokenizer st = new StringTokenizer(s);
079: while (st.hasMoreTokens()) {
080: v.addElement(st.nextToken());
081: }
082: return v;
083: }
084:
085: public void appendOtherFlags(StringBuffer sb) {
086:
087: Properties sp = System.getProperties();
088: String bootcp = sp.getProperty("bootcp");
089: String srvJvm = sp.getProperty("serverJvm");
090: // if we're coming in to be the server jvm for networkserver testing on j9,
091: // bootcp is null, so we need to try to setup the bootclasspath from scratch
092: // for now, assume we're only interested in doing this for wctme5.7, worry about
093: // newer versions, multiple class libraries, or multiple releases later.
094: sb.append(" -jcl:max");
095: if ((srvJvm != null) && (srvJvm.toUpperCase().startsWith("J9"))) {
096: String pathsep = System.getProperty("path.separator");
097: String wshome = guessWSHome();
098: // note, may have to switch to sep instead of hardcoding the slashes...
099: sb.append(" -Xbootclasspath/a:" + wshome
100: + "/wctme5.7/ive/lib/jclMax/classes.zip" + pathsep
101: + wshome + "/wctme5.7/ive/lib/charconv.zip"
102: + pathsep + wshome
103: + "/wctme5.7/ive/lib/database_enabler.jar");
104: } else
105: sb.append(" -Xbootclasspath/a:" + bootcp);
106: if (noasyncgc)
107: warn("j9_22 does not support noasyncgc");
108: if (verbosegc)
109: sb.append(" -verbose:gc");
110: if (noclassgc)
111: warn("j9_22 does not support noclassgc");
112: if (ss >= 0)
113: warn("j9_22 does not support ss");
114: if (oss >= 0)
115: warn("j9_22 does not support oss");
116: if (ms >= 0) {
117: sb.append(" -Xss");
118: sb.append(ms);
119: //sb.append("k");
120: }
121: if (mx >= 0) {
122: sb.append(" -Xmx");
123: sb.append(mx);
124: //sb.append("k");
125: }
126: if (classpath != null)
127: warn("j9_22 does not support classpath, use -Xbootclasspath,-Xbootclasspath/p,-Xbootclasspath/a");
128: if (prof != null)
129: warn("j9_22 does not support prof");
130: if (verify)
131: sb.append(" -verify");
132: if (noverify)
133: warn("j9_22 does not support noverify");
134: if (nojit)
135: sb.append(" -Xnojit");
136: if (D != null)
137: for (int i = 0; i < D.size(); i++) {
138: sb.append(" -D");
139: sb.append((String) (D.elementAt(i)));
140: }
141: }
142:
143: public String getDintro() {
144: return "-D";
145: }
146:
147: protected void setSecurityProps() {
148: System.out
149: .println("Note: J9 tests do not run with security manager");
150: }
151: }
|