8164437: Test for JDK-8042900
authorweijun
Sat, 20 Aug 2016 17:10:17 +0800
changeset 40454 84a6dc93eef8
parent 40453 0d68f70ab984
child 40455 db40a6f6f274
8164437: Test for JDK-8042900 Summary: GSSContext is of a different type when jdk.security.jgss is not loaded Reviewed-by: xuelei
jdk/test/sun/security/krb5/auto/Basic.java
--- a/jdk/test/sun/security/krb5/auto/Basic.java	Fri Aug 19 23:24:23 2016 +0000
+++ b/jdk/test/sun/security/krb5/auto/Basic.java	Sat Aug 20 17:10:17 2016 +0800
@@ -23,10 +23,13 @@
 
 /*
  * @test
- * @bug 7152176
+ * @bug 7152176 8164437
  * @summary More krb5 tests
  * @compile -XDignore.symbol.file Basic.java
- * @run main/othervm Basic
+ * @run main/othervm
+ *      Basic jdk.security.jgss
+ * @run main/othervm --limit-modules java.security.jgss,jdk.security.auth
+ *      Basic java.security.jgss
  */
 
 import sun.security.jgss.GSSUtil;
@@ -60,5 +63,12 @@
         b.startAsServer(GSSUtil.GSS_KRB5_MECH_OID);
 
         Context.handshake(s2, b);
+
+        // Bonus test for 8164437.
+        String moduleName = c.x().getClass().getModule().getName();
+        if (!moduleName.equals(args[0])) {
+            throw new Exception("Expected: " + args[0]
+                    + ". Actual: " + moduleName);
+        }
     }
 }