Package org.apache.qpid.test.framework.sequencers

Examples of org.apache.qpid.test.framework.sequencers.CircuitFactory


        // Set up the test properties to match the test case requirements.
        getTestProps().setProperty(ACK_MODE_PROPNAME, Session.AUTO_ACKNOWLEDGE);
        getTestProps().setProperty(PUBSUB_PROPNAME, false);

        // Create the test circuit from the test configuration parameters.
        CircuitFactory circuitFactory = getCircuitFactory();
        Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps());

        // This test case assumes it is using a local circuit.
        LocalCircuitImpl localCircuit = (LocalCircuitImpl) testCircuit;

        Session producerSession = localCircuit.getLocalPublisherCircuitEnd().getSession();
View Full Code Here


        // Customize the test parameters.
        testProps.setProperty("TEST_NAME", "DEFAULT_CIRCUIT_TEST");
        testProps.setProperty(MessagingTestConfigProperties.SEND_DESTINATION_NAME_ROOT_PROPNAME, "testqueue");

        // Get the test circuit factory to create test circuits and run the standard test procedure through.
        CircuitFactory circuitFactory = getCircuitFactory();

        // Create the test circuit. This projects the circuit onto the available test nodes and connects it up.
        Circuit testCircuit = circuitFactory.createCircuit(null, testProps);

        // Store the test configuration for the thread.
        PerThreadSetup setup = new PerThreadSetup();
        setup.testCircuit = testCircuit;
        threadSetup.set(setup);
View Full Code Here

            Set<List<TestClientDetails>> failPairs = allPairs(optOuts, allClients);

            for (List<TestClientDetails> failPair : failPairs)
            {
                // Create a distributed test circuit factory for the test.
                CircuitFactory circuitFactory = getTestSequencer();

                // Create an automatic failure test for the opted out test pair.
                FrameworkBaseCase failTest = new OptOutTestCase("testOptOut");
                circuitFactory.setSender(failPair.get(0));
                circuitFactory.setReceiver(failPair.get(1));
                failTest.setCircuitFactory(circuitFactory);

                failTest.run(testResult);
            }

            // Loop over all combinations of clients, willing to run the test.
            Set<List<TestClientDetails>> enlistedPairs = allPairs(enlists, enlists);

            for (List<TestClientDetails> enlistedPair : enlistedPairs)
            {
                // Create a distributed test circuit factory for the test.
                CircuitFactory circuitFactory = getTestSequencer();

                // Set the sending and receiving client details on the test circuitFactory.
                circuitFactory.setSender(enlistedPair.get(0));
                circuitFactory.setReceiver(enlistedPair.get(1));

                // Pass down the connection to hold the coordination conversation over.
                circuitFactory.setConversationFactory(conversationFactory);

                // Execute the test case.
                coordTest.setCircuitFactory(circuitFactory);
                coordTest.run(testResult);
            }
View Full Code Here

            {
                throw new RuntimeException("No clients to test with");
            }

            // Create a distributed test circuit factory for the test.
            CircuitFactory circuitFactory = getTestSequencer();

            // Set up the first client in the sender role, and the remainder in the receivers role.
            Iterator<TestClientDetails> clients = enlists.iterator();
            circuitFactory.setSender(clients.next());

            while (clients.hasNext())
            {
                // Set the sending and receiving client details on the test case.
                circuitFactory.setReceiver(clients.next());
            }

            // Pass down the connection to hold the coordinating conversation over.
            circuitFactory.setConversationFactory(conversationFactory);

            // If the current test case is a drop-in test, set it up as the currently running test for late joiners to
            // add in to. Otherwise the current test field is set to null, to indicate that late joiners are not allowed.
            currentTest = (coordTest instanceof DropInTest) ? coordTest : null;
View Full Code Here

        // Customize the test parameters.
        testProps.setProperty("TEST_NAME", "DEFAULT_CIRCUIT_TEST");
        testProps.setProperty(MessagingTestConfigProperties.SEND_DESTINATION_NAME_ROOT_PROPNAME, "testqueue");

        // Get the test circuit factory to create test circuits and run the standard test procedure through.
        CircuitFactory circuitFactory = getCircuitFactory();

        // Create the test circuit. This projects the circuit onto the available test nodes and connects it up.
        Circuit testCircuit = circuitFactory.createCircuit(testProps);

        // Store the test configuration for the thread.
        PerThreadSetup setup = new PerThreadSetup();
        setup.testCircuit = testCircuit;
        threadSetup.set(setup);
View Full Code Here

        // Ensure transactional sessions are off.
        testProps.setProperty(TRANSACTED_PROPNAME, false);
        testProps.setProperty(PUBSUB_PROPNAME, false);

        // Run the default test sequence over the test circuit checking for no errors.
        CircuitFactory circuitFactory = getCircuitFactory();
        Circuit testCircuit = circuitFactory.createCircuit(testProps);

        assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
    }
View Full Code Here

        // Ensure transactional sessions are off.
        testProps.setProperty(TRANSACTED_PROPNAME, true);
        testProps.setProperty(PUBSUB_PROPNAME, false);

        // Run the default test sequence over the test circuit checking for no errors.
        CircuitFactory circuitFactory = getCircuitFactory();
        Circuit testCircuit = circuitFactory.createCircuit(testProps);

        assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
    }
View Full Code Here

        testProps.setProperty(PUBSUB_PROPNAME, false);

        // Disconnect the consumer.
        testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);

        CircuitFactory circuitFactory = getCircuitFactory();
        Circuit testCircuit = circuitFactory.createCircuit(testProps);

        // Send one message with no errors.
        assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
    }
View Full Code Here

        testProps.setProperty(PUBSUB_PROPNAME, false);

        // Disconnect the consumer.
        testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);

        CircuitFactory circuitFactory = getCircuitFactory();
        Circuit testCircuit = circuitFactory.createCircuit(testProps);

        // Send one message with no errors.
        assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
    }
View Full Code Here

        // Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to
        // collect its messages).
        testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);

        // Send one message and get a linked no route exception.
        CircuitFactory circuitFactory = getCircuitFactory();
        Circuit testCircuit = circuitFactory.createCircuit(testProps);

        assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noRouteAssertion())));
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.test.framework.sequencers.CircuitFactory

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.