Examples of TestBrokerConfiguration


Examples of org.apache.qpid.test.utils.TestBrokerConfiguration

    @Override
    protected void customizeConfiguration() throws ConfigurationException, IOException
    {
        super.customizeConfiguration();
        TestBrokerConfiguration config = getBrokerConfiguration();

        Map<String, Object> anonymousAuthProviderAttributes = new HashMap<String, Object>();
        anonymousAuthProviderAttributes.put(AuthenticationManagerFactory.ATTRIBUTE_TYPE, AnonymousAuthenticationManagerFactory.PROVIDER_TYPE);
        anonymousAuthProviderAttributes.put(AuthenticationProvider.NAME, TestBrokerConfiguration.ENTRY_NAME_ANONYMOUS_PROVIDER);
        config.addAuthenticationProviderConfiguration(anonymousAuthProviderAttributes);

        // set anonymous authentication provider on http port for the tests
        config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_HTTP_PORT, Port.AUTHENTICATION_PROVIDER,
                TestBrokerConfiguration.ENTRY_NAME_ANONYMOUS_PROVIDER);
        config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_HTTP_MANAGEMENT, HttpManagement.HTTP_BASIC_AUTHENTICATION_ENABLED, false);

        // reset credentials
        getRestTestHelper().setUsernameAndPassword(null, null);
    }
View Full Code Here

Examples of org.apache.qpid.test.utils.TestBrokerConfiguration

        }
    }

    protected void customizeConfiguration() throws ConfigurationException, IOException
    {
        TestBrokerConfiguration config = getBrokerConfiguration();
        config.addHttpManagementConfiguration();
        config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_HTTP_PORT, Port.PORT, _restTestHelper.getHttpPort());
        config.removeObjectConfiguration(TestBrokerConfiguration.ENTRY_NAME_JMX_PORT);
        config.removeObjectConfiguration(TestBrokerConfiguration.ENTRY_NAME_RMI_PORT);

        Map<String, Object> anonymousProviderAttributes = new HashMap<String, Object>();
        anonymousProviderAttributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManagerFactory.PROVIDER_TYPE);
        anonymousProviderAttributes.put(AuthenticationProvider.NAME, ANONYMOUS_AUTHENTICATION_PROVIDER);
        config.addAuthenticationProviderConfiguration(anonymousProviderAttributes);

        // set password authentication provider on http port for the tests
        config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_HTTP_PORT, Port.AUTHENTICATION_PROVIDER,
                TestBrokerConfiguration.ENTRY_NAME_AUTHENTICATION_PROVIDER);
        config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_HTTP_MANAGEMENT, HttpManagement.HTTP_BASIC_AUTHENTICATION_ENABLED, true);
    }
View Full Code Here

Examples of org.apache.qpid.test.utils.TestBrokerConfiguration

        }
    }

    private void startBrokerAndCreateMonitor(boolean managementEnabled, boolean useManagementSSL) throws Exception
    {
        TestBrokerConfiguration config = getBrokerConfiguration();

        if (managementEnabled)
        {
            config.addJmxManagementConfiguration();
        }

        if(useManagementSSL)
        {
            // This test requires we have ssl, change the transport and add they keystore to the port config
            config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_JMX_PORT, Port.TRANSPORTS, Collections.singleton(Transport.SSL));
            config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_JMX_PORT, Port.KEY_STORE, TestBrokerConfiguration.ENTRY_NAME_SSL_KEYSTORE);
        }

        startBroker();

        // Now we can create the monitor as _outputFile will now be defined
View Full Code Here

Examples of org.apache.qpid.test.utils.TestBrokerConfiguration

        {
            file.delete();
        }
        assertFalse("Group file should not exist", file.exists());

        TestBrokerConfiguration config = getBrokerConfiguration();
        config.removeObjectConfiguration(TestBrokerConfiguration.ENTRY_NAME_GROUP_FILE);
        UUID id = config.addGroupFileConfiguration(file.getAbsolutePath());
        config.setSaved(false);
        startBroker(0, true);

        getRestTestHelper().setUsernameAndPassword(BrokerOptions.MANAGEMENT_MODE_USER_NAME, MANAGEMENT_MODE_PASSWORD);

        Map<String, Object> groupProvider = getRestTestHelper().getJsonAsSingletonList("/rest/groupprovider/" + TestBrokerConfiguration.ENTRY_NAME_GROUP_FILE);
View Full Code Here

