directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1083112 - in /directory/shared/trunk: integ/src/test/java/org/apache/directory/shared/ldap/entry/ ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/ ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/
Date Sat, 19 Mar 2011 00:22:44 GMT
Author: elecharny
Date: Sat Mar 19 00:22:44 2011
New Revision: 1083112

URL: http://svn.apache.org/viewvc?rev=1083112&view=rev
Log:
o Removed the EntrySerializer and ModificationSerializer classes
o Renamed the tests

Added:
    directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntryAttributeSerializationTest.java
      - copied, changed from r1083106, directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntryAttributeSerializerTest.java
    directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntrySerializationTest.java
      - copied, changed from r1082924, directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntrySerializerTest.java
    directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareModificationSerializationTest.java
      - copied, changed from r1082924, directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareModificationTest.java
    directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareValueSerializationTest.java
      - copied, changed from r1082924, directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareValueSerializerTest.java
    directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntryAttributeSerializationTest.java
      - copied, changed from r1083106, directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntryAttributeSerializerTest.java
    directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntrySerializationTest.java
      - copied, changed from r1082924, directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntrySerializerTest.java
    directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/ValueSerializationTest.java
      - copied, changed from r1082924, directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/ValueSerializerTest.java
Removed:
    directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntryAttributeSerializerTest.java
    directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntrySerializerTest.java
    directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareModificationTest.java
    directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareValueSerializerTest.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/EntrySerializer.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/ModificationSerializer.java
    directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntryAttributeSerializerTest.java
    directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntrySerializerTest.java
    directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/ValueSerializerTest.java

