Package org.arquillian.recorder.reporter

Examples of org.arquillian.recorder.reporter.ReporterConfiguration


public class AsciiDocReporterTestCase {

    @Test
    public void shouldExportReportOnAsciiDocCompliantFormatIfConfigured() throws Exception {
       
        ReporterConfiguration configuration = new ReporterConfiguration();
        Map<String, String> configMap = new HashMap<String, String>();
        configMap.put("report", "asciidoc");
        configMap.put("file", "report");
        configMap.put("asciidocStandardCompliant", "true");
        configuration.setConfiguration(configMap);
        configuration.validate();

        Reporter reporter = new ReporterImpl();
        reporter.setConfiguration(configuration);

        KeyValueEntry kve3 = new KeyValueEntry();
        kve3.setKey("key3");
        kve3.setValue("value3");

        reporter.getReporterCursor().getCursor().getPropertyEntries().add(kve3);

        TestSuiteReport testSuiteReport = new TestSuiteReport();
        reporter.getReport().getTestSuiteReports().add(testSuiteReport);
        reporter.setTestSuiteReport(testSuiteReport);

        KeyValueEntry kve = new KeyValueEntry();
        kve.setKey("key");
        kve.setValue("value");

        KeyValueEntry kve2 = new KeyValueEntry();
        kve2.setKey("key2");
        kve2.setValue("value2");

        FileEntry fe = new FileEntry();
        fe.setPath("somePath");
        fe.setSize("100MB");

        reporter.getReporterCursor().getCursor().getPropertyEntries().add(kve);
        reporter.getReporterCursor().getCursor().getPropertyEntries().add(kve2);
        reporter.getReporterCursor().getCursor().getPropertyEntries().add(fe);

        // containers
        ContainerReport containerReport = new ContainerReport();
        containerReport.setQualifier("wildfly");
        containerReport.setConfiguration(new HashMap<String, String>());
        reporter.getLastTestSuiteReport().getContainerReports().add(containerReport);
        reporter.setContainerReport(containerReport);

        // deployment
        DeploymentReport deploymentReport = new DeploymentReport();

        deploymentReport.setArchiveName("some.war");
        deploymentReport.setName("deploymentName");
        deploymentReport.setOrder(1);
        deploymentReport.setProtocol("someProtocol");
        deploymentReport.setTarget("wildfly");

        reporter.getLastContainerReport().getDeploymentReports().add(deploymentReport);

        TestClassReport testClassReport = new TestClassReport();
        testClassReport.setTestClassName(FakeTestClass.class.getName());
        reporter.getLastTestSuiteReport().getTestClassReports().add(testClassReport);
        reporter.setTestClassReport(testClassReport);

        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();
        sce.setPath(configuration.getRootDir().getAbsolutePath() + "/niceScreenshot.jpg");
        sce.setSize("56kB");
        sce.setPhase(When.BEFORE);
        sce.setWidth(300);
        sce.setHeight(500);

        ScreenshotEntry sce2 = new ScreenshotEntry();
        sce2.setPath(configuration.getRootDir().getAbsolutePath() + "/niceScreenshotBefore.jpg");
        sce2.setPhase(When.BEFORE);
        sce2.setWidth(300);
        sce2.setHeight(500);

        reporter.getLastTestMethodReport().getPropertyEntries().add(sce);
View Full Code Here


    }
   
