8176471: [TESTBUG] runtime/modules/IgnoreModulePropertiesTest.java fails with OpenJDK: java.lang.RuntimeException: 'java version ' missing from stdout/stderr

Check for strings such as " version " and "Runtime Environment" that appear in 'java -version' for both open and closed builds.

Reviewed-by: coleenp
This commit is contained in:
Harold Seigel 2017-03-13 16:23:17 -04:00
parent 586de47879
commit 958af9b3c3

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -44,7 +44,7 @@ public class IgnoreModulePropertiesTest {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
"-D" + prop + "=" + value, "-version"); "-D" + prop + "=" + value, "-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start()); OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldContain("java version "); output.shouldContain(" version ");
output.shouldHaveExitValue(0); output.shouldHaveExitValue(0);
// Ensure that the property and its value aren't available. // Ensure that the property and its value aren't available.