test/jdk/java/security/misc/GetInstanceNullsEmpties.java
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 41826 jdk/test/java/security/misc/GetInstanceNullsEmpties.java@b35ee9b35b09
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
41826
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
     1
/*
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
     2
 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
     4
 *
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
     7
 * published by the Free Software Foundation.
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
     8
 *
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    13
 * accompanied this code).
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    14
 *
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    18
 *
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    21
 * questions.
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    22
 */
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    23
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    24
import java.security.*;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    25
import java.security.cert.*;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    26
import javax.crypto.*;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    27
import javax.net.ssl.*;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    28
import javax.security.auth.login.*;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    29
import java.lang.reflect.*;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    30
import java.util.Arrays;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    31
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    32
/*
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    33
 * @test
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    34
 * @bug 4985694
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    35
 * @summary Incomplete spec for most of the getInstances
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    36
 */
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    37
/**
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    38
 * A simple test to see what is being thrown when null Strings are passed
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    39
 * to the various getInstance() methods.
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    40
 *
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    41
 * These tests use various algorithm names that don't exist (e.g. "FOO"
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    42
 * Ciphers). Just need something non-null for testing, as the tests will throw
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    43
 * exceptions before trying to instantiate a real object.
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    44
 */
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    45
public class GetInstanceNullsEmpties {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    46
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    47
    private static final Provider SUN = Security.getProvider("SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    48
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    49
    /*
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    50
     * See if there are more than "expected" number of getInstance() methods,
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    51
     * which will indicate to developers that this test needs an update.
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    52
     */
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    53
    private static void checkNewMethods(Class<?> clazz, int expected)
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    54
            throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    55
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    56
        long found = Arrays.stream(clazz.getMethods())
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    57
                .filter(name -> name.getName().equals("getInstance"))
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    58
                .count();
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    59
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    60
        if (found != expected) {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    61
            throw new Exception("Number of getInstance() mismatch: "
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    62
                    + expected + " expected, " + found + " found");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    63
        }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    64
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    65
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    66
    /**
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    67
     * Main loop.
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    68
     */
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    69
    public static void main(String[] args) throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    70
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    71
        /*
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    72
         * JCA
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    73
         */
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    74
        testAlgorithmParameterGenerator();
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    75
        testAlgorithmParameters();
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    76
        testCertificateFactory();
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    77
        testCertPathBuilder();
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    78
        testCertPathValidator();
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    79
        testCertStore();
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    80
        testKeyFactory();
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    81
        testKeyPairGenerator();
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    82
        testKeyStore();
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    83
        testMessageDigest();
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    84
        testPolicy();
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    85
        testSecureRandom();
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    86
        testSignature();
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    87
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    88
        /*
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    89
         * JCE
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    90
         */
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    91
        testCipher();
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    92
        testExemptionMechanism();
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    93
        testKeyAgreement();
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    94
        testKeyGenerator();
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    95
        testMac();
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    96
        testSecretKeyFactory();
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    97
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    98
        /*
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
    99
         * JSSE
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   100
         */
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   101
        testKeyManagerFactory();
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   102
        testSSLContext();
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   103
        testTrustManagerFactory();
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   104
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   105
        /*
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   106
         * JGSS
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   107
         *
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   108
         * KeyTab.getInstance doesn't take algorithm names, so we'll
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   109
         * ignore this one.
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   110
         */
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   111
        testConfiguration();
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   112
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   113
        System.out.println("\nTEST PASSED!");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   114
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   115
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   116
    private static Method getInstance(Class clazz, Class... args)
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   117
            throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   118
        boolean firstPrinted = false;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   119
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   120
        System.out.print("\n" + clazz.getName() + "(");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   121
        for (Class c : args) {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   122
            System.out.print(firstPrinted
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   123
                    ? ", " + c.getName() : c.getName());
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   124
            firstPrinted = true;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   125
        }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   126
        System.out.println("):");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   127
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   128
        return clazz.getMethod("getInstance", args);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   129
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   130
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   131
    private static void run(Method m, Class expectedException,
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   132
            Object... args) throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   133
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   134
        try {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   135
            m.invoke(null, args);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   136
            throw new Exception("Didn't throw exception");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   137
        } catch (InvocationTargetException ite) {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   138
            Throwable root = ite.getCause();
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   139
            if (root instanceof Exception) {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   140
                Exception e = (Exception) root;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   141
                if (expectedException.isInstance(e)) {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   142
                    System.out.print("OK ");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   143
                    return;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   144
                } else {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   145
                    System.out.println(
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   146
                        "Unexpected InvocationTargetException!");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   147
                    throw e;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   148
                }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   149
            }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   150
            throw ite;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   151
        }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   152
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   153
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   154
    /*
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   155
     * Constants so lines aren't so long.
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   156
     */
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   157
    private static final Class STRING = String.class;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   158
    private static final Class PROVIDER = Provider.class;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   159
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   160
    private static void testAlgorithmParameterGenerator() throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   161
        Class clazz = AlgorithmParameterGenerator.class;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   162
        Method m;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   163
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   164
        checkNewMethods(clazz, 3);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   165
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   166
        m = getInstance(clazz, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   167
        run(m, NullPointerException.class, (Object) null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   168
        run(m, NoSuchAlgorithmException.class, "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   169
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   170
        m = getInstance(clazz, STRING, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   171
        run(m, NullPointerException.class, null, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   172
        run(m, NoSuchAlgorithmException.class, "", "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   173
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   174
        run(m, IllegalArgumentException.class, "FOO", "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   175
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   176
        m = getInstance(clazz, STRING, PROVIDER);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   177
        run(m, NullPointerException.class, null, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   178
        run(m, NoSuchAlgorithmException.class, "", SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   179
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   180
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   181
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   182
    private static void testAlgorithmParameters() throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   183
        Class clazz = AlgorithmParameters.class;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   184
        Method m;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   185
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   186
        checkNewMethods(clazz, 3);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   187
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   188
        m = getInstance(clazz, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   189
        run(m, NullPointerException.class, (Object) null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   190
        run(m, NoSuchAlgorithmException.class, "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   191
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   192
        m = getInstance(clazz, STRING, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   193
        run(m, NullPointerException.class, null, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   194
        run(m, NoSuchAlgorithmException.class, "", "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   195
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   196
        run(m, IllegalArgumentException.class, "FOO", "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   197
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   198
        m = getInstance(clazz, STRING, PROVIDER);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   199
        run(m, NullPointerException.class, null, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   200
        run(m, NoSuchAlgorithmException.class, "", SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   201
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   202
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   203
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   204
    private static void testCertPathBuilder() throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   205
        Class clazz = CertPathBuilder.class;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   206
        Method m;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   207
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   208
        checkNewMethods(clazz, 3);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   209
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   210
        m = getInstance(clazz, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   211
        run(m, NullPointerException.class, (Object) null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   212
        run(m, NoSuchAlgorithmException.class, "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   213
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   214
        m = getInstance(clazz, STRING, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   215
        run(m, NullPointerException.class, null, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   216
        run(m, NoSuchAlgorithmException.class, "", "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   217
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   218
        run(m, IllegalArgumentException.class, "FOO", "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   219
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   220
        m = getInstance(clazz, STRING, PROVIDER);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   221
        run(m, NullPointerException.class, null, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   222
        run(m, NoSuchAlgorithmException.class, "", SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   223
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   224
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   225
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   226
    private static void testCertPathValidator() throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   227
        Class clazz = CertPathValidator.class;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   228
        Method m;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   229
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   230
        checkNewMethods(clazz, 3);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   231
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   232
        m = getInstance(clazz, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   233
        run(m, NullPointerException.class, (Object) null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   234
        run(m, NoSuchAlgorithmException.class, "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   235
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   236
        m = getInstance(clazz, STRING, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   237
        run(m, NullPointerException.class, null, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   238
        run(m, NoSuchAlgorithmException.class, "", "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   239
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   240
        run(m, IllegalArgumentException.class, "FOO", "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   241
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   242
        m = getInstance(clazz, STRING, PROVIDER);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   243
        run(m, NullPointerException.class, null, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   244
        run(m, NoSuchAlgorithmException.class, "", SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   245
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   246
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   247
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   248
    private static void testCertStore() throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   249
        Class clazz = CertStore.class;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   250
        Method m;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   251
        CertStoreParameters csp = () -> null;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   252
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   253
        checkNewMethods(clazz, 3);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   254
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   255
        m = getInstance(clazz, STRING, CertStoreParameters.class);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   256
        run(m, NullPointerException.class, (Object) null, csp);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   257
        run(m, NoSuchAlgorithmException.class, "", csp);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   258
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   259
        m = getInstance(clazz, STRING, CertStoreParameters.class, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   260
        run(m, NullPointerException.class, null, csp, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   261
        run(m, NoSuchAlgorithmException.class, "", csp, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   262
        run(m, IllegalArgumentException.class, "FOO", csp, null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   263
        run(m, IllegalArgumentException.class, "FOO", csp, "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   264
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   265
        m = getInstance(clazz, STRING, CertStoreParameters.class, PROVIDER);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   266
        run(m, NullPointerException.class, null, csp, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   267
        run(m, NoSuchAlgorithmException.class, "", csp, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   268
        run(m, IllegalArgumentException.class, "FOO", csp, null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   269
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   270
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   271
    private static void testCertificateFactory() throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   272
        Class clazz = CertificateFactory.class;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   273
        Method m;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   274
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   275
        checkNewMethods(clazz, 3);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   276
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   277
        m = getInstance(clazz, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   278
        run(m, NullPointerException.class, (Object) null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   279
        run(m, CertificateException.class, "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   280
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   281
        m = getInstance(clazz, STRING, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   282
        run(m, NullPointerException.class, null, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   283
        run(m, CertificateException.class, "", "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   284
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   285
        run(m, IllegalArgumentException.class, "FOO", "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   286
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   287
        m = getInstance(clazz, STRING, PROVIDER);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   288
        run(m, NullPointerException.class, null, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   289
        run(m, CertificateException.class, "", SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   290
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   291
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   292
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   293
    private static void testCipher() throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   294
        Class clazz = Cipher.class;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   295
        Method m;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   296
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   297
        checkNewMethods(clazz, 3);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   298
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   299
        /*
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   300
         * Note the Cipher API is spec'd to throw a NoSuchAlgorithmException
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   301
         * for a null transformation.
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   302
         */
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   303
        m = getInstance(clazz, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   304
        run(m, NoSuchAlgorithmException.class, (Object) null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   305
        run(m, NoSuchAlgorithmException.class, "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   306
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   307
        m = getInstance(clazz, STRING, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   308
        run(m, NoSuchAlgorithmException.class, null, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   309
        run(m, NoSuchAlgorithmException.class, "", "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   310
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   311
        run(m, IllegalArgumentException.class, "FOO", "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   312
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   313
        m = getInstance(clazz, STRING, PROVIDER);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   314
        run(m, NoSuchAlgorithmException.class, null, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   315
        run(m, NoSuchAlgorithmException.class, "", SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   316
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   317
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   318
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   319
    private static void testConfiguration() throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   320
        Class clazz = Configuration.class;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   321
        Method m;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   322
        Configuration.Parameters cp = new Configuration.Parameters() {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   323
        };
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   324
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   325
        checkNewMethods(clazz, 3);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   326
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   327
        m = getInstance(clazz, STRING, Configuration.Parameters.class);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   328
        run(m, NullPointerException.class, (Object) null, cp);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   329
        run(m, NoSuchAlgorithmException.class, "", cp);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   330
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   331
        m = getInstance(clazz, STRING, Configuration.Parameters.class, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   332
        run(m, NullPointerException.class, null, cp, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   333
        run(m, NoSuchAlgorithmException.class, "", cp, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   334
        run(m, IllegalArgumentException.class, "FOO", cp, null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   335
        run(m, IllegalArgumentException.class, "FOO", cp, "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   336
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   337
        m = getInstance(clazz, STRING, Configuration.Parameters.class,
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   338
                PROVIDER);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   339
        run(m, NullPointerException.class, null, cp, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   340
        run(m, NoSuchAlgorithmException.class, "", cp, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   341
        run(m, IllegalArgumentException.class, "FOO", cp, null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   342
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   343
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   344
    private static void testExemptionMechanism() throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   345
        Class clazz = ExemptionMechanism.class;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   346
        Method m;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   347
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   348
        checkNewMethods(clazz, 3);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   349
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   350
        m = getInstance(clazz, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   351
        run(m, NullPointerException.class, (Object) null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   352
        run(m, NoSuchAlgorithmException.class, "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   353
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   354
        m = getInstance(clazz, STRING, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   355
        run(m, NullPointerException.class, null, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   356
        run(m, NoSuchAlgorithmException.class, "", "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   357
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   358
        run(m, IllegalArgumentException.class, "FOO", "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   359
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   360
        m = getInstance(clazz, STRING, PROVIDER);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   361
        run(m, NullPointerException.class, null, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   362
        run(m, NoSuchAlgorithmException.class, "", SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   363
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   364
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   365
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   366
    private static void testKeyAgreement() throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   367
        Class clazz = KeyAgreement.class;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   368
        Method m;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   369
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   370
        checkNewMethods(clazz, 3);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   371
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   372
        m = getInstance(clazz, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   373
        run(m, NullPointerException.class, (Object) null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   374
        run(m, NoSuchAlgorithmException.class, "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   375
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   376
        m = getInstance(clazz, STRING, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   377
        run(m, NullPointerException.class, null, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   378
        run(m, NoSuchAlgorithmException.class, "", "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   379
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   380
        run(m, IllegalArgumentException.class, "FOO", "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   381
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   382
        m = getInstance(clazz, STRING, PROVIDER);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   383
        run(m, NullPointerException.class, null, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   384
        run(m, NoSuchAlgorithmException.class, "", SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   385
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   386
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   387
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   388
    private static void testKeyFactory() throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   389
        Class clazz = KeyFactory.class;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   390
        Method m;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   391
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   392
        checkNewMethods(clazz, 3);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   393
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   394
        m = getInstance(clazz, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   395
        run(m, NullPointerException.class, (Object) null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   396
        run(m, NoSuchAlgorithmException.class, "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   397
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   398
        m = getInstance(clazz, STRING, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   399
        run(m, NullPointerException.class, null, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   400
        run(m, NoSuchAlgorithmException.class, "", "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   401
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   402
        run(m, IllegalArgumentException.class, "FOO", "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   403
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   404
        m = getInstance(clazz, STRING, PROVIDER);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   405
        run(m, NullPointerException.class, null, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   406
        run(m, NoSuchAlgorithmException.class, "", SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   407
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   408
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   409
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   410
    private static void testKeyGenerator() throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   411
        Class clazz = KeyGenerator.class;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   412
        Method m;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   413
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   414
        checkNewMethods(clazz, 3);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   415
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   416
        m = getInstance(clazz, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   417
        run(m, NullPointerException.class, (Object) null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   418
        run(m, NoSuchAlgorithmException.class, "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   419
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   420
        m = getInstance(clazz, STRING, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   421
        run(m, NullPointerException.class, null, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   422
        run(m, NoSuchAlgorithmException.class, "", "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   423
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   424
        run(m, IllegalArgumentException.class, "FOO", "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   425
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   426
        m = getInstance(clazz, STRING, PROVIDER);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   427
        run(m, NullPointerException.class, null, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   428
        run(m, NoSuchAlgorithmException.class, "", SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   429
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   430
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   431
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   432
    private static void testKeyManagerFactory() throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   433
        Class clazz = KeyManagerFactory.class;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   434
        Method m;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   435
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   436
        checkNewMethods(clazz, 3);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   437
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   438
        m = getInstance(clazz, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   439
        run(m, NullPointerException.class, (Object) null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   440
        run(m, NoSuchAlgorithmException.class, "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   441
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   442
        m = getInstance(clazz, STRING, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   443
        run(m, NullPointerException.class, null, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   444
        run(m, NoSuchAlgorithmException.class, "", "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   445
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   446
        run(m, IllegalArgumentException.class, "FOO", "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   447
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   448
        m = getInstance(clazz, STRING, PROVIDER);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   449
        run(m, NullPointerException.class, null, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   450
        run(m, NoSuchAlgorithmException.class, "", SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   451
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   452
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   453
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   454
    private static void testKeyPairGenerator() throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   455
        Class clazz = KeyPairGenerator.class;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   456
        Method m;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   457
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   458
        checkNewMethods(clazz, 3);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   459
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   460
        m = getInstance(clazz, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   461
        run(m, NullPointerException.class, (Object) null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   462
        run(m, NoSuchAlgorithmException.class, "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   463
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   464
        m = getInstance(clazz, STRING, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   465
        run(m, NullPointerException.class, null, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   466
        run(m, NoSuchAlgorithmException.class, "", "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   467
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   468
        run(m, IllegalArgumentException.class, "FOO", "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   469
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   470
        m = getInstance(clazz, STRING, PROVIDER);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   471
        run(m, NullPointerException.class, null, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   472
        run(m, NoSuchAlgorithmException.class, "", SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   473
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   474
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   475
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   476
    private static void testKeyStore() throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   477
        Class clazz = KeyStore.class;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   478
        Method m;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   479
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   480
        /*
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   481
         * There are actually two additional getInstance() methods with File
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   482
         * as the first parameter.
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   483
         */
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   484
        checkNewMethods(clazz, 5);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   485
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   486
        m = getInstance(clazz, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   487
        run(m, NullPointerException.class, (Object) null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   488
        run(m, KeyStoreException.class, "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   489
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   490
        m = getInstance(clazz, STRING, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   491
        run(m, NullPointerException.class, null, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   492
        run(m, KeyStoreException.class, "", "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   493
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   494
        run(m, IllegalArgumentException.class, "FOO", "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   495
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   496
        m = getInstance(clazz, STRING, PROVIDER);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   497
        run(m, NullPointerException.class, null, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   498
        run(m, KeyStoreException.class, "", SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   499
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   500
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   501
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   502
    private static void testMac() throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   503
        Class clazz = Mac.class;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   504
        Method m;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   505
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   506
        checkNewMethods(clazz, 3);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   507
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   508
        m = getInstance(clazz, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   509
        run(m, NullPointerException.class, (Object) null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   510
        run(m, NoSuchAlgorithmException.class, "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   511
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   512
        m = getInstance(clazz, STRING, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   513
        run(m, NullPointerException.class, null, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   514
        run(m, NoSuchAlgorithmException.class, "", "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   515
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   516
        run(m, IllegalArgumentException.class, "FOO", "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   517
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   518
        m = getInstance(clazz, STRING, PROVIDER);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   519
        run(m, NullPointerException.class, null, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   520
        run(m, NoSuchAlgorithmException.class, "", SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   521
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   522
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   523
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   524
    private static void testMessageDigest() throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   525
        Class clazz = MessageDigest.class;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   526
        Method m;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   527
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   528
        checkNewMethods(clazz, 3);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   529
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   530
        m = getInstance(clazz, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   531
        run(m, NullPointerException.class, (Object) null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   532
        run(m, NoSuchAlgorithmException.class, "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   533
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   534
        m = getInstance(clazz, STRING, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   535
        run(m, NullPointerException.class, null, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   536
        run(m, NoSuchAlgorithmException.class, "", "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   537
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   538
        run(m, IllegalArgumentException.class, "FOO", "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   539
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   540
        m = getInstance(clazz, STRING, PROVIDER);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   541
        run(m, NullPointerException.class, null, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   542
        run(m, NoSuchAlgorithmException.class, "", SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   543
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   544
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   545
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   546
    private static void testPolicy() throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   547
        Class clazz = Policy.class;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   548
        Method m;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   549
        Policy.Parameters pp = new Policy.Parameters() {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   550
        };
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   551
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   552
        checkNewMethods(clazz, 3);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   553
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   554
        m = getInstance(clazz, STRING, Policy.Parameters.class);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   555
        run(m, NullPointerException.class, (Object) null, pp);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   556
        run(m, NoSuchAlgorithmException.class, "", pp);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   557
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   558
        m = getInstance(clazz, STRING, Policy.Parameters.class, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   559
        run(m, NullPointerException.class, null, pp, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   560
        run(m, NoSuchAlgorithmException.class, "", pp, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   561
        run(m, IllegalArgumentException.class, "FOO", pp, null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   562
        run(m, IllegalArgumentException.class, "FOO", pp, "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   563
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   564
        m = getInstance(clazz, STRING, Policy.Parameters.class, PROVIDER);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   565
        run(m, NullPointerException.class, null, pp, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   566
        run(m, NoSuchAlgorithmException.class, "", pp, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   567
        run(m, IllegalArgumentException.class, "FOO", pp, null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   568
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   569
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   570
    private static void testSSLContext() throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   571
        Class clazz = SSLContext.class;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   572
        Method m;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   573
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   574
        checkNewMethods(clazz, 3);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   575
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   576
        m = getInstance(clazz, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   577
        run(m, NullPointerException.class, (Object) null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   578
        run(m, NoSuchAlgorithmException.class, "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   579
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   580
        m = getInstance(clazz, STRING, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   581
        run(m, NullPointerException.class, null, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   582
        run(m, NoSuchAlgorithmException.class, "", "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   583
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   584
        run(m, IllegalArgumentException.class, "FOO", "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   585
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   586
        m = getInstance(clazz, STRING, PROVIDER);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   587
        run(m, NullPointerException.class, null, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   588
        run(m, NoSuchAlgorithmException.class, "", SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   589
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   590
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   591
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   592
    private static void testSecretKeyFactory() throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   593
        Class clazz = SecretKeyFactory.class;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   594
        Method m;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   595
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   596
        checkNewMethods(clazz, 3);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   597
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   598
        m = getInstance(clazz, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   599
        run(m, NullPointerException.class, (Object) null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   600
        run(m, NoSuchAlgorithmException.class, "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   601
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   602
        m = getInstance(clazz, STRING, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   603
        run(m, NullPointerException.class, null, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   604
        run(m, NoSuchAlgorithmException.class, "", "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   605
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   606
        run(m, IllegalArgumentException.class, "FOO", "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   607
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   608
        m = getInstance(clazz, STRING, PROVIDER);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   609
        run(m, NullPointerException.class, null, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   610
        run(m, NoSuchAlgorithmException.class, "", SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   611
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   612
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   613
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   614
    private static void testSecureRandom() throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   615
        Class clazz = SecureRandom.class;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   616
        Method m;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   617
        SecureRandomParameters srp = new SecureRandomParameters() {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   618
        };
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   619
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   620
        checkNewMethods(clazz, 6);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   621
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   622
        m = getInstance(clazz, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   623
        run(m, NullPointerException.class, (Object) null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   624
        run(m, NoSuchAlgorithmException.class, "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   625
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   626
        m = getInstance(clazz, STRING, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   627
        run(m, NullPointerException.class, null, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   628
        run(m, NoSuchAlgorithmException.class, "", "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   629
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   630
        run(m, IllegalArgumentException.class, "FOO", "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   631
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   632
        m = getInstance(clazz, STRING, PROVIDER);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   633
        run(m, NullPointerException.class, null, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   634
        run(m, NoSuchAlgorithmException.class, "", SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   635
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   636
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   637
        m = getInstance(clazz, STRING, SecureRandomParameters.class);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   638
        run(m, NullPointerException.class, (Object) null, srp);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   639
        run(m, NoSuchAlgorithmException.class, "", srp);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   640
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   641
        m = getInstance(clazz, STRING, SecureRandomParameters.class, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   642
        run(m, NullPointerException.class, null, srp, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   643
        run(m, NoSuchAlgorithmException.class, "", srp, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   644
        run(m, IllegalArgumentException.class, "FOO", srp, null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   645
        run(m, IllegalArgumentException.class, "FOO", srp, "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   646
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   647
        m = getInstance(clazz, STRING, SecureRandomParameters.class, PROVIDER);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   648
        run(m, NullPointerException.class, null, srp, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   649
        run(m, NoSuchAlgorithmException.class, "", srp, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   650
        run(m, IllegalArgumentException.class, "FOO", srp, null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   651
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   652
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   653
    private static void testSignature() throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   654
        Class clazz = Signature.class;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   655
        Method m;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   656
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   657
        checkNewMethods(clazz, 3);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   658
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   659
        m = getInstance(clazz, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   660
        run(m, NullPointerException.class, (Object) null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   661
        run(m, NoSuchAlgorithmException.class, "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   662
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   663
        m = getInstance(clazz, STRING, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   664
        run(m, NullPointerException.class, null, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   665
        run(m, NoSuchAlgorithmException.class, "", "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   666
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   667
        run(m, IllegalArgumentException.class, "FOO", "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   668
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   669
        m = getInstance(clazz, STRING, PROVIDER);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   670
        run(m, NullPointerException.class, null, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   671
        run(m, NoSuchAlgorithmException.class, "", SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   672
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   673
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   674
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   675
    private static void testTrustManagerFactory() throws Exception {
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   676
        Class clazz = TrustManagerFactory.class;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   677
        Method m;
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   678
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   679
        checkNewMethods(clazz, 3);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   680
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   681
        m = getInstance(clazz, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   682
        run(m, NullPointerException.class, (Object) null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   683
        run(m, NoSuchAlgorithmException.class, "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   684
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   685
        m = getInstance(clazz, STRING, STRING);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   686
        run(m, NullPointerException.class, null, "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   687
        run(m, NoSuchAlgorithmException.class, "", "SUN");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   688
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   689
        run(m, IllegalArgumentException.class, "FOO", "");
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   690
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   691
        m = getInstance(clazz, STRING, PROVIDER);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   692
        run(m, NullPointerException.class, null, SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   693
        run(m, NoSuchAlgorithmException.class, "", SUN);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   694
        run(m, IllegalArgumentException.class, "FOO", null);
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   695
    }
b35ee9b35b09 4985694: Incomplete spec for most of the getInstances
wetmore
parents:
diff changeset
   696
}