KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > naming > NamingContextTest


1 /*
2  * Copyright 2004,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.naming;
17
18 import java.util.Hashtable JavaDoc;
19
20 import javax.naming.Context JavaDoc;
21 import javax.naming.InitialContext JavaDoc;
22
23 import junit.framework.Test;
24 import junit.framework.TestSuite;
25 import junit.textui.TestRunner;
26
27
28 /**
29  * Unit tests for basic ops on a {@link NamingContext}.
30  *
31  * @version $Revision: 125387 $ $Date: 2003/11/30 05:36:07 $
32  */

33 public class NamingContextTest extends AbstractContextTest {
34     
35     public NamingContextTest(String JavaDoc name) {
36         super(name);
37     }
38
39     public static void main(String JavaDoc[] args) {
40         TestRunner.run(suite());
41     }
42
43     public static Test suite() {
44         TestSuite suite = new TestSuite(NamingContextTest.class);
45         suite.setName("Selector Context Tests");
46         return suite;
47     }
48     
49     protected Context JavaDoc makeInitialContext() {
50         try {
51             System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
52                     "org.apache.naming.NamingContextFactory");
53             return new InitialContext JavaDoc(new Hashtable JavaDoc());
54         } catch (Exception JavaDoc ex) {
55             fail("Failed to create NamingContext");
56         }
57         return null;
58     }
59     
60     protected boolean isGetNameInNamespaceSupported() {
61         return false;
62     }
63 }
64
Popular Tags