From 3c77564c02299f19255e05566eb0110086b36de9 Mon Sep 17 00:00:00 2001 From: Nelson Tavares de Sousa <stu103017@mail.uni-kiel.de> Date: Thu, 14 Jan 2016 13:03:50 +0100 Subject: [PATCH] compliance check is run by the ValidatingSignal now --- .../java/teetime/framework/AbstractStage.java | 24 +------------------ .../teetime/framework/AbstractStageTest.java | 2 +- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/src/main/java/teetime/framework/AbstractStage.java b/src/main/java/teetime/framework/AbstractStage.java index 35060756..1b3e0c9b 100644 --- a/src/main/java/teetime/framework/AbstractStage.java +++ b/src/main/java/teetime/framework/AbstractStage.java @@ -29,7 +29,6 @@ import org.slf4j.LoggerFactory; import teetime.framework.exceptionHandling.AbstractExceptionListener; import teetime.framework.exceptionHandling.AbstractExceptionListener.FurtherExecution; import teetime.framework.exceptionHandling.TerminateException; -import teetime.framework.pipe.IPipe; import teetime.framework.signal.ISignal; import teetime.framework.signal.StartingSignal; import teetime.framework.signal.TerminatingSignal; @@ -279,7 +278,7 @@ public abstract class AbstractStage { } public void onValidating(final List<InvalidPortConnection> invalidPortConnections) { - this.validateOutputPorts(invalidPortConnections); + this.checkTypeCompliance(); changeState(StageState.VALIDATED); } @@ -292,7 +291,6 @@ public abstract class AbstractStage { */ @SuppressWarnings("PMD.SignatureDeclareThrowsException") public void onStarting() throws Exception { - checkTypeCompliance(); if (logger.isDebugEnabled()) { logger.debug("Stage {} within thread {}", getId(), getOwningThread().getId()); } @@ -446,26 +444,6 @@ public abstract class AbstractStage { return outputPort; } - /** - * This should check, if the OutputPorts are connected correctly. This is needed to avoid NullPointerExceptions and other errors. - * - * @param invalidPortConnections - * <i>(Passed as parameter for performance reasons)</i> - */ - @SuppressWarnings("PMD.DataflowAnomalyAnalysis") - public void validateOutputPorts(final List<InvalidPortConnection> invalidPortConnections) { - for (OutputPort<?> outputPort : outputPorts.getOpenedPorts()) { - final IPipe<?> pipe = outputPort.getPipe(); - - final Class<?> sourcePortType = outputPort.getType(); - final Class<?> targetPortType = pipe.getTargetPort().getType(); - if (null == sourcePortType || !sourcePortType.equals(targetPortType)) { - final InvalidPortConnection invalidPortConnection = new InvalidPortConnection(outputPort, pipe.getTargetPort()); - invalidPortConnections.add(invalidPortConnection); - } - } - } - protected void terminate() { changeState(StageState.TERMINATING); } diff --git a/src/test/java/teetime/framework/AbstractStageTest.java b/src/test/java/teetime/framework/AbstractStageTest.java index 8ab3a41d..baaed72d 100644 --- a/src/test/java/teetime/framework/AbstractStageTest.java +++ b/src/test/java/teetime/framework/AbstractStageTest.java @@ -95,7 +95,7 @@ public class AbstractStageTest { @Test public void testCheckTypeCompliance() throws Exception { - new Execution<Configuration>(new TestConnectionsConfig(false)); + new Execution<Configuration>(new TestConnectionsConfig(false), true); } private class TestConnectionsConfig extends Configuration { -- GitLab