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);
}