Package org.apache.qpid.disttest.controller.config

Examples of org.apache.qpid.disttest.controller.config.Config


        }
    }

    public void testControllerSendsOneCommandToSingleClient() throws Exception
    {
        Config config = ConfigFileTestHelper.getConfigFromResource(getClass(), "distributedControllerTest.json");
        _controller.setConfig(config);

        sendRegistration(CLIENT1);
        _controller.awaitClientRegistrations();
View Full Code Here


        {
            List<ResultsForAllTests> results = new ArrayList<ResultsForAllTests>();

            for (String testConfigFile : testConfigFiles)
            {
                final Config testConfig = buildTestConfigFrom(testConfigFile);
                controller.setConfig(testConfig);

                controller.awaitClientRegistrations();

                LOGGER.info("Running test : " + testConfigFile);
View Full Code Here

        }
    }

    private ResultsForAllTests runTest(Controller controller, String testConfigFile)
    {
        final Config testConfig = buildTestConfigFrom(testConfigFile);
        controller.setConfig(testConfig);

        ResultsForAllTests rawResultsForAllTests = controller.runAllTests();
        ResultsForAllTests resultsForAllTests = _aggregator.aggregateResults(rawResultsForAllTests);
View Full Code Here

        if(!isDistributed())
        {
            int maxNumberOfClients = 0;
            for (String testConfigFile : testConfigFiles)
            {
                final Config testConfig = buildTestConfigFrom(testConfigFile);
                final int numClients = testConfig.getTotalNumberOfClients();
                maxNumberOfClients = Math.max(numClients, maxNumberOfClients);
            }

            //we must create the required test clients, running in single-jvm mode
            for (int i = 1; i <= maxNumberOfClients; i++)
View Full Code Here

    }

    private Config buildTestConfigFrom(String testConfigFile)
    {
        ConfigReader configReader = new ConfigReader();
        Config testConfig;
        try
        {
            testConfig = configReader.getConfigFromFile(testConfigFile);
        }
        catch (FileNotFoundException e)
View Full Code Here

    }

    public static Config getConfigFromResource(Class<?> testClass, String resourceName)
    {
        ConfigReader configReader = new ConfigReader();
        Config config = configReader.readConfig(getConfigFileReader(testClass, resourceName));
        return config;
    }
View Full Code Here

        _respondingJmsDelegate = mock(ControllerJmsDelegate.class);
        _controller = new Controller(_respondingJmsDelegate, REGISTRATION_TIMEOUT, COMMAND_RESPONSE_TIMEOUT);
        _testRunner = mock(TestRunner.class);
        _clientRegistry = mock(ClientRegistry.class);

        Config configWithOneClient = createMockConfig(1);
        _controller.setConfig(configWithOneClient);
        _controller.setClientRegistry(_clientRegistry);
        _controller.setTestRunnerFactory(createTestFactoryReturningMock());

        doAnswer(new Answer<Void>()
View Full Code Here

    }


    public void testControllerRejectsEmptyConfiguration()
    {
        Config configWithZeroClients = createMockConfig(0);

        try
        {
            _controller.setConfig(configWithZeroClients);
            fail("Exception not thrown");
View Full Code Here

        }
    }

    public void testControllerReceivesTwoExpectedClientRegistrations()
    {
        Config configWithTwoClients = createMockConfig(2);
        _controller.setConfig(configWithTwoClients);
        when(_clientRegistry.awaitClients(2, REGISTRATION_TIMEOUT)).thenReturn(0);

        _controller.awaitClientRegistrations();
    }
View Full Code Here

        verify(_respondingJmsDelegate).sendCommandToClient(eq(CLIENT1_REGISTERED_NAME), isA(StopClientCommand.class));
    }

    public void testRunAllTests()
    {
        Config config = createSimpleConfig();
        _controller.setConfig(config);

        TestResult testResult = new TestResult("test1");

        when(_testRunner.run()).thenReturn(testResult);
View Full Code Here

TOP

Related Classes of org.apache.qpid.disttest.controller.config.Config

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.