mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

dugan
23.57.2006 1c72a61779b04f2d5e2f281085ddc36a1778e754
Remove unused method from AbandonRequestOp class.
Added toString helper in LdapTestCase class.
Changed TestBindResponseProtocolOp.java/TestUnbindRequestProtocolOp.java
to use toString helper method.
Cleaned up unneeded start server call in TestUnbindRequestProtocolOp.java.
3 files modified
40 ■■■■■ changed files
opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/LdapTestCase.java 14 ●●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestBindResponseProtocolOp.java 4 ●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestUnbindRequestProtocolOp.java 22 ●●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/LdapTestCase.java
@@ -111,7 +111,7 @@
  }
/**
 * Generate an excepting by removing an element.
   * Generate an exception by removing an element.
 * @param op The op.
 * @param type The type of sequence.
 * @throws Exception If the protocol op decode has too few elements.
@@ -124,4 +124,16 @@
      elements.remove(0);
      ProtocolOp.decode(new ASN1Sequence(type, elements));
  }
  /**
   * Test toString methods.
   * @param op The op.
   * @throws Exception If the toString method fails.
   */
  static void
  toString(ProtocolOp op) throws Exception {
      StringBuilder sb = new StringBuilder();
      op.toString(sb);
      op.toString(sb, 1);
  }
}
opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestBindResponseProtocolOp.java
@@ -80,9 +80,7 @@
            new BindResponseProtocolOp(okCode.getIntValue(),
                    message, responseDn, referralURLs, 
                    serverSASLCredentials);
        StringBuilder sb = new StringBuilder();
        r.toString(sb);
        r.toString(sb, 1);
        toString(r);
    }
    @Test (expectedExceptions = LDAPException.class)
opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestUnbindRequestProtocolOp.java
@@ -26,32 +26,16 @@
 */
package org.opends.server.protocols.ldap;
import org.opends.server.TestCaseUtils;
import org.opends.server.protocols.asn1.ASN1Element;
import org.opends.server.protocols.ldap.UnbindRequestProtocolOp;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import static org.testng.Assert.*;
public class TestUnbindRequestProtocolOp  extends LdapTestCase {
    /**
     * Once-only initialization.
     *
     * @throws Exception
     *           If an unexpected error occurred.
     */
    @BeforeClass
    public void setUp() throws Exception {
        // This test suite depends on having the schema available, so we'll
        // start the server.TestBindResponseProtocolOp
        TestCaseUtils.startServer();
    }
  @Test()
  public void testUnbindRequest() throws Exception {
  public void testUnbindEncodeDecodeRequest() throws Exception {
      UnbindRequestProtocolOp req = new UnbindRequestProtocolOp();
      ASN1Element reqElem=req.encode();
      ProtocolOp reqOp= ProtocolOp.decode(reqElem);
@@ -64,8 +48,6 @@
  {
      UnbindRequestProtocolOp r = 
          new UnbindRequestProtocolOp();
      StringBuilder sb = new StringBuilder();
      r.toString(sb);
      r.toString(sb, 1);
      toString(r);
  }
}