directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: rev 22812 - incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber
Date Sat, 10 Jul 2004 22:39:41 GMT
Author: adc
Date: Sat Jul 10 15:39:40 2004
New Revision: 22812

Modified:
   incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/AbstractDecoderTestCase.java
   incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/AbstractDecoderTestCaseTest.java
   incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/BERDecoderTest.java
   incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/BERTestDecoder.java
   incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/ConstructedTLVTest.java
   incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/LengthTest.java
   incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/MultiByteLengthTest.java
   incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/MultiByteTagTest.java
   incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/SimplePrimitiveTLVTest.java
   incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/SingleByteLengthTest.java
   incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/SingleByteTagTest.java
   incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/TagTest.java
   incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/TupleTest.java
   incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/TypeClassTest.java
Log:
Snickers reorg

Modified: incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/AbstractDecoderTestCase.java
==============================================================================
--- incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/AbstractDecoderTestCase.java	(original)
+++ incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/AbstractDecoderTestCase.java	Sat Jul 10 15:39:40 2004
@@ -28,6 +28,7 @@
 import org.apache.snickers.encoding.DecoderCallback;
 import org.apache.snickers.encoding.DecoderException;
 import org.apache.snickers.encoding.DecoderMonitor;
+import org.apache.snickers.encoding.Tuple;
 
 
 /**
@@ -109,7 +110,7 @@
     /**
      * Fragments an array of bytes into multiple arrays 'attempting' to keep
      * them the same size however the last fragment will be an array
-     * bites.length%size which may or may not be of the requested fragment size.
+     * bites.lengthBuffer%size which may or may not be of the requested fragment size.
      * However it will never be greater.  Use this method to break appart TLV
      * byte arrays to feed them into the decoder for testing.
      *
@@ -162,7 +163,7 @@
     /**
      * Fragments a byte buffer into multiple buffer 'attempting' to keep
      * them the same size however the last fragment will be an array
-     * bites.length%size which may or may not be of the requested fragment size.
+     * bites.lengthBuffer%size which may or may not be of the requested fragment size.
      * However it will never be greater.  Use this method to break appart TLV
      * bytes to feed them into the decoder for testing.
      *
@@ -374,7 +375,7 @@
         assertEquals( this.decoder, decoder );
         Tuple t = (Tuple) decoded;
         assertNotNull( t );
-        if ( t.isPrimitive )
+        if ( t.isPrimitive() )
         {
             assertTrue( this.decoder.getCurrentTuple().equals( decoded ) );
         }
@@ -436,13 +437,13 @@
 
     /**
      * Method used to receive notification that a TLV tuple has begun to be
-     * read.  The following tag properties of the TLV tuple are valid at this
+     * read.  The following tagBuffer properties of the TLV tuple are valid at this
      * point:
      * <ul>
      * <li>id</li>
      * <li>isPrimitive</li>
      * <li>typeClass</li>
-     * <li>length</li>
+     * <li>lengthBuffer</li>
      * </ul>
      *
      * @param tlv the TLV tuple

Modified: incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/AbstractDecoderTestCaseTest.java
==============================================================================
--- incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/AbstractDecoderTestCaseTest.java	(original)
+++ incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/AbstractDecoderTestCaseTest.java	Sat Jul 10 15:39:40 2004
@@ -20,6 +20,7 @@
 import java.nio.ByteBuffer;
 
 import org.apache.commons.lang.ArrayUtils;
+import org.apache.snickers.encoding.Tuple;
 
 
 /**
@@ -61,8 +62,8 @@
         decode( (byte) 1 );
         setExpectedState( decoder.VALUE_STATE );
         Tuple t = decode( (byte) 1 );
-        assertEquals( 1, t.id );
-        assertEquals( 1, t.length );
+        assertEquals( 1, t.getId() );
+        assertEquals( 1, t.getLength() );
     }
 
     /*

Modified: incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/BERDecoderTest.java
==============================================================================
--- incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/BERDecoderTest.java	(original)
+++ incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/BERDecoderTest.java	Sat Jul 10 15:39:40 2004
@@ -25,6 +25,8 @@
 import org.apache.snickers.encoding.Decoder;
 import org.apache.snickers.encoding.DecoderCallback;
 import org.apache.snickers.encoding.DecoderMonitorAdapter;
+import org.apache.snickers.encoding.Tuple;
+import org.apache.snickers.encoding.TypeClass;
 
 
 /**

Modified: incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/BERTestDecoder.java
==============================================================================
--- incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/BERTestDecoder.java	(original)
+++ incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/BERTestDecoder.java	Sat Jul 10 15:39:40 2004
@@ -16,6 +16,8 @@
  */
 package org.apache.snickers.encoding.ber;
 
+import org.apache.snickers.encoding.Tuple;
+
 /**
  * @version $Revision: $ $Date: $
  */

Modified: incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/ConstructedTLVTest.java
==============================================================================
--- incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/ConstructedTLVTest.java	(original)
+++ incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/ConstructedTLVTest.java	Sat Jul 10 15:39:40 2004
@@ -16,6 +16,9 @@
  */
 package org.apache.snickers.encoding.ber;
 
