Index: jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/CompoundNameTest.java =================================================================== --- jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/CompoundNameTest.java (revision 447777) +++ jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/CompoundNameTest.java (working copy) @@ -29,6 +29,7 @@ import junit.framework.AssertionFailedError; import junit.framework.TestCase; import org.apache.harmony.jndi.tests.javax.naming.util.Log; +import org.apache.harmony.jndi.tests.javax.naming.util.TProperties; public class CompoundNameTest extends TestCase { @@ -681,6 +682,15 @@ testBehavior("'ac'", props); } + public void testConstructor_WithIrregularProps() throws InvalidNameException { + log.setMethod("testConstructor_WithIrregularProps()"); + try{ + new CompoundName("name", new TProperties()); + }catch(UnsupportedOperationException e){ + fail("unexpected UnsupportedOperationException"); + } + } + public void testConstructor_Advanced() throws InvalidNameException { log.setMethod("testConstructor_Advanced()"); @@ -1211,6 +1221,24 @@ assertNameEquals(name2, "b"); } + public void testClone_1() throws InvalidNameException { + log.setMethod("testClone_1()"); + CompoundName name = null, name2 = null; + + try{ + name = new CompoundName("name", new TProperties()); + }catch(UnsupportedOperationException e){ + fail("unexpected UnsupportedOperationException"); + } + + try{ + name2 = (CompoundName)name.clone(); + }catch(UnsupportedOperationException e){ + fail("unexpected UnsupportedOperationException"); + } + assertEquals(name, name2); + } + public void testCompareTo() throws InvalidNameException { log.setMethod("testCompareTo()"); Index: jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/util/TProperties.java =================================================================== --- jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/util/TProperties.java (revision 0) +++ jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/util/TProperties.java (revision 0) @@ -0,0 +1,26 @@ +/* + * Copyright 2005 - 2006 The Apache Software 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.util; + +import java.util.Properties; + +public class TProperties extends Properties{ + + public Object clone(){ + throw new UnsupportedOperationException(); + } +}