Package org.nasutekds.server.types

Examples of org.nasutekds.server.types.ByteStringBuilder.clear()


    ByteString bs = ByteString.wrap(b);
    ByteStringBuilder bsb = new ByteStringBuilder();

    for(byte type : testTypes)
    {
      bsb.clear();
      getWriter().writeOctetString(type, bs);

      ASN1Reader r = getReader(getEncodedBytes());
      assertEquals(r.peekLength(), b.length);
      assertEquals(r.peekType(), type);
View Full Code Here


      assertEquals(r.peekLength(), b.length);
      assertEquals(r.peekType(), type);
      r.readOctetString(bsb);
      assertTrue(bs.equals(bsb));

      bsb.clear();
      getWriter().writeOctetString(type, b, 0, b.length);

      r = getReader(getEncodedBytes());
      assertEquals(r.peekLength(), b.length);
      assertEquals(r.peekType(), type);
View Full Code Here

      else if(!escaped && dnKey[i] == 0x00)
      {
        if(buffer.length() > 0)
        {
          dn = dn.concat(RDN.decode(buffer.toString()));
          buffer.clear();
        }
      }
      else
      {
        if(escaped)
View Full Code Here

                                addDecoded.getAttributes()));

    //Test case for a full encode decode operation with large attributes.
    attributes = generateAttributes(100,50, "test");
    addEncoded = new AddRequestProtocolOp(dn, attributes);
    builder.clear();
    addEncoded.write(writer);
    reader = ASN1.getReader(builder.toByteString());
    addDecoded = (AddRequestProtocolOp)LDAPReader.readProtocolOp(reader);

    assertEquals(addEncoded.getDN(), addDecoded.getDN());
View Full Code Here

    assertTrue(attributesEquals(addEncoded.getAttributes(),
                                addDecoded.getAttributes()));

    //Test case for a full encode decode operation with no attributes.
    addEncoded = new AddRequestProtocolOp(dn, null);
    builder.clear();
    addEncoded.write(writer);
    reader = ASN1.getReader(builder.toByteString());
    addDecoded = (AddRequestProtocolOp)LDAPReader.readProtocolOp(reader);

    assertEquals(addEncoded.getDN(), addDecoded.getDN());
View Full Code Here

    assertEquals(modifyEncoded.getEntryDN(), modifyDecoded.getEntryDN());
    assertEquals(modifyEncoded.getNewRDN(), modifyDecoded.getNewRDN());
    assertEquals(modifyEncoded.getNewSuperior(), modifyDecoded.getNewSuperior());
    assertEquals(modifyEncoded.deleteOldRDN(), modifyDecoded.deleteOldRDN());

    builder.clear();
    modifyEncoded = new ModifyDNRequestProtocolOp(dn, newRdn, true);
    modifyEncoded.write(writer);

    reader = ASN1.getReader(builder.toByteString());
    modifyDecoded = (ModifyDNRequestProtocolOp)LDAPReader.readProtocolOp(reader);
View Full Code Here

    assertTrue(eclrc.getCookie().equalsTo(mdss));

    // Test encode/decode
    ByteStringBuilder bsb = new ByteStringBuilder();
    ASN1Writer writer = ASN1.getWriter(bsb);
    bsb.clear();
    eclrc.write(writer);
    LDAPControl control = LDAPReader.readControl(ASN1.getReader(bsb));
    eclrc =
      ExternalChangelogRequestControl.DECODER.decode(control.isCritical(), control.getValue());
    assertNotNull(eclrc);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.