/*******************************************************************************
 * Copyright (c) 2018 Eclipse RDF4J contributors.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Distribution License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/org/documents/edl-v10.php.
 *******************************************************************************/

package org.eclipse.rdf4j.sail.shacl.mock;

import org.eclipse.rdf4j.common.iteration.CloseableIteration;
import org.eclipse.rdf4j.sail.SailException;
import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNode;
import org.eclipse.rdf4j.sail.shacl.planNodes.Tuple;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Håvard Ottestad
 */
public class MockConsumePlanNode {

	PlanNode innerNode;

	public MockConsumePlanNode(PlanNode innerNode) {
		this.innerNode = innerNode;
	}

	public List<Tuple> asList() {

		CloseableIteration<Tuple, SailException> iterator = innerNode.iterator();

		List<Tuple> ret = new ArrayList<>();

		while (iterator.hasNext()) {
			ret.add(iterator.next());
		}

		return ret;

	}
}

@@ -726,16 +726,89 @@
 s.Tuple;
+%0Aimport org.eclipse.rdf4j.sail.shacl.planNodes.ValidationExecutionLogger;
 %0A%0Aimport
@@ -924,16 +924,127 @@
 Node %7B%0A%0A
+%09private static final ValidationExecutionLogger VALIDATION_EXECUTION_LOGGER = new ValidationExecutionLogger();%0A
 %09PlanNod
@@ -1137,16 +1137,72 @@
 erNode;%0A
+%09%09innerNode.receiveLogger(VALIDATION_EXECUTION_LOGGER);%0A
 %09%7D%0A%0A%09pub
@@ -1410,13 +1410,53 @@
 ));%0A
-
 %09%09%7D%0A%0A
+%09%09VALIDATION_EXECUTION_LOGGER.flush();%0A%0A
 %09%09re

fix test