KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2
3    Derby - Class org.apache.derbyTesting.functionTests.harness.j9_13
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.
31
32   @author ge
33  */

34 public class j9_13 extends jvm {
35
36     public String JavaDoc getName(){return "j9_13";}
37     public j9_13(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_13(String JavaDoc classpath, Vector JavaDoc D) {
45         super(classpath,D);
46     }
47     // more typical use:
48
public j9_13(long ms, long mx, String JavaDoc classpath, Vector JavaDoc D) {
49         super(ms,mx,classpath,D);
50     }
51     // actual use
52
public j9_13() {
53     Properties JavaDoc sp = System.getProperties();
54     String JavaDoc srvJvm = sp.getProperty("serverJvm");
55     if ((srvJvm!=null) && ((srvJvm.toUpperCase().startsWith("J9")) || (srvJvm.equalsIgnoreCase("wsdd5.6"))))
56     {
57         String JavaDoc wshome = guessWSHome();
58         // note, may have to switch to sep instead of hardcoding the slashes...
59
setJavaCmd(wshome+"/wsdd5.6/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 wsdd5.6, worry about
92
// newer versions, multiple class libraries, or multiple releases later.
93
if ((srvJvm !=null ) && ((srvJvm.toUpperCase().startsWith("J9")) || (srvJvm.equalsIgnoreCase("wsdd5.6"))))
94     {
95         String JavaDoc pathsep = System.getProperty("path.separator");
96         String JavaDoc wshome = guessWSHome();
97         // note, may have to switch to sep instead of hardcoding the slashes...
98
sb.append(" -Xbootclasspath/a:" + wshome + "/wsdd5.6/ive/lib/jclMax/classes.zip"
99             + pathsep + wshome + "/wsdd5.6/ive/lib/charconv.zip"
100             + pathsep + wshome + "/wsdd5.6/ive/lib/jclMax");
101     }
102     else
103         sb.append(" -Xbootclasspath/a:" + bootcp);
104         if (noasyncgc) warn("j9_13 does not support noasyncgc");
105         if (verbosegc) sb.append(" -verbose:gc");
106         if (noclassgc) warn("j9_13 does not support noclassgc");
107         if (ss>=0) warn("j9_13 does not support ss");
108         if (oss>=0) warn("j9_13 does not support oss");
109         if (ms>=0) {
110           sb.append(" -Xss");
111           sb.append(ms);
112           //sb.append("k");
113
}
114         if (mx>=0) {
115           sb.append(" -Xmx");
116           sb.append(mx);
117           //sb.append("k");
118
}
119         if (classpath!=null) warn("j9_13 does not support classpath, use -Xbootclasspath,-Xbootclasspath/p,-Xbootclasspath/a");
120         if (prof!=null) warn("j9_13 does not support prof");
121         if (verify) sb.append(" -verify");
122         if (noverify) warn("j9_13 does not support noverify");
123         if (nojit) sb.append(" -Xnojit");
124         if (D != null)
125           for (int i=0; i<D.size();i++) {
126             sb.append(" -D");
127             sb.append((String JavaDoc)(D.elementAt(i)));
128           }
129     }
130     public String JavaDoc getDintro() { return "-D"; }
131
132     protected void setSecurityProps()
133     {
134         System.out.println("Note: J9 tests do not run with security manager");
135     }
136 }
137
Popular Tags