harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r386087 [14/45] - in /incubator/harmony/enhanced/classlib/trunk: make/ make/patternsets/ modules/jndi/ modules/jndi/META-INF/ modules/jndi/make/ modules/jndi/make/common/ modules/jndi/src/ modules/jndi/src/main/ modules/jndi/src/main/java/ ...
Date Wed, 15 Mar 2006 14:57:17 GMT
Added: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/directory/TestBasicAttributes.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/directory/TestBasicAttributes.java?rev=386087&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/directory/TestBasicAttributes.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/directory/TestBasicAttributes.java Wed Mar 15 06:55:38 2006
@@ -0,0 +1,743 @@
+/* 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 tests.api.javax.naming.directory;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+
+import junit.framework.TestCase;
+import tests.api.javax.naming.util.Log;
+import tests.api.javax.naming.util.Person;
+
+public class TestBasicAttributes extends TestCase {
+	private BasicAttributes ignoreCaseAttributes;
+
+	private BasicAttributes caseSensitiveAttributes;
+
+	static Log log = new Log(TestBasicAttributes.class);
+
+	protected void setUp() {
+		ignoreCaseAttributes = new BasicAttributes(true);
+		caseSensitiveAttributes = new BasicAttributes(false);
+	}
+
+	public void testConstructor_simple() {
+		BasicAttributes attributes = new BasicAttributes();
+		assertFalse(attributes.isCaseIgnored());
+		assertEquals(0, attributes.size());
+	}
+
+	public void testConstructor_ignoreCase() {
+		BasicAttributes attributes = new BasicAttributes(false);
+		assertFalse(attributes.isCaseIgnored());
+		assertEquals(0, attributes.size());
+
+		attributes = new BasicAttributes(true);
+		assertTrue(attributes.isCaseIgnored());
+		assertEquals(0, attributes.size());
+	}
+
+	public void testConstructor_IDObj_Simple() throws NamingException {
+		String id = "Attribute one";
+		Person person = Person.getInstance();
+
+		BasicAttributes attributes = new BasicAttributes(id, person);
+		assertEquals(1, attributes.size());
+
+		BasicAttribute attribute = new BasicAttribute(id, person);
+		assertEquals(attribute, attributes.get(id));
+	}
+
+	public void testConstructor_IDObj_Simple_IDNULL() throws NamingException {
+		String id = null;
+		Person person = Person.getInstance();
+		try {
+			BasicAttributes attributes = new BasicAttributes(id, person);
+			fail("Should throw NullPointerException.");
+		} catch (NullPointerException e) {
+		}
+
+	}
+
+	public void testConstructor_IDObj_Simple_ObjNULL() throws NamingException {
+		String id = "Attribute one";
+		BasicAttributes attributes = new BasicAttributes(id, null);
+		assertEquals(1, attributes.size());
+
+		BasicAttribute attribute = new BasicAttribute(id, null);
+		assertEquals(attribute, attributes.get(id));
+	}
+
+	public void testConstructor_IDObjIgnoreCase() {
+		String id = "Attribute one";
+		Person person = Person.getInstance();
+
+		BasicAttributes attributes = new BasicAttributes(id, person, false);
+		assertEquals(1, attributes.size());
+		assertFalse(attributes.isCaseIgnored());
+		BasicAttribute attribute = new BasicAttribute(id, person);
+		assertEquals(attribute, attributes.get(id));
+	}
+
+	public void testConstructor_IDObjIgnoreCase_true() {
+		String id = "Attribute one";
+		Person person = Person.getInstance();
+
+		BasicAttributes attributes = new BasicAttributes(id, person, true);
+		assertEquals(1, attributes.size());
+		assertTrue(attributes.isCaseIgnored());
+		BasicAttribute attribute = new BasicAttribute(id, person);
+		assertEquals(attribute, attributes.get(id));
+	}
+
+	public void testClone_IgnoreCase() {
+		int count = 5;
+		Attribute[] attributes = new Attribute[count];
+
+		for (int i = 0; i < count; i++) {
+			Person person = Person.getInstance();
+			attributes[i] = new BasicAttribute(person.getName(), person);
+			ignoreCaseAttributes.put(attributes[i]);
+		}
+		BasicAttributes cloneAttributes = (BasicAttributes) ignoreCaseAttributes
+				.clone();
+
+		assertEquals(cloneAttributes, ignoreCaseAttributes);
+
+		for (int i = 0; i < attributes.length; i++) {
+			String id = attributes[i].getID();
+		}
+		cloneAttributes.put("newID", "new Obj");
+		assertEquals(ignoreCaseAttributes.size() + 1, cloneAttributes.size());
+	}
+
+	public void testClone_CaseSensitive() {
+		int count = 5;
+		Attribute[] attributes = new Attribute[count];
+
+		for (int i = 0; i < count; i++) {
+			Person person = Person.getInstance();
+			attributes[i] = new BasicAttribute(person.getName(), person);
+			caseSensitiveAttributes.put(attributes[i]);
+		}
+		BasicAttributes cloneAttributes = (BasicAttributes) caseSensitiveAttributes
+				.clone();
+
+		assertEquals(cloneAttributes, caseSensitiveAttributes);
+
+		for (int i = 0; i < attributes.length; i++) {
+			String id = attributes[i].getID();
+		}
+		cloneAttributes.put("newID", "new Obj");
+		assertEquals(caseSensitiveAttributes.size() + 1, cloneAttributes.size());
+	}
+
+	public void testGet_IgnoreCase_Simple() {
+		int count = 5;
+		Attribute[] attributes = new Attribute[count];
+
+		for (int i = 0; i < count; i++) {
+			Person person = Person.getInstance();
+			attributes[i] = new BasicAttribute(person.getName(), person);
+			ignoreCaseAttributes.put(attributes[i]);
+		}
+
+		for (int i = 0; i < count; i++) {
+			Attribute attribute = ignoreCaseAttributes.get(attributes[i]
+					.getID().toUpperCase());
+			assertEquals(attributes[i], attribute);
+		}
+
+		assertNull(ignoreCaseAttributes.get("Not existing value"));
+	}
+
+	public void testGet_IgnoreCase_NoValue() {
+		assertNull(ignoreCaseAttributes.get("No value"));
+	}
+
+	public void testGet_IgnoreCase_IDNull() {
+		try {
+			Attribute attribute = ignoreCaseAttributes.get(null);
+			fail("Should throw NullPointerException.");
+		} catch (NullPointerException e) {
+		}
+	}
+
+	public void testGet_CaseSensitive_Simple() {
+		int count = 5;
+		Attribute[] attributes = new Attribute[count];
+
+		for (int i = 0; i < count; i++) {
+			Person person = Person.getInstance();
+			attributes[i] = new BasicAttribute(person.getName(), person);
+			caseSensitiveAttributes.put(attributes[i]);
+		}
+
+		for (int i = 0; i < count; i++) {
+			Attribute attribute = caseSensitiveAttributes.get(attributes[i]
+					.getID());
+			assertEquals(attributes[i], attribute);
+		}
+
+		assertNull(caseSensitiveAttributes.get("Not existing value"));
+	}
+
+	public void testGet_CaseSensitive_NoValue() {
+		assertNull(caseSensitiveAttributes.get("No value"));
+	}
+
+	public void testGet_CaseSensitive_IDNull() {
+		try {
+			Attribute attribute = caseSensitiveAttributes.get(null);
+			fail("Should throw NullPointerException.");
+		} catch (NullPointerException e) {
+		}
+	}
+
+	public void testGetAll_CaseSensitive() throws NamingException {
+		Person person = Person.getInstance();
+		Attribute attribute = new BasicAttribute(person.getName(), person);
+		caseSensitiveAttributes.put(attribute);
+
+		NamingEnumeration enumeration = caseSensitiveAttributes.getAll();
+		int count = 0;
+		while (enumeration.hasMore()) {
+			count++;
+			assertEquals(attribute, enumeration.next());
+		}
+		assertEquals(1, count);
+	}
+
+	public void testGetAll_caseSensitive_NoValue() throws NamingException {
+		NamingEnumeration enumeration = caseSensitiveAttributes.getAll();
+		int count = 0;
+		while (enumeration.hasMore()) {
+			count++;
+		}
+
+		assertEquals(0, count);
+	}
+
+	public void testGetAll_IgnoreCase() throws NamingException {
+		Person person = Person.getInstance();
+		Attribute attribute = new BasicAttribute(person.getName(), person);
+		ignoreCaseAttributes.put(attribute);
+
+		NamingEnumeration enumeration = ignoreCaseAttributes.getAll();
+		int count = 0;
+		while (enumeration.hasMore()) {
+			count++;
+			assertEquals(attribute, enumeration.next());
+		}
+		assertEquals(1, count);
+	}
+
+	public void testGetAll_IgnoreCase_NoValue() throws NamingException {
+		NamingEnumeration enumeration = ignoreCaseAttributes.getAll();
+		int count = 0;
+		while (enumeration.hasMore()) {
+			count++;
+		}
+		assertEquals(0, count);
+	}
+
+	public void testGetIDs_IgnoreCase() throws NamingException {
+		String id = "Ignore case ID";
+		Attribute attribute = new BasicAttribute(id, "IgnoreCase value");
+		ignoreCaseAttributes.put(attribute);
+		NamingEnumeration enumeration = ignoreCaseAttributes.getIDs();
+		int count = 0;
+		while (enumeration.hasMore()) {
+			count++;
+			assertEquals(id, enumeration.next());
+		}
+		assertEquals(1, count);
+	}
+
+	public void testGetIDs_CaseSensitive() throws NamingException {
+		String id = "Ignore case ID";
+		Attribute attribute = new BasicAttribute(id, "IgnoreCase value");
+		caseSensitiveAttributes.put(attribute);
+		NamingEnumeration enumeration = caseSensitiveAttributes.getIDs();
+		int count = 0;
+		while (enumeration.hasMore()) {
+			count++;
+			assertEquals(id, enumeration.next());
+		}
+		assertEquals(1, count);
+	}
+
+	public void testIsCaseIgnored_Ignore() {
+		BasicAttributes attributes = new BasicAttributes(true);
+		assertTrue(attributes.isCaseIgnored());
+	}
+
+	public void testIsCaseIgnored() {
+		BasicAttributes attributes = new BasicAttributes(false);
+		assertFalse(attributes.isCaseIgnored());
+	}
+
+	public void testPut_IgnoreCase_notexistID() {
+		Person person = Person.getInstance();
+		BasicAttribute attribute = new BasicAttribute(person.getName(), person);
+		assertNull(ignoreCaseAttributes.put(attribute));
+		assertEquals(attribute, ignoreCaseAttributes.get(person.getName()));
+	}
+
+	public void testPut_IgnoreCase_existID() {
+		Person person0 = Person.getInstance();
+		Person person1 = Person.getInstance();
+		BasicAttribute attribute0 = new BasicAttribute(person0.getName()
+				.toUpperCase(), person0);
+		BasicAttribute attribute1 = new BasicAttribute(person0.getName(),
+				person1);
+		ignoreCaseAttributes.put(attribute0);
+		assertEquals(attribute0, ignoreCaseAttributes.put(attribute1));
+		assertEquals(attribute1, ignoreCaseAttributes.get(person0.getName()));
+	}
+
+	public void testPut_IgnoreCase_null() {
+		try {
+			ignoreCaseAttributes.put(null);
+			fail("Should throw NullPointerException.");
+		} catch (NullPointerException e) {
+		}
+	}
+
+	/**
+	 * put a attribute with null ID
+	 */
+	public void testPut_IgnoreCase_nullID() {
+		BasicAttribute attribute = new BasicAttribute(null, "NullID");
+		try {
+			ignoreCaseAttributes.put(attribute);
+			fail("Should throw NullPointerException.");
+		} catch (NullPointerException e) {
+		}
+	}
+
+	public void testPut_CaseSensitive_notexistID() {
+		Person person = Person.getInstance();
+		BasicAttribute attribute = new BasicAttribute(person.getName(), person);
+		assertNull(caseSensitiveAttributes.put(attribute));
+		assertEquals(attribute, caseSensitiveAttributes.get(person.getName()));
+	}
+
+	public void testPut_CaseSensitive_existID() {
+		Person person0 = Person.getInstance();
+		Person person1 = Person.getInstance();
+		BasicAttribute attribute0 = new BasicAttribute(person0.getName(),
+				person0);
+		BasicAttribute attribute1 = new BasicAttribute(person0.getName(),
+				person1);
+		caseSensitiveAttributes.put(attribute0);
+		assertEquals(attribute0, caseSensitiveAttributes.put(attribute1));
+		assertEquals(attribute1, caseSensitiveAttributes.get(person0.getName()));
+	}
+
+	public void testPut_CaseSensitive_null() {
+		try {
+			caseSensitiveAttributes.put(null);
+			fail("Should throw NullPointerException.");
+		} catch (NullPointerException e) {
+		}
+	}
+
+	/**
+	 * put a attribute with null ID
+	 */
+	public void testPut_CaseSensitive_nullID() {
+		BasicAttribute attribute = new BasicAttribute(null, "NullID");
+		try {
+			caseSensitiveAttributes.put(attribute);
+			fail("Should throw NullPointerException.");
+		} catch (NullPointerException e) {
+		}
+	}
+
+	public void testPut2_IgnoreCase_notexistID() {
+		Person person = Person.getInstance();
+		BasicAttribute attribute = new BasicAttribute(person.getName(), person);
+
+		assertNull(ignoreCaseAttributes.put(person.getName(), person));
+		assertEquals(attribute, ignoreCaseAttributes.get(person.getName()));
+	}
+
+	public void testPut2_IgnoreCase_existID() {
+		Person person0 = Person.getInstance();
+		Person person1 = Person.getInstance();
+		BasicAttribute attribute0 = new BasicAttribute(person0.getName()
+				.toUpperCase(), person0);
+		BasicAttribute attribute1 = new BasicAttribute(person0.getName(),
+				person1);
+		ignoreCaseAttributes.put(attribute0);
+		assertEquals(attribute0, ignoreCaseAttributes.put(person0.getName(),
+				person1));
+		assertEquals(attribute1, ignoreCaseAttributes.get(person0.getName()));
+	}
+
+	public void testPut2_IgnoreCase_null() {
+		try {
+			ignoreCaseAttributes.put(null, "null id");
+			fail("Should throw NullPointerException.");
+		} catch (NullPointerException e) {
+		}
+	}
+
+	public void testPut2_CaseSensitive_notexistID() {
+		Person person = Person.getInstance();
+		BasicAttribute attribute = new BasicAttribute(person.getName(), person);
+
+		assertNull(caseSensitiveAttributes.put(person.getName(), person));
+		assertEquals(attribute, caseSensitiveAttributes.get(person.getName()));
+	}
+
+	public void testPut2_CaseSensitive_existID() {
+		Person person0 = Person.getInstance();
+		Person person1 = Person.getInstance();
+		BasicAttribute attribute0 = new BasicAttribute(person0.getName(),
+				person0);
+		BasicAttribute attribute1 = new BasicAttribute(person0.getName(),
+				person1);
+		caseSensitiveAttributes.put(attribute0);
+		assertEquals(attribute0, caseSensitiveAttributes.put(person0.getName(),
+				person1));
+		assertEquals(attribute1, caseSensitiveAttributes.get(person0.getName()));
+	}
+
+	public void testPut2_CaseSensitive_null() {
+		try {
+			caseSensitiveAttributes.put(null, "null id");
+			fail("Should throw NullPointerException.");
+		} catch (NullPointerException e) {
+		}
+	}
+
+	public void testRemove_IgnoreCase_exist() {
+		Person person = Person.getInstance();
+		BasicAttribute attribute = new BasicAttribute(person.getName(), person);
+		ignoreCaseAttributes.put(attribute);
+
+		assertEquals(attribute, ignoreCaseAttributes.remove(person.getName()
+				.toUpperCase()));
+
+	}
+
+	public void testRemove_IgnoreCase_notexist() {
+		assertNull(ignoreCaseAttributes.remove("not this id"));
+	}
+
+	public void testRemove_IgnoreCase_Null() {
+		try {
+			Object obj = ignoreCaseAttributes.remove(null);
+			fail("Should throw NullPointerException.");
+		} catch (NullPointerException e) {
+		}
+	}
+
+	public void testRemove_CaseSensitive_exist() {
+		Person person = Person.getInstance();
+		BasicAttribute attribute = new BasicAttribute(person.getName(), person);
+		caseSensitiveAttributes.put(attribute);
+
+		assertEquals(attribute, caseSensitiveAttributes
+				.remove(person.getName()));
+
+	}
+
+	public void testRemove_CaseSensitive_notexist() {
+		assertNull(caseSensitiveAttributes.remove("not this id"));
+	}
+
+	public void testRemove_CaseSensitive_Null() {
+		try {
+			Object obj = caseSensitiveAttributes.remove(null);
+			fail("Should throw NullPointerException.");
+		} catch (NullPointerException e) {
+		}
+	}
+
+	public void testSize() {
+		int count = 10;
+		for (int i = 0; i < count; i++) {
+			ignoreCaseAttributes.put("ID:" + i, "Value: " + i);
+		}
+		assertEquals(count, ignoreCaseAttributes.size());
+	}
+
+	public void testSize_empty() {
+		assertEquals(0, caseSensitiveAttributes.size());
+	}
+
+	/**
+	 * 1. ignoreCase=true 2. Normal values
+	 */
+	public void testHashCode_ignoreCase() {
+		int count = 10;
+		BasicAttribute attribute[] = new BasicAttribute[count];
+
+		int hashCode = 1;
+		for (int i = 0; i < count; i++) {
+			attribute[i] = new BasicAttribute("ID:" + i, "Value: " + i);
+			hashCode += attribute[i].hashCode();
+			ignoreCaseAttributes.put(attribute[i]);
+		}
+
+		assertEquals(hashCode, ignoreCaseAttributes.hashCode());
+	}
+
+	/**
+	 * 1. ignoreCase=true 2. no value
+	 */
+	public void testHashCode_ignoreCase_NoValue() {
+		assertEquals(1, ignoreCaseAttributes.hashCode());
+	}
+
+	/**
+	 * 1. ignoreCase=false 2. Normal values
+	 */
+	public void testHashCode_CaseSensitive() {
+		int count = 10;
+		BasicAttribute attribute[] = new BasicAttribute[count];
+
+		int hashCode = 0;
+		for (int i = 0; i < count; i++) {
+			attribute[i] = new BasicAttribute("ID:" + i, "Value: " + i);
+			hashCode += attribute[i].hashCode();
+			caseSensitiveAttributes.put(attribute[i]);
+		}
+
+		assertEquals(hashCode, caseSensitiveAttributes.hashCode());
+	}
+
+	/**
+	 * 1. ignoreCase=false 2. no value
+	 */
+	public void testHashCode_CaseSensitive_NoValue() {
+		assertEquals(0, caseSensitiveAttributes.hashCode());
+	}
+
+	/**
+	 * 1. ignoreCase=true 2. Normal values
+	 */
+	public void testToString_ignoreCase() {
+		int count = 10;
+		BasicAttribute attribute[] = new BasicAttribute[count];
+
+		for (int i = 0; i < count; i++) {
+			attribute[i] = new BasicAttribute("ID:" + i, "Value: " + i);
+			ignoreCaseAttributes.put(attribute[i]);
+		}
+		String str = "{\nid:9=Attribute ID: ID:9\nAttribute values: Value: 9\n"
+				+ "; id:8=Attribute ID: ID:8\nAttribute values: Value: 8\n"
+				+ "; id:7=Attribute ID: ID:7\nAttribute values: Value: 7\n"
+				+ "; id:6=Attribute ID: ID:6\nAttribute values: Value: 6\n"
+				+ "; id:5=Attribute ID: ID:5\nAttribute values: Value: 5\n"
+				+ "; id:4=Attribute ID: ID:4\nAttribute values: Value: 4\n"
+				+ "; id:3=Attribute ID: ID:3\nAttribute values: Value: 3\n"
+				+ "; id:2=Attribute ID: ID:2\nAttribute values: Value: 2\n"
+				+ "; id:1=Attribute ID: ID:1\nAttribute values: Value: 1\n"
+				+ "; id:0=Attribute ID: ID:0\nAttribute values: Value: 0\n}\n";
+		// assertEquals(str, ignoreCaseAttributes.toString());
+		assertNotNull(ignoreCaseAttributes.toString());
+	}
+
+	/**
+	 * 1. IgnoreCase=true 2. No value
+	 */
+	public void testToString_ignoreCase_NoValue() {
+		/*
+		 * assertEquals( "This Attributes does not have any attributes.\n",
+		 * ignoreCaseAttributes.toString());
+		 */
+		assertNotNull(ignoreCaseAttributes.toString());
+	}
+
+	/**
+	 * 1. IgnoreCase=false 2. Normal values
+	 */
+	public void testToString_CaseSensitive() {
+		int count = 10;
+		BasicAttribute attribute[] = new BasicAttribute[count];
+
+		for (int i = 0; i < count; i++) {
+			attribute[i] = new BasicAttribute("ID:" + i, "Value: " + i);
+			caseSensitiveAttributes.put(attribute[i]);
+		}
+		String str = "{\nID:9=Attribute ID: ID:9\nAttribute values: Value: 9\n"
+				+ "; ID:8=Attribute ID: ID:8\nAttribute values: Value: 8\n"
+				+ "; ID:7=Attribute ID: ID:7\nAttribute values: Value: 7\n"
+				+ "; ID:6=Attribute ID: ID:6\nAttribute values: Value: 6\n"
+				+ "; ID:5=Attribute ID: ID:5\nAttribute values: Value: 5\n"
+				+ "; ID:4=Attribute ID: ID:4\nAttribute values: Value: 4\n"
+				+ "; ID:3=Attribute ID: ID:3\nAttribute values: Value: 3\n"
+				+ "; ID:2=Attribute ID: ID:2\nAttribute values: Value: 2\n"
+				+ "; ID:1=Attribute ID: ID:1\nAttribute values: Value: 1\n"
+				+ "; ID:0=Attribute ID: ID:0\nAttribute values: Value: 0\n}\n";
+		// assertEquals(str, caseSensitiveAttributes.toString());
+		assertNotNull(caseSensitiveAttributes.toString());
+	}
+
+	/**
+	 * 1. IgnoreCase=false 2. no value
+	 */
+	public void testToString_CaseSensitive_NoValue() {
+		/*
+		 * assertEquals( "This Attributes does not have any attributes.\n",
+		 * caseSensitiveAttributes.toString());
+		 */
+		assertNotNull(caseSensitiveAttributes.toString());
+	}
+
+	/**
+	 * 1. ignoreCase=true 2. Normal values
+	 */
+	public void testEquals_ignoreCase() {
+		BasicAttributes basicAttributes0 = new BasicAttributes(true);
+		BasicAttributes basicAttributes1 = new BasicAttributes(true);
+
+		int count = 10;
+		BasicAttribute attribute[] = new BasicAttribute[count];
+		for (int i = 0; i < count; i++) {
+			attribute[i] = new BasicAttribute("ID:" + i, "Value: " + i);
+			basicAttributes0.put(attribute[i]);
+			basicAttributes1.put(attribute[i]);
+		}
+		assertTrue(basicAttributes0.equals(basicAttributes1));
+		assertTrue(basicAttributes1.equals(basicAttributes0));
+		assertFalse(basicAttributes0.equals(null));
+
+		basicAttributes0.remove("ID:0");
+		assertFalse(basicAttributes0.equals(basicAttributes1));
+		assertFalse(basicAttributes1.equals(basicAttributes0));
+	}
+
+	/**
+	 * 1. ignoreCase=true 2. no value
+	 */
+	public void testEquals_ignoreCase_NoValue() {
+		BasicAttributes basicAttributes0 = new BasicAttributes(true);
+		BasicAttributes basicAttributes1 = new BasicAttributes(true);
+
+		assertTrue(basicAttributes0.equals(basicAttributes1));
+		assertTrue(basicAttributes1.equals(basicAttributes0));
+		assertFalse(basicAttributes0.equals(null));
+	}
+
+	public void testEquals_invalidObject() {
+		BasicAttributes basicAttributes0 = new BasicAttributes(true);
+		assertFalse(basicAttributes0.equals("String"));
+	}
+
+	public void testEquals_DifferentIgnoreCase() {
+		BasicAttributes basicAttributes0 = new BasicAttributes(true);
+		BasicAttributes basicAttributes1 = new BasicAttributes(false);
+
+		assertFalse(basicAttributes0.equals(basicAttributes1));
+		assertFalse(basicAttributes1.equals(basicAttributes0));
+	}
+
+	public void testEquals_DifferentSize() {
+		BasicAttributes basicAttributes0 = new BasicAttributes(true);
+		BasicAttributes basicAttributes1 = new BasicAttributes(true);
+
+		basicAttributes1.put("attr1", "value");
+
+		assertFalse(basicAttributes0.equals(basicAttributes1));
+		assertFalse(basicAttributes1.equals(basicAttributes0));
+	}
+
+	/**
+	 * 1. ignoreCase=false 2. Normal values
+	 */
+	public void testEquals_caseSensitive() {
+		BasicAttributes basicAttributes0 = new BasicAttributes(false);
+		BasicAttributes basicAttributes1 = new BasicAttributes(false);
+
+		int count = 10;
+		BasicAttribute attribute[] = new BasicAttribute[count];
+		for (int i = 0; i < count; i++) {
+			attribute[i] = new BasicAttribute("ID:" + i, "Value: " + i);
+			basicAttributes0.put(attribute[i]);
+			basicAttributes1.put(attribute[i]);
+		}
+		assertTrue(basicAttributes0.equals(basicAttributes1));
+		assertTrue(basicAttributes1.equals(basicAttributes0));
+		assertFalse(basicAttributes0.equals(null));
+	}
+
+	/**
+	 * 1. ignoreCase=false 2. no value
+	 */
+	public void testEquals_caseSensitive_NoValue() {
+		BasicAttributes basicAttributes0 = new BasicAttributes(false);
+		BasicAttributes basicAttributes1 = new BasicAttributes(false);
+
+		assertTrue(basicAttributes0.equals(basicAttributes1));
+		assertTrue(basicAttributes1.equals(basicAttributes0));
+		assertFalse(basicAttributes0.equals(null));
+	}
+
+	public void testSerializable_Simple() throws ClassNotFoundException,
+			IOException {
+		int count = 10;
+		BasicAttribute attribute[] = new BasicAttribute[count];
+
+		for (int i = 0; i < count; i++) {
+			attribute[i] = new BasicAttribute("ID:" + i, "Value: " + i);
+			caseSensitiveAttributes.put(attribute[i]);
+		}
+
+		// write to byte array
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		ObjectOutputStream oos = new ObjectOutputStream(baos);
+		oos.writeObject(caseSensitiveAttributes);
+		byte[] buffer = baos.toByteArray();
+
+		// read from byte array
+		ByteArrayInputStream bais = new ByteArrayInputStream(buffer);
+		ObjectInputStream ois = new ObjectInputStream(bais);
+		BasicAttributes attributes2 = (BasicAttributes) ois.readObject();
+
+		assertEquals(caseSensitiveAttributes, attributes2);
+	}
+
+	public void testSerializable_compatibility() throws ClassNotFoundException,
+			IOException {
+		ObjectInputStream ois = new ObjectInputStream(getClass()
+				.getClassLoader().getResourceAsStream(
+						"data/BasicAttributes.ser"));
+		BasicAttributes attributes2 = (BasicAttributes) ois.readObject();
+
+		int count = 10;
+		BasicAttribute attribute[] = new BasicAttribute[count];
+
+		for (int i = 0; i < count; i++) {
+			attribute[i] = new BasicAttribute("ID:" + i, "Value: " + i);
+			caseSensitiveAttributes.put(attribute[i]);
+		}
+
+		assertEquals(caseSensitiveAttributes, attributes2);
+	}
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/directory/TestInitialDirContext.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/directory/TestInitialDirContext.java?rev=386087&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/directory/TestInitialDirContext.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/directory/TestInitialDirContext.java Wed Mar 15 06:55:38 2006
@@ -0,0 +1,507 @@
+/* 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 tests.api.javax.naming.directory;
+
+import java.util.Hashtable;
+
+import javax.naming.CompositeName;
+import javax.naming.Context;
+import javax.naming.InvalidNameException;
+import javax.naming.Name;
+import javax.naming.NamingException;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.InitialDirContext;
+import javax.naming.directory.ModificationItem;
+import javax.naming.directory.SearchControls;
+
+import junit.framework.AssertionFailedError;
+import junit.framework.TestCase;
+import tests.api.javax.naming.mock.InvokeRecord;
+import tests.api.javax.naming.util.Log;
+
+public class TestInitialDirContext extends TestCase {
+
+	static Log log = new Log(TestInitialDirContext.class);
+
+	static Name n;
+
+	static Name urln;
+
+	static String strn;
+
+	static String urlstrn;
+
+	static String s;
+
+	static Object o;
+
+	static Object os[];
+
+	static Integer i;
+
+	static Attributes a;
+
+	static String as[];
+
+	static ModificationItem mis[];
+
+	static SearchControls c;
+
+	static {
+		try {
+			n = new CompositeName("name/sample");
+			urln = new CompositeName("'http://www.apache.org/foundation'");
+			strn = "name/sample";
+			urlstrn = "http://www.apache.org/foundation";
+			s = "str sample";
+			o = "object sample";
+			os = new Object[0];
+			i = new Integer(1);
+			a = new BasicAttributes("id sample", "value sample");
+			as = new String[] { "attr1", "attr2" };
+			mis = new ModificationItem[0];
+			c = new SearchControls();
+		} catch (InvalidNameException e) {
+			e.printStackTrace();
+		}
+	}
+
+	DirContext ctx = null;
+
+	/**
+	 * Constructor for TestInitialDirContext.
+	 * 
+	 * @param arg0
+	 */
+	public TestInitialDirContext(String arg0) {
+		super(arg0);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see junit.framework.TestCase#setUp()
+	 */
+	protected void setUp() throws Exception {
+		super.setUp();
+		Hashtable env = new Hashtable();
+		env.put(Context.INITIAL_CONTEXT_FACTORY,
+				"tests.api.javax.naming.mock.MockDirContextFactory");
+		env.put(Context.URL_PKG_PREFIXES, "tests.api.javax.naming.spi.mock");
+		ctx = new InitialDirContext(env);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see junit.framework.TestCase#tearDown()
+	 */
+	protected void tearDown() throws Exception {
+		super.tearDown();
+	}
+
+	public void testWhatAreUrlStringNames() throws NamingException {
+		log.setMethod("testWhatAreUrlStringNames()");
+
+		testIsUrlStringName("http://www.apache.org/foundation", "http");
+		testIsUrlStringName("http://www.apache.org", "http");
+		testIsUrlStringName("http://", "http");
+		testIsUrlStringName("http:", "http");
+
+		testIsUrlStringName("https://www.apache.org/foundation", "https");
+		testIsUrlStringName("https://www.apache.org", "https");
+		testIsUrlStringName("https://", "https");
+		testIsUrlStringName("https:", "https");
+
+		testIsUrlStringName("abc://www.apache.org/foundation", "abc");
+		testIsUrlStringName("abc://www.apache.org", "abc");
+		testIsUrlStringName("abc://", "abc");
+		testIsUrlStringName("abc:", "abc");
+
+		testIsUrlStringName("'http://www.apache.org/foundation'", null);
+		testIsUrlStringName("'http://www.apache.org'", null);
+		testIsUrlStringName("'http://'", null);
+		testIsUrlStringName("'http:'", null);
+
+		testIsUrlStringName("http", null);
+		testIsUrlStringName("https", null);
+		testIsUrlStringName("abc", null);
+		testIsUrlStringName("'http", null);
+	}
+
+	public void testWhatAreUrlStringNames_OddCase1() throws NamingException {
+		log.setMethod("testWhatAreUrlStringNames_OddCase1()");
+
+		testIsUrlStringName("HTTP2://www.apache.org/foundation", "HTTP2");
+		testIsUrlStringName("HTTP2://www.apache.org", "HTTP2");
+		testIsUrlStringName("HTTP2://", "HTTP2");
+		testIsUrlStringName("HTTP2:", "HTTP2");
+	}
+
+	public void testWhatAreUrlStringNames_OddCase2() throws NamingException {
+		log.setMethod("testWhatAreUrlStringNames_OddCase2()");
+
+		testIsUrlStringName("a_b_c://www.apache.org/foundation", "a_b_c");
+		testIsUrlStringName("a_b_c://www.apache.org", "a_b_c");
+		testIsUrlStringName("a_b_c://", "a_b_c");
+		testIsUrlStringName("a_b_c:", "a_b_c");
+	}
+
+	private void testIsUrlStringName(String str, String expectedSchema)
+			throws NamingException {
+		ctx.bind(str, o, a);
+		assertEquals(expectedSchema, InvokeRecord.getLatestUrlSchema());
+		ctx.rebind(str, o, a);
+		assertEquals(expectedSchema, InvokeRecord.getLatestUrlSchema());
+	}
+
+	/*
+	 * Test for void bind(Name, Object, Attributes)
+	 */
+	public void testBindNameObjectAttributes() throws NamingException {
+		log.setMethod("testBindNameObjectAttributes()");
+		ctx.bind(n, o, a);
+		assertTrue(InvokeRecord.equals(null, "bind", n, o, a));
+		ctx.bind(urln, o, a);
+		assertTrue(InvokeRecord.equals("http", "bind", urln, o, a));
+	}
+
+	/*
+	 * Test for void bind(String, Object, Attributes)
+	 */
+	public void testBindStringObjectAttributes() throws NamingException {
+		log.setMethod("testBindStringObjectAttributes()");
+		ctx.bind(strn, o, a);
+		assertTrue(InvokeRecord.equals(null, "bind", strn, o, a));
+		ctx.bind(urlstrn, o, a);
+		assertTrue(InvokeRecord.equals("http", "bind", urlstrn, o, a));
+	}
+
+	/*
+	 * Test for DirContext createSubcontext(Name, Attributes)
+	 */
+	public void testCreateSubcontextNameAttributes() throws NamingException {
+		log.setMethod("testCreateSubcontextNameAttributes()");
+		ctx.createSubcontext(n, a);
+		assertTrue(InvokeRecord.equals(null, "createSubcontext", n, a));
+		ctx.createSubcontext(urln, a);
+		assertTrue(InvokeRecord.equals("http", "createSubcontext", urln, a));
+	}
+
+	/*
+	 * Test for DirContext createSubcontext(String, Attributes)
+	 */
+	public void testCreateSubcontextStringAttributes() throws NamingException {
+		log.setMethod("testCreateSubcontextStringAttributes()");
+		ctx.createSubcontext(strn, a);
+		assertTrue(InvokeRecord.equals(null, "createSubcontext", strn, a));
+		ctx.createSubcontext(urlstrn, a);
+		assertTrue(InvokeRecord.equals("http", "createSubcontext", urlstrn, a));
+	}
+
+	/*
+	 * Test for Attributes getAttributes(Name)
+	 */
+	public void testGetAttributesName() throws NamingException {
+		log.setMethod("testGetAttributesName()");
+		ctx.getAttributes(n);
+		try {
+			assertTrue(InvokeRecord.equals(null, "getAttributes", n));
+		} catch (AssertionFailedError e) {
+			assertTrue(InvokeRecord.equals(null, "getAttributes", n, null));
+		}
+		ctx.getAttributes(urln);
+		try {
+			assertTrue(InvokeRecord.equals("http", "getAttributes", urln));
+		} catch (AssertionFailedError e) {
+			assertTrue(InvokeRecord.equals("http", "getAttributes", urln, null));
+		}
+	}
+
+	/*
+	 * Test for Attributes getAttributes(Name, String[])
+	 */
+	public void testGetAttributesNameStringArray() throws NamingException {
+		log.setMethod("testGetAttributesNameStringArray()");
+		ctx.getAttributes(n, as);
+		assertTrue(InvokeRecord.equals(null, "getAttributes", n, as));
+		ctx.getAttributes(urln, as);
+		assertTrue(InvokeRecord.equals("http", "getAttributes", urln, as));
+	}
+
+	/*
+	 * Test for Attributes getAttributes(String)
+	 */
+	public void testGetAttributesString() throws NamingException {
+		log.setMethod("testGetAttributesString()");
+		ctx.getAttributes(strn);
+		try {
+			assertTrue(InvokeRecord.equals(null, "getAttributes", strn));
+		} catch (AssertionFailedError e) {
+			assertTrue(InvokeRecord.equals(null, "getAttributes", strn, null));
+		}
+		ctx.getAttributes(urlstrn);
+		try {
+			assertTrue(InvokeRecord.equals("http", "getAttributes", urlstrn));
+		} catch (AssertionFailedError e) {
+			assertTrue(InvokeRecord.equals("http", "getAttributes", urlstrn,
+					null));
+		}
+	}
+
+	/*
+	 * Test for Attributes getAttributes(String, String[])
+	 */
+	public void testGetAttributesStringStringArray() throws NamingException {
+		log.setMethod("testGetAttributesStringStringArray()");
+		ctx.getAttributes(strn, as);
+		assertTrue(InvokeRecord.equals(null, "getAttributes", strn, as));
+		ctx.getAttributes(urlstrn, as);
+		assertTrue(InvokeRecord.equals("http", "getAttributes", urlstrn, as));
+	}
+
+	/*
+	 * Test for DirContext getSchema(Name)
+	 */
+	public void testGetSchemaName() throws NamingException {
+		log.setMethod("testGetSchemaName()");
+		ctx.getSchema(n);
+		assertTrue(InvokeRecord.equals(null, "getSchema", n));
+		ctx.getSchema(urln);
+		assertTrue(InvokeRecord.equals("http", "getSchema", urln));
+	}
+
+	/*
+	 * Test for DirContext getSchema(String)
+	 */
+	public void testGetSchemaString() throws NamingException {
+		log.setMethod("testGetSchemaString()");
+		ctx.getSchema(strn);
+		assertTrue(InvokeRecord.equals(null, "getSchema", strn));
+		ctx.getSchema(urlstrn);
+		assertTrue(InvokeRecord.equals("http", "getSchema", urlstrn));
+	}
+
+	/*
+	 * Test for DirContext getSchemaClassDefinition(Name)
+	 */
+	public void testGetSchemaClassDefinitionName() throws NamingException {
+		log.setMethod("testGetSchemaClassDefinitionName()");
+		ctx.getSchemaClassDefinition(n);
+		assertTrue(InvokeRecord.equals(null, "getSchemaClassDefinition", n));
+		ctx.getSchemaClassDefinition(urln);
+		assertTrue(InvokeRecord
+				.equals("http", "getSchemaClassDefinition", urln));
+	}
+
+	/*
+	 * Test for DirContext getSchemaClassDefinition(String)
+	 */
+	public void testGetSchemaClassDefinitionString() throws NamingException {
+		log.setMethod("testGetSchemaClassDefinitionString()");
+		ctx.getSchemaClassDefinition(strn);
+		assertTrue(InvokeRecord.equals(null, "getSchemaClassDefinition", strn));
+		ctx.getSchemaClassDefinition(urlstrn);
+		assertTrue(InvokeRecord.equals("http", "getSchemaClassDefinition",
+				urlstrn));
+	}
+
+	/*
+	 * Test for void modifyAttributes(Name, int, Attributes)
+	 */
+	public void testModifyAttributesNameintAttributes() throws NamingException {
+		log.setMethod("testModifyAttributesNameintAttributes()");
+		ctx.modifyAttributes(n, i.intValue(), a);
+		assertTrue(InvokeRecord.equals(null, "modifyAttributes", n, i, a));
+		ctx.modifyAttributes(urln, i.intValue(), a);
+		assertTrue(InvokeRecord.equals("http", "modifyAttributes", urln, i, a));
+	}
+
+	/*
+	 * Test for void modifyAttributes(Name, ModificationItem[])
+	 */
+	public void testModifyAttributesNameModificationItemArray()
+			throws NamingException {
+		log.setMethod("testModifyAttributesNameModificationItemArray()");
+		ctx.modifyAttributes(n, mis);
+		assertTrue(InvokeRecord.equals(null, "modifyAttributes", n, mis));
+		ctx.modifyAttributes(urln, mis);
+		assertTrue(InvokeRecord.equals("http", "modifyAttributes", urln, mis));
+	}
+
+	/*
+	 * Test for void modifyAttributes(String, int, Attributes)
+	 */
+	public void testModifyAttributesStringintAttributes()
+			throws NamingException {
+		log.setMethod("testModifyAttributesStringintAttributes()");
+		ctx.modifyAttributes(strn, i.intValue(), a);
+		assertTrue(InvokeRecord.equals(null, "modifyAttributes", strn, i, a));
+		ctx.modifyAttributes(urlstrn, i.intValue(), a);
+		assertTrue(InvokeRecord.equals("http", "modifyAttributes", urlstrn, i,
+				a));
+	}
+
+	/*
+	 * Test for void modifyAttributes(String, ModificationItem[])
+	 */
+	public void testModifyAttributesStringModificationItemArray()
+			throws NamingException {
+		log.setMethod("testModifyAttributesStringModificationItemArray()");
+		ctx.modifyAttributes(strn, mis);
+		assertTrue(InvokeRecord.equals(null, "modifyAttributes", strn, mis));
+		ctx.modifyAttributes(urlstrn, mis);
+		assertTrue(InvokeRecord
+				.equals("http", "modifyAttributes", urlstrn, mis));
+	}
+
+	/*
+	 * Test for void rebind(Name, Object, Attributes)
+	 */
+	public void testRebindNameObjectAttributes() throws NamingException {
+		log.setMethod("testRebindNameObjectAttributes()");
+		ctx.rebind(n, o, a);
+		assertTrue(InvokeRecord.equals(null, "rebind", n, o, a));
+		ctx.rebind(urln, o, a);
+		assertTrue(InvokeRecord.equals("http", "rebind", urln, o, a));
+	}
+
+	/*
+	 * Test for void rebind(String, Object, Attributes)
+	 */
+	public void testRebindStringObjectAttributes() throws NamingException {
+		log.setMethod("testRebindStringObjectAttributes()");
+		ctx.rebind(strn, o, a);
+		assertTrue(InvokeRecord.equals(null, "rebind", strn, o, a));
+		ctx.rebind(urlstrn, o, a);
+		assertTrue(InvokeRecord.equals("http", "rebind", urlstrn, o, a));
+	}
+
+	/*
+	 * Test for NamingEnumeration search(Name, Attributes)
+	 */
+	public void testSearchNameAttributes() throws NamingException {
+		log.setMethod("testSearchNameAttributes()");
+		ctx.search(n, a);
+		assertTrue(InvokeRecord.equals(null, "search", n, a));
+		ctx.search(urln, a);
+		assertTrue(InvokeRecord.equals("http", "search", urln, a));
+	}
+
+	/*
+	 * Test for NamingEnumeration search(Name, Attributes, String[])
+	 */
+	public void testSearchNameAttributesStringArray() throws NamingException {
+		log.setMethod("testSearchNameAttributesStringArray()");
+		ctx.search(n, a, as);
+		assertTrue(InvokeRecord.equals(null, "search", n, a, as));
+		ctx.search(urln, a, as);
+		assertTrue(InvokeRecord.equals("http", "search", urln, a, as));
+	}
+
+	/*
+	 * Test for NamingEnumeration search(Name, String, Object[], SearchControls)
+	 */
+	public void testSearchNameStringObjectArraySearchControls()
+			throws NamingException {
+		log.setMethod("testSearchNameStringObjectArraySearchControls()");
+		ctx.search(n, s, os, c);
+		assertTrue(InvokeRecord.equals(null, "search", n, s, os, c));
+		ctx.search(urln, s, os, c);
+		assertTrue(InvokeRecord.equals("http", "search", urln, s, os, c));
+	}
+
+	/*
+	 * Test for NamingEnumeration search(Name, String, SearchControls)
+	 */
+	public void testSearchNameStringSearchControls() throws NamingException {
+		log.setMethod("testSearchNameStringSearchControls()");
+		ctx.search(n, s, c);
+		assertTrue(InvokeRecord.equals(null, "search", n, s, c));
+		ctx.search(urln, s, c);
+		assertTrue(InvokeRecord.equals("http", "search", urln, s, c));
+	}
+
+	/*
+	 * Test for NamingEnumeration search(String, Attributes)
+	 */
+	public void testSearchStringAttributes() throws NamingException {
+		log.setMethod("testSearchStringAttributes()");
+		ctx.search(strn, a);
+		assertTrue(InvokeRecord.equals(null, "search", strn, a));
+		ctx.search(urlstrn, a);
+		assertTrue(InvokeRecord.equals("http", "search", urlstrn, a));
+	}
+
+	/*
+	 * Test for NamingEnumeration search(String, Attributes, String[])
+	 */
+	public void testSearchStringAttributesStringArray() throws NamingException {
+		log.setMethod("testSearchStringAttributesStringArray()");
+		ctx.search(strn, a, as);
+		assertTrue(InvokeRecord.equals(null, "search", strn, a, as));
+		ctx.search(urlstrn, a, as);
+		assertTrue(InvokeRecord.equals("http", "search", urlstrn, a, as));
+	}
+
+	/*
+	 * Test for NamingEnumeration search(String, String, Object[],
+	 * SearchControls)
+	 */
+	public void testSearchStringStringObjectArraySearchControls()
+			throws NamingException {
+		log.setMethod("testSearchStringStringObjectArraySearchControls()");
+		ctx.search(strn, s, os, c);
+		assertTrue(InvokeRecord.equals(null, "search", strn, s, os, c));
+		ctx.search(urlstrn, s, os, c);
+		assertTrue(InvokeRecord.equals("http", "search", urlstrn, s, os, c));
+	}
+
+	/*
+	 * Test for NamingEnumeration search(String, String, SearchControls)
+	 */
+	public void testSearchStringStringSearchControls() throws NamingException {
+		log.setMethod("testSearchStringStringSearchControls()");
+		ctx.search(strn, s, c);
+		assertTrue(InvokeRecord.equals(null, "search", strn, s, c));
+		ctx.search(urlstrn, s, c);
+		assertTrue(InvokeRecord.equals("http", "search", urlstrn, s, c));
+	}
+
+	/*
+	 * Test for void close()
+	 */
+	public void testClose() throws NamingException {
+		log.setMethod("testClose()");
+		ctx.close();
+		assertTrue(InvokeRecord.equals(null, "close"));
+	}
+
+	public void testDefaultConstructor() throws NamingException {
+		log.setMethod("testDefaultConstructor()");
+		// unstable behavior, hard to dig deep. just make logs.
+		try {
+			ctx = new InitialDirContext();
+			// expected result
+		} catch (Throwable e) {
+			e.printStackTrace();
+			log.log(e);
+			fail();
+		}
+	}
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/directory/TestModificationItem.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/directory/TestModificationItem.java?rev=386087&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/directory/TestModificationItem.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/directory/TestModificationItem.java Wed Mar 15 06:55:38 2006
@@ -0,0 +1,113 @@
+/* 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 tests.api.javax.naming.directory;
+
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.ModificationItem;
+
+import tests.api.javax.naming.util.Log;
+import junit.framework.TestCase;
+
+public class TestModificationItem extends TestCase {
+
+	static Log log = new Log(TestModificationItem.class);
+
+	BasicAttribute attr = new BasicAttribute("id_sample", "value_sample");
+
+	/**
+	 * Constructor for TestModificationItem.
+	 * 
+	 * @param arg0
+	 */
+	public TestModificationItem(String arg0) {
+		super(arg0);
+	}
+
+	/*
+	 * @see TestCase#setUp()
+	 */
+	protected void setUp() throws Exception {
+		super.setUp();
+	}
+
+	/*
+	 * @see TestCase#tearDown()
+	 */
+	protected void tearDown() throws Exception {
+		super.tearDown();
+	}
+
+	public void testModificationItem() {
+		log.setMethod("testModificationItem()");
+		ModificationItem item;
+
+		item = new ModificationItem(DirContext.ADD_ATTRIBUTE, attr);
+		assertEquals(DirContext.ADD_ATTRIBUTE, item.getModificationOp());
+		assertEquals(attr, item.getAttribute());
+	}
+
+	public void testModificationItem_InvalidOp() {
+		log.setMethod("testModificationItem_InvalidOp()");
+		ModificationItem item;
+
+		try {
+			item = new ModificationItem(-255, attr);
+			fail("Should throw IllegalArgumentException");
+		} catch (IllegalArgumentException e) {
+		}
+	}
+
+	public void testModificationItem_NullAttribute() {
+		log.setMethod("testModificationItem_NullAttribute()");
+		ModificationItem item;
+
+		try {
+			item = new ModificationItem(DirContext.ADD_ATTRIBUTE, null);
+			fail("Should throw IllegalArgumentException");
+		} catch (IllegalArgumentException e) {
+		}
+	}
+
+	public void testGetAttribute() {
+		log.setMethod("testGetAttribute()");
+		ModificationItem item;
+
+		item = new ModificationItem(DirContext.ADD_ATTRIBUTE, attr);
+		assertEquals(DirContext.ADD_ATTRIBUTE, item.getModificationOp());
+		assertEquals(attr, item.getAttribute());
+	}
+
+	public void testGetModificationOp() {
+		log.setMethod("testGetModificationOp()");
+		ModificationItem item;
+
+		item = new ModificationItem(DirContext.ADD_ATTRIBUTE, attr);
+		assertEquals(DirContext.ADD_ATTRIBUTE, item.getModificationOp());
+		assertEquals(attr, item.getAttribute());
+	}
+
+	/*
+	 * Test for String toString()
+	 */
+	public void testToString() {
+		log.setMethod("testToString()");
+		ModificationItem item;
+
+		item = new ModificationItem(DirContext.ADD_ATTRIBUTE, attr);
+		assertTrue(null != item.toString());
+	}
+
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/directory/TestSearchControls.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/directory/TestSearchControls.java?rev=386087&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/directory/TestSearchControls.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/directory/TestSearchControls.java Wed Mar 15 06:55:38 2006
@@ -0,0 +1,146 @@
+/* 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 tests.api.javax.naming.directory;
+
+import java.util.Arrays;
+
+import javax.naming.directory.SearchControls;
+
+import tests.api.javax.naming.util.Log;
+import junit.framework.TestCase;
+
+public class TestSearchControls extends TestCase {
+
+	static Log log = new Log(TestSearchControls.class);
+
+	/**
+	 * Constructor for TestSearchControls.
+	 * 
+	 * @param arg0
+	 */
+	public TestSearchControls(String arg0) {
+		super(arg0);
+	}
+
+	/*
+	 * @see TestCase#setUp()
+	 */
+	protected void setUp() throws Exception {
+		super.setUp();
+	}
+
+	/*
+	 * @see TestCase#tearDown()
+	 */
+	protected void tearDown() throws Exception {
+		super.tearDown();
+	}
+
+	/*
+	 * Test for void SearchControls()
+	 */
+	public void testSearchControls() {
+		log.setMethod("testSearchControls()");
+		SearchControls ctrl;
+
+		ctrl = new SearchControls();
+		assertEquals(SearchControls.ONELEVEL_SCOPE, ctrl.getSearchScope());
+		assertEquals(0, ctrl.getCountLimit());
+		assertEquals(0, ctrl.getTimeLimit());
+		assertEquals(null, ctrl.getReturningAttributes());
+		assertEquals(false, ctrl.getDerefLinkFlag());
+		assertEquals(false, ctrl.getReturningObjFlag());
+	}
+
+	/*
+	 * Test for void SearchControls(int, long, int, String[], boolean, boolean)
+	 */
+	public void testSearchControls_Full() {
+		log.setMethod("testSearchControls_Full()");
+		SearchControls ctrl;
+
+		ctrl = new SearchControls(SearchControls.OBJECT_SCOPE, 100, 200,
+				new String[] { "id1", "id2" }, true, true);
+		assertEquals(SearchControls.OBJECT_SCOPE, ctrl.getSearchScope());
+		assertEquals(100, ctrl.getCountLimit());
+		assertEquals(200, ctrl.getTimeLimit());
+		assertTrue(Arrays.equals(new String[] { "id1", "id2" }, ctrl
+				.getReturningAttributes()));
+		assertEquals(true, ctrl.getDerefLinkFlag());
+		assertEquals(true, ctrl.getReturningObjFlag());
+	}
+
+	public void testSearchControls_Illegal_Scope() {
+		log.setMethod("testSearchControls_Illegal_Scope()");
+		SearchControls ctrl;
+
+		ctrl = new SearchControls(-1, 100, 200, new String[] { "id1", "id2" },
+				true, true);
+
+	}
+
+	public void testSearchControls_Illegal_CountLimit() {
+		log.setMethod("testSearchControls_Illegal_CountLimit()");
+		SearchControls ctrl;
+
+		ctrl = new SearchControls(SearchControls.OBJECT_SCOPE, -1, 200,
+				new String[] { "id1", "id2" }, true, true);
+
+	}
+
+	public void testSearchControls_Illegal_TimeLimit() {
+		log.setMethod("testSearchControls_Illegal_TimeLimit()");
+		SearchControls ctrl;
+
+		ctrl = new SearchControls(SearchControls.OBJECT_SCOPE, 100, -1,
+				new String[] { "id1", "id2" }, true, true);
+
+	}
+
+	/*
+	 * Test for getter and setter methods
+	 */
+	public void testGetterAndSetter() {
+		log.setMethod("testGetterAndSetter()");
+		SearchControls ctrl;
+
+		ctrl = new SearchControls();
+		ctrl.setReturningAttributes(new String[] { "id1", "id2" });
+		ctrl.setCountLimit(100);
+		ctrl.setDerefLinkFlag(true);
+		ctrl.setReturningObjFlag(true);
+		ctrl.setSearchScope(SearchControls.OBJECT_SCOPE);
+		ctrl.setTimeLimit(200);
+		assertEquals(SearchControls.OBJECT_SCOPE, ctrl.getSearchScope());
+		assertEquals(100, ctrl.getCountLimit());
+		assertEquals(200, ctrl.getTimeLimit());
+		assertTrue(Arrays.equals(new String[] { "id1", "id2" }, ctrl
+				.getReturningAttributes()));
+		assertEquals(true, ctrl.getDerefLinkFlag());
+		assertEquals(true, ctrl.getReturningObjFlag());
+	}
+
+	/*
+	 * Test for String toString()
+	 */
+	public void testToString() {
+		log.setMethod("testToString()");
+		SearchControls ctrl;
+
+		ctrl = new SearchControls();
+		assertTrue(ctrl.toString() != null);
+	}
+
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/directory/TestSearchResult.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/directory/TestSearchResult.java?rev=386087&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/directory/TestSearchResult.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/directory/TestSearchResult.java Wed Mar 15 06:55:38 2006
@@ -0,0 +1,145 @@
+/* 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 tests.api.javax.naming.directory;
+
+import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.SearchResult;
+
+import tests.api.javax.naming.util.Log;
+import junit.framework.TestCase;
+
+public class TestSearchResult extends TestCase {
+
+	static Log log = new Log(TestSearchResult.class);
+
+	BasicAttributes attrs = new BasicAttributes("id_sample", "value_sample");
+
+	/**
+	 * Constructor for TestSearchResult.
+	 * 
+	 * @param arg0
+	 */
+	public TestSearchResult(String arg0) {
+		super(arg0);
+	}
+
+	/*
+	 * @see TestCase#setUp()
+	 */
+	protected void setUp() throws Exception {
+		super.setUp();
+	}
+
+	/*
+	 * @see TestCase#tearDown()
+	 */
+	protected void tearDown() throws Exception {
+		super.tearDown();
+	}
+
+	/*
+	 * Test for void SearchResult(String, Object, Attributes)
+	 */
+	public void testSearchResult_StringObjectAttributes() {
+		log.setMethod("testSearchResult_StringObjectAttributes()");
+		SearchResult r;
+
+		r = new SearchResult("name", "obj", attrs);
+		assertEquals("java.lang.String", r.getClassName());
+		assertEquals("name", r.getName());
+		assertEquals("obj", r.getObject());
+		assertEquals(attrs, r.getAttributes());
+		assertEquals(true, r.isRelative());
+	}
+
+	/*
+	 * Test for void SearchResult(String, Object, Attributes, boolean)
+	 */
+	public void testSearchResult_StringObjectAttributesboolean() {
+		log.setMethod("testSearchResult_StringObjectAttributesboolean()");
+		SearchResult r;
+
+		r = new SearchResult("name", "obj", attrs, false);
+		assertEquals("java.lang.String", r.getClassName());
+		assertEquals("name", r.getName());
+		assertEquals("obj", r.getObject());
+		assertEquals(attrs, r.getAttributes());
+		assertEquals(false, r.isRelative());
+	}
+
+	/*
+	 * Test for void SearchResult(String, String, Object, Attributes)
+	 */
+	public void testSearchResult_StringStringObjectAttributes() {
+		log.setMethod("testSearchResult_StringStringObjectAttributes()");
+		SearchResult r;
+
+		r = new SearchResult("name", "classname", "obj", attrs);
+		assertEquals("classname", r.getClassName());
+		assertEquals("name", r.getName());
+		assertEquals("obj", r.getObject());
+		assertEquals(attrs, r.getAttributes());
+		assertEquals(true, r.isRelative());
+	}
+
+	/*
+	 * Test for void SearchResult(String, String, Object, Attributes, boolean)
+	 */
+	public void testSearchResult_StringStringObjectAttributesboolean() {
+		log.setMethod("testSearchResult_StringStringObjectAttributesboolean()");
+		SearchResult r;
+
+		r = new SearchResult("name", "classname", "obj", attrs, false);
+		assertEquals("classname", r.getClassName());
+		assertEquals("name", r.getName());
+		assertEquals("obj", r.getObject());
+		assertEquals(attrs, r.getAttributes());
+		assertEquals(false, r.isRelative());
+	}
+
+	public void testSearchResult_NullAttributes() {
+		log.setMethod("testSearchResult_NullAttributes()");
+		SearchResult r;
+
+		r = new SearchResult(null, null, null);
+	}
+
+	public void testGetterAndSetter() {
+		log.setMethod("testGetterAndSetter()");
+		SearchResult r;
+
+		r = new SearchResult("name", "obj", null);
+		assertEquals(null, r.getAttributes());
+		r.setAttributes(attrs);
+		assertEquals(attrs, r.getAttributes());
+	}
+
+	/*
+	 * Test for String toString()
+	 */
+	public void testToString() {
+		log.setMethod("testToString()");
+		SearchResult r;
+
+		r = new SearchResult("name", "obj", attrs);
+		String str = r.toString();
+		assertTrue(str.indexOf("name") >= 0);
+		assertTrue(str.indexOf("obj") >= 0);
+		assertTrue(str.indexOf("java.lang.String") >= 0);
+		assertTrue(str.indexOf("id_sample") >= 0);
+		assertTrue(str.indexOf("value_sample") >= 0);
+	}
+
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/event/AllTests.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/event/AllTests.java?rev=386087&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/event/AllTests.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/event/AllTests.java Wed Mar 15 06:55:38 2006
@@ -0,0 +1,31 @@
+/* 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 tests.api.javax.naming.event;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTests {
+
+	public static Test suite() {
+		TestSuite suite = new TestSuite("Test for tests.api.javax.naming.event");
+		// $JUnit-BEGIN$
+		suite.addTestSuite(TestNamingExceptionEvent.class);
+		suite.addTestSuite(TestNamingEvent.class);
+		// $JUnit-END$
+		return suite;
+	}
+}

Added: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/event/MockEventDirContext.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/event/MockEventDirContext.java?rev=386087&view=auto
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/event/MockEventDirContext.java (added)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/tests/api/javax/naming/event/MockEventDirContext.java Wed Mar 15 06:55:38 2006
@@ -0,0 +1,712 @@
+/* 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 tests.api.javax.naming.event;
+
+import java.util.Hashtable;
+
+import javax.naming.Context;
+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.event.EventDirContext;
+import javax.naming.event.NamingListener;
+
+public class MockEventDirContext implements EventDirContext {
+
+	/*
+	 * -------------------------------------------------------------------
+	 * Methods
+	 * -------------------------------------------------------------------
+	 */
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.event.EventDirContext#addNamingListener(javax.naming.Name,
+	 *      java.lang.String, java.lang.Object[],
+	 *      javax.naming.directory.SearchControls,
+	 *      javax.naming.event.NamingListener)
+	 */
+	public void addNamingListener(Name name, String s, Object[] aobj,
+			SearchControls searchcontrols, NamingListener naminglistener)
+			throws NamingException {
+
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.event.EventDirContext#addNamingListener(javax.naming.Name,
+	 *      java.lang.String, javax.naming.directory.SearchControls,
+	 *      javax.naming.event.NamingListener)
+	 */
+	public void addNamingListener(Name name, String s,
+			SearchControls searchcontrols, NamingListener naminglistener)
+			throws NamingException {
+
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.event.EventDirContext#addNamingListener(java.lang.String,
+	 *      java.lang.String, java.lang.Object[],
+	 *      javax.naming.directory.SearchControls,
+	 *      javax.naming.event.NamingListener)
+	 */
+	public void addNamingListener(String s, String s1, Object[] aobj,
+			SearchControls searchcontrols, NamingListener naminglistener)
+			throws NamingException {
+
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.event.EventDirContext#addNamingListener(java.lang.String,
+	 *      java.lang.String, javax.naming.directory.SearchControls,
+	 *      javax.naming.event.NamingListener)
+	 */
+	public void addNamingListener(String s, String s1,
+			SearchControls searchcontrols, NamingListener naminglistener)
+			throws NamingException {
+
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.event.EventContext#addNamingListener(javax.naming.Name,
+	 *      int, javax.naming.event.NamingListener)
+	 */
+	public void addNamingListener(Name name, int i,
+			NamingListener naminglistener) throws NamingException {
+
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.event.EventContext#addNamingListener(java.lang.String,
+	 *      int, javax.naming.event.NamingListener)
+	 */
+	public void addNamingListener(String s, int i, NamingListener naminglistener)
+			throws NamingException {
+
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.event.EventContext#removeNamingListener(javax.naming.event.NamingListener)
+	 */
+	public void removeNamingListener(NamingListener naminglistener)
+			throws NamingException {
+
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see javax.naming.event.EventContext#targetMustExist()
+	 */
+	public boolean targetMustExist() throws NamingException {
+
+		return false;
+	}
+
+	/*
+	 * (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 {
+
+	}
+
+	/*
+	 * (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[] amodificationitem)
+			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[] amodificationitem)
+			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 s, Object[] aobj,
+			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 s,
+			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 s, 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 s, 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 s, String s1, Object[] aobj,
+			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 s, String s1,
+			SearchControls searchcontrols) throws NamingException {
+
+		return null;
+	}
+
+}



Mime
View raw message