[cleanup] renamed TestEvent into TestEventProcessor

GitOrigin-RevId: c66c50a9204854c7e8adb3771631daa40c18e2fd
This commit is contained in:
Sergei Vorobyov
2023-03-10 15:45:53 +00:00
committed by intellij-monorepo-bot
parent 5896bda00e
commit 4c59c49eba
11 changed files with 39 additions and 35 deletions
@@ -16,30 +16,30 @@ public final class GradleTestEventsProcessor {
return;
}
TestEvent testEvent = null;
TestEventProcessor testEventProcessor = null;
switch (eventType) {
case BEFORE_SUITE:
testEvent = new BeforeSuiteEvent(console);
testEventProcessor = new BeforeSuiteEventProcessor(console);
break;
case BEFORE_TEST:
testEvent = new BeforeTestEvent(console);
testEventProcessor = new BeforeTestEventProcessor(console);
break;
case ON_OUTPUT:
testEvent = new OnOutputEvent(console);
testEventProcessor = new OnOutputEventProcessor(console);
break;
case AFTER_TEST:
testEvent = new AfterTestEvent(console);
testEventProcessor = new AfterTestEventProcessor(console);
break;
case AFTER_SUITE:
testEvent = new AfterSuiteEvent(console);
testEventProcessor = new AfterSuiteEventProcessor(console);
break;
case CONFIGURATION_ERROR:
case REPORT_LOCATION:
case UNKNOWN_EVENT:
break;
}
if (testEvent != null) {
testEvent.process(event);
if (testEventProcessor != null) {
testEventProcessor.process(event);
}
}
@@ -31,34 +31,34 @@ public final class GradleTestsExecutionConsoleOutputProcessor {
final TestEventXmlView xml = new TestEventXPPXmlView(eventMessage);
final TestEventType eventType = TestEventType.fromValue(xml.getTestEventType());
TestEvent testEvent = null;
TestEventProcessor testEventProcessor = null;
switch (eventType) {
case CONFIGURATION_ERROR:
testEvent = new ConfigurationErrorEvent(executionConsole);
testEventProcessor = new ConfigurationErrorEventProcessor(executionConsole);
break;
case REPORT_LOCATION:
testEvent = new ReportLocationEvent(executionConsole);
testEventProcessor = new ReportLocationEventProcessor(executionConsole);
break;
case BEFORE_TEST:
testEvent = new BeforeTestEvent(executionConsole);
testEventProcessor = new BeforeTestEventProcessor(executionConsole);
break;
case ON_OUTPUT:
testEvent = new OnOutputEvent(executionConsole);
testEventProcessor = new OnOutputEventProcessor(executionConsole);
break;
case AFTER_TEST:
testEvent = new AfterTestEvent(executionConsole);
testEventProcessor = new AfterTestEventProcessor(executionConsole);
break;
case BEFORE_SUITE:
testEvent = new BeforeSuiteEvent(executionConsole);
testEventProcessor = new BeforeSuiteEventProcessor(executionConsole);
break;
case AFTER_SUITE:
testEvent = new AfterSuiteEvent(executionConsole);
testEventProcessor = new AfterSuiteEventProcessor(executionConsole);
break;
case UNKNOWN_EVENT:
break;
}
if (testEvent != null) {
testEvent.process(xml);
if (testEventProcessor != null) {
testEventProcessor.process(xml);
}
}
catch (TestEventXmlView.XmlParserException e) {
@@ -19,10 +19,11 @@ import static org.jetbrains.plugins.gradle.execution.test.runner.GradleTestLocat
/**
* @author Vladislav.Soroka
*/
public abstract class AbstractTestEvent implements TestEvent {
public abstract class AbstractTestEventProcessor implements TestEventProcessor {
private final GradleTestsExecutionConsole myExecutionConsole;
public AbstractTestEvent(GradleTestsExecutionConsole executionConsole) {
public AbstractTestEventProcessor(GradleTestsExecutionConsole executionConsole) {
this.myExecutionConsole = executionConsole;
}
@@ -28,8 +28,9 @@ import org.jetbrains.plugins.gradle.execution.test.runner.GradleTestsExecutionCo
/**
* @author Vladislav.Soroka
*/
public class AfterSuiteEvent extends AbstractTestEvent {
public AfterSuiteEvent(GradleTestsExecutionConsole executionConsole) {
public class AfterSuiteEventProcessor extends AbstractTestEventProcessor {
public AfterSuiteEventProcessor(GradleTestsExecutionConsole executionConsole) {
super(executionConsole);
}
@@ -30,8 +30,9 @@ import static org.jetbrains.plugins.gradle.execution.GradleRunnerUtil.parseCompa
/**
* @author Vladislav.Soroka
*/
public class AfterTestEvent extends AbstractTestEvent {
public AfterTestEvent(GradleTestsExecutionConsole executionConsole) {
public class AfterTestEventProcessor extends AbstractTestEventProcessor {
public AfterTestEventProcessor(GradleTestsExecutionConsole executionConsole) {
super(executionConsole);
}
@@ -17,8 +17,8 @@ import java.util.Objects;
/**
* @author Vladislav.Soroka
*/
public class BeforeSuiteEvent extends AbstractTestEvent {
public BeforeSuiteEvent(GradleTestsExecutionConsole executionConsole) {
public class BeforeSuiteEventProcessor extends AbstractTestEventProcessor {
public BeforeSuiteEventProcessor(GradleTestsExecutionConsole executionConsole) {
super(executionConsole);
}
@@ -16,9 +16,9 @@ import java.util.List;
/**
* @author Vladislav.Soroka
*/
public class BeforeTestEvent extends AbstractTestEvent {
public class BeforeTestEventProcessor extends AbstractTestEventProcessor {
public BeforeTestEvent(GradleTestsExecutionConsole executionConsole) {
public BeforeTestEventProcessor(GradleTestsExecutionConsole executionConsole) {
super(executionConsole);
}
@@ -29,9 +29,9 @@ import javax.swing.event.HyperlinkEvent;
/**
* @author Vladislav.Soroka
*/
public class ConfigurationErrorEvent extends AbstractTestEvent {
public class ConfigurationErrorEventProcessor extends AbstractTestEventProcessor {
public ConfigurationErrorEvent(GradleTestsExecutionConsole executionConsole) {
public ConfigurationErrorEventProcessor(GradleTestsExecutionConsole executionConsole) {
super(executionConsole);
}
@@ -14,12 +14,12 @@ import org.jetbrains.plugins.gradle.execution.test.runner.GradleTestsExecutionCo
/**
* @author Vladislav.Soroka
*/
public class OnOutputEvent extends AbstractTestEvent {
public class OnOutputEventProcessor extends AbstractTestEventProcessor {
private static final String OUT = "StdOut";
private static final String ERR = "StdErr";
public OnOutputEvent(GradleTestsExecutionConsole executionConsole) {
public OnOutputEventProcessor(GradleTestsExecutionConsole executionConsole) {
super(executionConsole);
}
@@ -25,9 +25,9 @@ import java.io.File;
/**
* @author Vladislav.Soroka
*/
public class ReportLocationEvent extends AbstractTestEvent {
public class ReportLocationEventProcessor extends AbstractTestEventProcessor {
public ReportLocationEvent(GradleTestsExecutionConsole consoleManager) {
public ReportLocationEventProcessor(GradleTestsExecutionConsole consoleManager) {
super(consoleManager);
}
@@ -22,7 +22,8 @@ import org.jetbrains.annotations.NotNull;
/**
* @author Vladislav.Soroka
*/
public interface TestEvent {
public interface TestEventProcessor {
void process(@NotNull final TestEventXmlView eventXml) throws TestEventXmlView.XmlParserException;
void process(@NotNull final ExternalSystemProgressEvent<? extends TestOperationDescriptor> testEvent);