jdk/test/java/security/Provider/TestSecurityProvider.java
author valeriep
Fri, 19 Aug 2016 06:27:54 +0000
changeset 40416 5d91b2fd668c
parent 36511 9d0388c6b336
permissions -rw-r--r--
8130181: Deprecate java.security.Provider(String, double, String), add Provider(Strin Summary: Added Provider constructor which uses version String and use sun.security.util.PROVIDER_VER Reviewed-by: weijun
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     1
/*
40416
5d91b2fd668c 8130181: Deprecate java.security.Provider(String, double, String), add Provider(Strin
valeriep
parents: 36511
diff changeset
     2
 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     4
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     7
 * published by the Free Software Foundation.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     8
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    13
 * accompanied this code).
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    14
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    18
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    21
 * questions.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    22
 */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    23
package provider;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    24
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    25
import java.security.Provider;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    26
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    27
/**
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    28
 * Custom Security provider for modular test.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    29
 */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    30
public final class TestSecurityProvider extends Provider {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    31
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    32
    public TestSecurityProvider() {
40416
5d91b2fd668c 8130181: Deprecate java.security.Provider(String, double, String), add Provider(Strin
valeriep
parents: 36511
diff changeset
    33
        super("TEST", "1.0", "Test Security provider");
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    34
        System.out.println(String.format("TEST Security provider loaded"
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    35
                + " successfully : %s", this.toString()));
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    36
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    37
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    38
    @Override
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    39
    public String toString() {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    40
        return "TestSecurityProvider [getName()=" + getName()
40416
5d91b2fd668c 8130181: Deprecate java.security.Provider(String, double, String), add Provider(Strin
valeriep
parents: 36511
diff changeset
    41
                + ", getVersion()=" + getVersionStr() + ", getInfo()="
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    42
                + getInfo() + ", toString()=" + super.toString() + "]";
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    43
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    44
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    45
}