Пример #1
0
  @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());
  }
Пример #2
0
  @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));
  }
Пример #3
0
  @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));
  }
Пример #4
0
  @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());
  }