jdk/test/javax/naming/spi/providers/test.template
author prappo
Thu, 16 Oct 2014 12:34:07 +0100
changeset 27090 e43821f6f7f3
permissions -rw-r--r--
8044627: Update JNDI to work with modules Reviewed-by: alanb, chegar
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
27090
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
     1
/*
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
     2
 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
     4
 *
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
     7
 * published by the Free Software Foundation.
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
     8
 *
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    13
 * accompanied this code).
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    14
 *
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    18
 *
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    21
 * questions.
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    22
 */
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    23
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    24
import javax.naming.Context;
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    25
import javax.naming.InitialContext;
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    26
import javax.naming.NamingException;
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    27
import java.util.Properties;
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    28
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    29
public class Test {
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    30
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    31
    public static void main(String[] args) throws NamingException {
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    32
        Properties env = System.getProperties();
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    33
        Context ctx = new InitialContext(env);
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    34
        try {
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    35
            ctx.lookup("");
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    36
        } finally {
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    37
            ctx.close();
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    38
        }
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    39
    }
e43821f6f7f3 8044627: Update JNDI to work with modules
prappo
parents:
diff changeset
    40
}