Package javax.naming.ldap

Examples of javax.naming.ldap.PagedResultsResponseControl


   */
  public void testPagedResultsResponseControl008() {

    try {
      byte[] b={48,5,2,1,0,4,0};
      PagedResultsResponseControl x=new PagedResultsResponseControl(null,false,b);
     
    } catch (IOException e) {
      fail("The arguments are ok.");
    }
  }
View Full Code Here


   */
  public void testPagedResultsResponseControl010() {

    try {
      byte[] b={48,5,2,1,0,4,0};
      PagedResultsResponseControl x=new PagedResultsResponseControl("",false,b);
     
    } catch (IOException e) {
      fail("The arguments are ok.");
    }
  }
View Full Code Here

  public void testPagedResultsResponseControl011() {

    try {
      byte[] b={48,5,2,1,0,4,0};
      byte[] c={48,5,2,1,0,4,0};
      PagedResultsResponseControl x=new PagedResultsResponseControl("",false,b);
      byte[] aux = x.getEncodedValue().clone();
      for (int i = 0; i < b.length; i++) {
        b[i]=1;
      }
      for (int i = 0; i < b.length; i++) {
        assertSame(c[i],aux[i]);
        assertSame(b[i],x.getEncodedValue()[i]);
      }
    } catch (IOException e) {
      fail("The arguments are ok.");
    }
  }
View Full Code Here

   */
  public void testGetResultSize001() {

    byte[] b={48,5,2,1,0,4,0};
    try {
      PagedResultsResponseControl x=new PagedResultsResponseControl("",false,b);
      assertEquals(0,x.getResultSize());
    } catch (IOException e) {
      fail("Failed with:"+e);
    }
  }
View Full Code Here

   */
  public void testGetResultSize002() {

    byte[] b={48,5,2,1,10,4,0};
    try {
      PagedResultsResponseControl x=new PagedResultsResponseControl("",false,b);
      assertEquals(10,x.getResultSize());
    } catch (IOException e) {
      fail("Failed with:"+e);
    }
  }
View Full Code Here

   */
  public void testGetCookie001() {

    byte[] b={48,5,2,1,0,4,0};
    try {
      PagedResultsResponseControl x=new PagedResultsResponseControl("",false,b);
      assertEquals(null,x.getCookie());
    } catch (IOException e) {
      fail("Failed with:"+e);
    }
  }
View Full Code Here

  public void testGetCookie002() {

    byte[] b={48,7,2,1,0,4,2,1,1};
    byte[] c={1,1};
    try {
      PagedResultsResponseControl x=new PagedResultsResponseControl("",false,b);
      for (int i = 0; i < x.getCookie().length; i++) {
        assertEquals(c[i],x.getCookie()[i]);
     
    } catch (IOException e) {
      fail("Failed with:"+e);
    }
  }
View Full Code Here

   */
  public void testGetCookie003() {

    byte[] b={48,6,2,1,0,4,1,0};
    try {
      PagedResultsResponseControl x=new PagedResultsResponseControl("",false,b);
      assertNotNull(x.getCookie());
    } catch (IOException e) {
      fail("Failed with:"+e);
    }
  }
View Full Code Here

    }
  }

    public void testSerializationCompatibility() throws Exception{
        byte[] b={48,5,2,1,0,4,0};
        PagedResultsResponseControl object=new PagedResultsResponseControl("test", true, b);
        SerializationTest.verifyGolden(this, object, PAGEDRESULTSRESPONSECONTROL_COMPARATOR);
    }
View Full Code Here

            }
   
            // Now read the next ones
            javax.naming.ldap.Control[] responseControls = ( ( LdapContext ) ctx ).getResponseControls();
   
            PagedResultsResponseControl responseControl =
                ( PagedResultsResponseControl ) responseControls[0];
            assertEquals( 0, responseControl.getResultSize() );
   
            // check if this is over
            byte[] cookie = responseControl.getCookie();
   
            if ( Strings.isEmpty( cookie ) )
            {
                // If so, exit the loop
                break;
            }
   
            // Prepare the next iteration
            createNextSearchControls( ctx, responseControl.getCookie(), pagedSizeLimit );
        }
   
        assertEquals( expectedException, hasSizeLimitException );
        assertEquals( expectedLoop, loop );
        checkResults( results, expectedNbEntries );
View Full Code Here

TOP

Related Classes of javax.naming.ldap.PagedResultsResponseControl

Copyright © 2018 www.massapicom. 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.