Remote impl = new Impl();
Remote proxy = exporter.export(impl);
TrustVerifier.Context ctx = new TestContext();
TrustVerifier tv = new Subclass(true, true);
if (tv.isTrustedObject(proxy, ctx) == true) {
System.err.println("Test 1 passed");
} else {
throw new RuntimeException("Test 1 FAILED");
}
tv = new Subclass(true, false);
if (tv.isTrustedObject(proxy, ctx) == false) {
System.err.println("Test 2 passed");
} else {
throw new RuntimeException("Test 2 FAILED");
}
tv = new Subclass(false, true);
if (tv.isTrustedObject(proxy, ctx) == false) {
System.err.println("Test 3 passed");
} else {
throw new RuntimeException("Test 3 FAILED");
}
tv = new Subclass(false, false);
if (tv.isTrustedObject(proxy, ctx) == false) {
System.err.println("Test 4 passed");
} else {
throw new RuntimeException("Test 4 FAILED");
}