1
1
/*
2
- * Copyright (c) 2012, 2015 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2012, 2019 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -132,11 +132,9 @@ void testNativeMemoryTracking() {
132
132
* Code to create env variable not executed.
133
133
* 4) give and invalid value and check to make sure JVM commented
134
134
*/
135
- String launcherPidString = "launcher.pid=" ;
136
135
String envVarPidString = "TRACER_MARKER: NativeMemoryTracking: env var is NMT_LEVEL_" ;
137
136
String NMT_Option_Value = "off" ;
138
137
String myClassName = "helloworld" ;
139
- boolean haveLauncherPid = false ;
140
138
141
139
// === Run the tests ===
142
140
// ---Test 1a
@@ -163,46 +161,6 @@ void testNativeMemoryTracking() {
163
161
throw new RuntimeException ("Error: env Var Pid in tracking info is empty string" );
164
162
}
165
163
166
- /*
167
- * On Linux, Launcher Tracking will print the PID. Use this info
168
- * to validate what we got as the PID in the Launcher itself.
169
- * Linux is the only one that prints this, and trying to get it
170
- * here for win is awful. So let the linux test make sure we get
171
- * the valid pid, and for non-linux, just make sure pid string is
172
- * non-zero.
173
- */
174
- if (isLinux ) {
175
- // get what the test says is the launcher pid
176
- String launcherPid = null ;
177
- for (String line : tr .testOutput ) {
178
- int index = line .indexOf (launcherPidString );
179
- if (index >= 0 ) {
180
- int sindex = index + launcherPidString .length ();
181
- int tindex = sindex + line .substring (sindex ).indexOf ("'" );
182
- System .out .println ("DEBUG INFO: sindex = " + sindex );
183
- System .out .println ("DEBUG INFO: searching substring: " + line .substring (sindex ));
184
- System .out .println ("DEBUG INFO: tindex = " + tindex );
185
- // DEBUG INFO
186
- System .out .println (tr );
187
- launcherPid = line .substring (sindex , tindex );
188
- break ;
189
- }
190
- }
191
- if (launcherPid == null ) {
192
- System .out .println (tr );
193
- throw new RuntimeException ("Error: failed to find launcher Pid in launcher tracking info" );
194
- }
195
-
196
- // did we create the env var with the correct pid?
197
- if (!launcherPid .equals (envVarPid )) {
198
- System .out .println (tr );
199
- System .out .println ("Error: wrong pid in creating env var" );
200
- System .out .println ("Error Info: launcherPid = " + launcherPid );
201
- System .out .println ("Error Info: envVarPid = " + envVarPid );
202
- throw new RuntimeException ("Error: wrong pid in creating env var" );
203
- }
204
- }
205
-
206
164
// --- Test 1b
207
165
if (!tr .contains ("NativeMemoryTracking: got value " + NMT_Option_Value )) {
208
166
System .out .println (tr );
0 commit comments