Package org.apache.directory.shared.ldap.model.cursor

Examples of org.apache.directory.shared.ldap.model.cursor.EntryCursor


   
   
    @Test
    public void testSearchUTF8() throws Exception
    {
        EntryCursor cursor = connection.search( "ou=users,ou=system", "(sn=Emmanuel L\u00E9charny)", SearchScope.ONELEVEL, "*", "+" );

        assertTrue(cursor.next() );
       
        Entry entry = cursor.get();
        assertNotNull( entry );
        assertTrue( entry.contains( "cn", "elecharny" ) );
        assertTrue( entry.contains( "sn", "Emmanuel L\u00E9charny" ) );
       
        cursor.close();
    }
View Full Code Here


   
    @Test
    public void testSearchBinary() throws Exception
    {
        connection.loadSchema();
        EntryCursor cursor = connection.search( "ou=system", "(publicKey=\\30\\5C\\30\\0D\\06\\09\\2A\\86\\48\\86\\F7\\0D\\01\\01\\01\\05\\00\\03\\4B\\00\\30\\48\\02\\41\\00\\A6\\C7\\9C\\B1\\6C\\E4\\DD\\8F\\1E\\4D\\20\\93\\22\\3F\\83\\75\\DE\\21\\D8\\F1\\9D\\63\\80\\5B\\94\\55\\6A\\9E\\33\\59\\9B\\8D\\63\\88\\0D\\18\\7D\\4C\\85\\F1\\CF\\54\\77\\32\\E9\\61\\0C\\A2\\8F\\B3\\6B\\15\\34\\5E\\1F\\88\\BF\\A0\\73\\AC\\86\\BB\\D0\\85\\02\\03\\01\\00\\01)", SearchScope.SUBTREE, "publicKey" );
       
        assertTrue( cursor.next() );
       
        Entry entry = cursor.get();
        assertNotNull( entry.get( "publicKey" ) );
       
        cursor.close();
    }
View Full Code Here

     * @throws Exception
     */
    @Test
    public void testSearchAll() throws Exception
    {
        EntryCursor cursor = connection.search( "cn=user1,ou=users,ou=system", "(objectclass=*)",
            SearchScope.OBJECT, "*", "+" );
        int count = 0;
        Entry entry = null;

        while ( cursor.next() )
        {
            entry = cursor.get();
            assertNotNull( entry );
            count++;
        }
        cursor.close();

        assertEquals( 1, count );
        assertNotNull( entry );

        assertEquals( 8, entry.size() );
View Full Code Here

     * @throws Exception
     */
    @Test
    public void testSearchAllUsers() throws Exception
    {
        EntryCursor cursor = connection.search( "cn=user1,ou=users,ou=system", "(objectclass=*)",
            SearchScope.OBJECT, "*" );
        int count = 0;
        Entry entry = null;

        while ( cursor.next() )
        {
            entry = cursor.get();
            assertNotNull( entry );
            count++;
        }
        cursor.close();

        assertEquals( 1, count );
        assertNotNull( entry );

        assertEquals( 3, entry.size() );
View Full Code Here

     * @throws Exception
     */
    @Test
    public void testSearchAllOperationals() throws Exception
    {
        EntryCursor cursor = connection.search( "cn=user1,ou=users,ou=system", "(objectclass=*)",
            SearchScope.OBJECT, "+" );
        int count = 0;
        Entry entry = null;

        while ( cursor.next() )
        {
            entry = cursor.get();
            assertNotNull( entry );
            count++;
        }
        cursor.close();

        assertEquals( 1, count );
        assertNotNull( entry );

        assertEquals( 5, entry.size() );
View Full Code Here

     * @throws Exception
     */
    @Test
    public void testSearchAllUsersAndSomeOperationals() throws Exception
    {
        EntryCursor cursor = connection.search( "cn=user1,ou=users,ou=system", "(objectclass=*)",
            SearchScope.OBJECT, "*", "entryCSN", "entryUUID" );
        int count = 0;
        Entry entry = null;

        while ( cursor.next() )
        {
            entry = cursor.get();
            assertNotNull( entry );
            count++;
        }
        cursor.close();

        assertEquals( 1, count );
        assertNotNull( entry );

        assertEquals( 5, entry.size() );
View Full Code Here

     * @throws Exception
     */
    @Test
    public void testSearchAllOperationalAndSomeUsers() throws Exception
    {
        EntryCursor cursor = connection.search( "cn=user1,ou=users,ou=system", "(objectclass=*)",
            SearchScope.OBJECT, "+", "cn", "sn" );
        int count = 0;
        Entry entry = null;

        while ( cursor.next() )
        {
            entry = cursor.get();
            assertNotNull( entry );
            count++;
        }

        cursor.close();

        assertEquals( 1, count );
        assertNotNull( entry );

        assertEquals( 7, entry.size() );
View Full Code Here

     * @throws Exception
     */
    @Test
    public void testSearchSomeOpsAndUsers() throws Exception
    {
        EntryCursor cursor = connection.search( "cn=user1,ou=users,ou=system", "(objectclass=*)",
            SearchScope.OBJECT, "cn", "entryUUID", "sn", "entryCSN" );
        int count = 0;
        Entry entry = null;

        while ( cursor.next() )
        {
            entry = cursor.get();
            assertNotNull( entry );
            count++;
        }
        cursor.close();

        assertEquals( 1, count );
        assertNotNull( entry );

        assertEquals( 4, entry.size() );
View Full Code Here

     * @throws Exception
     */
    @Test
    public void testSearchWithDuplicatedAttrs() throws Exception
    {
        EntryCursor cursor = connection.search( "cn=user1,ou=users,ou=system", "(objectclass=*)",
            SearchScope.OBJECT, "cn", "entryUUID", "cn", "sn", "entryCSN", "entryUUID" );
        int count = 0;
        Entry entry = null;

        while ( cursor.next() )
        {
            entry = cursor.get();
            assertNotNull( entry );
            count++;
        }
        cursor.close();

        assertEquals( 1, count );
        assertNotNull( entry );

        assertEquals( 4, entry.size() );
View Full Code Here

     * @throws Exception
     */
    @Test
    public void testSearchWithOIDAndtext() throws Exception
    {
        EntryCursor cursor = connection.search( "cn=user1,ou=users,ou=system", "(objectclass=*)",
            SearchScope.OBJECT, "cn", "1.3.6.1.1.16.4", "surName", "entryCSN", "entryUUID" );
        int count = 0;
        Entry entry = null;

        while ( cursor.next() )
        {
            entry = cursor.get();
            assertNotNull( entry );
            count++;
        }
        cursor.close();

        assertEquals( 1, count );
        assertNotNull( entry );

        assertEquals( 4, entry.size() );
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.model.cursor.EntryCursor

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.