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

boli
20.06.2010 27442dd0dcfec710f241d6d53574a6fdafb6f92a
sdk/tests/unit-tests-testng/src/org/opends/sdk/requests/GSSAPISASLBindRequestTestCase.java
@@ -31,13 +31,17 @@
import org.opends.sdk.ByteString;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import java.util.Arrays;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
/**
 * Tests GSSAPI SASL Bind requests.
 */
public abstract class GSSAPISASLBindRequestTestCase extends BindRequestTestCase
public class GSSAPISASLBindRequestTestCase extends BindRequestTestCase
{
  @DataProvider(name = "GSSAPISASLBindRequests")
  public Object[][] getGSSAPISASLBindRequests() throws Exception
@@ -67,4 +71,43 @@
    }
    return ops;
  }
  @Test(enabled = false)
  public void testBindClient(BindRequest request) throws Exception {
    // Should setup a test krb server...
    super.testBindClient(request);
  }
  @Test(dataProvider = "GSSAPISASLBindRequests")
  public void testQOP(GSSAPISASLBindRequest request) throws Exception
  {
    GSSAPISASLBindRequest.QOPOption [] options =
        new GSSAPISASLBindRequest.QOPOption[]{
            GSSAPISASLBindRequest.QOPOption.AUTH,
            GSSAPISASLBindRequest.QOPOption.AUTH_INT,
            GSSAPISASLBindRequest.QOPOption.AUTH_CONF};
    request.setQOP(options);
    assertTrue(Arrays.deepEquals(options, request.getQOP()));
  }
  @Test(dataProvider = "GSSAPISASLBindRequests")
  public void testServerAuth(GSSAPISASLBindRequest request) throws Exception
  {
    request.setServerAuth(true);
    assertEquals(request.getServerAuth(), true);
  }
  @Test(dataProvider = "GSSAPISASLBindRequests")
  public void testSendBuffer(GSSAPISASLBindRequest request) throws Exception
  {
    request.setMaxSendBufferSize(512);
    assertEquals(request.getMaxSendBufferSize(), 512);
  }
  @Test(dataProvider = "GSSAPISASLBindRequests")
  public void testRecieveBuffer(GSSAPISASLBindRequest request) throws Exception
  {
    request.setMaxReceiveBufferSize(512);
    assertEquals(request.getMaxReceiveBufferSize(), 512);
  }
}