Examples of org.apache.qpid.test.utils.TestBrokerConfiguration

        setCommonBrokerSSLProperties(needClientAuth, Collections.singleton(TestBrokerConfiguration.ENTRY_NAME_SSL_TRUSTSTORE));
    }

    private void setCommonBrokerSSLProperties(boolean needClientAuth, Collection<String> trustStoreNames) throws ConfigurationException
    {
        TestBrokerConfiguration config = getBrokerConfiguration();

        Map<String, Object> sslPortAttributes = new HashMap<String, Object>();
        sslPortAttributes.put(Port.TRANSPORTS, Collections.singleton(Transport.SSL));
        sslPortAttributes.put(Port.PORT, DEFAULT_SSL_PORT);
        sslPortAttributes.put(Port.NEED_CLIENT_AUTH, String.valueOf(needClientAuth));
        sslPortAttributes.put(Port.NAME, TestBrokerConfiguration.ENTRY_NAME_SSL_PORT);
        sslPortAttributes.put(Port.KEY_STORE, TestBrokerConfiguration.ENTRY_NAME_SSL_KEYSTORE);
        sslPortAttributes.put(Port.TRUST_STORES, trustStoreNames);
        config.addPortConfiguration(sslPortAttributes);

        Map<String, Object> externalAuthProviderAttributes = new HashMap<String, Object>();
        externalAuthProviderAttributes.put(AuthenticationProvider.NAME, TestBrokerConfiguration.ENTRY_NAME_EXTERNAL_PROVIDER);
        externalAuthProviderAttributes.put(AuthenticationManagerFactory.ATTRIBUTE_TYPE, ExternalAuthenticationManagerFactory.PROVIDER_TYPE);
        config.addAuthenticationProviderConfiguration(externalAuthProviderAttributes);

        config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_SSL_PORT, Port.AUTHENTICATION_PROVIDER, TestBrokerConfiguration.ENTRY_NAME_EXTERNAL_PROVIDER);
    }
View Full Code Here

Examples of org.apache.qpid.test.utils.TestBrokerConfiguration

            {
                _bdbHelperPort = bdbPort;
            }

            configureClusterNode(brokerPort, bdbPort);
            TestBrokerConfiguration brokerConfiguration = _testcase.getBrokerConfiguration(brokerPort);
            brokerConfiguration.addJmxManagementConfiguration();
            collectConfig(brokerPort, brokerConfiguration, _testcase.getTestVirtualhosts());

            brokerPort = _testcase.getNextAvailable(bdbPort + 1);
        }
    }
View Full Code Here

Examples of org.apache.qpid.test.utils.TestBrokerConfiguration

    public void doActualSetUp() throws Exception
    {
        // use webadmin account to perform tests
        _restTestHelper.setUsernameAndPassword("webadmin", "webadmin");

        TestBrokerConfiguration config = getBrokerConfiguration();
        config.addHttpManagementConfiguration();
        config.setObjectAttribute(Port.class,
                                  TestBrokerConfiguration.ENTRY_NAME_HTTP_PORT,
                                  Port.PORT,
                                  _restTestHelper.getHttpPort());

        config.setObjectAttribute(AuthenticationProvider.class, TestBrokerConfiguration.ENTRY_NAME_AUTHENTICATION_PROVIDER,
                                  "secureOnlyMechanisms",
                                  "{}");

        // set password authentication provider on http port for the tests
        config.setObjectAttribute(Port.class, TestBrokerConfiguration.ENTRY_NAME_HTTP_PORT, Port.AUTHENTICATION_PROVIDER,
                                  TestBrokerConfiguration.ENTRY_NAME_AUTHENTICATION_PROVIDER);
        config.setObjectAttribute(Plugin.class, TestBrokerConfiguration.ENTRY_NAME_HTTP_MANAGEMENT, HttpManagement.HTTP_BASIC_AUTHENTICATION_ENABLED, true);

        super.setUp();
    }
View Full Code Here

Examples of org.apache.qpid.test.utils.TestBrokerConfiguration

{
    @Override
    protected void configure() throws Exception
    {
        // Setup housekeeping every second
        TestBrokerConfiguration brokerConfiguration = getBrokerConfiguration();
        setTestSystemProperty("virtualhost.housekeepingCheckPeriod", "100");

        // No transaction timeout configuration.
    }
View Full Code Here

Examples of org.apache.qpid.test.utils.TestBrokerConfiguration

    public void setUp() throws Exception
    {
        //enable DLQ/maximumDeliveryCount support for all queues at the vhost level

        TestBrokerConfiguration brokerConfiguration = getBrokerConfiguration();
        setTestSystemProperty("queue.deadLetterQueueEnabled","true");
        setTestSystemProperty("queue.maximumDeliveryAttempts", String.valueOf(MAX_DELIVERY_COUNT));

        //Ensure management is on
        brokerConfiguration.addJmxManagementConfiguration();

        // Set client-side flag to allow the server to determine if messages
        // dead-lettered or requeued.
        if (!isBroker010())
        {
View Full Code Here

Examples of org.apache.qpid.test.utils.TestBrokerConfiguration

    {
        // switch off connection close in order to test timeout on publishing of unroutable messages
        getBrokerConfiguration().setBrokerAttribute(Broker.CONNECTION_CLOSE_WHEN_NO_ROUTE, false);

        // Setup housekeeping every 100ms
        TestBrokerConfiguration brokerConfiguration = getBrokerConfiguration();
        setTestSystemProperty("virtualhost.housekeepingCheckPeriod","100");

        if (getName().contains("ProducerIdle"))
        {
            setTestSystemProperty("virtualhost.storeTransactionOpenTimeoutWarn", "0");
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.