public void testNotInitialzedInputResultsInException() { Graph graph = new Graph("graph"); Node goodNode = new Node("Good", goodOpSpi.getOperatorAlias()); Node consumerNode = new Node("Consumer", consumerOpSpi.getOperatorAlias()); graph.addNode(goodNode); graph.addNode(consumerNode); try { new GraphContext(graph); fail("GraphException expected, because input1 is not initialized"); } catch (GraphException ge) { } }
public void testOptionalAndWrongProductIsGiven() { Graph graph = new Graph("graph"); Node wrongBandsNode = new Node("WrongBands", wrongBandsOpSpi.getOperatorAlias()); Node consumerNode = new Node("OptionalConsumer", optionalConsumerOpSpi.getOperatorAlias()); consumerNode.addSource(new NodeSource("input1", "WrongBands")); graph.addNode(wrongBandsNode); graph.addNode(consumerNode); try { new GraphContext(graph); fail("GraphException expected, caused by missing bands, even if optional"); } catch (GraphException ge) { } }
public void testForWrongBands() { Graph graph = new Graph("graph"); Node wrongBandsNode = new Node("WrongBands", wrongBandsOpSpi.getOperatorAlias()); Node consumerNode = new Node("Consumer", consumerOpSpi.getOperatorAlias()); consumerNode.addSource(new NodeSource("input1", "WrongBands")); graph.addNode(wrongBandsNode); graph.addNode(consumerNode); try { new GraphContext(graph); fail("GraphException expected, caused by missing bands"); } catch (GraphException ge) { } }
public void testForWrongType() { Graph graph = new Graph("graph"); Node wrongTypeNode = new Node("WrongType", wrongTypeOpSpi.getOperatorAlias()); Node consumerNode = new Node("Consumer", consumerOpSpi.getOperatorAlias()); consumerNode.addSource(new NodeSource("input1", "WrongType")); graph.addNode(wrongTypeNode); graph.addNode(consumerNode); try { new GraphContext(graph); fail("GraphException expected caused by wrong type of source product"); } catch (GraphException ge) { } }