1 /*
2 * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
100
101 // getAbsolutePath requires permission to read user.dir
102 String args =
103 " -log " + (new File(LOGDIR, log)).getAbsolutePath();
104
105 if (includePortArg) {
106 args += " -port " + port;
107 }
108
109 // +
110 // " -C-Djava.compiler= ";
111
112 // if test params set, want to propagate them
113 if (!TestParams.testSrc.equals("")) {
114 args += " -C-Dtest.src=" + TestParams.testSrc;
115 }
116 if (!TestParams.testClasses.equals("")) {
117 args += " -C-Dtest.classes=" + TestParams.testClasses;
118 }
119
120 args += " -C-Djava.rmi.server.useCodebaseOnly=false ";
121
122 args += " " + getCodeCoverageArgs();
123 return args;
124 }
125
126 /**
127 * Routine that creates an rmid that will run with or without a
128 * policy file.
129 */
130 public static RMID createRMID() {
131 return createRMID(System.out, System.err, true);
132 }
133
134 public static RMID createRMID(boolean debugExec) {
135 return createRMID(System.out, System.err, debugExec);
136 }
137
138 public static RMID createRMID(OutputStream out, OutputStream err) {
139 return createRMID(out, err, true);
|
1 /*
2 * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
100
101 // getAbsolutePath requires permission to read user.dir
102 String args =
103 " -log " + (new File(LOGDIR, log)).getAbsolutePath();
104
105 if (includePortArg) {
106 args += " -port " + port;
107 }
108
109 // +
110 // " -C-Djava.compiler= ";
111
112 // if test params set, want to propagate them
113 if (!TestParams.testSrc.equals("")) {
114 args += " -C-Dtest.src=" + TestParams.testSrc;
115 }
116 if (!TestParams.testClasses.equals("")) {
117 args += " -C-Dtest.classes=" + TestParams.testClasses;
118 }
119
120 if (!TestParams.testJavaOpts.equals("")) {
121 for (String a : TestParams.testJavaOpts.split(" +")) {
122 args += " -C" + a;
123 }
124 }
125
126 if (!TestParams.testVmOpts.equals("")) {
127 for (String a : TestParams.testVmOpts.split(" +")) {
128 args += " -C" + a;
129 }
130 }
131
132 args += " -C-Djava.rmi.server.useCodebaseOnly=false ";
133
134 args += " " + getCodeCoverageArgs();
135 return args;
136 }
137
138 /**
139 * Routine that creates an rmid that will run with or without a
140 * policy file.
141 */
142 public static RMID createRMID() {
143 return createRMID(System.out, System.err, true);
144 }
145
146 public static RMID createRMID(boolean debugExec) {
147 return createRMID(System.out, System.err, debugExec);
148 }
149
150 public static RMID createRMID(OutputStream out, OutputStream err) {
151 return createRMID(out, err, true);
|