Exemple #1
0
  public void testType() throws Exception {
    String vmName = System.getProperty("java.vm.name").toLowerCase();
    String expectedType = TestConfigObject.getInstance().jvmType().trim().toLowerCase();

    System.err.println(
        "Actual JVM type: '" + vmName + "'; expected JVM type: '" + expectedType + "'");

    assertTrue(
        "Actual type of '" + vmName + "' includes expected type of '" + expectedType + "'",
        vmName.indexOf(expectedType) >= 0);
  }
Exemple #2
0
  public void testVersion() throws Exception {
    if (Vm.isIBM()) {
      // IBM has a non-uniform version string that makes no sense to test in an automated way
      return;
    }
    String actualVersion = System.getProperty("java.runtime.version");
    String expectedVersion = TestConfigObject.getInstance().jvmVersion();

    Matcher matcher = VERSION_PATTERN.matcher(actualVersion);

    System.err.println(
        "Actual JVM version: '"
            + actualVersion
            + "'; expected JVM version: '"
            + expectedVersion
            + "'");

    assertTrue("Actual version of '" + actualVersion + "' matches pattern", matcher.matches());
    assertEquals(expectedVersion, matcher.group(1));
  }