Skip to content

Commit

Permalink
reimplemented the structure and changed abstraction node -> section; …
Browse files Browse the repository at this point in the history
…section -> report;
  • Loading branch information
MatousJobanek committed Jan 19, 2017
1 parent 40607cc commit 18cae4d
Show file tree
Hide file tree
Showing 66 changed files with 1,507 additions and 1,086 deletions.
14 changes: 7 additions & 7 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.

Thus, it is not the intent of this section to claim rights or contest
Thus, it is not the intent of this report to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
Expand Down Expand Up @@ -207,14 +207,14 @@ all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.

If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
If any portion of this report is held invalid or unenforceable under
any particular circumstance, the balance of the report is intended to
apply and the report as a whole is intended to apply in other
circumstances.

It is not the purpose of this section to induce you to infringe any
It is not the purpose of this report to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
such claims; this report has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
Expand All @@ -223,7 +223,7 @@ system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.

This section is intended to make thoroughly clear what is believed to
This report is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.

8. If the distribution and/or use of the Program is restricted in
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package org.arquillian.core.reporter.event;

import org.arquillian.reporter.api.event.SectionEvent;
import org.arquillian.reporter.api.model.report.Report;

/**
* @author <a href="mailto:[email protected]">Matous Jobanek</a>
*/
public class TestSuiteConfigurationContainerDeploymentSection extends
SectionEvent<TestSuiteConfigurationContainerDeploymentSection, Report, TestSuiteConfigurationContainerSection> {

private String containerId;
private String testSuiteId;


public TestSuiteConfigurationContainerDeploymentSection(String deploymentId, String containerId) {
super(deploymentId);
this.containerId = containerId;
}

public TestSuiteConfigurationContainerDeploymentSection(String deploymentId, String containerId, String testSuiteId) {
super(deploymentId);
this.containerId = containerId;
this.testSuiteId = testSuiteId;
}

public TestSuiteConfigurationContainerDeploymentSection(Report sectionReport, String deploymentId,
String containerId) {
super(sectionReport, deploymentId);
this.containerId = containerId;
}

@Override
public TestSuiteConfigurationContainerSection getParentSectionThisSectionBelongsTo() {
return new TestSuiteConfigurationContainerSection(containerId, testSuiteId);
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package org.arquillian.core.reporter.event;

import org.arquillian.reporter.api.event.SectionEvent;
import org.arquillian.reporter.api.event.TestSuiteConfigurationSection;
import org.arquillian.reporter.api.model.report.Report;

/**
* @author <a href="mailto:[email protected]">Matous Jobanek</a>
*/
public class TestSuiteConfigurationContainerSection extends SectionEvent<TestSuiteConfigurationContainerSection, Report, TestSuiteConfigurationSection> {

private String testSuiteId;

public TestSuiteConfigurationContainerSection(String containerId, String testSuiteId) {
super(containerId);
this.testSuiteId = testSuiteId;
}

public TestSuiteConfigurationContainerSection(Report sectionReport, String containerId, String testSuiteId) {
super(sectionReport, containerId);
this.testSuiteId = testSuiteId;
}

@Override
public TestSuiteConfigurationSection getParentSectionThisSectionBelongsTo() {
return new TestSuiteConfigurationSection(testSuiteId);
}

// todo support multiple test suites
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
import java.lang.reflect.Method;
import java.util.Map;

import org.arquillian.core.reporter.event.TestSuiteConfigurationContainerDeploymentNode;
import org.arquillian.core.reporter.event.TestSuiteConfigurationContainerNode;
import org.arquillian.core.reporter.event.TestSuiteConfigurationContainerDeploymentSection;
import org.arquillian.core.reporter.event.TestSuiteConfigurationContainerSection;
import org.arquillian.reporter.api.builder.Reporter;
import org.arquillian.reporter.api.event.ReportNodeEvent;
import org.arquillian.reporter.api.event.TestClassNode;
import org.arquillian.reporter.api.event.TestMethodNode;
import org.arquillian.reporter.api.event.TestSuiteConfigurationNode;
import org.arquillian.reporter.api.event.TestSuiteNode;
import org.arquillian.reporter.api.event.SectionEvent;
import org.arquillian.reporter.api.event.TestClassSection;
import org.arquillian.reporter.api.event.TestMethodSection;
import org.arquillian.reporter.api.event.TestSuiteConfigurationSection;
import org.arquillian.reporter.api.event.TestSuiteSection;
import org.arquillian.reporter.api.model.report.ConfigurationReport;
import org.arquillian.reporter.api.model.report.TestClassReport;
import org.arquillian.reporter.api.model.report.TestMethodReport;
import org.arquillian.reporter.api.model.report.TestSuiteReport;
Expand Down Expand Up @@ -40,49 +41,49 @@ public class ArquillianCoreReporterLifecycleManager {
private static String TEST_SUITE_NAME = "Arquillian Test Suite";

@Inject
private Event<ReportNodeEvent> reportEvent;
private Event<SectionEvent> reportEvent;

@Inject
private Event<TestSuiteConfigurationNode> config;
private Event<TestSuiteConfigurationSection> config;

public void startTestSuite(@Observes(precedence = Integer.MAX_VALUE) BeforeSuite managerProcessing) {
Reporter
.section(new TestSuiteReport(TEST_SUITE_NAME))
.attachToNode(new TestSuiteNode(TEST_SUITE_NAME))
.report(reportEvent);
.createReport(new TestSuiteReport(TEST_SUITE_NAME))
.inSection(new TestSuiteSection(TEST_SUITE_NAME))
.fire(reportEvent);
}

public void reportContainer(@Observes Container event) {
Map<String, String> containerProperties = event.getContainerConfiguration().getContainerProperties();

TestSuiteConfigurationNode containers = (TestSuiteConfigurationNode) Reporter
.section("Containers")
.attachToNode(new TestSuiteConfigurationNode(TEST_SUITE_NAME))
.report(config);
Reporter
.createReport(new ConfigurationReport("Containers"))
.inSection(new TestSuiteConfigurationSection(TEST_SUITE_NAME))
.fire(config);

String containerId = event.getContainerConfiguration().isDefault() ? "_DEFAULT_" : event.getName();

Reporter.section("Container")
Reporter.createReport("Container")
.addKeyValueEntry("Container name", event.getName())
.addSection(
Reporter.section("Configuration")
.addReport(
Reporter.createReport("Configuration")
.feedKeyValueListFromMap(containerProperties))
.attachToNode(new TestSuiteConfigurationContainerNode(containerId).setParentEvent(containers))
.report(reportEvent);
.inSection(new TestSuiteConfigurationContainerSection(containerId, TEST_SUITE_NAME))
.fire(reportEvent);
}

public void reportDeployment(@Observes BeforeDeploy event) {
DeploymentDescription description = event.getDeployment();
String targetContainer = description.getTarget().getName();

Reporter
.section("Deployment")
.createReport("Deployment")
.addKeyValueEntry("Deployment name", description.getName())
.addKeyValueEntry("Archive name", description.getArchive().getName())
.addKeyValueEntry("Order", description.getOrder())
.addKeyValueEntry("Protocol", description.getProtocol().getName())
.attachToNode(new TestSuiteConfigurationContainerDeploymentNode(description.getName(), targetContainer))
.report(reportEvent);
.inSection(new TestSuiteConfigurationContainerDeploymentSection(description.getName(), targetContainer))
.fire(reportEvent);
}

public void startTestClass(@Observes(precedence = Integer.MAX_VALUE) BeforeClass event) {
Expand All @@ -91,16 +92,16 @@ public void startTestClass(@Observes(precedence = Integer.MAX_VALUE) BeforeClass

TestClassReport testClassReport = new TestClassReport(testClass.getName());
Reporter
.section(testClassReport.getConfiguration())
.createReport(new ConfigurationReport("Test class config"))
.addKeyValueEntry("Runs as client", runAsClient);

String reportMessage = ReportMessageParser.parseTestClassReportMessage(event.getTestClass().getJavaClass());
Reporter
.section(testClassReport)
.createReport(testClassReport)
.addKeyValueEntry("Report message", reportMessage)

.attachToNode(new TestClassNode(testClass.getJavaClass(), "TEST_SUITE_NAME"))
.report(reportEvent);
.inSection(new TestClassSection(testClass.getJavaClass(), "TEST_SUITE_NAME"))
.fire(reportEvent);
}

public void startTestMethod(@Observes(precedence = Integer.MAX_VALUE) Before event) {
Expand All @@ -113,11 +114,11 @@ public void startTestMethod(@Observes(precedence = Integer.MAX_VALUE) Before eve
}

Reporter
.section(new TestMethodReport(testMethod.getName()))
.createReport(new TestMethodReport(testMethod.getName()))
.addKeyValueEntry("Operates on deployment", deploymentName)
.addKeyValueEntry("Runs as client", runAsClient)
.attachToNode(new TestMethodNode(testMethod))
.report(reportEvent);
.inSection(new TestMethodSection(testMethod))
.fire(reportEvent);
}

public void stopTestMethod(@Observes(precedence = Integer.MIN_VALUE) After event, TestResult result) {
Expand All @@ -126,46 +127,46 @@ public void stopTestMethod(@Observes(precedence = Integer.MIN_VALUE) After event
String reportMessage = ReportMessageParser.parseTestReportMessage(event.getTestMethod());

Reporter
.section(new TestMethodReport(testMethod.getName()))
.createReport(new TestMethodReport(testMethod.getName()))
.stop()
.setResult(result)
.addKeyValueEntry("Report message", reportMessage)
.attachToNode(new TestMethodNode(testMethod))
.report(reportEvent);
.inSection(new TestMethodSection(testMethod))
.fire(reportEvent);

// inTestResourceReportEvent.report(new InTestResourceReport());
// inTestResourceReportEvent.fire(new InTestResourceReport());
// reporter.get().setReporterCursor(new ReporterCursor(reporter.get().getLastTestClassReport()));
// report(event, descriptor.get());
// fire(event, descriptor.get());
}

public void stopTestClass(@Observes(precedence = Integer.MIN_VALUE) AfterClass event) {

Reporter
.section(new TestClassReport(event.getTestClass().getName()))
.createReport(new TestClassReport(event.getTestClass().getName()))
.stop()
.attachToNode(new TestClassNode(event.getTestClass().getJavaClass(), TEST_SUITE_NAME))
.report(reportEvent);
.inSection(new TestClassSection(event.getTestClass().getJavaClass(), TEST_SUITE_NAME))
.fire(reportEvent);

// reporter.get().setReporterCursor(new ReporterCursor(reporter.get().getLastTestSuiteReport()));
// report(event, descriptor.get());
// fire(event, descriptor.get());
}

public void stopTestSuite(@Observes(precedence = Integer.MIN_VALUE) AfterSuite event) {

Reporter
.section(new TestSuiteReport(TEST_SUITE_NAME))
.createReport(new TestSuiteReport(TEST_SUITE_NAME))
.stop()
.attachToNode(new TestSuiteNode(TEST_SUITE_NAME))
.report(reportEvent);
.inSection(new TestSuiteSection(TEST_SUITE_NAME))
.fire(reportEvent);

// exportReportEvent.report(new ExportReport(reporter.get().getReport()));
// exportReportEvent.fire(new ExportReport(reporter.get().getReport()));
}

// public void observeReportEvent(@Observes PropertyReportEvent event) {
// reporter.get().getReporterCursor().getCursor().getPropertyEntries().add(event.getPropertyEntry());
// }
//
// private void report(org.jboss.arquillian.core.spi.event.Event event, ArquillianDescriptor descriptor) {
// private void fire(org.jboss.arquillian.core.spi.event.Event event, ArquillianDescriptor descriptor) {
// if (shouldReport(event, configuration.get().getReportAfterEvery())) {
// List<ExtensionReport> extensionReports = reporter.get().getReport().getExtensionReports();
// if (extensionReports.isEmpty()) {
Expand All @@ -175,7 +176,7 @@ public void stopTestSuite(@Observes(precedence = Integer.MIN_VALUE) AfterSuite e
// reporter.get().getLastTestClassReport().setStop(new Date(System.currentTimeMillis()));
// reporter.get().getLastTestSuiteReport().setStop(new Date(System.currentTimeMillis()));
//
// exportReportEvent.report(new ExportReport(reporter.get().getReport()));
// exportReportEvent.fire(new ExportReport(reporter.get().getReport()));
// }
// }
//
Expand All @@ -193,7 +194,7 @@ public void stopTestSuite(@Observes(precedence = Integer.MIN_VALUE) AfterSuite e
// for (ExtensionDef extensionDef : descriptor.getExtensions()) {
// ExtensionReport extensionReport = new ExtensionReport();
// extensionReport.setQualifier(extensionDef.getExtensionName());
// extensionReport.setConfiguration(extensionDef.getExtensionProperties());
// extensionReport.setConfigurations(extensionDef.getExtensionProperties());
// extensionReports.add(extensionReport);
// }
// return extensionReports;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.lang.annotation.Target;

/**
* When this is put on a test method and enter some message, that message will be written into target report so you can comment
* When this is put on a test method and enter some message, that message will be written into target fire so you can comment
* your test in any way.
*
* https://issues.jboss.org/browse/ARQ-1703
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
</container>

<!--<container qualifier="second_chameleon" >
<configuration>
<configurations>
<property name="chameleonTarget">WildFly:8.0.0.Final:managed</property>
&lt;!&ndash;<property name="modulePath">target/server/wildfly-dist_10.1.0.Final/wildfly-10.1.0.Final/modules/</property>&ndash;&gt;
</configuration>
</configurations>
</container>-->


Expand Down
Loading

0 comments on commit 18cae4d

Please sign in to comment.