Package com.consol.citrus

Examples of com.consol.citrus.TestAction


   
    @Test
    public void testCatchFirstActionFailing() {
        Catch catchAction = new Catch();
       
        TestAction action = EasyMock.createMock(TestAction.class);

        reset(action);
       
        action.execute(context);
        expectLastCall().once();
       
        replay(action);
       
        List<TestAction> actionList = new ArrayList<TestAction>();
View Full Code Here


   
    @Test
    public void testCatchSomeActionFailing() {
        Catch catchAction = new Catch();
       
        TestAction action = EasyMock.createMock(TestAction.class);
       
        reset(action);
       
        action.execute(context);
        expectLastCall().times(2);
       
        replay(action);
       
        List<TestAction> actionList = new ArrayList<TestAction>();
View Full Code Here

   
    @Test
    public void testMultipleActions() {
        Sequence sequenceAction = new Sequence();
       
        TestAction action1 = EasyMock.createMock(TestAction.class);
        TestAction action2 = EasyMock.createMock(TestAction.class);
        TestAction action3 = EasyMock.createMock(TestAction.class);

        reset(action1, action2, action3);
       
        action1.execute(context);
        expectLastCall().once();
        action2.execute(context);
        expectLastCall().once();
        action3.execute(context);
        expectLastCall().once();
       
        replay(action1, action2, action3);
       
        List<TestAction> actionList = new ArrayList<TestAction>();
View Full Code Here

   
    @Test(expectedExceptions=CitrusRuntimeException.class)
    public void testFirstActionFailing() {
        Sequence sequenceAction = new Sequence();
       
        TestAction action1 = EasyMock.createMock(TestAction.class);
        TestAction action2 = EasyMock.createMock(TestAction.class);
        TestAction action3 = EasyMock.createMock(TestAction.class);

        reset(action1, action2, action3);
       
        replay(action1, action2, action3);
       
View Full Code Here

   
    @Test(expectedExceptions=CitrusRuntimeException.class)
    public void testLastActionFailing() {
        Sequence sequenceAction = new Sequence();
       
        TestAction action1 = EasyMock.createMock(TestAction.class);
        TestAction action2 = EasyMock.createMock(TestAction.class);
        TestAction action3 = EasyMock.createMock(TestAction.class);

        reset(action1, action2, action3);
       
        action1.execute(context);
        expectLastCall().once();
        action2.execute(context);
        expectLastCall().once();
        action3.execute(context);
        expectLastCall().once();
       
        replay(action1, action2, action3);
       
        List<TestAction> actionList = new ArrayList<TestAction>();
View Full Code Here

   
    @Test(expectedExceptions=CitrusRuntimeException.class)
    public void testFailingAction() {
        Sequence sequenceAction = new Sequence();
       
        TestAction action1 = EasyMock.createMock(TestAction.class);
        TestAction action2 = EasyMock.createMock(TestAction.class);
        TestAction action3 = EasyMock.createMock(TestAction.class);

        reset(action1, action2, action3);
       
        action1.execute(context);
        expectLastCall().once();
View Full Code Here

    public void testFirstActionFailing() {
        TestCase test = new TestCase();
        test.setPackageName("com.consol.citrus.util");
        test.setName("FailureStackExampleTest");

        TestAction failedAction = new MockedTestAction("sleep");
       
        List<TestAction> actions = new ArrayList<TestAction>();
        actions.add(failedAction);
       
        actions.add(new MockedActionContainer("parallel",
                new MockedTestAction("sleep"),
                new MockedTestAction("fail"),
                new MockedActionContainer("sequential", new MockedTestAction("sleep"), new MockedTestAction("echo"))));
       
        actions.add(new MockedTestAction("sleep"));
       
        actions.add(new MockedActionContainer("sequential",
                new MockedTestAction("echo"),
                new MockedTestAction("sleep"),
                new MockedActionContainer("iterate", new MockedTestAction("sleep"))));
       
        actions.add(new MockedTestAction("fail"));
        actions.add(new MockedTestAction("echo"));
       
        test.setActions(actions);
        test.setLastExecutedAction(failedAction);
       
        List<FailureStackElement> failureStack = TestUtils.getFailureStack(test);
       
        Assert.assertFalse(failureStack.isEmpty());
        Assert.assertTrue(failureStack.size() == 1);
       
        FailureStackElement failureStackElement = failureStack.get(0);
        Assert.assertEquals(failureStackElement.getStackMessage(), "at com/consol/citrus/util/FailureStackExampleTest(" + failedAction.getName() + ":13)");
        Assert.assertEquals(failureStackElement.getLineNumberStart().longValue(), 13L);
    }
View Full Code Here

    public void testNestedContainerBeforeFailedAction() {
        TestCase test = new TestCase();
        test.setPackageName("com.consol.citrus.util");
        test.setName("FailureStackExampleTest");

        TestAction failedAction = new MockedTestAction("fail");
       
        List<TestAction> actions = new ArrayList<TestAction>();
        actions.add(new MockedTestAction("sleep"));
       
        actions.add(new MockedActionContainer("parallel",
                new MockedTestAction("sleep"),
                new MockedTestAction("fail"),
                new MockedActionContainer("sequential", new MockedTestAction("sleep"), new MockedTestAction("echo"))));
       
        actions.add(new MockedTestAction("sleep"));
       
        actions.add(new MockedActionContainer("sequential",
                new MockedTestAction("echo"),
                new MockedTestAction("sleep"),
                new MockedActionContainer("iterate", new MockedTestAction("sleep"))));
       
        actions.add(failedAction);
        actions.add(new MockedTestAction("echo"));
       
        test.setActions(actions);
        test.setLastExecutedAction(failedAction);
       
        List<FailureStackElement> failureStack = TestUtils.getFailureStack(test);
       
        Assert.assertFalse(failureStack.isEmpty());
        Assert.assertTrue(failureStack.size() == 1);
        FailureStackElement failureStackElement = failureStack.get(0);
        Assert.assertEquals(failureStackElement.getStackMessage(), "at com/consol/citrus/util/FailureStackExampleTest(" + failedAction.getName() + ":34)");
        Assert.assertEquals(failureStackElement.getLineNumberStart().longValue(), 34L);
    }
View Full Code Here

    public void testMiddleActionFailing() {
        TestCase test = new TestCase();
        test.setPackageName("com.consol.citrus.util");
        test.setName("FailureStackExampleTest");

        TestAction failedAction = new MockedTestAction("sleep");
       
        List<TestAction> actions = new ArrayList<TestAction>();
        actions.add(new MockedTestAction("sleep"));
       
        actions.add(new MockedActionContainer("parallel",
                new MockedTestAction("sleep"),
                new MockedTestAction("fail"),
                new MockedActionContainer("sequential", new MockedTestAction("sleep"), new MockedTestAction("echo"))));
       
        actions.add(failedAction);
       
        actions.add(new MockedActionContainer("sequential",
                new MockedTestAction("echo"),
                new MockedTestAction("sleep"),
                new MockedActionContainer("iterate", new MockedTestAction("sleep"))));
       
        actions.add(new MockedTestAction("fail"));
        actions.add(new MockedTestAction("echo"));
       
        test.setActions(actions);
        test.setLastExecutedAction(failedAction);
       
        List<FailureStackElement> failureStack = TestUtils.getFailureStack(test);
       
        Assert.assertFalse(failureStack.isEmpty());
        Assert.assertTrue(failureStack.size() == 1);
        FailureStackElement failureStackElement = failureStack.get(0);
        Assert.assertEquals(failureStackElement.getStackMessage(), "at com/consol/citrus/util/FailureStackExampleTest(" + failedAction.getName() + ":24)");
        Assert.assertEquals(failureStackElement.getLineNumberStart().longValue(), 24L);
    }
View Full Code Here

    public void testActionFailingInContainer() {
        TestCase test = new TestCase();
        test.setPackageName("com.consol.citrus.util");
        test.setName("FailureStackExampleTest");

        TestAction failedAction = new MockedTestAction("sleep");
       
        List<TestAction> actions = new ArrayList<TestAction>();
        actions.add(new MockedTestAction("sleep"));
       
        actions.add(new MockedActionContainer("parallel",
                new MockedTestAction("sleep"),
                new MockedTestAction("fail"),
                new MockedActionContainer("sequential", new MockedTestAction("sleep"), new MockedTestAction("echo"))));
       
        actions.add(new MockedTestAction("sleep"));
       
        TestAction failedContainer = new MockedActionContainer("sequential",
                new MockedTestAction("echo"),
                failedAction,
                new MockedActionContainer("iterate", new MockedTestAction("sleep")));
        ((TestActionContainer)failedContainer).setLastExecutedAction(failedAction);
        actions.add(failedContainer);
View Full Code Here

TOP

Related Classes of com.consol.citrus.TestAction

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.