Skip to content
Snippets Groups Projects
Commit d385091c authored by Nelson Tavares de Sousa's avatar Nelson Tavares de Sousa
Browse files

minor changes

parent cdc72e42
No related branches found
No related tags found
No related merge requests found
......@@ -310,7 +310,7 @@ public abstract class AbstractStage {
Class<?> targetType = port.getType();
Class<?> sourceType = port.pipe.getSourcePort().getType();
if (targetType != null && sourceType != null) {
if (!targetType.isAssignableFrom(sourceType)) { // TODO: Is this correct? // kinda instanceof, but for Class class
if (!targetType.isAssignableFrom(sourceType)) { // if targetType is not superclass of sourceType
invalidPortConnections.add(new InvalidPortConnection(port.pipe.getSourcePort(), port));
// throw new IllegalStateException("2002 - Invalid pipe at " + port.toString() + ": " + targetType + " is not a superclass/type of " +
// sourceType);
......
......@@ -103,15 +103,18 @@ public class AbstractStageTest {
@Test(expected = AnalysisNotValidException.class)
public void testCheckTypeCompliance() throws Exception {
try {
// Correct connection
new Execution<Configuration>(new TestConnectionsConfig(false), true).executeBlocking();
} catch (AnalysisNotValidException e) {
fail();
}
// Incorrect connection should fail!
new Execution<Configuration>(new TestConnectionsConfig(true), true).executeBlocking();
}
private class TestConnectionsConfig extends Configuration {
@SuppressWarnings({ "unchecked", "rawtypes" })
TestConnectionsConfig(final boolean fails) {
EmptyStage stage = new EmptyStage();
if (fails) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment