use of org.talend.core.model.process.INodeConnector in project tdi-studio-se by Talend.
the class ConnectionCreateCommandTest method redoSimpleInputToSimpleOutput2.
/**
* DOC nrousseau Comment method "redoSimpleInputToSimpleOutput1".
*/
private void redoSimpleInputToSimpleOutput2() {
ConnectionCreateCommand ccc = undoSimpleInputToSimpleOutput2();
ccc.redo();
//$NON-NLS-1$
INodeConnector inputConnector = ccc.source.getConnectorFromName("FLOW");
//$NON-NLS-1$
INodeConnector outputConnector = ccc.target.getConnectorFromName("FLOW");
assertEquals(inputConnector.getCurLinkNbOutput(), 1);
assertEquals(outputConnector.getCurLinkNbInput(), 1);
}
use of org.talend.core.model.process.INodeConnector in project tdi-studio-se by Talend.
the class ConnectionCreateCommandTest method undoSimpleInputToSimpleOutput3.
/**
* DOC nrousseau Comment method "undoSimpleInputToSimpleOutput1".
*/
private ConnectionCreateCommand undoSimpleInputToSimpleOutput3() {
ConnectionCreateCommand ccc = executeSimpleInputToSimpleOutput3();
ccc.undo();
assertEquals(ccc.source.getOutgoingConnections().size(), 0);
assertEquals(ccc.target.getOutgoingConnections().size(), 0);
//$NON-NLS-1$
INodeConnector inputConnector = ccc.source.getConnectorFromName("FLOW");
//$NON-NLS-1$
INodeConnector outputConnector = ccc.target.getConnectorFromName("FLOW");
assertEquals(inputConnector.getCurLinkNbOutput(), 0);
assertEquals(outputConnector.getCurLinkNbInput(), 0);
return ccc;
}
use of org.talend.core.model.process.INodeConnector in project tdi-studio-se by Talend.
the class ConnectionCreateCommandTest method undoSimpleInputToSimpleOutput2.
/**
* DOC nrousseau Comment method "undoSimpleInputToSimpleOutput1".
*/
private ConnectionCreateCommand undoSimpleInputToSimpleOutput2() {
ConnectionCreateCommand ccc = executeSimpleInputToSimpleOutput2();
ccc.undo();
assertEquals(ccc.source.getOutgoingConnections().size(), 0);
assertEquals(ccc.target.getOutgoingConnections().size(), 0);
//$NON-NLS-1$
INodeConnector inputConnector = ccc.source.getConnectorFromName("FLOW");
//$NON-NLS-1$
INodeConnector outputConnector = ccc.target.getConnectorFromName("FLOW");
assertEquals(inputConnector.getCurLinkNbOutput(), 0);
assertEquals(outputConnector.getCurLinkNbInput(), 0);
return ccc;
}
use of org.talend.core.model.process.INodeConnector in project tdi-studio-se by Talend.
the class ConnectionCreateCommandTest method executeSimpleInputToSimpleOutput3.
/**
* simple input to simple output with no metadata and without schema auto propagate.
*/
private ConnectionCreateCommand executeSimpleInputToSimpleOutput3() {
IProcess2 process = getFakeProcess();
Node simpleInputNode = NodeTestCreator.createSimpleInputNode(process);
// simple tests only since it's simply using the class ConnectionManager which already have JUnits.
List<Object> args = new ArrayList<Object>();
args.add(simpleInputNode.getUniqueName());
//$NON-NLS-1$
args.add("connectionName");
simpleInputNode.getMetadataList().clear();
IMetadataTable table = createSimpleMetadata1();
table.setTableName(simpleInputNode.getUniqueName());
table.setLabel(simpleInputNode.getUniqueName());
//$NON-NLS-1$
table.setAttachedConnector("FLOW");
simpleInputNode.getMetadataList().add(table);
// set null, the command should take the schema from the component directly
args.add(null);
//$NON-NLS-1$
ConnectionCreateCommand ccc = new ConnectionCreateCommand(simpleInputNode, "FLOW", args);
ConnectionCreateCommand.setCreatingConnection(true);
Node simpleOutputNode = NodeTestCreator.createSimpleOutputNodeNoPropagate(process);
ccc.setTarget(simpleOutputNode);
ccc.execute();
assertEquals(simpleInputNode.getOutgoingConnections().size(), 1);
assertEquals(simpleOutputNode.getIncomingConnections().size(), 1);
assertEquals(simpleOutputNode.getMetadataList().size(), 1);
IMetadataTable outputMetadata = simpleOutputNode.getMetadataList().get(0);
// no propagation
assertEquals(outputMetadata.getListColumns().size(), 0);
IConnection connection = simpleInputNode.getOutgoingConnections().get(0);
assertEquals(simpleOutputNode.getIncomingConnections().get(0), connection);
assertEquals(connection.getSource(), simpleInputNode);
assertEquals(connection.getTarget(), simpleOutputNode);
assertEquals(connection.getMetaName(), simpleInputNode.getUniqueName());
//$NON-NLS-1$
assertEquals(connection.getConnectorName(), "FLOW");
//$NON-NLS-1$
INodeConnector inputConnector = simpleInputNode.getConnectorFromName("FLOW");
//$NON-NLS-1$
INodeConnector outputConnector = simpleOutputNode.getConnectorFromName("FLOW");
assertEquals(inputConnector.getCurLinkNbOutput(), 1);
assertEquals(outputConnector.getCurLinkNbInput(), 1);
return ccc;
}
use of org.talend.core.model.process.INodeConnector in project tdi-studio-se by Talend.
the class ConnectionCreateCommandTest method redoSimpleInputToSimpleOutput1.
/**
* DOC nrousseau Comment method "redoSimpleInputToSimpleOutput1".
*/
private void redoSimpleInputToSimpleOutput1() {
ConnectionCreateCommand ccc = undoSimpleInputToSimpleOutput1();
ccc.redo();
//$NON-NLS-1$
INodeConnector inputConnector = ccc.source.getConnectorFromName("FLOW");
//$NON-NLS-1$
INodeConnector outputConnector = ccc.target.getConnectorFromName("FLOW");
assertEquals(inputConnector.getCurLinkNbOutput(), 1);
assertEquals(outputConnector.getCurLinkNbInput(), 1);
}
Aggregations