// Path: neo4j-jdbc-examples/mybatis/src/main/java/org/neo4j/jdbc/example/mybatis/bean/Actor.java
// public class Actor {
// 
// 	private int nodeId;
// 	private int born;
// 	private String name;
// 
// 	public int getNodeId() {
// 		return nodeId;
// 	}
// 
// 	public void setNodeId(int nodeId) {
// 		this.nodeId = nodeId;
// 	}
// 
// 	public int getBorn() {
// 		return born;
// 	}
// 
// 	public void setBorn(int born) {
// 		this.born = born;
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 
// }
// 
// Path: neo4j-jdbc-examples/mybatis/src/main/java/org/neo4j/jdbc/example/mybatis/util/ActorManager.java
// public class ActorManager {
// 
// 	private ActorManager() {}
// 
// 	public static Actor selectActorByBorn(int born) {
// 		SqlSession sqlSession = ConnectionFactory.getSqlSessionFactory()
// 				.openSession();
// 		try {
// 			ActorMapper categoryMapper = sqlSession
// 					.getMapper(ActorMapper.class);
// 			return categoryMapper.selectActorByBorn(born);
// 		} finally {
// 			sqlSession.close();
// 		}
// 	}
// }
// 
// Path: neo4j-jdbc-examples/mybatis/src/main/java/org/neo4j/jdbc/example/mybatis/util/ConnectionFactory.java
// public class ConnectionFactory {
// 
// 	private static final String DATABASE_CONFIG_XML = "database-config.xml";
// 
// 	private static SqlSessionFactory factory;
// 
// 	private ConnectionFactory() {}
// 
// 	public static SqlSessionFactory getSqlSessionFactory() {
// 		return getSqlSessionFactory(DATABASE_CONFIG_XML);
// 	}
// 
// 	public static SqlSessionFactory getSqlSessionFactory(String config) {
// 		if (factory == null) {
// 			try (Reader reader = Resources.getResourceAsReader(config)){
// 				factory = new SqlSessionFactoryBuilder().build(reader);
// 			} catch (IOException e) {
// 				throw new RuntimeException(e);
// 			}
// 		}
// 		return factory;
// 	}
// 
// 	public static SqlSessionFactory getSqlSessionFactory(Configuration configuration) {
// 		if (factory == null) {
// 			factory = new SqlSessionFactoryBuilder().build(configuration);
// 		}
// 		return factory;
// 	}
// }


import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.neo4j.jdbc.example.mybatis.bean.Actor;
import org.neo4j.jdbc.example.mybatis.util.ActorManager;
import org.neo4j.jdbc.example.mybatis.util.ConnectionFactory;

/*
 *
 * 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 24/4/2016
 *
 */
package org.neo4j.jdbc.example.mybatis;


/**
 * @author AgileLARUS
 * @since 3.0.2
 */
public class ActorManagerBoltTestWithLocalServer extends MybatisTestUtil {

	/*
	 * Need to start a neo4j instance and load the "Movie" example graph  
	 */
	@Test
	@Ignore
	public void testSelectActorBornIn1973() {
		ConnectionFactory.getSqlSessionFactory("bolt-database-config.xml");
		
		Actor actor = ActorManager.selectActorByBorn(1973);
		Assert.assertNotNull(actor);

// Path: neo4j-jdbc-examples/mybatis/src/main/java/org/neo4j/jdbc/example/mybatis/bean/Actor.java
// public class Actor {
// 
// 	private int nodeId;
// 	private int born;
// 	private String name;
// 
// 	public int getNodeId() {
// 		return nodeId;
// 	}
// 
// 	public void setNodeId(int nodeId) {
// 		this.nodeId = nodeId;
// 	}
// 
// 	public int getBorn() {
// 		return born;
// 	}
// 
// 	public void setBorn(int born) {
// 		this.born = born;
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 
// }
// 
// Path: neo4j-jdbc-examples/mybatis/src/main/java/org/neo4j/jdbc/example/mybatis/util/ActorManager.java
// public class ActorManager {
// 
// 	private ActorManager() {}
// 
// 	public static Actor selectActorByBorn(int born) {
// 		SqlSession sqlSession = ConnectionFactory.getSqlSessionFactory()
// 				.openSession();
// 		try {
// 			ActorMapper categoryMapper = sqlSession
// 					.getMapper(ActorMapper.class);
// 			return categoryMapper.selectActorByBorn(born);
// 		} finally {
// 			sqlSession.close();
// 		}
// 	}
// }
// 
// Path: neo4j-jdbc-examples/mybatis/src/main/java/org/neo4j/jdbc/example/mybatis/util/ConnectionFactory.java
// public class ConnectionFactory {
// 
// 	private static final String DATABASE_CONFIG_XML = "database-config.xml";
// 
// 	private static SqlSessionFactory factory;
// 
// 	private ConnectionFactory() {}
// 
// 	public static SqlSessionFactory getSqlSessionFactory() {
// 		return getSqlSessionFactory(DATABASE_CONFIG_XML);
// 	}
// 
// 	public static SqlSessionFactory getSqlSessionFactory(String config) {
// 		if (factory == null) {
// 			try (Reader reader = Resources.getResourceAsReader(config)){
// 				factory = new SqlSessionFactoryBuilder().build(reader);
// 			} catch (IOException e) {
// 				throw new RuntimeException(e);
// 			}
// 		}
// 		return factory;
// 	}
// 
// 	public static SqlSessionFactory getSqlSessionFactory(Configuration configuration) {
// 		if (factory == null) {
// 			factory = new SqlSessionFactoryBuilder().build(configuration);
// 		}
// 		return factory;
// 	}
// }


// Path: neo4j-jdbc-examples/mybatis/src/test/java/org/neo4j/jdbc/example/mybatis/ActorManagerBoltTestWithLocalServer.java
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.neo4j.jdbc.example.mybatis.bean.Actor;
import org.neo4j.jdbc.example.mybatis.util.ActorManager;
import org.neo4j.jdbc.example.mybatis.util.ConnectionFactory;

/*
 *
 * 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 24/4/2016
 *
 */
package org.neo4j.jdbc.example.mybatis;


/**
 * @author AgileLARUS
 * @since 3.0.2
 */
public class ActorManagerBoltTestWithLocalServer extends MybatisTestUtil {

	/*
	 * Need to start a neo4j instance and load the "Movie" example graph  
	 */
	@Test
	@Ignore
	public void testSelectActorBornIn1973() {
		ConnectionFactory.getSqlSessionFactory("bolt-database-config.xml");
		
		Actor actor = ActorManager.selectActorByBorn(1973);
		Assert.assertNotNull(actor);

		Assert.assertEquals(1973, actor.getBorn());
