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

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


        // 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(getConnection(), testProps);

        assertNoFailures(testCircuit.test(1,
                assertionList(((AMQPPublisher) testCircuit.getPublisher()).noRouteAssertion(testProps))));
    }
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(getConnection(), testProps);

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

        // Ensure transactional sessions are on.
        testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
        testProps.setProperty(ROLLBACK_PUBLISHER_PROPNAME, true);

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

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

        // Ensure transactional sessions are on.
        testProps.setProperty(TRANSACTED_RECEIVER_PROPNAME, true);
        testProps.setProperty(ROLLBACK_RECEIVER_PROPNAME, true);

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

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

        // Ensure transactional sessions are on.
        testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
        testProps.setProperty(ROLLBACK_PUBLISHER_PROPNAME, true);

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

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

        // Ensure transactional sessions are on.
        testProps.setProperty(TRANSACTED_RECEIVER_PROPNAME, false);
        testProps.setProperty(ROLLBACK_RECEIVER_PROPNAME, true);

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

        assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getReceiver().channelClosedAssertion(testProps))));
    }
View Full Code Here

        testProps.setProperty(PUBSUB_PROPNAME, false);

        // MessagingTestConfigProperties props = this.getTestParameters();

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

        // Create an assertion that all messages are received.
        Assertion allMessagesReceived = testCircuit.getReceiver().allMessagesReceivedAssertion(testProps);

        // This test case assumes it is using a local circuit.
View Full Code Here

    }

    /** Generates an appropriate test failure assertion. */
    public void testOptOut()
    {
        CircuitFactory circuitFactory = getCircuitFactory();

        fail("One of " + circuitFactory.getSender() + " and " + getCircuitFactory().getReceivers()
            + " opted out of the test.");
    }
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

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.