Fix JvmInfoTests#testUseG1GC to include OpenJDK VMs

Since OpenJDK virtual machines have G1 GC but do not have a java.vm.name
that contains HotSpot, this test fails on OpenJDK. Instead, the
java.vm.name condition should be expanded to include OpenJDK virtual
machines.
This commit is contained in:
Jason Tedor 2016-04-14 10:09:55 -04:00
parent 1c5449fe1a
commit ed3a71fa2b
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ public class JvmInfoTests extends ESTestCase {
// if we are running on HotSpot, and the test JVM was started
// with UseG1GC, then JvmInfo should successfully report that
// G1GC is enabled
if (Constants.JVM_NAME.contains("HotSpot")) {
if (Constants.JVM_NAME.contains("HotSpot") || Constants.JVM_NAME.contains("OpenJDK")) {
assertEquals(Boolean.toString(isG1GCEnabled()), JvmInfo.jvmInfo().useG1GC());
} else {
assertEquals("unknown", JvmInfo.jvmInfo().useG1GC());