// Path: neo4j-json/src/main/java/org/neo4j/helpers/json/config/JsonHelperConfiguration.java
// public abstract class JsonHelperConfiguration {
// 
// 	/**
// 	 * Create a new execution context setting db and log.
// 	 * @param db
// 	 * @param log
// 	 * @return
// 	 */
// 	protected abstract DocumentGrapherExecutionContext buildContext(GraphDatabaseService db, Log log);
// 	
// 	private static JsonHelperConfiguration instance;
// 	
// 	/**
// 	 * Get current configuration manager
// 	 * @return
// 	 */
// 	public static DocumentGrapherExecutionContext newContext(GraphDatabaseService db, Log log)
// 	{
// 		
// 		if(instance == null)
// 		{
// 			Node configurationNode = db.findNode(Label.label("JSON_CONFIG"), "configuration", "byNode");
// 			if(configurationNode == null)
// 			{
// 				log.info("Load default configuration: "+JsonHelperConfigurationDefault.class);
// 				instance = new JsonHelperConfigurationDefault();				
// 			}else
// 			{
// 				log.info("Load configuration from node: "+JsonHelperConfigurationByNode.class);
// 				instance = new JsonHelperConfigurationByNode(configurationNode);	
// 			}
// 		}
// 		
// 		return instance.buildContext(db, log);
// 	}
// 	
// 	public static void reset()
// 	{
// 		instance = null;
// 	}
// }


import org.neo4j.driver.v1.Driver;
import org.neo4j.driver.v1.GraphDatabase;
import org.neo4j.driver.v1.Record;
import org.neo4j.driver.v1.Session;
import org.neo4j.driver.v1.StatementResult;
import org.neo4j.driver.v1.Values;
import org.neo4j.harness.junit.Neo4jRule;
import org.neo4j.helpers.json.config.JsonHelperConfiguration;
import java.util.List;
import java.util.stream.Collectors;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import org.neo4j.driver.v1.Config;
/**
 * Copyright (c) 2017 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.
 */

package org.neo4j.helpers.json;



/**
 * Test with default configuration
 * @author Omar Rampado
 *
 */
public class JsonHelperCustomTest {

	private static final String CALL_UPSERT = "CALL json.upsert({key},{json})";
	private static final String CALL_DELETE = "CALL json.delete({key})";

	// This rule starts a Neo4j instance for us
	@ClassRule
	public static Neo4jRule neo4j = new Neo4jRule().withProcedure(JsonHelper.class);

	private static Driver driver;

	private Session session;

	@BeforeClass
	public static void init() {
// Path: neo4j-json/src/main/java/org/neo4j/helpers/json/config/JsonHelperConfiguration.java
// public abstract class JsonHelperConfiguration {
// 
// 	/**
// 	 * Create a new execution context setting db and log.
// 	 * @param db
// 	 * @param log
// 	 * @return
// 	 */
// 	protected abstract DocumentGrapherExecutionContext buildContext(GraphDatabaseService db, Log log);
// 	
// 	private static JsonHelperConfiguration instance;
// 	
// 	/**
// 	 * Get current configuration manager
// 	 * @return
// 	 */
// 	public static DocumentGrapherExecutionContext newContext(GraphDatabaseService db, Log log)
// 	{
// 		
// 		if(instance == null)
// 		{
// 			Node configurationNode = db.findNode(Label.label("JSON_CONFIG"), "configuration", "byNode");
// 			if(configurationNode == null)
// 			{
// 				log.info("Load default configuration: "+JsonHelperConfigurationDefault.class);
// 				instance = new JsonHelperConfigurationDefault();				
// 			}else
// 			{
// 				log.info("Load configuration from node: "+JsonHelperConfigurationByNode.class);
// 				instance = new JsonHelperConfigurationByNode(configurationNode);	
// 			}
// 		}
// 		
// 		return instance.buildContext(db, log);
// 	}
// 	
// 	public static void reset()
// 	{
// 		instance = null;
// 	}
// }


// Path: neo4j-json/src/test/java/org/neo4j/helpers/json/JsonHelperCustomTest.java
import org.neo4j.driver.v1.Driver;
import org.neo4j.driver.v1.GraphDatabase;
import org.neo4j.driver.v1.Record;
import org.neo4j.driver.v1.Session;
import org.neo4j.driver.v1.StatementResult;
import org.neo4j.driver.v1.Values;
import org.neo4j.harness.junit.Neo4jRule;
import org.neo4j.helpers.json.config.JsonHelperConfiguration;
import java.util.List;
import java.util.stream.Collectors;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import org.neo4j.driver.v1.Config;

/**
 * Copyright (c) 2017 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.
 */

package org.neo4j.helpers.json;



/**
 * Test with default configuration
 * @author Omar Rampado
 *
 */
public class JsonHelperCustomTest {

	private static final String CALL_UPSERT = "CALL json.upsert({key},{json})";
	private static final String CALL_DELETE = "CALL json.delete({key})";

	// This rule starts a Neo4j instance for us
	@ClassRule
	public static Neo4jRule neo4j = new Neo4jRule().withProcedure(JsonHelper.class);

	private static Driver driver;

	private Session session;

	@BeforeClass
	public static void init() {
		JsonHelperConfiguration.reset();