+import org.apache.snickers.encoding.Tuple;
+import org.apache.snickers.encoding.TypeClass;
+
 
 /**
  * Performs constructed tlv tests.
@@ -38,30 +41,30 @@
 
     public void testConstructedDefinateTLV() throws Exception
     {
-        // decode tag
+        // decode tagBuffer
         Tuple outter = decode( "01100001" );
-        assertEquals( 1, outter.id );
+        assertEquals( 1, outter.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( false, outter.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, outter.typeClass );
+        assertEquals( false, outter.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, outter.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
 
-        // decode length
+        // decode lengthBuffer
         outter = decode( "00000011" );
         assertEquals( decoder.TAG_STATE, decoder.getState() );
 
-        // decode tag
+        // decode tagBuffer
         Tuple tlv = decode( "01000001" );
-        assertEquals( 1, tlv.id );
+        assertEquals( 1, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
 
-        // decode length
+        // decode lengthBuffer
         tlv = decode( "00000001" );
         assertEquals( decoder.VALUE_STATE, decoder.getState() );
-        assertEquals( 1, tlv.length );
+        assertEquals( 1, tlv.getLength() );
 
         // decode value
         setExpectedState( decoder.VALUE_STATE );
@@ -75,15 +78,15 @@
     {
         // --------------------------------------------------------------------
 
-        // decode tag
+        // decode tagBuffer
         Tuple outter = decode( "01100001" );
-        assertEquals( 1, outter.id );
+        assertEquals( 1, outter.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( false, outter.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, outter.typeClass );
+        assertEquals( false, outter.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, outter.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
 
-        // decode length
+        // decode lengthBuffer
         outter = decode( "10000000" );
         assertEquals( decoder.TAG_STATE, decoder.getState() );
 
@@ -91,18 +94,18 @@
         // --------------------------------------------------------------------
 
 
-        // decode tag
+        // decode tagBuffer
         Tuple tlv = decode( "01000001" );
-        assertEquals( 1, tlv.id );
+        assertEquals( 1, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
 
-        // decode length
+        // decode lengthBuffer
         tlv = decode( "00000001" );
         assertEquals( decoder.VALUE_STATE, decoder.getState() );
-        assertEquals( 1, tlv.length );
+        assertEquals( 1, tlv.getLength() );
         assertEquals( 0, tlvList.size() );
 
         // decode value
@@ -116,18 +119,18 @@
         // --------------------------------------------------------------------
 
 
-        // decode tag
+        // decode tagBuffer
         tlv = decode( "01000001" );
-        assertEquals( 1, tlv.id );
+        assertEquals( 1, tlv.getId() );
         assertEquals( 1, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
 
-        // decode length
+        // decode lengthBuffer
         tlv = decode( "00000001" );
         assertEquals( decoder.VALUE_STATE, decoder.getState() );
-        assertEquals( 1, tlv.length );
+        assertEquals( 1, tlv.getLength() );
 
         // decode value
         tlv = decode( "01010101" );
@@ -139,18 +142,18 @@
         // --------------------------------------------------------------------
 
 
-        // decode tag
+        // decode tagBuffer
         tlv = decode( "01000001" );
-        assertEquals( 1, tlv.id );
+        assertEquals( 1, tlv.getId() );
         assertEquals( 2, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
 
-        // decode length
+        // decode lengthBuffer
         tlv = decode( "00000001" );
         assertEquals( decoder.VALUE_STATE, decoder.getState() );
-        assertEquals( 1, tlv.length );
+        assertEquals( 1, tlv.getLength() );
 
         // decode value
         tlv = decode( "01010101" );

Modified: incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/LengthTest.java
==============================================================================
--- incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/LengthTest.java	(original)
+++ incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/LengthTest.java	Sat Jul 10 15:39:40 2004
@@ -21,6 +21,8 @@
 
 import junit.framework.TestCase;
 
+import org.apache.snickers.encoding.Length;
+
 
 /**
  * Tests the Length class.

Modified: incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/MultiByteLengthTest.java
==============================================================================
--- incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/MultiByteLengthTest.java	(original)
+++ incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/MultiByteLengthTest.java	Sat Jul 10 15:39:40 2004
@@ -16,9 +16,12 @@
  */
 package org.apache.snickers.encoding.ber;
 
