@Test public void shouldNotIssueWarningWhenUsingOpenJDKClientVmVersion7() throws Exception { BufferingLogger bufferingLogger = new BufferingLogger(); new JvmChecker( bufferingLogger, new CannedJvmMetadataRepository("OpenJDK Client VM", "1.7.0-b147")) .checkJvmCompatibilityAndIssueWarning(); assertTrue(bufferingLogger.toString().isEmpty()); }
@Test public void shouldIssueWarningWhenUsingUnsupportedJvm() throws Exception { BufferingLogger bufferingLogger = new BufferingLogger(); new JvmChecker( bufferingLogger, new CannedJvmMetadataRepository("MyOwnJDK 64-Bit Awesome VM", "1.7")) .checkJvmCompatibilityAndIssueWarning(); assertThat(bufferingLogger.toString().trim(), is(INCOMPATIBLE_JVM_WARNING)); }
@Test public void shouldIssueWarningWhenUsingUnsupportedJvmVersion() throws Exception { BufferingLogger bufferingLogger = new BufferingLogger(); new JvmChecker( bufferingLogger, new CannedJvmMetadataRepository("Java HotSpot(TM) 64-Bit Server VM", "1.6.42_87")) .checkJvmCompatibilityAndIssueWarning(); assertThat(bufferingLogger.toString().trim(), is(INCOMPATIBLE_JVM_VERSION_WARNING)); }
@Test public void shouldNotIssueWarningWhenUsingHotspotServerVmVersion7() throws Exception { BufferingLogger bufferingLogger = new BufferingLogger(); new JvmChecker( bufferingLogger, new CannedJvmMetadataRepository("Java HotSpot(TM) 64-Bit Server VM", "1.7.0-b147")) .checkJvmCompatibilityAndIssueWarning(); assertTrue(bufferingLogger.toString().isEmpty()); }