/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 7029048
* @summary Checks for LD_LIBRARY_PATH on *nixes
* @compile -XDignore.symbol.file ExecutionEnvironment.java TestHelper.java Test7029048.java
* @run main Test7029048
*/
/*
* 7029048: test for LD_LIBRARY_PATH set to different paths pointing which may
* contain a libjvm.so and may not, but we test to ensure that the launcher
* behaves correctly in all cases.
*/
public class Test7029048 {
// used primarily to test the solaris variants in dual mode
static {
if (TestHelper.isDualMode) {
} else {
}
}
return s[1].trim();
}
}
return null;
}
// only for a dual-mode system
} else {
}
/*
* empty or null strings can confuse the ProcessBuilder. A null flag
* indicates that the appropriate data model is enforced on the chosen
* launcher variant.
*/
} else {
}
}
// no cross launch, ie. no change to the data model.
throws IOException {
}
/*
* the envValue can never be null, since the test code should always
* print a "null" string.
*/
throw new RuntimeException("NPE, likely a program crash ??");
}
passes++;
} else {
errors++;
}
}
/*
* A crucial piece, specifies what we should expect, given the conditions.
* That is for a given enum type, the value indicates how many absolute
* environment variables that can be expected. This value is used to base
* the actual expected values by adding the set environment variable usually
* it is 1, but it could be more if the test wishes to set more paths in
* the future.
*/
private static enum LLP_VAR {
private final int value;
LLP_VAR(int i) {
this.value = i;
}
}
/*
* test for 7029048
*/
switch (v) {
case LLP_SET_WITH_JVM:
// copy the files into the directory structures
// does not matter if it is client or a server
// does not matter if the arch do not match either
if (TestHelper.isDualMode) {
}
desc = "LD_LIBRARY_PATH should be set";
break;
case LLP_SET_EMPTY_PATH:
if (!dstClientDir.exists()) {
} else {
}
if (!dstServerDir.exists()) {
} else {
}
if (TestHelper.isDualMode) {
if (!dstOtherServerDir.exists()) {
} else {
}
}
desc = "LD_LIBRARY_PATH should not be set";
break;
}
desc = "LD_LIBRARY_PATH should not be set";
break;
default:
throw new RuntimeException("unknown case");
}
/*
* Case 1: set the server path
*/
/*
* Case 2: repeat with client path
*/
if (!TestHelper.isDualMode) {
continue; // nothing more to do for Linux
}
// Tests applicable only to solaris.
// initialize test variables for dual mode operations
/*
* Case 3: set the appropriate LLP_XX flag,
* java32 -d32, LLP_32 is relevant, LLP_64 is ignored
* java64 -d64, LLP_64 is relevant, LLP_32 is ignored
*/
/*
* Case 4: we are in dual mode environment, running 64-bit then
* we have the following scenarios:
* java32 -d64, LLP_64 is relevant, LLP_32 is ignored
* java64 -d32, LLP_32 is relevant, LLP_64 is ignored
*/
if (TestHelper.dualModePresent()) {
}
}
return;
}
return;
}
// create our test jar first
// run the tests
test7029048();
if (errors > 0) {
throw new Exception("Test7029048: FAIL: with "
throw new Exception("Test7029048: FAIL: " +
throw new Exception("Test7029048: FAIL: " +
throw new Exception("Test7029048: FAIL: " +
} else {
}
}
}