    @Test
    public void shouldExportReportInAsciiDocFormat() throws Exception {

        ReporterConfiguration configuration = new ReporterConfiguration();
        Map<String, String> configMap = new HashMap<String, String>();
        configMap.put("report", "asciidoc");
        configMap.put("file", "report");
        configuration.setConfiguration(configMap);
        configuration.validate();

        Reporter reporter = new ReporterImpl();
        reporter.setConfiguration(configuration);

        KeyValueEntry kve3 = new KeyValueEntry();
        kve3.setKey("key3");
        kve3.setValue("value3");

        reporter.getReporterCursor().getCursor().getPropertyEntries().add(kve3);

        TestSuiteReport testSuiteReport = new TestSuiteReport();
        reporter.getReport().getTestSuiteReports().add(testSuiteReport);
        reporter.setTestSuiteReport(testSuiteReport);

        KeyValueEntry kve = new KeyValueEntry();
        kve.setKey("key");
        kve.setValue("value");

        KeyValueEntry kve2 = new KeyValueEntry();
        kve2.setKey("key2");
        kve2.setValue("value2");

        FileEntry fe = new FileEntry();
        fe.setPath("somePath");
        fe.setSize("100MB");

        reporter.getReporterCursor().getCursor().getPropertyEntries().add(kve);
        reporter.getReporterCursor().getCursor().getPropertyEntries().add(kve2);
        reporter.getReporterCursor().getCursor().getPropertyEntries().add(fe);

        // containers
        ContainerReport containerReport = new ContainerReport();
        containerReport.setQualifier("wildfly");
        containerReport.setConfiguration(new HashMap<String, String>());
        reporter.getLastTestSuiteReport().getContainerReports().add(containerReport);
        reporter.setContainerReport(containerReport);

        // deployment
        DeploymentReport deploymentReport = new DeploymentReport();

        deploymentReport.setArchiveName("some.war");
        deploymentReport.setName("deploymentName");
        deploymentReport.setOrder(1);
        deploymentReport.setProtocol("someProtocol");
        deploymentReport.setTarget("wildfly");

        reporter.getLastContainerReport().getDeploymentReports().add(deploymentReport);

        TestClassReport testClassReport = new TestClassReport();
        testClassReport.setTestClassName(FakeTestClass.class.getName());
        reporter.getLastTestSuiteReport().getTestClassReports().add(testClassReport);
        reporter.setTestClassReport(testClassReport);

        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();
        sce.setPath(configuration.getRootDir().getAbsolutePath() + "/niceScreenshot.jpg");
        sce.setSize("56kB");
        sce.setPhase(When.BEFORE);
        sce.setWidth(300);
        sce.setHeight(500);

        ScreenshotEntry sce2 = new ScreenshotEntry();
        sce2.setPath(configuration.getRootDir().getAbsolutePath() + "/niceScreenshotBefore.jpg");
        sce2.setPhase(When.BEFORE);
        sce2.setWidth(300);
        sce2.setHeight(500);

        reporter.getLastTestMethodReport().getPropertyEntries().add(sce);
View Full Code Here

@RunWith(JUnit4.class)
public class ReporterTestCase {

    @Test
    public void configurationTest() {
        ReporterConfiguration configuration = new ReporterConfiguration();

        Map<String, String> configMap = new HashMap<String, String>();
        configMap.put("report", "xml");
        configMap.put("file", "report");
        configuration.setConfiguration(configMap);

        configuration.validate();
        System.out.println(configuration.toString());
    }
View Full Code Here

        System.out.println(configuration.toString());
    }

    @Test
    public void testReporter() throws Exception {
        ReporterConfiguration configuration = new ReporterConfiguration();
        Map<String, String> configMap = new HashMap<String, String>();
        configMap.put("report", "xml");
        configMap.put("file", "report");
        configuration.setConfiguration(configMap);
        configuration.validate();

        Reporter reporter = new ReporterImpl();
        reporter.setConfiguration(configuration);

        KeyValueEntry kve3 = new KeyValueEntry();
View Full Code Here

@RunWith(JUnit4.class)
public class ReporterTestCase {

    @Test
    public void configurationTest() {
        ReporterConfiguration configuration = new ReporterConfiguration();

        Map<String, String> configMap = new HashMap<String, String>();
        configMap.put("report", "xml");
        configMap.put("file", "report");
        configuration.setConfiguration(configMap);

        configuration.validate();
        System.out.println(configuration.toString());
    }
View Full Code Here

        System.out.println(configuration.toString());
    }

    @Test
    public void testReporter() throws Exception {
        ReporterConfiguration configuration = new ReporterConfiguration();
        Map<String, String> configMap = new HashMap<String, String>();
        configMap.put("report", "xml");
        configMap.put("file", "report");
        configuration.setConfiguration(configMap);
        configuration.validate();

        Reporter reporter = new ReporterImpl();
        reporter.setConfiguration(configuration);

        KeyValueEntry kve3 = new KeyValueEntry();
View Full Code Here

public class AsciiDocReporterTestCase {

    @Test
    public void shouldExportReportInAsciiDocFormat() throws Exception {

        ReporterConfiguration configuration = new ReporterConfiguration();
        Map<String, String> configMap = new HashMap<String, String>();
        configMap.put("report", "asciidoc");
        configMap.put("file", "report");
        configuration.setConfiguration(configMap);
        configuration.validate();

        Reporter reporter = new ReporterImpl();
        reporter.setConfiguration(configuration);

        KeyValueEntry kve3 = new KeyValueEntry();
        kve3.setKey("key3");
        kve3.setValue("value3");

        reporter.getReporterCursor().getCursor().getPropertyEntries().add(kve3);

        TestSuiteReport testSuiteReport = new TestSuiteReport();
        reporter.getReport().getTestSuiteReports().add(testSuiteReport);
        reporter.setTestSuiteReport(testSuiteReport);

        KeyValueEntry kve = new KeyValueEntry();
        kve.setKey("key");
        kve.setValue("value");

        KeyValueEntry kve2 = new KeyValueEntry();
        kve2.setKey("key2");
        kve2.setValue("value2");

        FileEntry fe = new FileEntry();
        fe.setPath("somePath");
        fe.setSize("100MB");

        reporter.getReporterCursor().getCursor().getPropertyEntries().add(kve);
        reporter.getReporterCursor().getCursor().getPropertyEntries().add(kve2);
        reporter.getReporterCursor().getCursor().getPropertyEntries().add(fe);

        // containers
        ContainerReport containerReport = new ContainerReport();
        containerReport.setQualifier("wildfly");
        containerReport.setConfiguration(new HashMap<String, String>());
        reporter.getLastTestSuiteReport().getContainerReports().add(containerReport);
        reporter.setContainerReport(containerReport);

        // deployment
        DeploymentReport deploymentReport = new DeploymentReport();

        deploymentReport.setArchiveName("some.war");
        deploymentReport.setName("deploymentName");
        deploymentReport.setOrder(1);
        deploymentReport.setProtocol("someProtocol");
        deploymentReport.setTarget("wildfly");

        reporter.getLastContainerReport().getDeploymentReports().add(deploymentReport);

        TestClassReport testClassReport = new TestClassReport();
        testClassReport.setTestClassName(FakeTestClass.class.getName());
        reporter.getLastTestSuiteReport().getTestClassReports().add(testClassReport);
        reporter.setTestClassReport(testClassReport);

        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();
        sce.setPath(configuration.getRootDir().getAbsolutePath() + "/niceScreenshot.jpg");
        sce.setSize("56kB");
        sce.setPhase(When.BEFORE);

        ScreenshotEntry sce2 = new ScreenshotEntry();
        sce2.setPath(configuration.getRootDir().getAbsolutePath() + "/niceScreenshotBefore.jpg");
        sce2.setPhase(When.BEFORE);

        reporter.getReporterCursor().getCursor().getPropertyEntries().add(sce);
        reporter.getReporterCursor().getCursor().getPropertyEntries().add(sce2);
View Full Code Here

    @Inject
    private Event<ReportingExtensionConfigured> extensionConfigured;

    public void configureExtension(@Observes ArquillianDescriptor descriptor) {

        ReporterConfiguration configuration = new ReporterConfiguration();

        for (ExtensionDef extension : descriptor.getExtensions()) {
            if (extension.getExtensionName().equals(EXTENSION_NAME)) {
                configuration.setConfiguration(extension.getExtensionProperties());
                configuration.validate();
                break;
            }
        }

        this.configuration.set(configuration);
View Full Code Here

TOP

Related Classes of org.arquillian.recorder.reporter.ReporterConfiguration

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.