directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: rev 56422 - in incubator/directory/snickers/trunk/ber-codec/src: java/org/apache/snickers/ber test/org/apache/snickers/ber
Date Tue, 02 Nov 2004 21:35:00 GMT
Author: akarasulu
Date: Tue Nov  2 13:34:59 2004
New Revision: 56422

Modified:
   incubator/directory/snickers/trunk/ber-codec/src/java/org/apache/snickers/ber/AbstractDecoderTestCase.java
   incubator/directory/snickers/trunk/ber-codec/src/test/org/apache/snickers/ber/EncodeDecodeTests.java
   incubator/directory/snickers/trunk/ber-codec/src/test/org/apache/snickers/ber/TupleTreeDecoderTest.java
Log:
adjust test code for changes made to encoders

Modified: incubator/directory/snickers/trunk/ber-codec/src/java/org/apache/snickers/ber/AbstractDecoderTestCase.java
==============================================================================
--- incubator/directory/snickers/trunk/ber-codec/src/java/org/apache/snickers/ber/AbstractDecoderTestCase.java
(original)
+++ incubator/directory/snickers/trunk/ber-codec/src/java/org/apache/snickers/ber/AbstractDecoderTestCase.java
Tue Nov  2 13:34:59 2004
@@ -373,7 +373,7 @@
         env.setProperty( Provider.BERLIB_PROVIDER,
                 "org.apache.ldap.common.berlib.snacc.SnaccProvider" );
         MessageEncoder encoder = new MessageEncoder( env );
-        decode( encoder.encode( msg ) ) ;
+        decode( encoder.encodeBlocking( msg ) ) ;
         
         return ( Tuple ) tlvList.get( tlvList.size() - 1 ) ;
     }
@@ -394,7 +394,7 @@
         env.setProperty( Provider.BERLIB_PROVIDER,
                 "org.apache.ldap.common.berlib.snacc.SnaccProvider" );
         MessageEncoder encoder = new MessageEncoder( env );
-        return ByteBuffer.wrap( encoder.encode( msg ) ) ;
+        return encoder.encodeBlocking( msg ) ;
     }
 
     

Modified: incubator/directory/snickers/trunk/ber-codec/src/test/org/apache/snickers/ber/EncodeDecodeTests.java
==============================================================================
--- incubator/directory/snickers/trunk/ber-codec/src/test/org/apache/snickers/ber/EncodeDecodeTests.java
(original)
+++ incubator/directory/snickers/trunk/ber-codec/src/test/org/apache/snickers/ber/EncodeDecodeTests.java
Tue Nov  2 13:34:59 2004
@@ -47,11 +47,12 @@
         // @todo replace this with the Snickers encoder or use serialized
         // PDUs stubs for test cases rather than decoding live.
         Properties env = new Properties();
-        env.setProperty( Provider.BERLIB_PROVIDER,
-                "org.apache.ldap.common.berlib.snacc.SnaccProvider" );
+        env.setProperty( Provider.BERLIB_PROVIDER, "org.apache.ldap.common.berlib.snacc.SnaccProvider"
);
         MessageEncoder encoder = new MessageEncoder( env );
-        byte[] snaccBytes = encoder.encode( request ) ;
-        
+        buf = encoder.encodeBlocking( request );
+        byte[] snaccBytes = new byte[buf.remaining()];
+        buf.get( snaccBytes );
+
         String snaccEncoded = new String( Hex.encodeHex( snaccBytes ) ) ;
         System.out.println( "snacc encoded = [" + snaccEncoded + "][" 
                 + snaccBytes.length + "]" ) ;
@@ -99,8 +100,9 @@
         env.setProperty( Provider.BERLIB_PROVIDER,
                 "org.apache.ldap.common.berlib.snacc.SnaccProvider" );
         MessageEncoder encoder = new MessageEncoder( env );
-
-        byte[] snaccBytes = encoder.encode( request ) ;
+        buf = encoder.encodeBlocking( request );
+        byte[] snaccBytes = new byte[buf.remaining()];
+        buf.get( snaccBytes );
 
         String snaccEncoded = new String( Hex.encodeHex( snaccBytes ) ) ;
         System.out.println( "snacc encoded = [" + snaccEncoded + "]["

Modified: incubator/directory/snickers/trunk/ber-codec/src/test/org/apache/snickers/ber/TupleTreeDecoderTest.java
==============================================================================
--- incubator/directory/snickers/trunk/ber-codec/src/test/org/apache/snickers/ber/TupleTreeDecoderTest.java
(original)
+++ incubator/directory/snickers/trunk/ber-codec/src/test/org/apache/snickers/ber/TupleTreeDecoderTest.java
Tue Nov  2 13:34:59 2004
@@ -104,7 +104,7 @@
         MessageEncoder encoder = new MessageEncoder( env );
 
         // Send encoded request to server
-        encoder.encode( null, out, request );
+        encoder.encodeBlocking( null, out, request );
 
         StopWatch watch = new StopWatch() ;
         watch.start() ;

Mime
View raw message