Package org.apache.qpid.server.security.auth.sasl

Examples of org.apache.qpid.server.security.auth.sasl.UsernamePasswordInitialiser


public class AMQPlainSaslServerTest extends SaslServerTestCase
{
    protected void setUp() throws Exception
    {
        UsernamePasswordInitialiser handler = new AmqPlainInitialiser();
        handler.initialise(db);
        this.server = new AmqPlainSaslServer(handler.getCallbackHandler());
        FieldTable table = FieldTableFactory.newFieldTable();
        table.setString("LOGIN", username);
        table.setString("PASSWORD", password);
        correctResponse = table.getDataAsBytes();
        table.setString("PASSWORD", notPassword);
View Full Code Here


public class AMQPlainSaslServerTest extends SaslServerTestCase
{
    protected void setUp() throws Exception
    {
        UsernamePasswordInitialiser handler = new AmqPlainInitialiser();
        handler.initialise(db);
        this.server = new AmqPlainSaslServer(handler.getCallbackHandler());
        FieldTable table = FieldTableFactory.newFieldTable();
        table.setString("LOGIN", username);
        table.setString("PASSWORD", password);
        correctresponse = table.getDataAsBytes();
        table.setString("PASSWORD", notpassword);
View Full Code Here

public class PlainSaslServerTest extends SaslServerTestCase
{
   
    protected void setUp() throws Exception
    {
        UsernamePasswordInitialiser handler = new PlainInitialiser();
        handler.initialise(db);
        this.server = new PlainSaslServer(handler.getCallbackHandler());
        correctresponse = new byte[]{0x0, (byte) username.charAt(0), 0x0, (byte) password.charAt(0)};
        wrongresponse = new byte[]{0x0,(byte) username.charAt(0), 0x0, (byte) notpassword.charAt(0)};
    }
View Full Code Here

public class PlainSaslServerTest extends SaslServerTestCase
{
   
    protected void setUp() throws Exception
    {
        UsernamePasswordInitialiser handler = new PlainInitialiser();
        handler.initialise(db);
        this.server = new PlainSaslServer(handler.getCallbackHandler());
        correctResponse = new byte[]{0x0, (byte) username.charAt(0), 0x0, (byte) password.charAt(0)};
        wrongResponse = new byte[]{0x0,(byte) username.charAt(0), 0x0, (byte) notPassword.charAt(0)};
    }
View Full Code Here

    private void setupMocksWithInitialiser() throws Exception
    {
        _principalDatabase = mock(PrincipalDatabase.class);

        UsernamePasswordInitialiser usernamePasswordInitialiser = new UsernamePasswordInitialiser()
        {
            @Override
            public Class<? extends SaslServerFactory> getServerFactoryClassForJCARegistration()
            {
                return MySaslServerFactory.class;
            }

            @Override
            public String getMechanismName()
            {
                return MOCK_MECH_NAME;
            }
        };

        Map<String,AuthenticationProviderInitialiser> initialisers = new HashMap<String, AuthenticationProviderInitialiser>();
        initialisers.put(MOCK_MECH_NAME, usernamePasswordInitialiser);

        when(_principalDatabase.getMechanisms()).thenReturn(initialisers);

        usernamePasswordInitialiser.initialise(_principalDatabase);

        _manager = new PrincipalDatabaseAuthenticationManager(_principalDatabase);
        _manager.initialise();
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.security.auth.sasl.UsernamePasswordInitialiser

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.