Package com.consol.citrus.report

Examples of com.consol.citrus.report.TestSuiteListeners


            ApplicationContext ctx = testContext.getApplicationContext();

            List<SequenceBeforeSuite> beforeSuite = CollectionUtils.arrayToList(ctx.getBeansOfType(SequenceBeforeSuite.class).values().toArray());

            com.consol.citrus.context.TestContext context = ctx.getBean(com.consol.citrus.context.TestContext.class);
            TestSuiteListeners testSuiteListener = ctx.getBean(TestSuiteListeners.class);

            if (!beforeSuite.isEmpty()) {
                for (SequenceBeforeSuite sequenceBeforeSuite : beforeSuite) {
                    try {
                        if (sequenceBeforeSuite.shouldExecute(testContext.getTestInstance().getClass().getPackage().getName(), null)) {
                            sequenceBeforeSuite.execute(context);
                        }
                    } catch (Exception e) {
                        throw new CitrusRuntimeException("Before suite failed with errors", e);
                    }
                }
            }  else {
                testSuiteListener.onStart();
                testSuiteListener.onStartSuccess();
            }

            List<SequenceAfterSuite> afterSuite = CollectionUtils.arrayToList(ctx.getBeansOfType(SequenceAfterSuite.class).values().toArray());
            Runtime.getRuntime().addShutdownHook(new Thread(new AfterSuiteShutdownHook(testContext.getTestInstance().getClass().getPackage().getName(), afterSuite, context, testSuiteListener)));
        }
View Full Code Here

TOP

Related Classes of com.consol.citrus.report.TestSuiteListeners

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.