directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r923708 [2/2] - in /directory/apacheds/trunk/core-entry/src: main/java/org/apache/directory/server/core/entry/ test/java/org/apache/directory/server/core/entry/
Date Tue, 16 Mar 2010 12:27:46 GMT
Modified: directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerEntryTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerEntryTest.java?rev=923708&r1=923707&r2=923708&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerEntryTest.java
(original)
+++ directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerEntryTest.java
Tue Mar 16 12:27:46 2010
@@ -37,10 +37,8 @@ import java.util.Set;
 
 import javax.naming.InvalidNameException;
 import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.BasicAttributes;
-import javax.naming.directory.NoSuchAttributeException;
 
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.Entry;
@@ -50,6 +48,9 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.client.ClientEntry;
 import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
 import org.apache.directory.shared.ldap.entry.client.DefaultClientEntry;
+import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
+import org.apache.directory.shared.ldap.exception.LdapNoSuchAttributeException;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
@@ -300,7 +301,7 @@ public class DefaultServerEntryTest
             entry.add( "wrongAT", BYTES1, BYTES2 );
             fail();
          }
-         catch ( NoSuchAttributeException nsae )
+         catch ( LdapNoSuchAttributeException nsae )
          {
              assertTrue( true );
          }
@@ -345,7 +346,7 @@ public class DefaultServerEntryTest
             entry.add( "wrongAT", "wrong", "wrong" );
             fail();
         }
-        catch ( NoSuchAttributeException nsae )
+        catch ( LdapNoSuchAttributeException nsae )
         {
             assertTrue( true );
         }
@@ -402,7 +403,7 @@ public class DefaultServerEntryTest
             entry.add( "wrongAT", value1, value2 );
             fail();
         }
-        catch ( NoSuchAttributeException nsae )
+        catch ( LdapNoSuchAttributeException nsae )
         {
             assertTrue( true );
         }
@@ -1735,7 +1736,7 @@ public class DefaultServerEntryTest
      * Test method for getDN()
      */
     @Test
-    public void testGetDn() throws InvalidNameException 
+    public void testGetDn() throws LdapInvalidDnException 
     {
         Entry entry = new DefaultServerEntry( schemaManager, EXAMPLE_DN );
          
@@ -2130,7 +2131,7 @@ public class DefaultServerEntryTest
             entry.put( "badAttr", atPwd, BYTES1 );
             fail();
         }
-        catch ( NoSuchAttributeException nsae )
+        catch ( LdapNoSuchAttributeException nsae )
         {
             assertTrue( true );
         }
@@ -2195,7 +2196,7 @@ public class DefaultServerEntryTest
             entry.put( "badAttr", (AttributeType)null, "test" );
             fail();
         }
-        catch ( NoSuchAttributeException nsae )
+        catch ( LdapNoSuchAttributeException nsae )
         {
             assertTrue( true );
         }
@@ -2205,7 +2206,7 @@ public class DefaultServerEntryTest
             entry.put( "badAttr", atCN, "test" );
             fail();
         }
-        catch ( NoSuchAttributeException nsae )
+        catch ( LdapNoSuchAttributeException nsae )
         {
             assertTrue( true );
         }
@@ -2286,7 +2287,7 @@ public class DefaultServerEntryTest
             entry.put( "badAttr", atCN, strValue1 );
             fail();
         }
-        catch ( NoSuchAttributeException nsae )
+        catch ( LdapNoSuchAttributeException nsae )
         {
             assertTrue( true );
         }
@@ -3867,7 +3868,7 @@ public class DefaultServerEntryTest
      * Test the copy constructor of a ServerEntry
      */
     @Test 