Copied: directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntryAttributeSerializationTest.java
(from r1083106, directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntryAttributeSerializerTest.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntryAttributeSerializationTest.java?p2=directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntryAttributeSerializationTest.java&p1=directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntryAttributeSerializerTest.java&r1=1083106&r2=1083112&rev=1083112&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntryAttributeSerializerTest.java
(original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntryAttributeSerializationTest.java
Sat Mar 19 00:22:44 2011
@@ -46,7 +46,7 @@ import com.mycila.junit.concurrent.Concu
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class SchemaAwareEntryAttributeSerializerTest
+public class SchemaAwareEntryAttributeSerializationTest
 {
     private static byte[] data1 = new byte[] {0x01, 0x02, 0x03, 0x04};
     private static byte[] data2 = new byte[] {0x05, 0x06, 0x07, 0x08};

Copied: directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntrySerializationTest.java
(from r1082924, directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntrySerializerTest.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntrySerializationTest.java?p2=directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntrySerializationTest.java&p1=directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntrySerializerTest.java&r1=1082924&r2=1083112&rev=1083112&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntrySerializerTest.java
(original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntrySerializationTest.java
Sat Mar 19 00:22:44 2011
@@ -28,8 +28,8 @@ import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 
+import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.model.entry.Entry;
-import org.apache.directory.shared.ldap.model.entry.EntrySerializer;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.ldif.LdifUtils;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
@@ -48,7 +48,7 @@ import com.mycila.junit.concurrent.Concu
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class SchemaAwareEntrySerializerTest
+public class SchemaAwareEntrySerializationTest
 {
     private static SchemaManager schemaManager;
 
@@ -76,14 +76,15 @@ public class SchemaAwareEntrySerializerT
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream out = new ObjectOutputStream( baos );
 
-        EntrySerializer.serialize( entry1, out );
+        entry1.writeExternal( out );
         
         ObjectInputStream in = null;
 
         byte[] data = baos.toByteArray();
         in = new ObjectInputStream( new ByteArrayInputStream( data ) );
 
-        Entry entry2 = EntrySerializer.deserialize( schemaManager, in );
+        Entry entry2 = new DefaultEntry( schemaManager );
+        entry2.readExternal( in );
         
         assertEquals( entry1, entry2 );
         assertTrue( entry2.contains( "2.5.4.0", "top", "domain" ) );
@@ -104,14 +105,15 @@ public class SchemaAwareEntrySerializerT
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream out = new ObjectOutputStream( baos );
 
-        EntrySerializer.serialize( entry1, out );
+        entry1.writeExternal( out );
         
         ObjectInputStream in = null;
 
         byte[] data = baos.toByteArray();
         in = new ObjectInputStream( new ByteArrayInputStream( data ) );
 
-        Entry entry2 = EntrySerializer.deserialize( schemaManager, in );
+        Entry entry2 = new DefaultEntry( schemaManager );
+        entry2.readExternal( in );
 
         assertEquals( entry1, entry2 );
         assertTrue( entry2.contains( "ObjectClass", "top", "domain" ) );
@@ -127,14 +129,15 @@ public class SchemaAwareEntrySerializerT
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream out = new ObjectOutputStream( baos );
 
-        EntrySerializer.serialize( entry1, out );
+        entry1.writeExternal( out );
         
         ObjectInputStream in = null;
 
         byte[] data = baos.toByteArray();
         in = new ObjectInputStream( new ByteArrayInputStream( data ) );
 
-        Entry entry2 = EntrySerializer.deserialize( schemaManager, in );
+        Entry entry2 = new DefaultEntry( schemaManager );
+        entry2.readExternal( in );
 
         assertEquals( entry1, entry2 );
         assertEquals( 0, entry2.size() );
@@ -149,14 +152,15 @@ public class SchemaAwareEntrySerializerT
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream out = new ObjectOutputStream( baos );
 
-        EntrySerializer.serialize( entry1, out );
+        entry1.writeExternal( out );
         
         ObjectInputStream in = null;
 
         byte[] data = baos.toByteArray();
         in = new ObjectInputStream( new ByteArrayInputStream( data ) );
 
-        Entry entry2 = EntrySerializer.deserialize( schemaManager, in );
+        Entry entry2 = new DefaultEntry( schemaManager );
+        entry2.readExternal( in );
 
         assertEquals( entry1, entry2 );
         assertEquals( 0, entry2.size() );

Copied: directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareModificationSerializationTest.java
(from r1082924, directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareModificationTest.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareModificationSerializationTest.java?p2=directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareModificationSerializationTest.java&p1=directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareModificationTest.java&r1=1082924&r2=1083112&rev=1083112&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareModificationTest.java
(original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareModificationSerializationTest.java
Sat Mar 19 00:22:44 2011
@@ -33,7 +33,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.model.entry.Modification;
 import org.apache.directory.shared.ldap.model.entry.ModificationOperation;
-import org.apache.directory.shared.ldap.model.entry.ModificationSerializer;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schemamanager.impl.DefaultSchemaManager;
@@ -52,7 +51,7 @@ import com.mycila.junit.concurrent.Concu
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class SchemaAwareModificationTest
+public class SchemaAwareModificationSerializationTest
 {
     private static SchemaManager schemaManager;
     private static AttributeType CN_AT;
@@ -80,7 +79,7 @@ public class SchemaAwareModificationTest
         {
             oOut = new ObjectOutputStream( out );
             
-            ModificationSerializer.serialize( modification, oOut );
+            modification.writeExternal( oOut );
         }
         catch ( IOException ioe )
         {
@@ -117,7 +116,17 @@ public class SchemaAwareModificationTest
         try
         {
             oIn = new ObjectInputStream( in );
-            Modification modification = ModificationSerializer.deserialize( schemaManager,
oIn );
+            Modification modification = new DefaultModification();
+            modification.readExternal( oIn );
+
+            EntryAttribute attribute = modification.getAttribute();
+            
+            if ( ( attribute != null ) && ( schemaManager != null ) )
+            {
+                AttributeType attributeType = schemaManager.getAttributeType( attribute.getId()
);
+                
+                modification.applyAttributeType( attributeType );
+            }
 
             return modification;
         }

Copied: directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareValueSerializationTest.java
(from r1082924, directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareValueSerializerTest.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareValueSerializationTest.java?p2=directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareValueSerializationTest.java&p1=directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareValueSerializerTest.java&r1=1082924&r2=1083112&rev=1083112&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareValueSerializerTest.java
(original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareValueSerializationTest.java
Sat Mar 19 00:22:44 2011
@@ -48,7 +48,7 @@ import com.mycila.junit.concurrent.Concu
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class SchemaAwareValueSerializerTest
+public class SchemaAwareValueSerializationTest
 {
     private static byte[] data = new byte[] {0x01, 0x02, 0x03, 0x04};
     private static BinaryValue bv1;

Copied: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntryAttributeSerializationTest.java
(from r1083106, directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntryAttributeSerializerTest.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntryAttributeSerializationTest.java?p2=directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntryAttributeSerializationTest.java&p1=directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntryAttributeSerializerTest.java&r1=1083106&r2=1083112&rev=1083112&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntryAttributeSerializerTest.java
(original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntryAttributeSerializationTest.java
Sat Mar 19 00:22:44 2011
@@ -40,7 +40,7 @@ import com.mycila.junit.concurrent.Concu
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class EntryAttributeSerializerTest
+public class EntryAttributeSerializationTest
 {
     private static byte[] data1 = new byte[] {0x01, 0x02, 0x03, 0x04};
     private static byte[] data2 = new byte[] {0x05, 0x06, 0x07, 0x08};

Copied: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntrySerializationTest.java
(from r1082924, directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntrySerializerTest.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntrySerializationTest.java?p2=directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntrySerializationTest.java&p1=directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntrySerializerTest.java&r1=1082924&r2=1083112&rev=1083112&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntrySerializerTest.java
(original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/EntrySerializationTest.java
Sat Mar 19 00:22:44 2011
@@ -43,7 +43,7 @@ import com.mycila.junit.concurrent.Concu
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class EntrySerializerTest
+public class EntrySerializationTest
 {
     @Test
     public void testEntryFullSerialization() throws IOException, LdapException, ClassNotFoundException
@@ -58,14 +58,15 @@ public class EntrySerializerTest
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream out = new ObjectOutputStream( baos );
 
-        EntrySerializer.serialize( entry1, out );
+        entry1.writeExternal( out );
         
         ObjectInputStream in = null;
 
         byte[] data = baos.toByteArray();
         in = new ObjectInputStream( new ByteArrayInputStream( data ) );
 
-        Entry entry2 = EntrySerializer.deserialize( null, in );
+        Entry entry2 = new DefaultEntry();
+        entry2.readExternal( in );
 
         assertEquals( entry1, entry2 );
         assertTrue( entry2.contains( "ObjectClass", "top", "domain" ) );
@@ -85,14 +86,15 @@ public class EntrySerializerTest
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream out = new ObjectOutputStream( baos );
 
-        EntrySerializer.serialize( entry1, out );
+        entry1.writeExternal( out );
         
         ObjectInputStream in = null;
 
         byte[] data = baos.toByteArray();
         in = new ObjectInputStream( new ByteArrayInputStream( data ) );
 
-        Entry entry2 = EntrySerializer.deserialize( null, in );
+        Entry entry2 = new DefaultEntry();
+        entry2.readExternal( in );
 
         assertEquals( entry1, entry2 );
         assertTrue( entry2.contains( "ObjectClass", "top", "domain" ) );
@@ -108,14 +110,15 @@ public class EntrySerializerTest
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream out = new ObjectOutputStream( baos );
 
-        EntrySerializer.serialize( entry1, out );
+        entry1.writeExternal( out );
         
         ObjectInputStream in = null;
 
         byte[] data = baos.toByteArray();
         in = new ObjectInputStream( new ByteArrayInputStream( data ) );
 
-        Entry entry2 = EntrySerializer.deserialize( null, in );
+        Entry entry2 = new DefaultEntry();
+        entry2.readExternal( in );
 
         assertEquals( entry1, entry2 );
         assertEquals( 0, entry2.size() );
@@ -130,14 +133,15 @@ public class EntrySerializerTest
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream out = new ObjectOutputStream( baos );
 
-        EntrySerializer.serialize( entry1, out );
+        entry1.writeExternal( out );
         
         ObjectInputStream in = null;
 
         byte[] data = baos.toByteArray();
         in = new ObjectInputStream( new ByteArrayInputStream( data ) );
 
-        Entry entry2 = EntrySerializer.deserialize( null, in );
+        Entry entry2 = new DefaultEntry();
+        entry2.readExternal( in );
 
         assertEquals( entry1, entry2 );
         assertEquals( 0, entry2.size() );

Copied: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/ValueSerializationTest.java
(from r1082924, directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/ValueSerializerTest.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/ValueSerializationTest.java?p2=directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/ValueSerializationTest.java&p1=directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/ValueSerializerTest.java&r1=1082924&r2=1083112&rev=1083112&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/ValueSerializerTest.java
(original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/entry/ValueSerializationTest.java
Sat Mar 19 00:22:44 2011
@@ -43,7 +43,7 @@ import com.mycila.junit.concurrent.Concu
  */
 @RunWith(ConcurrentJunitRunner.class)
 @Concurrency()
-public class ValueSerializerTest
+public class ValueSerializationTest
 {
     private static byte[] data = new byte[] {0x01, 0x02, 0x03, 0x04};
     BinaryValue bv1 = new BinaryValue( data );



Mime
View raw message