+import org.apache.snickers.encoding.Tuple;
+import org.apache.snickers.encoding.TypeClass;
+
 
 /**
- * Tests single byte length encodings in a BER TLV.
+ * Tests single byte lengthBuffer encodings in a BER TLV.
  *
  * @author <a href="mailto:directory-dev@incubator.apache.org">
  *         Apache Directory Project</a>
@@ -40,107 +43,107 @@
     public void testLength128() throws Exception
     {
         Tuple tlv = decode( "01000001" );
-        assertEquals( 1, tlv.id );
+        assertEquals( 1, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
-        assertEquals( 0, tlv.length );
+        assertEquals( 0, tlv.getLength() );
 
         tlv = decode( "10000001" );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
-        assertEquals( 0, tlv.length );
+        assertEquals( 0, tlv.getLength() );
 
         tlv = decode( "10000000" );
         assertEquals( decoder.VALUE_STATE, decoder.getState() );
-        assertEquals( 128, tlv.length );
+        assertEquals( 128, tlv.getLength() );
     }
 
 
     public void testLength129() throws Exception
     {
         Tuple tlv = decode( "01000001" );
-        assertEquals( 1, tlv.id );
+        assertEquals( 1, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
-        assertEquals( 0, tlv.length );
+        assertEquals( 0, tlv.getLength() );
 
         tlv = decode( "10000001" );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
-        assertEquals( 0, tlv.length );
+        assertEquals( 0, tlv.getLength() );
 
         tlv = decode( "10000001" );
         assertEquals( decoder.VALUE_STATE, decoder.getState() );
-        assertEquals( 129, tlv.length );
+        assertEquals( 129, tlv.getLength() );
     }
 
 
     public void testLength255() throws Exception
     {
         Tuple tlv = decode( "01000001" );
-        assertEquals( 1, tlv.id );
+        assertEquals( 1, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
-        assertEquals( 0, tlv.length );
+        assertEquals( 0, tlv.getLength() );
 
         tlv = decode( "10000001" );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
-        assertEquals( 0, tlv.length );
+        assertEquals( 0, tlv.getLength() );
 
         tlv = decode( "11111111" );
         assertEquals( decoder.VALUE_STATE, decoder.getState() );
-        assertEquals( 255, tlv.length );
+        assertEquals( 255, tlv.getLength() );
     }
 
 
     public void testLength32768() throws Exception
     {
         Tuple tlv = decode( "01000001" );
-        assertEquals( 1, tlv.id );
+        assertEquals( 1, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
-        assertEquals( 0, tlv.length );
+        assertEquals( 0, tlv.getLength() );
 
         tlv = decode( "10000010" );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
-        assertEquals( 0, tlv.length );
+        assertEquals( 0, tlv.getLength() );
 
         tlv = decode( "00000000" );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
-        assertEquals( 0, tlv.length );
+        assertEquals( 0, tlv.getLength() );
 
         tlv = decode( "10000000" );
         assertEquals( decoder.VALUE_STATE, decoder.getState() );
-        assertEquals( 32768, tlv.length );
+        assertEquals( 32768, tlv.getLength() );
     }
 
 
     public void testLength65535() throws Exception
     {
         Tuple tlv = decode( "01000001" );
-        assertEquals( 1, tlv.id );
+        assertEquals( 1, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
-        assertEquals( 0, tlv.length );
+        assertEquals( 0, tlv.getLength() );
 
         tlv = decode( "10000010" );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
-        assertEquals( 0, tlv.length );
+        assertEquals( 0, tlv.getLength() );
 
         tlv = decode( "11111111" );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
-        assertEquals( 0, tlv.length );
+        assertEquals( 0, tlv.getLength() );
 
         tlv = decode( "11111111" );
         assertEquals( decoder.VALUE_STATE, decoder.getState() );
-        assertEquals( 65535, tlv.length );
+        assertEquals( 65535, tlv.getLength() );
     }
 }

Modified: incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/MultiByteTagTest.java
==============================================================================
--- incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/MultiByteTagTest.java	(original)
+++ incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/MultiByteTagTest.java	Sat Jul 10 15:39:40 2004
@@ -16,9 +16,12 @@
  */
 package org.apache.snickers.encoding.ber;
 
