directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: rev 9753 - incubator/directory/snickers/branches/chunking/ber/src/test/org/apache/snickers/ber
Date Fri, 26 Mar 2004 04:06:43 GMT
Author: akarasulu
Date: Thu Mar 25 20:06:43 2004
New Revision: 9753

Modified:
   incubator/directory/snickers/branches/chunking/ber/src/test/org/apache/snickers/ber/SimplePrimitiveTLVTests.java
Log:
changes for chunching

Modified: incubator/directory/snickers/branches/chunking/ber/src/test/org/apache/snickers/ber/SimplePrimitiveTLVTests.java
==============================================================================
--- incubator/directory/snickers/branches/chunking/ber/src/test/org/apache/snickers/ber/SimplePrimitiveTLVTests.java
(original)
+++ incubator/directory/snickers/branches/chunking/ber/src/test/org/apache/snickers/ber/SimplePrimitiveTLVTests.java
Thu Mar 25 20:06:43 2004
@@ -16,6 +16,8 @@
  */
 package org.apache.snickers.ber ;
 
+import java.nio.ByteBuffer;
+
 
 /**
  * Performs simple primitive tlv tests.
@@ -56,7 +58,7 @@
         assertEquals( BERDecoderState.TAG, decoder.getState() ) ;
         assertEquals( 1, tlvList.size() ) ;
         assertNotNull( tlv.value ) ;
-        assertEquals( 0x0055, 0x00ff & ( int ) ( (byte[]) tlv.value)[0] ) ;
+        assertEquals( 0x0055, 0x00ff & tlv.value.get( 0 ) ) ;
     }
 
 
@@ -80,7 +82,7 @@
         assertEquals( BERDecoderState.TAG, decoder.getState() ) ;
         assertEquals( 1, tlvList.size() ) ;
         assertNotNull( tlv.value ) ;
-        assertEquals( 0x0055, 0x00ff & ( int ) ( (byte[]) tlv.value)[0] ) ;
+        assertEquals( 0x0055, 0x00ff & tlv.value.get( 0 ) ) ;
 
     
         // decode tag
@@ -101,7 +103,7 @@
         assertEquals( BERDecoderState.TAG, decoder.getState() ) ;
         assertEquals( 2, tlvList.size() ) ;
         assertNotNull( tlv.value ) ;
-        assertEquals( 0x0055, 0x00ff & ( int ) ( (byte[]) tlv.value)[0] ) ;
+        assertEquals( 0x0055, 0x00ff & tlv.value.get( 0 ) ) ;
 
     
         // decode tag
@@ -122,7 +124,7 @@
         assertEquals( BERDecoderState.TAG, decoder.getState() ) ;
         assertEquals( 3, tlvList.size() ) ;
         assertNotNull( tlv.value ) ;
-        assertEquals( 0x0055, 0x00ff & ( int ) ( (byte[]) tlv.value)[0] ) ;
+        assertEquals( 0x0055, 0x00ff & tlv.value.get( 0 ) ) ;
     }
 
 
@@ -151,12 +153,12 @@
         assertEquals( BERDecoderState.TAG, decoder.getState() ) ;
         assertEquals( 1, tlvList.size() ) ;
         assertNotNull( tlv.value ) ;
-        assertEquals( 7, ((byte[]) tlv.value).length) ;
+        assertEquals( 7, tlv.value.capacity() ) ;
         
-        byte[] value = (byte[]) tlv.value ;
+        ByteBuffer value = tlv.value.duplicate() ;
         for ( int ii = 0 ; ii < 7; ii++ )
         {    
-            assertEquals( 0x0055, 0x00ff & ( int ) value[ii] ) ;
+            assertEquals( 0x0055, 0x00ff & value.get( ii ) ) ;
         }
     }
 }

Mime
View raw message