jdk/test/java/security/IdentityScope/NoDefaultSystemScope.java
author duke
Wed, 05 Jul 2017 17:27:51 +0200
changeset 7193 ea1f849ce702
parent 5506 202f599c92aa
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4983
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4983
diff changeset
     2
 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
4983
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
     4
 *
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
     7
 * published by the Free Software Foundation.
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
     8
 *
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    13
 * accompanied this code).
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    14
 *
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    18
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4983
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4983
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4983
diff changeset
    21
 * questions.
4983
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    22
 */
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    23
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    24
/*
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    25
 * @test
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    26
 * @bug 6921001
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    27
 * @summary The default system identity scope is now null.
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    28
 */
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    29
import java.security.*;
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    30
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    31
public class NoDefaultSystemScope {
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    32
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    33
    public static void main(String args[]) throws Exception {
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    34
        IdentityScope s = IdentityScope.getSystemScope();
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    35
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    36
        if (s != null) {
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    37
            throw new Exception("The default system scope should be null");
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    38
        }
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    39
        System.out.println("TEST PASSED");
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    40
    }
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    41
}
91e752cf5bb1 6921001: api/java_security/IdentityScope/IdentityScopeTests.html#getSystemScope fails starting from b78 JDK7
vinnie
parents:
diff changeset
    42