+import org.apache.snickers.encoding.Tuple;
+import org.apache.snickers.encoding.TypeClass;
+
 
 /**
- * Here we test simple 1 byte tag and length values to test the decoder's
+ * Here we test simple 1 byte tagBuffer and lengthBuffer values to test the decoder's
  * ability to handle these most simple tlvs.
  *
  * @author <a href="mailto:directory-dev@incubator.apache.org">
@@ -62,10 +65,10 @@
     {
         Tuple tlv = decode( "00011111" + "01011111" );
 
-        assertEquals( 31, tlv.id );
+        assertEquals( 31, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -74,10 +77,10 @@
     {
         Tuple tlv = decode( "01100100" + "01011111" );
 
-        assertEquals( 100, tlv.id );
+        assertEquals( 100, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -86,10 +89,10 @@
     {
         Tuple tlv = decode( "01111111" + "01011111" );
 
-        assertEquals( 127, tlv.id );
+        assertEquals( 127, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -98,10 +101,10 @@
     {
         Tuple tlv = decode( "00000000" + "10000001" + "01011111" );
 
-        assertEquals( 128, tlv.id );
+        assertEquals( 128, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -110,10 +113,10 @@
     {
         Tuple tlv = decode( "00000001" + "10000001" + "01011111" );
 
-        assertEquals( 129, tlv.id );
+        assertEquals( 129, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -122,10 +125,10 @@
     {
         Tuple tlv = decode( "00000000" + "10000000" + "10000001" + "01011111" );
 
-        assertEquals( BIT_13, tlv.id );
+        assertEquals( BIT_13, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -134,10 +137,10 @@
     {
         Tuple tlv = decode( "01111111" + "11111111" + "01011111" );
 
-        assertEquals( BIT_13 - 1, tlv.id );
+        assertEquals( BIT_13 - 1, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -146,10 +149,10 @@
     {
         Tuple tlv = decode( "00000001" + "10000000" + "10000001" + "01011111" );
 
-        assertEquals( BIT_13 + 1, tlv.id );
+        assertEquals( BIT_13 + 1, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -158,10 +161,10 @@
     {
         Tuple tlv = decode( "01111111" + "11111111" + "11111111" + "01011111" );
 
-        assertEquals( BIT_20 - 1, tlv.id );
+        assertEquals( BIT_20 - 1, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 }

Modified: incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/SimplePrimitiveTLVTest.java
==============================================================================
--- incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/SimplePrimitiveTLVTest.java	(original)
+++ incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/SimplePrimitiveTLVTest.java	Sat Jul 10 15:39:40 2004
@@ -18,6 +18,9 @@
 
 import java.nio.ByteBuffer;
 
+import org.apache.snickers.encoding.Tuple;
+import org.apache.snickers.encoding.TypeClass;
+
 
 /**
  * Performs simple primitive tlv tests.
@@ -40,18 +43,18 @@
 
     public void testSingleSimpleTLV() throws Exception
     {
-        // decode tag
+        // decode tagBuffer
         Tuple tlv = decode( "01000001" );
-        assertEquals( 1, tlv.id );
+        assertEquals( 1, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
 
-        // decode length
+        // decode lengthBuffer
         tlv = decode( "00000001" );
         assertEquals( decoder.VALUE_STATE, decoder.getState() );
-        assertEquals( 1, tlv.length );
+        assertEquals( 1, tlv.getLength() );
 
         // decode value
         this.setExpectedState( decoder.VALUE_STATE );
@@ -64,18 +67,18 @@
 
     public void testMultipleSimpleTLV() throws Exception
     {
-        // decode tag
+        // decode tagBuffer
         Tuple tlv = decode( "01000001" );
-        assertEquals( 1, tlv.id );
+        assertEquals( 1, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
 
-        // decode length
+        // decode lengthBuffer
         tlv = decode( "00000001" );
         assertEquals( decoder.VALUE_STATE, decoder.getState() );
-        assertEquals( 1, tlv.length );
+        assertEquals( 1, tlv.getLength() );
 
         // decode value
         this.setExpectedState( decoder.VALUE_STATE );
@@ -85,18 +88,18 @@
         assertEquals( 0x0055, 0x00ff & buffer.get() );
 
 
-        // decode tag
+        // decode tagBuffer
         tlv = decode( "01000001" );
-        assertEquals( 1, tlv.id );
+        assertEquals( 1, tlv.getId() );
         assertEquals( 1, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
 
-        // decode length
+        // decode lengthBuffer
         tlv = decode( "00000001" );
         assertEquals( decoder.VALUE_STATE, decoder.getState() );
-        assertEquals( 1, tlv.length );
+        assertEquals( 1, tlv.getLength() );
 
         // decode value
         this.setExpectedState( decoder.VALUE_STATE );
@@ -106,18 +109,18 @@
         assertEquals( 0x0055, 0x00ff & buffer.get() );
 
 
-        // decode tag
+        // decode tagBuffer
         tlv = decode( "01000001" );
-        assertEquals( 1, tlv.id );
+        assertEquals( 1, tlv.getId() );
         assertEquals( 2, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
 
-        // decode length
+        // decode lengthBuffer
         tlv = decode( "00000001" );
         assertEquals( decoder.VALUE_STATE, decoder.getState() );
-        assertEquals( 1, tlv.length );
+        assertEquals( 1, tlv.getLength() );
 
         // decode value
         this.setExpectedState( decoder.VALUE_STATE );
@@ -130,22 +133,22 @@
 
     public void testSingleSimpleLongTLV() throws Exception
     {
-        // decode tag
+        // decode tagBuffer
         Tuple tlv = decode( "01000001" );
-        assertEquals( 1, tlv.id );
+        assertEquals( 1, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
 
-        // decode length
+        // decode lengthBuffer
         tlv = decode( "10000001" );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
-        assertEquals( 0, tlv.length );
+        assertEquals( 0, tlv.getLength() );
 
         tlv = decode( "00000111" );
         assertEquals( decoder.VALUE_STATE, decoder.getState() );
-        assertEquals( 7, tlv.length );
+        assertEquals( 7, tlv.getLength() );
 
         // decode value
         this.setExpectedState( decoder.VALUE_STATE );

Modified: incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/SingleByteLengthTest.java
==============================================================================
--- incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/SingleByteLengthTest.java	(original)
+++ incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/SingleByteLengthTest.java	Sat Jul 10 15:39:40 2004
@@ -16,9 +16,12 @@
  */
 package org.apache.snickers.encoding.ber;
 
+import org.apache.snickers.encoding.Tuple;
+import org.apache.snickers.encoding.TypeClass;
+
 
 /**
- * Tests single byte length encodings in a BER TLV.
+ * Tests single byte lengthBuffer encodings in a BER TLV.
  *
  * @author <a href="mailto:directory-dev@incubator.apache.org">
  *         Apache Directory Project</a>
@@ -46,47 +49,47 @@
     {
         this.setExpectedState( decoder.LENGTH_STATE );
         Tuple tlv = decode( "00000000" + "01000001" );
-        assertEquals( 1, tlv.id );
+        assertEquals( 1, tlv.getId() );
         assertEquals( 1, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.TAG_STATE, decoder.getState() );
-        assertEquals( 0, tlv.length );
+        assertEquals( 0, tlv.getLength() );
     }
 
 
     public void testLength1() throws Exception
     {
         Tuple tlv = decode( "00000001" + "01000001" );
-        assertEquals( 1, tlv.id );
+        assertEquals( 1, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.VALUE_STATE, decoder.getState() );
-        assertEquals( 1, tlv.length );
+        assertEquals( 1, tlv.getLength() );
     }
 
 
     public void testLength3() throws Exception
     {
         Tuple tlv = decode( "00000011" + "01000001" );
-        assertEquals( 1, tlv.id );
+        assertEquals( 1, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.VALUE_STATE, decoder.getState() );
-        assertEquals( 3, tlv.length );
+        assertEquals( 3, tlv.getLength() );
     }
 
 
     public void testLength127() throws Exception
     {
         Tuple tlv = decode( "01111111" + "01000001" );
-        assertEquals( 1, tlv.id );
+        assertEquals( 1, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.VALUE_STATE, decoder.getState() );
-        assertEquals( 127, tlv.length );
+        assertEquals( 127, tlv.getLength() );
     }
 }

Modified: incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/SingleByteTagTest.java
==============================================================================
--- incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/SingleByteTagTest.java	(original)
+++ incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/SingleByteTagTest.java	Sat Jul 10 15:39:40 2004
@@ -16,9 +16,12 @@
  */
 package org.apache.snickers.encoding.ber;
 
