Package netscape.ldap

Examples of netscape.ldap.LDAPConnection.connect()


        LDAPConnection conn = null;

        try
        {
            conn = new LDAPConnection();
            conn.connect( 100, "localhost", getLdapServer().getPort(), "uid=admin,ou=system", "secret" );
            fail( "try to connect with illegal version number should fail" );
        }
        catch ( LDAPException e )
        {
            assertEquals( "statuscode", LDAPException.PROTOCOL_ERROR, e.getLDAPResultCode() );
View Full Code Here


        constraints.setServerControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, Strings.EMPTY_BYTES ) );
        conn.setConstraints( constraints );

        try
        {
            conn.connect( 3, "localhost", getLdapServer().getPort(),
                "uid=akarasuluref,ou=users,ou=system", "secret", constraints );
            fail( "try to connect with illegal version number should fail" );
        }
        catch ( LDAPException e )
        {
View Full Code Here

            assertEquals( "statuscode", LDAPException.INVALID_CREDENTIALS, e.getLDAPResultCode() );
        }

        try
        {
            conn.connect( 3, "localhost", getLdapServer().getPort(),
                "uid=akarasuluref,ou=users,ou=system", "secret" );
            fail( "try to connect with illegal version number should fail" );
        }
        catch ( LDAPException e )
        {
View Full Code Here

    env.put( Context.SECURITY_PRINCIPAL, args[ 2 ] );
    env.put( Context.SECURITY_CREDENTIALS, args[ 3 ] );
    ctx = new InitialDirContext( env );
      } else {
    conn = new LDAPConnection();
    conn.connect( args[ 1 ], LDAPv2.DEFAULT_PORT );
    conn.authenticate( args[ 2 ], args[ 3 ] );
      }

      if ( jndi ) {
    importer = new JNDIImporter( ctx );
View Full Code Here

        throws MojoExecutionException
    {
        try
        {
            final LDAPConnection connection = new LDAPConnection();
            connection.connect(this.version, this.host, this.port, this.authDn,
                this.passwd);
            return connection;
        }
        catch (LDAPException e)
        {
View Full Code Here

        LDAPConnection conn = null;
       
        try
        {
            conn = new LDAPConnection();
            conn.connect( 100, "localhost", ldapServer.getPort(), "uid=admin,ou=system", "secret" );
            fail( "try to connect with illegal version number should fail" );
        }
        catch ( LDAPException e )
        {
            assertEquals( "statuscode", LDAPException.PROTOCOL_ERROR, e.getLDAPResultCode() );
View Full Code Here

        constraints.setServerControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, new byte[0] ) );
        conn.setConstraints( constraints );
       
        try
        {
            conn.connect( 3, "localhost", ldapServer.getPort(),
                "uid=akarasuluref,ou=users,ou=system", "secret", constraints );
            fail( "try to connect with illegal version number should fail" );
        }
        catch( LDAPException e )
        {
View Full Code Here

            assertEquals( "statuscode", LDAPException.INVALID_CREDENTIALS, e.getLDAPResultCode() );
        }
       
        try
        {
            conn.connect( 3, "localhost", ldapServer.getPort(),
                "uid=akarasuluref,ou=users,ou=system", "secret" );
            fail( "try to connect with illegal version number should fail" );
        }
        catch( LDAPException e )
        {
View Full Code Here

    @Test
    public void testCompareWithoutAuthentication() throws LDAPException
    {
        ldapServer.getDirectoryService().setAllowAnonymousAccess( false );
        LDAPConnection conn = new LDAPConnection();
        conn.connect( "localhost", ldapServer.getPort() );
        LDAPAttribute attr = new LDAPAttribute( "uid", "admin" );
       
        try
        {
            conn.compare( "uid=admin,ou=system", attr );
View Full Code Here

        LDAPConnection conn = null;

        try
        {
            conn = new LDAPConnection();
            conn.connect( 100, "localhost", getLdapServer().getPort(), "uid=admin,ou=system", "secret" );
            fail( "try to connect with illegal version number should fail" );
        }
        catch ( LDAPException e )
        {
            assertEquals( "statuscode", LDAPException.PROTOCOL_ERROR, e.getLDAPResultCode() );
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.