Package org.arquillian.recorder.reporter.model

Examples of org.arquillian.recorder.reporter.model.TestMethodReport


        VideoEntry videoEntry = new VideoEntry();
        videoEntry.setPath(configuration.getRootDir().getAbsolutePath() + "/some/someVideo.mp4");
        videoEntry.setSize("54M");
        reporter.getReporterCursor().getCursor().getPropertyEntries().add(videoEntry);

        TestMethodReport testMethodReport = new TestMethodReport();
        testMethodReport.setName("someTestMethod");
        TestResult testResult = TestResult.passed();
        testResult.setStart(System.currentTimeMillis());
        testResult.setEnd(testResult.getStart() + 1000);
        testMethodReport.setReportMessage("This test should be executed manually too.");
        testMethodReport.setStatus(testResult.getStatus());
        testMethodReport.setDuration(testResult.getEnd() - testResult.getStart());

        reporter.getLastTestClassReport().getTestMethodReports().add(testMethodReport);
        reporter.setTestMethodReport(testMethodReport);

        TestMethodReport testMethodReport2 = new TestMethodReport();
        testMethodReport2.setName("someTestMethod2");
        TestResult testResult2 = TestResult.failed(new IOException("Exception"));
        testResult2.setStart(System.currentTimeMillis());
        testResult2.setEnd(testResult2.getStart() + 2000);
        testMethodReport2.setStatus(testResult2.getStatus());
        testMethodReport2.setDuration(testResult2.getEnd() - testResult2.getStart());
        testMethodReport2.setException("some exception");

        reporter.getLastTestClassReport().getTestMethodReports().add(testMethodReport2);
        reporter.setTestMethodReport(testMethodReport2);

        ScreenshotEntry sce = new ScreenshotEntry();
View Full Code Here


        VideoEntry videoEntry = new VideoEntry();
        videoEntry.setPath(configuration.getRootDir().getAbsolutePath() + "/some/someVideo.mp4");
        videoEntry.setSize("54M");
        reporter.getReporterCursor().getCursor().getPropertyEntries().add(videoEntry);

        TestMethodReport testMethodReport = new TestMethodReport();
        testMethodReport.setName("someTestMethod");
        TestResult testResult = TestResult.passed();
        testResult.setStart(System.currentTimeMillis());
        testResult.setEnd(testResult.getStart() + 1000);
        testMethodReport.setReportMessage("This test should be executed manually too.");
        testMethodReport.setStatus(testResult.getStatus());
        testMethodReport.setDuration(testResult.getEnd() - testResult.getStart());

        reporter.getLastTestClassReport().getTestMethodReports().add(testMethodReport);
        reporter.setTestMethodReport(testMethodReport);

        TestMethodReport testMethodReport2 = new TestMethodReport();
        testMethodReport2.setName("someTestMethod2");
        TestResult testResult2 = TestResult.failed(new IOException("Exception"));
        testResult2.setStart(System.currentTimeMillis());
        testResult2.setEnd(testResult2.getStart() + 2000);
        testMethodReport2.setStatus(testResult2.getStatus());
        testMethodReport2.setDuration(testResult2.getEnd() - testResult2.getStart());
        testMethodReport2.setException("some exception");

        reporter.getLastTestClassReport().getTestMethodReports().add(testMethodReport2);
        reporter.setTestMethodReport(testMethodReport2);

        ScreenshotEntry sce = new ScreenshotEntry();