+import org.apache.snickers.encoding.TypeClass;
+import org.apache.snickers.encoding.Tuple;
+
 
 /**
- * Here we test simple 1 byte tag and length values to test the decoder's
+ * Here we test simple 1 byte tagBuffer and lengthBuffer values to test the decoder's
  * ability to handle these most simple tlvs.
  *
  * @author <a href="mailto:directory-dev@incubator.apache.org">
@@ -40,10 +43,10 @@
     public void testAppTypeClass() throws Exception
     {
         Tuple tlv = decode( "01000001" );
-        assertEquals( 1, tlv.id );
+        assertEquals( 1, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -51,10 +54,10 @@
     public void testPrivTypeClass() throws Exception
     {
         Tuple tlv = decode( "11000001" );
-        assertEquals( 1, tlv.id );
+        assertEquals( 1, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.PRIVATE, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.PRIVATE, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -62,10 +65,10 @@
     public void testCtxTypeClass() throws Exception
     {
         Tuple tlv = decode( "10000001" );
-        assertEquals( 1, tlv.id );
+        assertEquals( 1, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.CONTEXT_SPECIFIC, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.CONTEXT_SPECIFIC, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -73,10 +76,10 @@
     public void testUniTypeClass() throws Exception
     {
         Tuple tlv = decode( "01000001" );
-        assertEquals( 1, tlv.id );
+        assertEquals( 1, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
 
     }
@@ -85,7 +88,7 @@
     {
         try
         {
-            Tuple tlv = decode( "00000001" );
+            decode( "00000001" );
         }
         catch ( IllegalStateException e )
         {
@@ -96,10 +99,10 @@
     public void testId1() throws Exception
     {
         Tuple tlv = decode( "01000001" );
-        assertEquals( 1, tlv.id );
+        assertEquals( 1, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -107,10 +110,10 @@
     public void testId2() throws Exception
     {
         Tuple tlv = decode( "01000010" );
-        assertEquals( 2, tlv.id );
+        assertEquals( 2, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -118,10 +121,10 @@
     public void testId3() throws Exception
     {
         Tuple tlv = decode( "01000011" );
-        assertEquals( 3, tlv.id );
+        assertEquals( 3, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -129,10 +132,10 @@
     public void testId4() throws Exception
     {
         Tuple tlv = decode( "01000100" );
-        assertEquals( 4, tlv.id );
+        assertEquals( 4, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -140,10 +143,10 @@
     public void testId5() throws Exception
     {
         Tuple tlv = decode( "01000101" );
-        assertEquals( 5, tlv.id );
+        assertEquals( 5, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -151,10 +154,10 @@
     public void testId6() throws Exception
     {
         Tuple tlv = decode( "01000110" );
-        assertEquals( 6, tlv.id );
+        assertEquals( 6, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -162,10 +165,10 @@
     public void testId7() throws Exception
     {
         Tuple tlv = decode( "01000111" );
-        assertEquals( 7, tlv.id );
+        assertEquals( 7, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -173,10 +176,10 @@
     public void testId8() throws Exception
     {
         Tuple tlv = decode( "01001000" );
-        assertEquals( 8, tlv.id );
+        assertEquals( 8, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -184,10 +187,10 @@
     public void testId9() throws Exception
     {
         Tuple tlv = decode( "01001001" );
-        assertEquals( 9, tlv.id );
+        assertEquals( 9, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -195,10 +198,10 @@
     public void testId10() throws Exception
     {
         Tuple tlv = decode( "01001010" );
-        assertEquals( 10, tlv.id );
+        assertEquals( 10, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -206,10 +209,10 @@
     public void testId11() throws Exception
     {
         Tuple tlv = decode( "01001011" );
-        assertEquals( 11, tlv.id );
+        assertEquals( 11, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -217,10 +220,10 @@
     public void testId12() throws Exception
     {
         Tuple tlv = decode( "01001100" );
-        assertEquals( 12, tlv.id );
+        assertEquals( 12, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -228,10 +231,10 @@
     public void testId13() throws Exception
     {
         Tuple tlv = decode( "01001101" );
-        assertEquals( 13, tlv.id );
+        assertEquals( 13, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -239,10 +242,10 @@
     public void testId14() throws Exception
     {
         Tuple tlv = decode( "01001110" );
-        assertEquals( 14, tlv.id );
+        assertEquals( 14, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -250,10 +253,10 @@
     public void testId15() throws Exception
     {
         Tuple tlv = decode( "01001111" );
-        assertEquals( 15, tlv.id );
+        assertEquals( 15, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -261,10 +264,10 @@
     public void testId16() throws Exception
     {
         Tuple tlv = decode( "01010000" );
-        assertEquals( 16, tlv.id );
+        assertEquals( 16, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -272,10 +275,10 @@
     public void testId17() throws Exception
     {
         Tuple tlv = decode( "01010001" );
-        assertEquals( 17, tlv.id );
+        assertEquals( 17, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -283,10 +286,10 @@
     public void testId18() throws Exception
     {
         Tuple tlv = decode( "01010010" );
-        assertEquals( 18, tlv.id );
+        assertEquals( 18, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -294,10 +297,10 @@
     public void testId19() throws Exception
     {
         Tuple tlv = decode( "01010011" );
-        assertEquals( 19, tlv.id );
+        assertEquals( 19, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -305,10 +308,10 @@
     public void testId20() throws Exception
     {
         Tuple tlv = decode( "01010100" );
-        assertEquals( 20, tlv.id );
+        assertEquals( 20, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -316,10 +319,10 @@
     public void testId21() throws Exception
     {
         Tuple tlv = decode( "01010101" );
-        assertEquals( 21, tlv.id );
+        assertEquals( 21, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -327,10 +330,10 @@
     public void testId22() throws Exception
     {
         Tuple tlv = decode( "01010110" );
-        assertEquals( 22, tlv.id );
+        assertEquals( 22, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -338,10 +341,10 @@
     public void testId23() throws Exception
     {
         Tuple tlv = decode( "01010111" );
-        assertEquals( 23, tlv.id );
+        assertEquals( 23, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -349,10 +352,10 @@
     public void testId24() throws Exception
     {
         Tuple tlv = decode( "01011000" );
-        assertEquals( 24, tlv.id );
+        assertEquals( 24, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -360,10 +363,10 @@
     public void testId25() throws Exception
     {
         Tuple tlv = decode( "01011001" );
-        assertEquals( 25, tlv.id );
+        assertEquals( 25, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -371,10 +374,10 @@
     public void testId26() throws Exception
     {
         Tuple tlv = decode( "01011010" );
-        assertEquals( 26, tlv.id );
+        assertEquals( 26, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -382,10 +385,10 @@
     public void testId27() throws Exception
     {
         Tuple tlv = decode( "01011011" );
-        assertEquals( 27, tlv.id );
+        assertEquals( 27, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -393,10 +396,10 @@
     public void testId28() throws Exception
     {
         Tuple tlv = decode( "01011100" );
-        assertEquals( 28, tlv.id );
+        assertEquals( 28, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -404,10 +407,10 @@
     public void testId29() throws Exception
     {
         Tuple tlv = decode( "01011101" );
-        assertEquals( 29, tlv.id );
+        assertEquals( 29, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -415,10 +418,10 @@
     public void testId30() throws Exception
     {
         Tuple tlv = decode( "01011110" );
-        assertEquals( 30, tlv.id );
+        assertEquals( 30, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( true, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( true, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 
@@ -431,7 +434,7 @@
         assertEquals( null, tlv );
         assertEquals( 0, tlvList.size() );
 
-        // state did not switch since we are still reading the long tag
+        // state did not switch since we are still reading the long tagBuffer
         assertEquals( decoder.TAG_STATE, decoder.getState() );
     }
 
@@ -439,10 +442,10 @@
     public void testIsConstructed() throws Exception
     {
         Tuple tlv = decode( "01111110" );
-        assertEquals( 30, tlv.id );
+        assertEquals( 30, tlv.getId() );
         assertEquals( 0, tlvList.size() );
-        assertEquals( false, tlv.isPrimitive );
-        assertEquals( TypeClass.APPLICATION, tlv.typeClass );
+        assertEquals( false, tlv.isPrimitive() );
+        assertEquals( TypeClass.APPLICATION, tlv.getTypeClass() );
         assertEquals( decoder.LENGTH_STATE, decoder.getState() );
     }
 }

Modified: incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/TagTest.java
==============================================================================
--- incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/TagTest.java	(original)
+++ incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/TagTest.java	Sat Jul 10 15:39:40 2004
@@ -22,6 +22,8 @@
 import junit.framework.TestCase;
 
 import org.apache.commons.lang.ArrayUtils;
+import org.apache.snickers.encoding.Tag;
+import org.apache.snickers.encoding.TypeClass;
 
 
 /**

Modified: incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/TupleTest.java
==============================================================================
--- incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/TupleTest.java	(original)
+++ incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/TupleTest.java	Sat Jul 10 15:39:40 2004
@@ -22,6 +22,9 @@
 import java.util.Collections;
 
 import org.apache.commons.codec.binary.Binary;
+import org.apache.snickers.encoding.Tuple;
+import org.apache.snickers.encoding.TypeClass;
+import org.apache.snickers.encoding.Length;
 
 
 /**
@@ -99,9 +102,9 @@
     public void testTupleint()
     {
         Tuple t0 = new Tuple( 0, 0 );
-        assertEquals( 0, t0.id );
+        assertEquals( 0, t0.getId() );
         Tuple t1 = new Tuple( 1, 0 );
-        assertEquals( 1, t1.id );
+        assertEquals( 1, t1.getId() );
         assertFalse( t0.equals( t1 ) );
     }
 
@@ -111,11 +114,11 @@
     public void testTupleintint()
     {
         Tuple t0 = new Tuple( 0, 0 );
-        assertEquals( 0, t0.id );
-        assertEquals( 0, t0.length );
+        assertEquals( 0, t0.getId() );
+        assertEquals( 0, t0.getLength() );
         Tuple t1 = new Tuple( 0, 1 );
-        assertEquals( 0, t1.id );
-        assertEquals( 1, t1.length );
+        assertEquals( 0, t1.getId() );
+        assertEquals( 1, t1.getLength() );
         assertFalse( t0.equals( t1 ) );
     }
 
@@ -125,12 +128,12 @@
     public void testTupleintintTypeClass()
     {
         Tuple t0 = new Tuple( 0, 0, TypeClass.PRIVATE );
-        assertEquals( 0, t0.id );
-        assertEquals( 0, t0.length );
+        assertEquals( 0, t0.getId() );
+        assertEquals( 0, t0.getLength() );
         assertEquals( TypeClass.PRIVATE, t0.getTypeClass() );
         Tuple t1 = new Tuple( 0, 1, null );
-        assertEquals( 0, t1.id );
-        assertEquals( 1, t1.length );
+        assertEquals( 0, t1.getId() );
+        assertEquals( 1, t1.getLength() );
         assertFalse( t0.equals( t1 ) );
         assertEquals( TypeClass.APPLICATION, t1.getTypeClass() );
     }
@@ -159,7 +162,7 @@
         assertEquals( 0, t.getId() );
         t = new Tuple( 2, 0 );
         assertEquals( 2, t.getId() );
-        t.id = 21;
+        t.setId( 21 );
         assertEquals( 21, t.getId() );
     }
 
@@ -168,24 +171,24 @@
     {
         Tuple t = new Tuple( 1, TypeClass.APPLICATION );
         assertEquals( 2, t.size() );
-        t.id = 32;
+        t.setId( 32 );
         assertEquals( 3, t.size() );
-        t.id = 127;
+        t.setId( 127 );
         assertEquals( 4, t.size() );
-        t.id = 128;
+        t.setId( 128 );
         assertEquals( 4, t.size() );
-        t.id = 1 << 14;
+        t.setId( 1 << 14 );
         assertEquals( 5, t.size() );
-        t.id = 1 << 21;
+        t.setId( 1 << 21 );
         assertEquals( 6, t.size() );
 
-        t.length = 127;
+        t.setLength( 127 );
         assertEquals( 6 + 127, t.size() );
-        t.length = 128;
+        t.setLength( 128 );
         assertEquals( 7 + 128, t.size() );
-        t.length = 255;
+        t.setLength( 255 );
         assertEquals( 7 + 255, t.size() );
-        t.length = 256;
+        t.setLength( 256 );
         assertEquals( 8 + 256, t.size() );
     }
 
@@ -194,7 +197,7 @@
     {
         Tuple t = new Tuple();
         assertFalse( t.isIndefinite() );
-        t.length = Length.INDEFINITE;
+        t.setLength( Length.INDEFINITE );
         assertTrue( t.isIndefinite() );
     }
 
@@ -203,10 +206,10 @@
     {
         Tuple t = new Tuple();
         assertFalse( t.isIndefiniteTerminator() );
-        t.id = 0;
-        t.length = 0;
-        t.isPrimitive = true;
-        t.typeClass = TypeClass.UNIVERSAL;
+        t.setId( 0 );
+        t.setLength( 0 );
+        t.setPrimitive( true );
+        t.setTypeClass( TypeClass.UNIVERSAL );
         assertTrue( t.isIndefiniteTerminator() );
     }
 
@@ -215,7 +218,7 @@
     {
         Tuple t = new Tuple();
         assertTrue( t.isPrimitive() );
-        t.isPrimitive = false;
+        t.setPrimitive( false );
         assertFalse( t.isPrimitive() );
     }
 
@@ -225,47 +228,47 @@
         assertEquals( 0, t.getLength() );
         t = new Tuple( 1, 2 );
         assertEquals( 2, t.getLength() );
-        t.length = 21;
+        t.setLength( 21 );
         assertEquals( 21, t.getLength() );
     }
 
     public void testGetTypeClass()
     {
         Tuple t = new Tuple();
-        assertEquals( t.typeClass, TypeClass.APPLICATION );
+        assertEquals( t.getTypeClass(), TypeClass.APPLICATION );
         t = new Tuple( 0, 0 );
         assertEquals( TypeClass.APPLICATION, t.getTypeClass() );
-        t.typeClass = TypeClass.PRIVATE;
+        t.setTypeClass( TypeClass.PRIVATE);
         assertEquals( TypeClass.PRIVATE, t.getTypeClass() );
     }
 
     public void testClear()
     {
         Tuple t = new Tuple();
-        t.id = 12;
-        assertEquals( 12, t.id );
+        t.setId( 12 );
+        assertEquals( 12, t.getId() );
         t.clear();
-        assertEquals( 0, t.id );
+        assertEquals( 0, t.getId() );
 
-        t.length = 12;
-        assertEquals( 12, t.length );
+        t.setLength( 12 );
+        assertEquals( 12, t.getLength() );
         t.clear();
-        assertEquals( Length.UNDEFINED, t.length );
+        assertEquals( Length.UNDEFINED, t.getLength() );
 
-        t.index = 12;
-        assertEquals( 12, t.index );
+        t.setIndex( 12 );
+        assertEquals( 12, t.getIndex() );
         t.clear();
-        assertEquals( 0, t.index );
+        assertEquals( 0, t.getIndex() );
 
-        t.isPrimitive = false;
-        assertEquals( false, t.isPrimitive );
+        t.setPrimitive( false );
+        assertEquals( false, t.isPrimitive() );
         t.clear();
-        assertEquals( true, t.isPrimitive );
+        assertEquals( true, t.isPrimitive() );
 
-        t.typeClass = TypeClass.CONTEXT_SPECIFIC;
-        assertEquals( TypeClass.CONTEXT_SPECIFIC, t.typeClass );
+        t.setTypeClass( TypeClass.CONTEXT_SPECIFIC );
+        assertEquals( TypeClass.CONTEXT_SPECIFIC, t.getTypeClass() );
         t.clear();
-        assertEquals( TypeClass.APPLICATION, t.typeClass );
+        assertEquals( TypeClass.APPLICATION, t.getTypeClass() );
 
     }
 
@@ -513,7 +516,7 @@
 
         bites = ByteBuffer.allocate( 1 );
         t = new Tuple( 30, 0 );
-        t.isPrimitive = true;
+        t.setPrimitive( true );
         t.setTag( bites, 1 );
         binary = toAsciiString( bites );
         assertEquals( "01011110", binary );
@@ -631,7 +634,7 @@
 
         bites = ByteBuffer.allocate( 1 );
         t = new Tuple( 30, 0 );
-        t.isPrimitive = true;
+        t.setPrimitive( true );
         t.setTag( bites, 1 );
         binary = toAsciiString( bites );
         assertEquals( "01011110", binary );
@@ -988,37 +991,37 @@
     {
         Tuple t = new Tuple();
         assertEquals( 1, t.getTagLength() );
-        t.id = 30;
+        t.setId( 30 );
         assertEquals( 1, t.getTagLength() );
-        t.id = 31;
+        t.setId( 31 );
         assertEquals( 2, t.getTagLength() );
-        t.id = 100;
+        t.setId( 100 );
         assertEquals( 3, t.getTagLength() );
-        t.id = 127;
+        t.setId( 127 );
         assertEquals( 3, t.getTagLength() );
-        t.id = 128;
+        t.setId( 128 );
         assertEquals( 3, t.getTagLength() );
-        t.id = 129;
+        t.setId( 129 );
         assertEquals( 3, t.getTagLength() );
 
-        t.id = BIT_13 - 1;
+        t.setId( BIT_13 - 1 );
         assertEquals( 3, t.getTagLength() );
-        t.id = BIT_13;
+        t.setId( BIT_13 );
         assertEquals( 4, t.getTagLength() );
-        t.id = BIT_13 + 100;
+        t.setId( BIT_13 + 100 );
         assertEquals( 4, t.getTagLength() );
 
-        t.id = BIT_20 - 1;
+        t.setId( BIT_20 - 1 );
         assertEquals( 4, t.getTagLength() );
-        t.id = BIT_20;
+        t.setId( BIT_20 );
         assertEquals( 5, t.getTagLength() );
-        t.id = BIT_20 + 100;
+        t.setId( BIT_20 + 100 );
         assertEquals( 5, t.getTagLength() );
 
-        t.id = BIT_27 - 1;
+        t.setId( BIT_27 - 1 );
         assertEquals( 5, t.getTagLength() );
 
-        t.id = BIT_27;
+        t.setId( BIT_27 );
 
         try
         {
@@ -1035,34 +1038,34 @@
     {
         Tuple t = new Tuple();
         assertEquals( 1, t.getLengthLength() );
-        t.length = 127;
+        t.setLength( 127 );
         assertEquals( 1, t.getLengthLength() );
-        t.length = 128;
+        t.setLength( 128 );
         assertEquals( 2, t.getLengthLength() );
-        t.length = 255;
+        t.setLength( 255 );
         assertEquals( 2, t.getLengthLength() );
-        t.length = 256;
+        t.setLength( 256 );
         assertEquals( 3, t.getLengthLength() );
 
-        t.length = BIT_15 - 1;
+        t.setLength( BIT_15 - 1 );
         assertEquals( 3, t.getLengthLength() );
-        t.length = BIT_15;
+        t.setLength( BIT_15 );
         assertEquals( 4, t.getLengthLength() );
-        t.length = BIT_15 + 100;
+        t.setLength( BIT_15 + 100 );
         assertEquals( 4, t.getLengthLength() );
 
-        t.length = BIT_23 - 1;
+        t.setLength( BIT_23 - 1 );
         assertEquals( 4, t.getLengthLength() );
-        t.length = BIT_23;
+        t.setLength( BIT_23 );
         assertEquals( 5, t.getLengthLength() );
-        t.length = BIT_23 + 100;
+        t.setLength( BIT_23 + 100 );
         assertEquals( 5, t.getLengthLength() );
 
-        t.length = Integer.MAX_VALUE;
+        t.setLength( Integer.MAX_VALUE );
         assertEquals( 5, t.getLengthLength() );
 
 
-        t.length = Integer.MAX_VALUE + 1;
+        t.setLength( Integer.MAX_VALUE + 1 );
         try
         {
             assertEquals( 6, t.getLengthLength() );

Modified: incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/TypeClassTest.java
==============================================================================
--- incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/TypeClassTest.java	(original)
+++ incubator/directory/snickers/branches/ber-decoder/modules/runtime/src/test/org/apache/snickers/encoding/ber/TypeClassTest.java	Sat Jul 10 15:39:40 2004
@@ -22,6 +22,8 @@
 
 import junit.framework.TestCase;
 
+import org.apache.snickers.encoding.TypeClass;
+
 
 /**
  * Tests TypeClass class.

Mime
View raw message