// Path: neo4j-jdbc-http/src/main/java/org/neo4j/jdbc/http/driver/Neo4jStatement.java
// public class Neo4jStatement {
// 
// 	/**
// 	 * Cypher query.
// 	 */
// 	public final String statement;
// 
// 	/**
// 	 * Params of the cypher query.
// 	 */
// 	public final Map<String, Object> parameters;
// 
// 	/**
// 	 * Do we need to include stats with the query ?
// 	 */
// 	public final Boolean includeStats;
// 
// 	/**
// 	 * Default constructor.
// 	 *
// 	 * @param statement    Cypher query
// 	 * @param parameters   List of named params for the cypher query
// 	 * @param includeStats Do we need to include stats
// 	 * @throws SQLException sqlexception
// 	 */
// 	public Neo4jStatement(String statement, Map<String, Object> parameters, Boolean includeStats) throws SQLException {
// 		if (statement != null && !"".equals(statement)) {
// 			this.statement = statement;
// 		} else {
// 			throw new SQLException("Creating a NULL query");
// 		}
// 		if (parameters != null) {
// 			this.parameters = parameters;
// 		} else {
// 			this.parameters = new HashMap<>();
// 		}
// 		if (includeStats != null) {
// 			this.includeStats = includeStats;
// 		} else {
// 			this.includeStats = Boolean.FALSE;
// 		}
// 	}
// 
// 	/**
// 	 * Convert the list of query to a JSON compatible with Neo4j endpoint.
// 	 *
// 	 * @param queries List of cypher queries.
// 	 * @param mapper mapper
// 	 * @return The JSON string that correspond to the body of the API call
// 	 * @throws SQLException sqlexception
// 	 */
// 	public static String toJson(List<Neo4jStatement> queries, ObjectMapper mapper) throws SQLException {
// 		StringBuilder sb = new StringBuilder();
// 		try {
// 			sb.append("{\"statements\":");
// 			sb.append(mapper.writeValueAsString(queries));
// 			sb.append("}");
// 
// 		} catch (JsonProcessingException e) {
// 			throw new SQLException("Can't convert Cypher statement(s) into JSON", e);
// 		}
// 		return sb.toString();
// 	}
// 
// 	/**
// 	 * Getter for Statements.
// 	 * We escape the string for the API.
// 	 * 
// 	 * @return the statement
// 	 */
// 	public String getStatement() {
// 		return statement;
// 	}
// 
// }


import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.opencsv.CSVParserBuilder;
import com.opencsv.CSVReader;
import com.opencsv.CSVReaderBuilder;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.rules.ExpectedException;
import org.neo4j.jdbc.http.driver.Neo4jStatement;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.stream.Collectors;
/*
 * Copyright (c) 2016 LARUS Business Automation [http://www.larus-ba.it]
 * <p>
 * This file is part of the "LARUS Integration Framework for Neo4j".
 * <p>
 * The "LARUS Integration Framework for Neo4j" is licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * <p>
 * Created on 15/4/2016
 */
package org.neo4j.jdbc.http.test;



public class Neo4jHttpUnitTestUtil {

	@Rule public ExpectedException expectedEx = ExpectedException.none();

	private final static int CSV_STATEMENT    = 0;
	private final static int CSV_PARAMETERS   = 1;
	private final static int CSV_INCLUDESTATS = 2;

	/**
	 * Retrieve some random queries from a csv file.
	 * We return a map with the CSV source into the kye <code>source</code> and its object Neo4jStatement into key <code>object</code>.
	 *
	 * @param filename  The filename that contains queries
	 * @param nbElement The number element to return
	 * @return
	 * @throws Exception
	 */
	protected Map<String, List> getRandomNeo4jStatementFromCSV(String filename, int nbElement) throws Exception {
// Path: neo4j-jdbc-http/src/main/java/org/neo4j/jdbc/http/driver/Neo4jStatement.java
// public class Neo4jStatement {
// 
// 	/**
// 	 * Cypher query.
// 	 */
// 	public final String statement;
// 
// 	/**
// 	 * Params of the cypher query.
// 	 */
// 	public final Map<String, Object> parameters;
// 
// 	/**
// 	 * Do we need to include stats with the query ?
// 	 */
// 	public final Boolean includeStats;
// 
// 	/**
// 	 * Default constructor.
// 	 *
// 	 * @param statement    Cypher query
// 	 * @param parameters   List of named params for the cypher query
// 	 * @param includeStats Do we need to include stats
// 	 * @throws SQLException sqlexception
// 	 */
// 	public Neo4jStatement(String statement, Map<String, Object> parameters, Boolean includeStats) throws SQLException {
// 		if (statement != null && !"".equals(statement)) {
// 			this.statement = statement;
// 		} else {
// 			throw new SQLException("Creating a NULL query");
// 		}
// 		if (parameters != null) {
// 			this.parameters = parameters;
// 		} else {
// 			this.parameters = new HashMap<>();
// 		}
// 		if (includeStats != null) {
// 			this.includeStats = includeStats;
// 		} else {
// 			this.includeStats = Boolean.FALSE;
// 		}
// 	}
// 
// 	/**
// 	 * Convert the list of query to a JSON compatible with Neo4j endpoint.
// 	 *
// 	 * @param queries List of cypher queries.
// 	 * @param mapper mapper
// 	 * @return The JSON string that correspond to the body of the API call
// 	 * @throws SQLException sqlexception
// 	 */
// 	public static String toJson(List<Neo4jStatement> queries, ObjectMapper mapper) throws SQLException {
// 		StringBuilder sb = new StringBuilder();
// 		try {
// 			sb.append("{\"statements\":");
// 			sb.append(mapper.writeValueAsString(queries));
// 			sb.append("}");
// 
// 		} catch (JsonProcessingException e) {
// 			throw new SQLException("Can't convert Cypher statement(s) into JSON", e);
// 		}
// 		return sb.toString();
// 	}
// 
// 	/**
// 	 * Getter for Statements.
// 	 * We escape the string for the API.
// 	 * 
// 	 * @return the statement
// 	 */
// 	public String getStatement() {
// 		return statement;
// 	}
// 
// }


// Path: neo4j-jdbc-http/src/test/java/org/neo4j/jdbc/http/test/Neo4jHttpUnitTestUtil.java
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.opencsv.CSVParserBuilder;
import com.opencsv.CSVReader;
import com.opencsv.CSVReaderBuilder;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.rules.ExpectedException;
import org.neo4j.jdbc.http.driver.Neo4jStatement;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.stream.Collectors;

/*
 * Copyright (c) 2016 LARUS Business Automation [http://www.larus-ba.it]
 * <p>
 * This file is part of the "LARUS Integration Framework for Neo4j".
 * <p>
 * The "LARUS Integration Framework for Neo4j" is licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * <p>
 * Created on 15/4/2016
 */
package org.neo4j.jdbc.http.test;



public class Neo4jHttpUnitTestUtil {

	@Rule public ExpectedException expectedEx = ExpectedException.none();

	private final static int CSV_STATEMENT    = 0;
	private final static int CSV_PARAMETERS   = 1;
	private final static int CSV_INCLUDESTATS = 2;

	/**
	 * Retrieve some random queries from a csv file.
	 * We return a map with the CSV source into the kye <code>source</code> and its object Neo4jStatement into key <code>object</code>.
	 *
	 * @param filename  The filename that contains queries
	 * @param nbElement The number element to return
	 * @return
	 * @throws Exception
	 */
	protected Map<String, List> getRandomNeo4jStatementFromCSV(String filename, int nbElement) throws Exception {
		List<Neo4jStatement> queriesObj = new ArrayList<>();