View Full Code Here

        VideoEntry videoEntry = new VideoEntry();
        videoEntry.setPath("some/someVideo.mp4");
        videoEntry.setSize("54M");
        reporter.getReporterCursor().getCursor().getPropertyEntries().add(videoEntry);

        TestMethodReport testMethodReport = new TestMethodReport();
        testMethodReport.setName("someTestMethod");
        TestResult testResult = TestResult.passed();
        testResult.setStart(System.currentTimeMillis());
        testResult.setEnd(testResult.getStart() + 1000);
        testMethodReport.setStatus(testResult.getStatus());
        testMethodReport.setDuration(testResult.getEnd() - testResult.getStart());

        reporter.getLastTestClassReport().getTestMethodReports().add(testMethodReport);
        reporter.setTestMethodReport(testMethodReport);

        TestMethodReport testMethodReport2 = new TestMethodReport();
        testMethodReport2.setName("someTestMethod2");
        TestResult testResult2 = TestResult.failed(new RuntimeException());
        testResult2.setStart(System.currentTimeMillis());
        testResult2.setEnd(testResult2.getStart() + 2000);
        testMethodReport2.setStatus(testResult2.getStatus());
        testMethodReport2.setDuration(testResult2.getEnd() - testResult2.getStart());
        testMethodReport2.setException("some exception");

        reporter.getLastTestClassReport().getTestMethodReports().add(testMethodReport2);
        reporter.setTestMethodReport(testMethodReport2);

        ScreenshotEntry sce = new ScreenshotEntry();
View Full Code Here

        reporter.get().getLastTestSuiteReport().getTestClassReports().add(testClassReport);
        reporter.get().setTestClassReport(testClassReport);
    }

    public void observeBeforeTest(@Observes(precedence = Integer.MAX_VALUE) Before event) {
        TestMethodReport testMethodReport = new TestMethodReport();
        testMethodReport.setName(event.getTestMethod().getName());

        if (event.getTestMethod().isAnnotationPresent(OperateOnDeployment.class)) {
            OperateOnDeployment ood = event.getTestMethod().getAnnotation(OperateOnDeployment.class);
            testMethodReport.setOperateOnDeployment(ood.value());
        } else {
            testMethodReport.setOperateOnDeployment("_DEFAULT_");
        }

        testMethodReport.setRunAsClient(event.getTestMethod().isAnnotationPresent(RunAsClient.class));

        reporter.get().getLastTestClassReport().getTestMethodReports().add(testMethodReport);
        reporter.get().setTestMethodReport(testMethodReport);
    }
