jdk/test/sun/security/jca/PreferredProviderNegativeTest.java
author erikj
Fri, 01 Apr 2016 17:08:43 +0200
changeset 36725 f458544b0d76
parent 36647 26bac33028c6
child 39339 3a9850ed77e8
permissions -rw-r--r--
8153261: Clean up fix for JDK-8153217 Reviewed-by: tbell
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33673
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
     1
/*
36647
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
     2
 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
33673
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
     4
 *
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
     7
 * published by the Free Software Foundation.
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
     8
 *
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    13
 * accompanied this code).
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    14
 *
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    18
 *
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    21
 * questions.
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    22
 */
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    23
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    24
import java.security.Security;
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    25
import java.security.NoSuchAlgorithmException;
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    26
import javax.crypto.Cipher;
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    27
import javax.crypto.NoSuchPaddingException;
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    28
36647
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    29
/**
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    30
 * @test
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    31
 * @bug 8076359 8133151 8150512
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    32
 * @summary Test for jdk.security.provider.preferred security property
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    33
 * @run main/othervm  PreferredProviderNegativeTest preSet AES false
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    34
 * @run main/othervm  PreferredProviderNegativeTest preSet AES:SunNegative true
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    35
 * @run main/othervm  PreferredProviderNegativeTest afterSet AES:SunJGSS
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    36
 * @run main/othervm  PreferredProviderNegativeTest afterSet AES:SunECNegative
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    37
 * @run main/othervm  PreferredProviderNegativeTest invalidAlg AESInvalid:SunJCE
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    38
 */
33673
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    39
public class PreferredProviderNegativeTest {
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    40
36647
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    41
    static final String SEC_PREF_PROP = "jdk.security.provider.preferred";
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    42
33673
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    43
    /*
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    44
     * Test security property could be set by valid and invalid provider
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    45
     * before JCE was loaded
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    46
     */
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    47
    public static void preJCESet(String value, boolean negativeProvider)
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    48
            throws NoSuchAlgorithmException, NoSuchPaddingException {
36647
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    49
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    50
        Security.setProperty(SEC_PREF_PROP, value);
33673
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    51
36647
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    52
        if (!Security.getProperty(SEC_PREF_PROP).equals(value)) {
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    53
            throw new RuntimeException("Test Failed:The property wasn't set");
33673
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    54
        }
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    55
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    56
        String[] arrays = value.split(":");
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    57
        Cipher cipher = Cipher.getInstance(arrays[0]);
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    58
        if (negativeProvider) {
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    59
            if (cipher.getProvider().getName().equals(arrays[1])) {
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    60
                throw new RuntimeException(
36647
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    61
                        "Test Failed:The provider shouldn't be set.");
33673
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    62
            }
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    63
        } else {
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    64
            if (!cipher.getProvider().getName().equals(arrays[1])) {
36647
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    65
                throw new RuntimeException("Test Faild:The provider could be "
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    66
                        + "set by valid provider.");
33673
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    67
            }
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    68
        }
36647
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    69
        System.out.println("Test Pass.");
33673
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    70
    }
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    71
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    72
    /*
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    73
     * Test that the setting of the security property after Cipher.getInstance()
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    74
     * does not influence previously loaded instances
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    75
     */
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    76
    public static void afterJCESet(String value)
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    77
            throws NoSuchAlgorithmException, NoSuchPaddingException {
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    78
        String[] arrays = value.split(":");
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    79
        Cipher cipher = Cipher.getInstance(arrays[0]);
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    80
36647
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    81
        Security.setProperty(SEC_PREF_PROP, value);
33673
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    82
        if (!cipher.getProvider().getName().equals("SunJCE")) {
36647
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    83
            throw new RuntimeException("Test Failed:The security property can't"
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    84
                    + " be updated after JCE load.");
33673
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    85
        }
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    86
        System.out.println("Test Pass");
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    87
    }
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    88
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    89
    /* Test the security property with negative algorithm */
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    90
    public static void invalidAlg(String value) throws NoSuchPaddingException {
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    91
        String[] arrays = value.split(":");
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    92
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    93
        try {
36647
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    94
            Security.setProperty(SEC_PREF_PROP, value);
33673
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    95
            Cipher.getInstance(arrays[0]);
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    96
        } catch (NoSuchAlgorithmException e) {
36647
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    97
            System.out.println(
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
    98
                    "Test Pass:Got NoSuchAlgorithmException as expired");
33673
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
    99
            return;
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
   100
        }
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
   101
        throw new RuntimeException(
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
   102
                "Test Failed:Expected NoSuchAlgorithmException was not thrown");
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
   103
    }
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
   104
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
   105
    public static void main(String[] args)
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
   106
            throws NoSuchAlgorithmException, NoSuchPaddingException {
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
   107
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
   108
        if (args.length >= 2) {
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
   109
            switch (args[0]) {
36647
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
   110
                case "preSet":
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
   111
                    boolean negativeProvider = Boolean.valueOf(args[2]);
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
   112
                    boolean solaris = System.getProperty("os.name")
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
   113
                            .toLowerCase().contains("sun");
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
   114
                    String value = args[1];
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
   115
                    if (args[1].split(":").length < 2) {
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
   116
                        if (solaris) {
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
   117
                            value += ":OracleUcrypto";
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
   118
                        } else {
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
   119
                            value += ":SunJCE";
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
   120
                        }
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
   121
                    }
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
   122
                    PreferredProviderNegativeTest.preJCESet(
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
   123
                            value, negativeProvider);
33673
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
   124
                    break;
36647
26bac33028c6 8150512: Update test for jdk.security.provider.preferred security property.
ssahoo
parents: 33673
diff changeset
   125
                case "afterSet":
33673
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
   126
                    PreferredProviderNegativeTest.afterJCESet(args[1]);
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
   127
                    break;
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
   128
                case "invalidAlg":
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
   129
                    PreferredProviderNegativeTest.invalidAlg(args[1]);
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
   130
                    break;
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
   131
            }
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
   132
        } else {
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
   133
            throw new RuntimeException(
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
   134
                    "Test Failed:Please pass the correct args");
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
   135
        }
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
   136
    }
ab8e6d8e3ab9 8076359: Test Task: Develop new tests for Leverage CPU Instructions for GHASH and RSA
asmotrak
parents:
diff changeset
   137
}