-    public void testCopyConstructorServerEntry() throws NamingException
+    public void testCopyConstructorServerEntry() throws LdapException
     {
         Entry serverEntry = new DefaultServerEntry( schemaManager );
         serverEntry.add( "cn", "test1", "test2" );
@@ -3891,7 +3892,7 @@ public class DefaultServerEntryTest
      * Test the copy constructor of a ClientEntry
      */
     @Test 
-    public void testCopyConstructorClientEntry() throws NamingException
+    public void testCopyConstructorClientEntry() throws LdapException
     {
         Entry clientEntry = new DefaultClientEntry();
         clientEntry.setDn( new DN( "ou=system" ) );
@@ -3915,7 +3916,7 @@ public class DefaultServerEntryTest
      * Test the conversion method 
      */
     @Test 
-    public void testToClientEntry() throws NamingException
+    public void testToClientEntry() throws LdapException
     {
         DN dn = new DN( "ou=system" );
         ServerEntry serverEntry = new DefaultServerEntry( schemaManager );

Modified: directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerBinaryValueTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerBinaryValueTest.java?rev=923708&r1=923707&r2=923708&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerBinaryValueTest.java
(original)
+++ directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerBinaryValueTest.java
Tue Mar 16 12:27:46 2010
@@ -34,10 +34,9 @@ import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.util.Arrays;
 
-import javax.naming.NamingException;
-
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.entry.client.ClientBinaryValue;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.LdapSyntax;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
@@ -87,7 +86,7 @@ public class ServerBinaryValueTest
         {
             private static final long serialVersionUID = 1L;
             
-            public Value<?> normalize( Value<?> value ) throws NamingException
+            public Value<?> normalize( Value<?> value ) throws LdapException
             {
                 if ( value.isBinary() )
                 {
@@ -108,7 +107,7 @@ public class ServerBinaryValueTest
             }
 
         
-            public String normalize( String value ) throws NamingException
+            public String normalize( String value ) throws LdapException
             {
                 throw new IllegalStateException( "expected byte[] to normalize" );
             }
@@ -290,7 +289,7 @@ public class ServerBinaryValueTest
      * Test the clone method
      */
     @Test
-    public void testClone() throws NamingException
+    public void testClone() throws LdapException
     {
         AttributeType at1 = TestServerEntryUtils.getBytesAttributeType();
         ServerBinaryValue sbv = new ServerBinaryValue( at1, null );
@@ -468,7 +467,7 @@ public class ServerBinaryValueTest
      * Test the same method
      */
     @Test
-    public void testSame() throws NamingException
+    public void testSame() throws LdapException
     {
         AttributeType attribute = TestServerEntryUtils.getBytesAttributeType();
         ServerBinaryValue sbv = new ServerBinaryValue( attribute );
@@ -494,7 +493,7 @@ public class ServerBinaryValueTest
      * Test the instanceOf method
      */
     @Test
-    public void testInstanceOf() throws NamingException
+    public void testInstanceOf() throws LdapException
     {
         AttributeType attribute = TestServerEntryUtils.getBytesAttributeType();
         ServerBinaryValue sbv = new ServerBinaryValue( attribute );
@@ -511,7 +510,7 @@ public class ServerBinaryValueTest
      * Test the normalize method
      */
     @Test
-    public void testNormalize() throws NamingException
+    public void testNormalize() throws LdapException
     {
         AttributeType attribute = TestServerEntryUtils.getBytesAttributeType();
         ServerBinaryValue sbv = new ServerBinaryValue( attribute );
@@ -552,7 +551,7 @@ public class ServerBinaryValueTest
     /**
      * Test serialization of a BinaryValue which has a normalized value
      */
-    @Test public void testNormalizedBinaryValueSerialization() throws NamingException, IOException,
ClassNotFoundException
+    @Test public void testNormalizedBinaryValueSerialization() throws LdapException, IOException,
ClassNotFoundException
     {
         byte[] v1 = StringTools.getBytesUtf8( "  Test   Test  " );
         byte[] v1Norm = StringTools.getBytesUtf8( "Test   Test" );
@@ -576,7 +575,7 @@ public class ServerBinaryValueTest
      * Test serialization of a BinaryValue which normalized value is the same
      * than the value
      */
-    @Test public void testNormalizedBinarySameValueSerialization() throws NamingException,
IOException, ClassNotFoundException
+    @Test public void testNormalizedBinarySameValueSerialization() throws LdapException,
IOException, ClassNotFoundException
     {
         byte[] v1 = StringTools.getBytesUtf8( "Test   Test" );
         
@@ -592,7 +591,7 @@ public class ServerBinaryValueTest
     /**
      * Test serialization of a BinaryValue which does not have a normalized value
      */
-    @Test public void testNoNormalizedBinaryValueSerialization() throws NamingException,
IOException, ClassNotFoundException
+    @Test public void testNoNormalizedBinaryValueSerialization() throws LdapException, IOException,
ClassNotFoundException
     {
         byte[] v1 = StringTools.getBytesUtf8( "test" );
         byte[] v1Norm = StringTools.getBytesUtf8( "test" );
@@ -615,7 +614,7 @@ public class ServerBinaryValueTest
     /**
      * Test serialization of a null BinaryValue
      */
-    @Test public void testNullBinaryValueSerialization() throws NamingException, IOException,
ClassNotFoundException
+    @Test public void testNullBinaryValueSerialization() throws LdapException, IOException,
ClassNotFoundException
     {
         // First check with a value which will be normalized
         ServerBinaryValue sbv = new ServerBinaryValue( at );
@@ -635,7 +634,7 @@ public class ServerBinaryValueTest
     /**
      * Test serialization of an empty BinaryValue
      */
-    @Test public void testEmptyBinaryValueSerialization() throws NamingException, IOException,
ClassNotFoundException
+    @Test public void testEmptyBinaryValueSerialization() throws LdapException, IOException,
ClassNotFoundException
     {
         // First check with a value which will be normalized
         ServerBinaryValue sbv = new ServerBinaryValue( at, StringTools.EMPTY_BYTES );
@@ -655,7 +654,7 @@ public class ServerBinaryValueTest
     /**
      * Test serialization of a BinaryValue which is the same than the value
      */
-    @Test public void testSameNormalizedBinaryValueSerialization() throws NamingException,
IOException, ClassNotFoundException
+    @Test public void testSameNormalizedBinaryValueSerialization() throws LdapException,
IOException, ClassNotFoundException
     {
         byte[] v1 = StringTools.getBytesUtf8( "test" );
         byte[] v1Norm = StringTools.getBytesUtf8( "test" );

Modified: directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerModificationTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerModificationTest.java?rev=923708&r1=923707&r2=923708&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerModificationTest.java
(original)
+++ directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerModificationTest.java
Tue Mar 16 12:27:46 2010
@@ -34,14 +34,13 @@ import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.util.List;
 
-import javax.naming.NamingException;
-
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.entry.client.ClientAttribute;
 import org.apache.directory.shared.ldap.entry.client.ClientModification;
 import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
@@ -110,7 +109,7 @@ public class ServerModificationTest
     /**
      * Deserialize a ServerModification
      */
-    private ServerModification deserializeValue( ByteArrayOutputStream out ) throws IOException,
ClassNotFoundException, NamingException
+    private ServerModification deserializeValue( ByteArrayOutputStream out ) throws IOException,
ClassNotFoundException, LdapException
     {
         ObjectInputStream oIn = null;
         ByteArrayInputStream in = new ByteArrayInputStream( out.toByteArray() );
@@ -257,7 +256,7 @@ public class ServerModificationTest
     
     
     @Test
-    public void testSerializationModificationADD() throws ClassNotFoundException, IOException,
NamingException
+    public void testSerializationModificationADD() throws ClassNotFoundException, IOException,
LdapException
     {
         EntryAttribute attribute = new DefaultServerAttribute( atCN );
         attribute.add( "test1", "test2" );
@@ -271,7 +270,7 @@ public class ServerModificationTest
     
     
     @Test
-    public void testSerializationModificationREPLACE() throws ClassNotFoundException, IOException,
NamingException
+    public void testSerializationModificationREPLACE() throws ClassNotFoundException, IOException,
LdapException
     {
         EntryAttribute attribute = new DefaultServerAttribute( atCN );
         attribute.add( "test1", "test2" );
@@ -285,7 +284,7 @@ public class ServerModificationTest
     
     
     @Test
-    public void testSerializationModificationREMOVE() throws ClassNotFoundException, IOException,
NamingException
+    public void testSerializationModificationREMOVE() throws ClassNotFoundException, IOException,
LdapException
     {
         EntryAttribute attribute = new DefaultServerAttribute( atCN );
         attribute.add( "test1", "test2" );
@@ -299,7 +298,7 @@ public class ServerModificationTest
     
     
     @Test
-    public void testSerializationModificationNoAttribute() throws ClassNotFoundException,
IOException, NamingException
+    public void testSerializationModificationNoAttribute() throws ClassNotFoundException,
IOException, LdapException
     {
         ServerModification mod = new ServerModification();
         

Modified: directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerStringValueTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerStringValueTest.java?rev=923708&r1=923707&r2=923708&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerStringValueTest.java
(original)
+++ directory/apacheds/trunk/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerStringValueTest.java
Tue Mar 16 12:27:46 2010
@@ -38,9 +38,8 @@ import java.util.Comparator;
 import java.util.HashSet;
 import java.util.List;
 
-import javax.naming.NamingException;
-
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.LdapComparator;
 import org.apache.directory.shared.ldap.schema.SyntaxChecker;
@@ -234,7 +233,7 @@ public class ServerStringValueTest
      * Test the normalize method
      */
     @Test
-    public void testNormalize() throws NamingException
+    public void testNormalize() throws LdapException
     {
         AttributeType attribute = TestServerEntryUtils.getIA5StringAttributeType();
         ServerStringValue ssv = new ServerStringValue( attribute );
@@ -256,7 +255,7 @@ public class ServerStringValueTest
      * Test the instanceOf method
      */
     @Test
-    public void testInstanceOf() throws NamingException
+    public void testInstanceOf() throws LdapException
     {
         AttributeType attribute = TestServerEntryUtils.getIA5StringAttributeType();
         ServerStringValue ssv = new ServerStringValue( attribute );
@@ -407,7 +406,7 @@ public class ServerStringValueTest
      * Test the clone method
      */
     @Test
-    public void testClone() throws NamingException
+    public void testClone() throws LdapException
     {
         AttributeType at1 = TestServerEntryUtils.getCaseIgnoringAttributeNoNumbersType();
         ServerStringValue ssv = new ServerStringValue( at1, "Test" );
@@ -681,7 +680,7 @@ public class ServerStringValueTest
     /**
      * Test serialization of a StringValue which has a normalized value
      */
-    @Test public void testNormalizedStringValueSerialization() throws NamingException, IOException,
ClassNotFoundException
+    @Test public void testNormalizedStringValueSerialization() throws LdapException, IOException,
ClassNotFoundException
     {
         // First check with a value which will be normalized
         ServerStringValue ssv = new ServerStringValue( at, "  Test   Test  " );
@@ -701,7 +700,7 @@ public class ServerStringValueTest
     /**
      * Test serialization of a StringValue which does not have a normalized value
      */
-    @Test public void testNoNormalizedStringValueSerialization() throws NamingException,
IOException, ClassNotFoundException
+    @Test public void testNoNormalizedStringValueSerialization() throws LdapException, IOException,
ClassNotFoundException
     {
         // First check with a value which will be normalized
         ServerStringValue ssv = new ServerStringValue( at, "test" );
@@ -721,7 +720,7 @@ public class ServerStringValueTest
     /**
      * Test serialization of a null StringValue
      */
-    @Test public void testNullStringValueSerialization() throws NamingException, IOException,
ClassNotFoundException
+    @Test public void testNullStringValueSerialization() throws LdapException, IOException,
ClassNotFoundException
     {
         // First check with a value which will be normalized
         ServerStringValue ssv = new ServerStringValue( at );
@@ -741,7 +740,7 @@ public class ServerStringValueTest
     /**
      * Test serialization of an empty StringValue
      */
-    @Test public void testEmptyStringValueSerialization() throws NamingException, IOException,
ClassNotFoundException
+    @Test public void testEmptyStringValueSerialization() throws LdapException, IOException,
ClassNotFoundException
     {
         // First check with a value which will be normalized
         ServerStringValue ssv = new ServerStringValue( at, "" );
@@ -761,7 +760,7 @@ public class ServerStringValueTest
     /**
      * Test serialization of an empty StringValue
      */
-    @Test public void testStringValueEmptyNormalizedSerialization() throws NamingException,
IOException, ClassNotFoundException
+    @Test public void testStringValueEmptyNormalizedSerialization() throws LdapException,
IOException, ClassNotFoundException
     {
         // First check with a value which will be normalized
         ServerStringValue ssv = new ServerStringValue( at, "  " );



Mime
View raw message