KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derbyTesting > functionTests > harness > j9_22


1 /*
2
3    Derby - Class org.apache.derbyTesting.functionTests.harness.j9_22
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to You under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derbyTesting.functionTests.harness;
23
24 import java.util.Vector JavaDoc;
25 import java.util.StringTokenizer JavaDoc;
26 import java.util.Properties JavaDoc;
27
28
29 /**
30   <p>This class is for IBM's J9 jdk 1.3.1 subset - 2.2
31
32   @author myrna
33  */

34 public class j9_22 extends jvm {
35
36     public String JavaDoc getName(){return "j9_22";}
37     public j9_22(boolean noasyncgc, boolean verbosegc, boolean noclassgc,
38     long ss, long oss, long ms, long mx, String JavaDoc classpath, String JavaDoc prof,
39     boolean verify, boolean noverify, boolean nojit, Vector JavaDoc D) {
40         super(noasyncgc,verbosegc,noclassgc,ss,oss,ms,mx,classpath,prof,
41         verify,noverify,nojit,D);
42     }
43     // more typical use:
44
public j9_22(String JavaDoc classpath, Vector JavaDoc D) {
45         super(classpath,D);
46     }
47     // more typical use:
48
public j9_22(long ms, long mx, String JavaDoc classpath, Vector JavaDoc D) {
49         super(ms,mx,classpath,D);
50     }
51     // actual use
52
public j9_22() {
53     Properties JavaDoc sp = System.getProperties();
54     String JavaDoc srvJvm = sp.getProperty("serverJvm");
55     if ((srvJvm!=null) && (srvJvm.toUpperCase().startsWith("J9")))
56     {
57         String JavaDoc wshome = guessWSHome();
58         // note, may have to switch to sep instead of hardcoding the slashes...
59
setJavaCmd(wshome+"/wctme5.7/ive/bin/j9");
60     }
61     else
62         setJavaCmd("j9");
63     }
64
65     // return the command line to invoke this VM. The caller then adds
66
// the class and program arguments.
67
public Vector JavaDoc getCommandLine()
68     {
69
70         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
71         Vector JavaDoc v = super.getCommandLine();
72
73         appendOtherFlags(sb);
74         String JavaDoc s = sb.toString();
75         StringTokenizer JavaDoc st = new StringTokenizer JavaDoc(s);
76         while (st.hasMoreTokens())
77         {
78             v.addElement(st.nextToken());
79         }
80         return v;
81     }
82
83     public void appendOtherFlags(StringBuffer JavaDoc sb)
84     {
85
86     Properties JavaDoc sp = System.getProperties();
87     String JavaDoc bootcp = sp.getProperty("bootcp");
88     String JavaDoc srvJvm = sp.getProperty("serverJvm");
89     // if we're coming in to be the server jvm for networkserver testing on j9,
90
// bootcp is null, so we need to try to setup the bootclasspath from scratch
91
// for now, assume we're only interested in doing this for wctme5.7, worry about
92
// newer versions, multiple class libraries, or multiple releases later.
93
sb.append(" -jcl:max");
94     if ((srvJvm !=null ) && (srvJvm.toUpperCase().startsWith("J9")))
95     {
96         String JavaDoc pathsep = System.getProperty("path.separator");
97         String JavaDoc wshome = guessWSHome();
98         // note, may have to switch to sep instead of hardcoding the slashes...
99
sb.append(" -Xbootclasspath/a:" + wshome + "/wctme5.7/ive/lib/jclMax/classes.zip"
100             + pathsep + wshome + "/wctme5.7/ive/lib/charconv.zip"
101             + pathsep + wshome + "/wctme5.7/ive/lib/database_enabler.jar");
102     }
103     else
104         sb.append(" -Xbootclasspath/a:" + bootcp);
105         if (noasyncgc) warn("j9_22 does not support noasyncgc");
106         if (verbosegc) sb.append(" -verbose:gc");
107         if (noclassgc) warn("j9_22 does not support noclassgc");
108         if (ss>=0) warn("j9_22 does not support ss");
109         if (oss>=0) warn("j9_22 does not support oss");
110         if (ms>=0) {
111           sb.append(" -Xss");
112           sb.append(ms);
113           //sb.append("k");
114
}
115         if (mx>=0) {
116           sb.append(" -Xmx");
117           sb.append(mx);
118           //sb.append("k");
119
}
120         if (classpath!=null) warn("j9_22 does not support classpath, use -Xbootclasspath,-Xbootclasspath/p,-Xbootclasspath/a");
121         if (prof!=null) warn("j9_22 does not support prof");
122         if (verify) sb.append(" -verify");
123         if (noverify) warn("j9_22 does not support noverify");
124         if (nojit) sb.append(" -Xnojit");
125         if (D != null)
126           for (int i=0; i<D.size();i++) {
127             sb.append(" -D");
128             sb.append((String JavaDoc)(D.elementAt(i)));
129           }
130     }
131     public String JavaDoc getDintro() { return "-D"; }
132
133     protected void setSecurityProps()
134     {
135         System.out.println("Note: J9 tests do not run with security manager");
136     }
137 }
138
Popular Tags