View Full Code Here

        reporter.get().getLastTestClassReport().getTestMethodReports().add(testMethodReport);
        reporter.get().setTestMethodReport(testMethodReport);
    }

    public void observeAfterTest(@Observes(precedence = Integer.MIN_VALUE) After event, TestResult result) {
        TestMethodReport testMethodReport = reporter.get().getLastTestMethodReport();

        testMethodReport.setStatus(result.getStatus());
        testMethodReport.setDuration(result.getEnd() - result.getStart());
        testMethodReport.setReportMessage(parseTestReportMessage(event.getTestMethod()));

        if (result.getStatus() == Status.FAILED) {
            if (result.getThrowable() != null) {
                if (!isThrowingExpectedException(event.getTestMethod(), result.getThrowable().getClass())) {
                    testMethodReport.setException(getStackTrace(result.getThrowable()));
                } else {
                    testMethodReport.setStatus(Status.PASSED);
                }
            }
        }

        inTestResourceReportEvent.fire(new InTestResourceReport());
View Full Code Here

        VideoEntry videoEntry = new VideoEntry();
        videoEntry.setPath("some/someVideo.mp4");
        videoEntry.setSize("54M");
        reporter.getReporterCursor().getCursor().getPropertyEntries().add(videoEntry);

        TestMethodReport testMethodReport = new TestMethodReport();
        testMethodReport.setName("someTestMethod");
        TestResult testResult = new TestResult();
        testResult.setStatus(Status.PASSED);
        testResult.setStart(System.currentTimeMillis());
        testResult.setEnd(testResult.getStart() + 1000);
        testMethodReport.setStatus(testResult.getStatus());
        testMethodReport.setDuration(testResult.getEnd() - testResult.getStart());

        reporter.getLastTestClassReport().getTestMethodReports().add(testMethodReport);
        reporter.setTestMethodReport(testMethodReport);

        TestMethodReport testMethodReport2 = new TestMethodReport();
        testMethodReport2.setName("someTestMethod2");
        TestResult testResult2 = new TestResult();
        testResult2.setStatus(Status.FAILED);
        testResult2.setStart(System.currentTimeMillis());
        testResult2.setEnd(testResult2.getStart() + 2000);
        testMethodReport2.setStatus(testResult2.getStatus());
        testMethodReport2.setDuration(testResult2.getEnd() - testResult2.getStart());
        testMethodReport2.setException("some exception");

        reporter.getLastTestClassReport().getTestMethodReports().add(testMethodReport2);
        reporter.setTestMethodReport(testMethodReport2);

        ScreenshotEntry sce = new ScreenshotEntry();
View Full Code Here

        VideoEntry videoEntry = new VideoEntry();
        videoEntry.setPath(configuration.getRootDir().getAbsolutePath() + "/some/someVideo.mp4");
        videoEntry.setSize("54M");
        reporter.getReporterCursor().getCursor().getPropertyEntries().add(videoEntry);

        TestMethodReport testMethodReport = new TestMethodReport();
        testMethodReport.setName("someTestMethod");
        TestResult testResult = new TestResult();
        testResult.setStatus(Status.PASSED);
        testResult.setStart(System.currentTimeMillis());
        testResult.setEnd(testResult.getStart() + 1000);
        testMethodReport.setReportMessage("This test should be executed manually too.");
        testMethodReport.setStatus(testResult.getStatus());
        testMethodReport.setDuration(testResult.getEnd() - testResult.getStart());

        reporter.getLastTestClassReport().getTestMethodReports().add(testMethodReport);
        reporter.setTestMethodReport(testMethodReport);

        TestMethodReport testMethodReport2 = new TestMethodReport();
        testMethodReport2.setName("someTestMethod2");
        TestResult testResult2 = new TestResult();
        testResult2.setStatus(Status.FAILED);
        testResult2.setThrowable(new IOException("Exception"));
        testResult2.setStart(System.currentTimeMillis());
        testResult2.setEnd(testResult2.getStart() + 2000);
        testMethodReport2.setStatus(testResult2.getStatus());
        testMethodReport2.setDuration(testResult2.getEnd() - testResult2.getStart());
        testMethodReport2.setException("some exception");

        reporter.getLastTestClassReport().getTestMethodReports().add(testMethodReport2);
        reporter.setTestMethodReport(testMethodReport2);

        ScreenshotEntry sce = new ScreenshotEntry();
View Full Code Here

        reporter.get().getLastTestSuiteReport().getTestClassReports().add(testClassReport);
        reporter.get().setTestClassReport(testClassReport);
    }

    public void observeBeforeTest(@Observes(precedence = Integer.MAX_VALUE) Before event) {
        TestMethodReport testMethodReport = new TestMethodReport();
        testMethodReport.setName(event.getTestMethod().getName());

        if (event.getTestMethod().isAnnotationPresent(OperateOnDeployment.class)) {
            OperateOnDeployment ood = event.getTestMethod().getAnnotation(OperateOnDeployment.class);
            testMethodReport.setOperateOnDeployment(ood.value());
        } else {
            testMethodReport.setOperateOnDeployment("_DEFAULT_");
        }

        testMethodReport.setRunAsClient(event.getTestMethod().isAnnotationPresent(RunAsClient.class));

        reporter.get().getLastTestClassReport().getTestMethodReports().add(testMethodReport);
        reporter.get().setTestMethodReport(testMethodReport);
    }
View Full Code Here

        reporter.get().getLastTestClassReport().getTestMethodReports().add(testMethodReport);
        reporter.get().setTestMethodReport(testMethodReport);
    }

    public void observeAfterTest(@Observes(precedence = Integer.MIN_VALUE) After event, TestResult result) {
        TestMethodReport testMethodReport = reporter.get().getLastTestMethodReport();

        testMethodReport.setStatus(result.getStatus());
        testMethodReport.setDuration(result.getEnd() - result.getStart());
        testMethodReport.setReportMessage(ReportMessageParser.parseTestReportMessage(event.getTestMethod()));

        if (result.getStatus() == Status.FAILED && result.getThrowable() != null) {
            testMethodReport.setException(getStackTrace(result.getThrowable()));
        }

        inTestResourceReportEvent.fire(new InTestResourceReport());

        reporter.get().setReporterCursor(new ReporterCursor(reporter.get().getLastTestClassReport()));
View Full Code Here

TOP

Related Classes of org.arquillian.recorder.reporter.model.TestMethodReport

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.