VelocityContext velocityContext = metadataResourceEngine.getVelocityContext(); velocityContext.put("graph", graphContext.getGraph()); Product[] outputProducts = graphContext.getOutputProducts(); if (outputProducts.length >= 1) { velocityContext.put("targetProduct", outputProducts[0]);
Graph graph = GraphIO.read(new FileReader(file)); graphContext = new GraphContext(graph); Product[] outputProducts = graphContext.getOutputProducts(); if (outputProducts.length != 1) { getLogger().warning("Filtered out graph '" + file + "'");
if (pm.isCanceled()) { return graphContext.getOutputProducts(); return graphContext.getOutputProducts();
public void testTargetProductCreation() throws GraphException { Graph graph = new Graph("chain1"); Node node1 = new Node("node1", "Op1"); graph.addNode(node1); GraphContext graphContext = new GraphContext(graph); Product[] outputProducts = graphContext.getOutputProducts(); assertNotNull(outputProducts); assertEquals(1, outputProducts.length); assertNotNull(outputProducts[0]); }
public void testThreeOpsExecutionOrder() throws Exception { VerbousTileCache.setVerbous(false); Graph graph = new Graph("graph"); Node node1 = new Node("node1", "Op1"); Node node2 = new Node("node2", "Op2"); Node node3 = new Node("node3", "Op3"); node2.addSource(new NodeSource("input", "node1")); node3.addSource(new NodeSource("input1", "node1")); node3.addSource(new NodeSource("input2", "node2")); graph.addNode(node1); graph.addNode(node2); graph.addNode(node3); GraphProcessor processor = new GraphProcessor(); GraphContext graphContext = new GraphContext(graph); Product chainOut = graphContext.getOutputProducts()[0]; assertNotNull(chainOut); assertEquals("Op3Name", chainOut.getName()); processor.executeGraph(graphContext, ProgressMonitor.NULL); // - Op3 requires the two bands of Op2 // - Op2 computes all bands // --> Op2 should only be called once assertEquals("Op1;Op2;Op3;", TestOps.getCalls()); TestOps.clearCalls(); VerbousTileCache.setVerbous(false); }