harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ghar...@apache.org
Subject svn commit: r397337 [7/11] - in /incubator/harmony/enhanced/classlib/trunk/modules/jndi: make/common/ src/test/java/com/sun/jndi/url/dir2/ src/test/java/com/sun/jndi/url/nntp/ src/test/java/jndiproperties/ src/test/java/org/ src/test/java/org/apache/ s...
Date Wed, 26 Apr 2006 23:26:01 GMT
Added: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/ctx2/MockContextTwo.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/ctx2/MockContextTwo.java?rev=397337&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/ctx2/MockContextTwo.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/ctx2/MockContextTwo.java Wed Apr 26 16:25:54 2006
@@ -0,0 +1,290 @@
+/* Copyright 2004 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.harmony.jndi.tests.javax.naming.ldap.ctx2;
+
+import java.util.Hashtable;
+
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NameParser;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+
+public class MockContextTwo implements Context {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#addToEnvironment(java.lang.String,
+	 *      java.lang.Object)
+	 */
+	public Object addToEnvironment(String s, Object o) throws NamingException {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#bind(javax.naming.Name, java.lang.Object)
+	 */
+	public void bind(Name n, Object o) throws NamingException {
+
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#bind(java.lang.String, java.lang.Object)
+	 */
+	public void bind(String s, Object o) throws NamingException {
+
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#close()
+	 */
+	public void close() throws NamingException {
+
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#composeName(javax.naming.Name,
+	 *      javax.naming.Name)
+	 */
+	public Name composeName(Name n, Name pfx) throws NamingException {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#composeName(java.lang.String, java.lang.String)
+	 */
+	public String composeName(String s, String pfx) throws NamingException {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#createSubcontext(javax.naming.Name)
+	 */
+	public Context createSubcontext(Name n) throws NamingException {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#createSubcontext(java.lang.String)
+	 */
+	public Context createSubcontext(String s) throws NamingException {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#destroySubcontext(javax.naming.Name)
+	 */
+	public void destroySubcontext(Name n) throws NamingException {
+
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#destroySubcontext(java.lang.String)
+	 */
+	public void destroySubcontext(String s) throws NamingException {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#getEnvironment()
+	 */
+	public Hashtable getEnvironment() throws NamingException {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#getNameInNamespace()
+	 */
+	public String getNameInNamespace() throws NamingException {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#getNameParser(javax.naming.Name)
+	 */
+	public NameParser getNameParser(Name n) throws NamingException {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#getNameParser(java.lang.String)
+	 */
+	public NameParser getNameParser(String s) throws NamingException {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#list(javax.naming.Name)
+	 */
+	public NamingEnumeration list(Name n) throws NamingException {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#list(java.lang.String)
+	 */
+	public NamingEnumeration list(String s) throws NamingException {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#listBindings(javax.naming.Name)
+	 */
+	public NamingEnumeration listBindings(Name n) throws NamingException {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#listBindings(java.lang.String)
+	 */
+	public NamingEnumeration listBindings(String s) throws NamingException {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#lookup(javax.naming.Name)
+	 */
+	public Object lookup(Name n) throws NamingException {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#lookup(java.lang.String)
+	 */
+	public Object lookup(String s) throws NamingException {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#lookupLink(javax.naming.Name)
+	 */
+	public Object lookupLink(Name n) throws NamingException {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#lookupLink(java.lang.String)
+	 */
+	public Object lookupLink(String s) throws NamingException {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#rebind(javax.naming.Name, java.lang.Object)
+	 */
+	public void rebind(Name n, Object o) throws NamingException {
+
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#rebind(java.lang.String, java.lang.Object)
+	 */
+	public void rebind(String s, Object o) throws NamingException {
+
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#removeFromEnvironment(java.lang.String)
+	 */
+	public Object removeFromEnvironment(String s) throws NamingException {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#rename(javax.naming.Name, javax.naming.Name)
+	 */
+	public void rename(Name nOld, Name nNew) throws NamingException {
+
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#rename(java.lang.String, java.lang.String)
+	 */
+	public void rename(String sOld, String sNew) throws NamingException {
+
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#unbind(javax.naming.Name)
+	 */
+	public void unbind(Name n) throws NamingException {
+
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.Context#unbind(java.lang.String)
+	 */
+	public void unbind(String s) throws NamingException {
+
+	}
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/ctx2/MockContextTwo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/spi/AllTests.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/spi/AllTests.java?rev=397337&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/spi/AllTests.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/spi/AllTests.java Wed Apr 26 16:25:54 2006
@@ -0,0 +1,38 @@
+/* Copyright 2004 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.harmony.jndi.tests.javax.naming.spi;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTests {
+
+	public static Test suite() {
+		TestSuite suite = new TestSuite(
+                "Suite for org.apache.harmony.jndi.tests.javax.naming.spi");
+		// $JUnit-BEGIN$
+		suite.addTestSuite(DirectoryManagerTest.class);
+		suite.addTestSuite(DirStateFactoryResultTest.class);
+		// suite.addTestSuite(NamingManagerExploreTest.class); // run in seperate vm
+		// suite.addTestSuite(DirectoryManagerBuilderTest.class); // run in seperate vm
+		// suite.addTestSuite(NamingManagerBuilderTest.class); // run in seperate vm
+		suite.addTestSuite(NamingManagerTest.class);
+		suite.addTestSuite(ResolveResultTest.class);
+		suite.addTestSuite(DirectoryManagerJCKTest.class);
+		// $JUnit-END$
+		return suite;
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/spi/AllTests.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/spi/DirStateFactoryResultTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/spi/DirStateFactoryResultTest.java?rev=397337&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/spi/DirStateFactoryResultTest.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/spi/DirStateFactoryResultTest.java Wed Apr 26 16:25:54 2006
@@ -0,0 +1,62 @@
+/* Copyright 2004 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.harmony.jndi.tests.javax.naming.spi;
+
+import javax.naming.directory.BasicAttributes;
+import javax.naming.spi.DirStateFactory;
+
+import junit.framework.TestCase;
+import org.apache.harmony.jndi.tests.javax.naming.util.Person;
+
+public class DirStateFactoryResultTest extends TestCase {
+    /**
+     * Test Result(Object o, Attributes a) with normal values
+     */
+    public void testConstructor_Simple() {
+        Person person = Person.getInstance();
+        BasicAttributes attributes = new BasicAttributes("Anyuser", person);
+        String strObj = "Harmony";
+        DirStateFactory.Result result =
+            new DirStateFactory.Result(strObj, attributes);
+        assertEquals(strObj, result.getObject());
+        assertEquals(attributes, result.getAttributes());
+    }
+
+    /**
+     * Test Result(Object o, Attributes a) with the first param o as null
+     */
+    public void testConstructor_ObjectNull() {
+        Person person = Person.getInstance();
+        BasicAttributes attributes = new BasicAttributes("Anyuser", person);
+        DirStateFactory.Result result =
+            new DirStateFactory.Result(null, attributes);
+        assertNull(result.getObject());
+        assertEquals(attributes, result.getAttributes());
+    }
+
+    /**
+     * Test Result(Object o, Attributes a) with the second param attributes as null
+     */
+    public void testConstructor_AttributesNull() {
+        String strObj = "Harmony";
+        DirStateFactory.Result result =
+            new DirStateFactory.Result(strObj, null);
+        assertEquals(strObj, result.getObject());
+        assertNull(result.getAttributes());
+        
+    }
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/spi/DirStateFactoryResultTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/spi/DirectoryManagerBuilderTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/spi/DirectoryManagerBuilderTest.java?rev=397337&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/spi/DirectoryManagerBuilderTest.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/spi/DirectoryManagerBuilderTest.java Wed Apr 26 16:25:54 2006
@@ -0,0 +1,327 @@
+/* Copyright 2004 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.harmony.jndi.tests.javax.naming.spi;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Hashtable;
+
+import javax.naming.CompositeName;
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NamingException;
+import javax.naming.Reference;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttributes;
+import javax.naming.spi.DirObjectFactory;
+import javax.naming.spi.DirectoryManager;
+import javax.naming.spi.NamingManager;
+import javax.naming.spi.ObjectFactory;
+import javax.naming.spi.ObjectFactoryBuilder;
+
+import junit.framework.TestCase;
+import org.apache.harmony.jndi.tests.javax.naming.util.Log;
+
+public class DirectoryManagerBuilderTest extends TestCase {
+
+	private static final String OBJ = "mockDirObject by Builder";
+
+	static Log log = new Log(DirectoryManagerBuilderTest.class);
+
+	/**
+	 * Constructor for DirectoryManagerBuilderTest.
+	 * 
+	 * @param arg0
+	 */
+	public DirectoryManagerBuilderTest(String arg0) {
+		super(arg0);
+	}
+
+	/*
+	 * -------------------------------------------------------------------
+	 * Methods
+	 * -------------------------------------------------------------------
+	 */
+
+	private void invokeMyTestMethod(String methodName) {
+		log.setMethod(methodName);
+		try {
+			Method m = this.getClass().getMethod(methodName, new Class[0]);
+			m.invoke(this, new Object[0]);
+			// log.log("Succeeded!");
+		} catch (Throwable t) {
+			String errMsg = t.getMessage();
+
+			if (t instanceof InvocationTargetException) {
+				errMsg = ((InvocationTargetException) t).getTargetException()
+						.getMessage();
+			}
+
+			log.log("Failed: " + t.getClass().getName() + " - " + errMsg);
+		}
+	}
+
+	/**
+	 * Test the normal condition when factory builder is properly set.
+	 */
+	public void myTestGetObjectInstance_HasBuilder_Normal() throws Exception {
+		log.setMethod("myTestGetObjectInstance_HasBuilder_Normal");
+		Attributes a = new BasicAttributes();
+		Object obj = DirectoryManager.getObjectInstance(null, null, null, null,
+				null);
+		assertSame(OBJ, obj);
+
+		obj = DirectoryManager.getObjectInstance("String", null, null, null, a);
+		assertSame(OBJ, obj);
+
+		Reference r = new Reference(null,
+				"org.apache.harmony.jndi.tests.javax.naming.spi.mock.MockDirObjectFactoryNoException",
+				null);
+		obj = DirectoryManager.getObjectInstance(r, null, null, null, a);
+		assertSame(OBJ, obj);
+
+		obj = DirectoryManager.getObjectInstance(null, new CompositeName(
+				"compositename"), null, null, a);
+		assertSame(OBJ, obj);
+
+		NamingManagerTest.MockContext cxt = new NamingManagerTest.MockContext(
+				null);
+
+		obj = DirectoryManager.getObjectInstance(null, null, cxt, null, a);
+		assertSame(OBJ, obj);
+
+		Hashtable env = new Hashtable();
+		env.put(Context.INITIAL_CONTEXT_FACTORY,
+				"dazzle.jndi.testing.spi.DazzleContextFactory");
+		env.put(Context.STATE_FACTORIES,
+				"org.apache.harmony.jndi.tests.javax.naming.spi.mock.MockDirObjectFactoryNoException");
+		obj = DirectoryManager.getObjectInstance(null, null, null, env, a);
+
+		assertSame(OBJ, obj);
+	}
+
+	/**
+	 * Test the behavior when factory builder throws NullPointerException.
+	 */
+	public void myTestGetObjectInstance_HasBuilder_BuilderNullPointerException()
+			throws Exception {
+		log
+				.setMethod("myTestGetObjectInstance_HasBuilder_BuilderNullPointerException");
+		Hashtable env = new Hashtable();
+		NamingManagerTest.indicateNullPointerException(env, 1);
+		env.put(Context.INITIAL_CONTEXT_FACTORY,
+				"dazzle.jndi.testing.spi.DazzleContextFactory");
+		env.put(Context.STATE_FACTORIES,
+				"org.apache.harmony.jndi.tests.javax.naming.spi.mock.MockDirObjectFactoryNoException");
+		Attributes a = new BasicAttributes();
+		try {
+			Object obj = DirectoryManager.getObjectInstance(null, null, null,
+					env, a);
+			fail("Should throw NullPointerException.");
+		} catch (NullPointerException e) {
+			// log.log(e);
+		}
+	}
+
+	/**
+	 * Test the behavior when factory builder throws NamingException.
+	 */
+	public void myTestGetObjectInstance_HasBuilder_BuilderNamingException()
+			throws Exception {
+		log
+				.setMethod("myTestGetObjectInstance_HasBuilder_BuilderNamingException");
+		Hashtable env = new Hashtable();
+		NamingManagerTest.indicateNamingException(env, 1);
+		env.put(Context.INITIAL_CONTEXT_FACTORY,
+				"dazzle.jndi.testing.spi.DazzleContextFactory");
+		env.put(Context.STATE_FACTORIES,
+				"org.apache.harmony.jndi.tests.javax.naming.spi.mock.MockDirObjectFactoryNoException");
+		Attributes a = new BasicAttributes();
+		try {
+			Object obj = DirectoryManager.getObjectInstance(null, null, null,
+					env, a);
+			fail("Should throw NamingException.");
+		} catch (NamingException e) {
+			// log.log(e);
+		}
+	}
+
+	/**
+	 * Test the behavior when factory throws RuntimeException.
+	 */
+	public void myTestGetObjectInstance_HasBuilder_FactoryRuntimeException()
+			throws Exception {
+		log
+				.setMethod("myTestGetObjectInstance_HasBuilder_FactoryRuntimeException");
+		Hashtable env = new Hashtable();
+		NamingManagerTest.indicateRuntimeException(env, 2);
+		env.put(Context.INITIAL_CONTEXT_FACTORY,
+				"dazzle.jndi.testing.spi.DazzleContextFactory");
+		env.put(Context.STATE_FACTORIES,
+				"org.apache.harmony.jndi.tests.javax.naming.spi.mock.MockDirObjectFactoryNoException");
+		Attributes a = new BasicAttributes();
+		try {
+			Object obj = DirectoryManager.getObjectInstance(null, null, null,
+					env, a);
+			fail("Should throw RuntimeException.");
+		} catch (RuntimeException e) {
+			// log.log(e);
+		}
+	}
+
+	/**
+	 * Test the behavior when factory throws NamingException.
+	 */
+	public void myTestGetObjectInstance_HasBuilder_FactoryNamingException()
+			throws Exception {
+		log
+				.setMethod("myTestGetObjectInstance_HasBuilder_FactoryNamingException");
+		Hashtable env = new Hashtable();
+		NamingManagerTest.indicateNamingException(env, 2);
+		env.put(Context.INITIAL_CONTEXT_FACTORY,
+				"dazzle.jndi.testing.spi.DazzleContextFactory");
+		env.put(Context.STATE_FACTORIES,
+				"org.apache.harmony.jndi.tests.javax.naming.spi.mock.MockDirObjectFactoryNoException");
+		Attributes a = new BasicAttributes();
+		try {
+			Object obj = DirectoryManager.getObjectInstance(null, null, null,
+					env, a);
+			fail("Should throw NamingException.");
+		} catch (NamingException e) {
+		}
+	}
+
+	/**
+	 * Test the behavior when factory builder is set but the factory builder
+	 * returns null.
+	 */
+	public void myTestGetObjectInstance_HasBuilder_BuilderReturnNull()
+			throws Exception {
+		log.setMethod("myTestGetObjectInstance_HasBuilder_BuilderReturnNull");
+		Hashtable env = new Hashtable();
+		NamingManagerTest.indicateReturnNull(env, 1);
+		env.put(Context.INITIAL_CONTEXT_FACTORY,
+				"dazzle.jndi.testing.spi.DazzleContextFactory");
+		env.put(Context.STATE_FACTORIES,
+				"org.apache.harmony.jndi.tests.javax.naming.spi.mock.MockDirObjectFactoryNoException");
+		Attributes a = new BasicAttributes();
+		try {
+			Object obj = DirectoryManager.getObjectInstance(null, null, null,
+					env, a);
+			fail("Should throw NullPointerException.");
+		} catch (NullPointerException e) {
+		}
+	}
+
+	/**
+	 * Test the behavior when factory builder is set but the factory returns
+	 * null.
+	 */
+	public void myTestGetObjectInstance_HasBuilder_FactoryReturnNull()
+			throws Exception {
+		log.setMethod("myTestGetObjectInstance_HasBuilder_FactoryReturnNull");
+		Hashtable env = new Hashtable();
+		NamingManagerTest.indicateReturnNull(env, 2);
+		env.put(Context.INITIAL_CONTEXT_FACTORY,
+				"dazzle.jndi.testing.spi.DazzleContextFactory");
+		env.put(Context.STATE_FACTORIES,
+				"org.apache.harmony.jndi.tests.javax.naming.spi.mock.MockDirObjectFactoryNoException");
+		Attributes a = new BasicAttributes();
+
+		Object obj = DirectoryManager.getObjectInstance("string", null, null,
+				env, a);
+		assertNull(obj);
+	}
+
+	/**
+	 * Set the object factory builder to a mock instance.
+	 * 
+	 */
+	public void myTestSetObjectFactoryBuilder_SetNormal()
+			throws NamingException {
+		log.setMethod("myTestSetObjectFactoryBuilder_SetNormal");
+		ObjectFactoryBuilder objectFactoryBuilder = MockObjectFactoryBuilder
+				.getInstance();
+		DirectoryManager.setObjectFactoryBuilder(objectFactoryBuilder);
+		// NamingManager.setObjectFactoryBuilder(objectFactoryBuilder);
+	}
+
+	public void testSetObjectFactoryBuilder_AfterSet() {
+
+		// myTestSetObjectFactoryBuilder_SetNormal();
+		invokeMyTestMethod("myTestSetObjectFactoryBuilder_SetNormal");
+
+		// myTestGetObjectInstance_HasBuilder_Normal();
+		invokeMyTestMethod("myTestGetObjectInstance_HasBuilder_Normal");
+		// myTestGetObjectInstance_HasBuilder_BuilderNullPointerException();
+		invokeMyTestMethod("myTestGetObjectInstance_HasBuilder_BuilderNullPointerException");
+		// myTestGetObjectInstance_HasBuilder_BuilderNamingException();
+		invokeMyTestMethod("myTestGetObjectInstance_HasBuilder_BuilderNamingException");
+		// myTestGetObjectInstance_HasBuilder_FactoryRuntimeException();
+		invokeMyTestMethod("myTestGetObjectInstance_HasBuilder_FactoryRuntimeException");
+		// myTestGetObjectInstance_HasBuilder_FactoryNamingException();
+		invokeMyTestMethod("myTestGetObjectInstance_HasBuilder_FactoryNamingException");
+		// myTestGetObjectInstance_HasBuilder_BuilderReturnNull();
+		invokeMyTestMethod("myTestGetObjectInstance_HasBuilder_BuilderReturnNull");
+		// myTestGetObjectInstance_HasBuilder_FactoryReturnNull();
+		invokeMyTestMethod("myTestGetObjectInstance_HasBuilder_FactoryReturnNull");
+
+	}
+
+	public static class MockObjectFactoryBuilder implements
+			ObjectFactoryBuilder {
+
+		private static MockObjectFactoryBuilder _builder = new MockObjectFactoryBuilder();
+
+		public static MockObjectFactoryBuilder getInstance() {
+			return _builder;
+		}
+
+		public ObjectFactory createObjectFactory(Object o, Hashtable envmt)
+				throws NamingException {
+			NamingManagerTest.issueIndicatedExceptions(envmt);
+			if (NamingManagerTest.returnNullIndicated(envmt)) {
+				return null;
+			}
+			return new MockDirObjectFactory();
+		}
+	}
+
+	public static class MockDirObjectFactory implements DirObjectFactory {
+
+		public Object getObjectInstance(Object o, Name n, Context c,
+				Hashtable envmt, Attributes a) throws Exception {
+			NamingManagerTest.issueIndicatedExceptions(envmt);
+			if (NamingManagerTest.returnNullIndicated(envmt)) {
+				return null;
+			}
+			return OBJ;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.spi.ObjectFactory#getObjectInstance(java.lang.Object,
+		 *      javax.naming.Name, javax.naming.Context, java.util.Hashtable)
+		 */
+		public Object getObjectInstance(Object o, Name n, Context c,
+				Hashtable envmt) throws Exception {
+			log.setMethod("getObjectInstance");
+			log.log("wrong method call");
+			return getObjectInstance(o, n, c, envmt, null);
+		}
+
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/spi/DirectoryManagerBuilderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/spi/DirectoryManagerJCKTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/spi/DirectoryManagerJCKTest.java?rev=397337&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/spi/DirectoryManagerJCKTest.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/spi/DirectoryManagerJCKTest.java Wed Apr 26 16:25:54 2006
@@ -0,0 +1,1072 @@
+/* Copyright 2004 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.harmony.jndi.tests.javax.naming.spi;
+
+import java.util.Hashtable;
+
+import javax.naming.CannotProceedException;
+import javax.naming.Context;
+import javax.naming.InvalidNameException;
+import javax.naming.Name;
+import javax.naming.NameParser;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.ModificationItem;
+import javax.naming.directory.SearchControls;
+import javax.naming.ldap.Control;
+import javax.naming.ldap.ExtendedRequest;
+import javax.naming.ldap.ExtendedResponse;
+import javax.naming.ldap.LdapContext;
+import javax.naming.spi.DirectoryManager;
+import javax.naming.spi.InitialContextFactory;
+import javax.naming.spi.ObjectFactory;
+
+import junit.framework.TestCase;
+import org.apache.harmony.jndi.tests.javax.naming.util.Log;
+
+public class DirectoryManagerJCKTest extends TestCase {
+
+	private static Log log = new Log(DirectoryManagerJCKTest.class);
+
+	public void testGetContinuationDirContext() throws NamingException {
+		// Step 1: Write a simple class which implements
+		// LdapContext and InitialContextFactory.
+		// Please refer to the following class MyLdapContext
+
+		// Step 2: Create an instance of MyLdapContext
+		DirContext context = new MyLdapContext();
+
+		// Step 3: Create an instance of CannotProceedException,
+		// and set the resolve object as "context"
+		CannotProceedException exception = new CannotProceedException(
+				"TestGetContinuationDirContext");
+		exception.setResolvedObj(context);
+		// Step 4: Call DirectoryManager.getContinuationDirContext and pass
+		// the "exception";
+
+		DirContext newContext = DirectoryManager
+				.getContinuationDirContext(exception);
+		// Step 5: check result
+		assertNotNull(newContext);
+		// System.out.println(context);
+		// System.out.println(newContext);
+	}
+
+	public void testGetContinuationDirContext2() throws NamingException {
+		// 1.Write a simple class which implements Context, NameParser,
+		// InitialContextFactory,ObjectFactory
+
+		// 2.Create an instance of the class defined in step 1 as a Context.
+		Context context = new MyContext161();
+
+		// 3.Set the Resolved Object of the CannotProceedException to be the
+		// Context
+		// created in step 2 using the setResolvedObj method.
+		CannotProceedException ex = new CannotProceedException(
+				"TestGetContinuationDirContext2");
+		ex.setResolvedObj(context);
+
+		// 4. Call the getcontinuationDirContext method of the DirectoryManager
+		// class
+		// passing the CannotProceedException object and modified at step 3.
+		DirContext newContext = null;
+		try {
+			newContext = DirectoryManager.getContinuationDirContext(ex);
+			// fail("Should throw CannotProceedException.");
+		} catch (CannotProceedException cpe) {
+			// System.out.println(cpe);
+		}
+
+		try {
+			newContext.bind("bindName", "Object to be binded");
+		} catch (Exception e) {
+			// System.out.println(e);
+		}
+
+		try {
+			Attributes attributes = newContext.getAttributes("test");
+		} catch (Exception e) {
+			// System.out.println(e);
+		}
+
+		// 5. Check the DirContext returned in step 4: this will throw
+		// javax.naming.CannotProceedException
+	}
+
+	public void testGetContinuationDirContext3() throws NamingException {
+		CannotProceedException cpe = new CannotProceedException(
+				"TestGetContinuationDirContext3");
+		DirContext ctx = DirectoryManager.getContinuationDirContext(cpe);
+		// System.out.println(ctx instanceof DirContext);
+	}
+
+	/*
+	 * Mock class for internal use which implements LdapContext and
+	 * InitialContextFactory
+	 * 
+	 */
+	class MyLdapContext implements LdapContext, InitialContextFactory {
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.ldap.LdapContext#extendedOperation(javax.naming.ldap.ExtendedRequest)
+		 */
+		public ExtendedResponse extendedOperation(ExtendedRequest e)
+				throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.ldap.LdapContext#getConnectControls()
+		 */
+		public Control[] getConnectControls() throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.ldap.LdapContext#getRequestControls()
+		 */
+		public Control[] getRequestControls() throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.ldap.LdapContext#getResponseControls()
+		 */
+		public Control[] getResponseControls() throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.ldap.LdapContext#newInstance(javax.naming.ldap.Control[])
+		 */
+		public LdapContext newInstance(Control[] ac) throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.ldap.LdapContext#reconnect(javax.naming.ldap.Control[])
+		 */
+		public void reconnect(Control[] ac) throws NamingException {
+
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.ldap.LdapContext#setRequestControls(javax.naming.ldap.Control[])
+		 */
+		public void setRequestControls(Control[] ac) throws NamingException {
+
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.spi.InitialContextFactory#getInitialContext(java.util.Hashtable)
+		 */
+		public Context getInitialContext(Hashtable envmt)
+				throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#bind(javax.naming.Name,
+		 *      java.lang.Object, javax.naming.directory.Attributes)
+		 */
+		public void bind(Name name, Object obj, Attributes attributes)
+				throws NamingException {
+
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#bind(java.lang.String,
+		 *      java.lang.Object, javax.naming.directory.Attributes)
+		 */
+		public void bind(String s, Object obj, Attributes attributes)
+				throws NamingException {
+
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#createSubcontext(javax.naming.Name,
+		 *      javax.naming.directory.Attributes)
+		 */
+		public DirContext createSubcontext(Name name, Attributes attributes)
+				throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#createSubcontext(java.lang.String,
+		 *      javax.naming.directory.Attributes)
+		 */
+		public DirContext createSubcontext(String s, Attributes attributes)
+				throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#getAttributes(javax.naming.Name)
+		 */
+		public Attributes getAttributes(Name name) throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#getAttributes(javax.naming.Name,
+		 *      java.lang.String[])
+		 */
+		public Attributes getAttributes(Name name, String[] as)
+				throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#getAttributes(java.lang.String)
+		 */
+		public Attributes getAttributes(String s) throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#getAttributes(java.lang.String,
+		 *      java.lang.String[])
+		 */
+		public Attributes getAttributes(String s, String[] as)
+				throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#getSchema(javax.naming.Name)
+		 */
+		public DirContext getSchema(Name name) throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#getSchema(java.lang.String)
+		 */
+		public DirContext getSchema(String s) throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#getSchemaClassDefinition(javax.naming.Name)
+		 */
+		public DirContext getSchemaClassDefinition(Name name)
+				throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#getSchemaClassDefinition(java.lang.String)
+		 */
+		public DirContext getSchemaClassDefinition(String s)
+				throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#modifyAttributes(javax.naming.Name,
+		 *      int, javax.naming.directory.Attributes)
+		 */
+		public void modifyAttributes(Name name, int i, Attributes attributes)
+				throws NamingException {
+
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#modifyAttributes(javax.naming.Name,
+		 *      javax.naming.directory.ModificationItem[])
+		 */
+		public void modifyAttributes(Name name,
+				ModificationItem[] modificationItems) throws NamingException {
+
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#modifyAttributes(java.lang.String,
+		 *      int, javax.naming.directory.Attributes)
+		 */
+		public void modifyAttributes(String s, int i, Attributes attributes)
+				throws NamingException {
+
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#modifyAttributes(java.lang.String,
+		 *      javax.naming.directory.ModificationItem[])
+		 */
+		public void modifyAttributes(String s,
+				ModificationItem[] modificationItems) throws NamingException {
+
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#rebind(javax.naming.Name,
+		 *      java.lang.Object, javax.naming.directory.Attributes)
+		 */
+		public void rebind(Name name, Object obj, Attributes attributes)
+				throws NamingException {
+
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#rebind(java.lang.String,
+		 *      java.lang.Object, javax.naming.directory.Attributes)
+		 */
+		public void rebind(String s, Object obj, Attributes attributes)
+				throws NamingException {
+
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#search(javax.naming.Name,
+		 *      javax.naming.directory.Attributes)
+		 */
+		public NamingEnumeration search(Name name, Attributes attributes)
+				throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#search(javax.naming.Name,
+		 *      javax.naming.directory.Attributes, java.lang.String[])
+		 */
+		public NamingEnumeration search(Name name, Attributes attributes,
+				String[] as) throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#search(javax.naming.Name,
+		 *      java.lang.String, java.lang.Object[],
+		 *      javax.naming.directory.SearchControls)
+		 */
+		public NamingEnumeration search(Name name, String filter,
+				Object[] objs, SearchControls searchControls)
+				throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#search(javax.naming.Name,
+		 *      java.lang.String, javax.naming.directory.SearchControls)
+		 */
+		public NamingEnumeration search(Name name, String filter,
+				SearchControls searchControls) throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#search(java.lang.String,
+		 *      javax.naming.directory.Attributes)
+		 */
+		public NamingEnumeration search(String name, Attributes attributes)
+				throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#search(java.lang.String,
+		 *      javax.naming.directory.Attributes, java.lang.String[])
+		 */
+		public NamingEnumeration search(String name, Attributes attributes,
+				String[] as) throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#search(java.lang.String,
+		 *      java.lang.String, java.lang.Object[],
+		 *      javax.naming.directory.SearchControls)
+		 */
+		public NamingEnumeration search(String name, String filter,
+				Object[] objs, SearchControls searchControls)
+				throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.directory.DirContext#search(java.lang.String,
+		 *      java.lang.String, javax.naming.directory.SearchControls)
+		 */
+		public NamingEnumeration search(String name, String filter,
+				SearchControls searchControls) throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#addToEnvironment(java.lang.String,
+		 *      java.lang.Object)
+		 */
+		public Object addToEnvironment(String s, Object o)
+				throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#bind(javax.naming.Name, java.lang.Object)
+		 */
+		public void bind(Name n, Object o) throws NamingException {
+
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#bind(java.lang.String, java.lang.Object)
+		 */
+		public void bind(String s, Object o) throws NamingException {
+
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#close()
+		 */
+		public void close() throws NamingException {
+
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#composeName(javax.naming.Name,
+		 *      javax.naming.Name)
+		 */
+		public Name composeName(Name n, Name pfx) throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#composeName(java.lang.String,
+		 *      java.lang.String)
+		 */
+		public String composeName(String s, String pfx) throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#createSubcontext(javax.naming.Name)
+		 */
+		public Context createSubcontext(Name n) throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#createSubcontext(java.lang.String)
+		 */
+		public Context createSubcontext(String s) throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#destroySubcontext(javax.naming.Name)
+		 */
+		public void destroySubcontext(Name n) throws NamingException {
+
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#destroySubcontext(java.lang.String)
+		 */
+		public void destroySubcontext(String s) throws NamingException {
+
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#getEnvironment()
+		 */
+		public Hashtable getEnvironment() throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#getNameInNamespace()
+		 */
+		public String getNameInNamespace() throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#getNameParser(javax.naming.Name)
+		 */
+		public NameParser getNameParser(Name n) throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#getNameParser(java.lang.String)
+		 */
+		public NameParser getNameParser(String s) throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#list(javax.naming.Name)
+		 */
+		public NamingEnumeration list(Name n) throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#list(java.lang.String)
+		 */
+		public NamingEnumeration list(String s) throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#listBindings(javax.naming.Name)
+		 */
+		public NamingEnumeration listBindings(Name n) throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#listBindings(java.lang.String)
+		 */
+		public NamingEnumeration listBindings(String s) throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#lookup(javax.naming.Name)
+		 */
+		public Object lookup(Name n) throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#lookup(java.lang.String)
+		 */
+		public Object lookup(String s) throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#lookupLink(javax.naming.Name)
+		 */
+		public Object lookupLink(Name n) throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#lookupLink(java.lang.String)
+		 */
+		public Object lookupLink(String s) throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#rebind(javax.naming.Name, java.lang.Object)
+		 */
+		public void rebind(Name n, Object o) throws NamingException {
+
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#rebind(java.lang.String, java.lang.Object)
+		 */
+		public void rebind(String s, Object o) throws NamingException {
+
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#removeFromEnvironment(java.lang.String)
+		 */
+		public Object removeFromEnvironment(String s) throws NamingException {
+
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#rename(javax.naming.Name,
+		 *      javax.naming.Name)
+		 */
+		public void rename(Name nOld, Name nNew) throws NamingException {
+
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#rename(java.lang.String, java.lang.String)
+		 */
+		public void rename(String sOld, String sNew) throws NamingException {
+
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#unbind(javax.naming.Name)
+		 */
+		public void unbind(Name n) throws NamingException {
+
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#unbind(java.lang.String)
+		 */
+		public void unbind(String s) throws NamingException {
+
+		}
+	}
+
+	class MyContext161 implements Context, NameParser, InitialContextFactory,
+			ObjectFactory {
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#addToEnvironment(java.lang.String,
+		 *      java.lang.Object)
+		 */
+		public Object addToEnvironment(String s, Object o)
+				throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#bind(javax.naming.Name, java.lang.Object)
+		 */
+		public void bind(Name n, Object o) throws NamingException {
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#bind(java.lang.String, java.lang.Object)
+		 */
+		public void bind(String s, Object o) throws NamingException {
+			// System.out.println("The mock method bind is called!");
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#close()
+		 */
+		public void close() throws NamingException {
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#composeName(javax.naming.Name,
+		 *      javax.naming.Name)
+		 */
+		public Name composeName(Name n, Name pfx) throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#composeName(java.lang.String,
+		 *      java.lang.String)
+		 */
+		public String composeName(String s, String pfx) throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#createSubcontext(javax.naming.Name)
+		 */
+		public Context createSubcontext(Name n) throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#createSubcontext(java.lang.String)
+		 */
+		public Context createSubcontext(String s) throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#destroySubcontext(javax.naming.Name)
+		 */
+		public void destroySubcontext(Name n) throws NamingException {
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#destroySubcontext(java.lang.String)
+		 */
+		public void destroySubcontext(String s) throws NamingException {
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#getEnvironment()
+		 */
+		public Hashtable getEnvironment() throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#getNameInNamespace()
+		 */
+		public String getNameInNamespace() throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#getNameParser(javax.naming.Name)
+		 */
+		public NameParser getNameParser(Name n) throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#getNameParser(java.lang.String)
+		 */
+		public NameParser getNameParser(String s) throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#list(javax.naming.Name)
+		 */
+		public NamingEnumeration list(Name n) throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#list(java.lang.String)
+		 */
+		public NamingEnumeration list(String s) throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#listBindings(javax.naming.Name)
+		 */
+		public NamingEnumeration listBindings(Name n) throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#listBindings(java.lang.String)
+		 */
+		public NamingEnumeration listBindings(String s) throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#lookup(javax.naming.Name)
+		 */
+		public Object lookup(Name n) throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#lookup(java.lang.String)
+		 */
+		public Object lookup(String s) throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#lookupLink(javax.naming.Name)
+		 */
+		public Object lookupLink(Name n) throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#lookupLink(java.lang.String)
+		 */
+		public Object lookupLink(String s) throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#rebind(javax.naming.Name, java.lang.Object)
+		 */
+		public void rebind(Name n, Object o) throws NamingException {
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#rebind(java.lang.String, java.lang.Object)
+		 */
+		public void rebind(String s, Object o) throws NamingException {
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#removeFromEnvironment(java.lang.String)
+		 */
+		public Object removeFromEnvironment(String s) throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#rename(javax.naming.Name,
+		 *      javax.naming.Name)
+		 */
+		public void rename(Name nOld, Name nNew) throws NamingException {
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#rename(java.lang.String, java.lang.String)
+		 */
+		public void rename(String sOld, String sNew) throws NamingException {
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#unbind(javax.naming.Name)
+		 */
+		public void unbind(Name n) throws NamingException {
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.Context#unbind(java.lang.String)
+		 */
+		public void unbind(String s) throws NamingException {
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.NameParser#parse(java.lang.String)
+		 */
+		public Name parse(String s) throws InvalidNameException,
+				NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.spi.InitialContextFactory#getInitialContext(java.util.Hashtable)
+		 */
+		public Context getInitialContext(Hashtable envmt)
+				throws NamingException {
+			return null;
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see javax.naming.spi.ObjectFactory#getObjectInstance(java.lang.Object,
+		 *      javax.naming.Name, javax.naming.Context, java.util.Hashtable)
+		 */
+		public Object getObjectInstance(Object o, Name n, Context c,
+				Hashtable envmt) throws Exception {
+			return null;
+		}
+
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/spi/DirectoryManagerJCKTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message