@Test
  public void test() {
    if (verifyUnhandledExceptionDetails(
        RuntimeException.class.getName(),
        "This test throws an expected exception.",
        "+log.finest+=,gov.nasa.jpf.vm.ClassInfo")) {
      // Throw an exception to avoid backtracking.  Backtracking will wipe out the class object ref.
      throw new RuntimeException("This test throws an expected exception.");
    } else {
      ClassInfo ci =
          ClassLoaderInfo.getCurrentResolvedClassInfo(
              InitializeInterfaceClassObjectRefTestInterface.class.getName());

      if (ci.getClassObjectRef() < 0)
        throw new AssertionError("ci.getClassObjectRef() < 0 : " + ci.getClassObjectRef());
    }
  }
Example #2
0
 /**
  * obtain the ClassInfo (JPF class) for this ref. This will cause on-demand class loading by JPF
  */
 public ClassInfo getClassInfo() {
   return ClassLoaderInfo.getCurrentResolvedClassInfo(clsName);
 }