test/jdk/sun/security/ssl/CipherSuite/SupportedGroups.java
branchJDK-8171279-XDH-TLS-branch-2
changeset 56879 2aefd58f8ec5
parent 56866 d6feac8fbdff
equal deleted inserted replaced
56878:55bac0266042 56879:2aefd58f8ec5
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @bug 8171279
    26  * @bug 8171279
    27  * @library /javax/net/ssl/templates
    27  * @library /javax/net/ssl/templates
    28  * @summary Test TLS connection with each individual supported group
    28  * @summary Test TLS connection with each individual supported group
    29  * @run main/othervm SupportedGroups fail false
       
    30  * @run main/othervm SupportedGroups secp256r1
    29  * @run main/othervm SupportedGroups secp256r1
    31  * @run main/othervm SupportedGroups secp384r1
    30  * @run main/othervm SupportedGroups secp384r1
    32  * @run main/othervm SupportedGroups secp521r1
    31  * @run main/othervm SupportedGroups secp521r1
    33  * @run main/othervm SupportedGroups x25519
    32  * @run main/othervm SupportedGroups x25519
    34  * @run main/othervm SupportedGroups x448
    33  * @run main/othervm SupportedGroups x448
    45      * Run the test case.
    44      * Run the test case.
    46      */
    45      */
    47     public static void main(String[] args) throws Exception {
    46     public static void main(String[] args) throws Exception {
    48         System.setProperty("jdk.tls.namedGroups", args[0]);
    47         System.setProperty("jdk.tls.namedGroups", args[0]);
    49 
    48 
    50         boolean shouldPass = true;
    49         (new SupportedGroups()).run();
    51         if (args.length > 1) {
       
    52             shouldPass = Boolean.parseBoolean(args[1]);
       
    53         }
       
    54 
       
    55         boolean passed;
       
    56         try {
       
    57             (new SupportedGroups()).run();
       
    58             passed = true;
       
    59         } catch (Throwable ex) {
       
    60             passed = false;
       
    61         }
       
    62 
       
    63         if (passed != shouldPass) {
       
    64             throw new RuntimeException("passed: " + passed +
       
    65                 ", should pass: " + shouldPass);
       
    66         }
       
    67     }
    50     }
    68 }
    51 }