// Path: moneta-core/src/test/java/org/moneta/HSqlTestBase.java
// public class HSqlTestBase {
// 	
// 	protected Connection nativeConnection;
// 
// 	@Before
// 	public void setUp() throws Exception {
// 		org.hsqldb.jdbcDriver nativeDriver = new org.hsqldb.jdbcDriver();
//         nativeConnection = nativeDriver.connect("jdbc:hsqldb:mem:TestDb", new Properties());
// 	}
// 
// 
// }
// 
// Path: moneta-core/src/main/java/org/moneta/types/Record.java
// public class Record extends BaseType {
// 	
// 	@JsonProperty("record")
// 	private Value[] values;
// 
// 	public Value[] getValues() {
// 		return values;
// 	}
// 
// 	public void setValues(Value[] values) {
// 		this.values = values;
// 	}
// 
// }
// 
// Path: moneta-core/src/main/java/org/moneta/types/Value.java
// public class Value extends BaseType {
// 	
// 	private String name;
// 	private Object value;
// 	
// 	public Value()   {}
// 	public Value(String name, Object value)   {
// 		this.setName(name);
// 		this.setValue(value);
// 	}
// 	
// 	public String getName() {
// 		return name;
// 	}
// 	
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 	
// 	public Object getValue() {
// 		return value;
// 	}
// 	
// 	public void setValue(Object value) {
// 		this.value = value;
// 	}
// 
// }


import org.apache.commons.dbutils.QueryRunner;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.moneta.HSqlTestBase;
import org.moneta.types.Record;
import org.moneta.types.Value;

		handler.getAliasMap().put("TABLE_CAT", "Catalog");
	}
	
	@Test
	public void testBasicHappyPath() throws Exception {
		QueryRunner runner = new QueryRunner();
		Record[] recArray = runner.query(nativeConnection, 
				"select * from INFORMATION_SCHEMA.SYSTEM_TABLES", handler);
		Assert.assertTrue(recArray != null);
		Assert.assertTrue(recArray.length == 92);
		Assert.assertTrue(searchForColumn(recArray, "Catalog"));
		Assert.assertTrue(!searchForColumn(recArray, "TABLE_CAT"));
		Assert.assertTrue(searchForColumn(recArray, "TABLE_TYPE"));
		
		handler.setStartRow(90L);
		recArray = runner.query(nativeConnection, 
				"select * from INFORMATION_SCHEMA.SYSTEM_TABLES", handler);
		Assert.assertTrue(recArray != null);
		Assert.assertTrue(recArray.length == 3);
		
		handler.setStartRow(null);
		handler.setMaxRows(10L);
		recArray = runner.query(nativeConnection, 
				"select * from INFORMATION_SCHEMA.SYSTEM_TABLES", handler);
		Assert.assertTrue(recArray != null);
		Assert.assertTrue(recArray.length == 10);
	}

	private boolean searchForColumn(Record[] recArray, String testColumn) {
		boolean testColumnFound=false;

// Path: moneta-core/src/test/java/org/moneta/HSqlTestBase.java
// public class HSqlTestBase {
// 	
// 	protected Connection nativeConnection;
// 
// 	@Before
// 	public void setUp() throws Exception {
// 		org.hsqldb.jdbcDriver nativeDriver = new org.hsqldb.jdbcDriver();
//         nativeConnection = nativeDriver.connect("jdbc:hsqldb:mem:TestDb", new Properties());
// 	}
// 
// 
// }
// 
// Path: moneta-core/src/main/java/org/moneta/types/Record.java
// public class Record extends BaseType {
// 	
// 	@JsonProperty("record")
// 	private Value[] values;
// 
// 	public Value[] getValues() {
// 		return values;
// 	}
// 
// 	public void setValues(Value[] values) {
// 		this.values = values;
// 	}
// 
// }
// 
// Path: moneta-core/src/main/java/org/moneta/types/Value.java
// public class Value extends BaseType {
// 	
// 	private String name;
// 	private Object value;
// 	
// 	public Value()   {}
// 	public Value(String name, Object value)   {
// 		this.setName(name);
// 		this.setValue(value);
// 	}
// 	
// 	public String getName() {
// 		return name;
// 	}
// 	
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 	
// 	public Object getValue() {
// 		return value;
// 	}
// 	
// 	public void setValue(Object value) {
// 		this.value = value;
// 	}
// 
// }


// Path: moneta-core/src/test/java/org/moneta/dao/RecordResultSetHandlerTest.java
import org.apache.commons.dbutils.QueryRunner;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.moneta.HSqlTestBase;
import org.moneta.types.Record;
import org.moneta.types.Value;

		handler.getAliasMap().put("TABLE_CAT", "Catalog");
	}
	
	@Test
	public void testBasicHappyPath() throws Exception {
		QueryRunner runner = new QueryRunner();
		Record[] recArray = runner.query(nativeConnection, 
				"select * from INFORMATION_SCHEMA.SYSTEM_TABLES", handler);
		Assert.assertTrue(recArray != null);
		Assert.assertTrue(recArray.length == 92);
		Assert.assertTrue(searchForColumn(recArray, "Catalog"));
		Assert.assertTrue(!searchForColumn(recArray, "TABLE_CAT"));
		Assert.assertTrue(searchForColumn(recArray, "TABLE_TYPE"));
		
		handler.setStartRow(90L);
		recArray = runner.query(nativeConnection, 
				"select * from INFORMATION_SCHEMA.SYSTEM_TABLES", handler);
		Assert.assertTrue(recArray != null);
		Assert.assertTrue(recArray.length == 3);
		
		handler.setStartRow(null);
		handler.setMaxRows(10L);
		recArray = runner.query(nativeConnection, 
				"select * from INFORMATION_SCHEMA.SYSTEM_TABLES", handler);
		Assert.assertTrue(recArray != null);
		Assert.assertTrue(recArray.length == 10);
	}

	private boolean searchForColumn(Record[] recArray, String testColumn) {
		boolean testColumnFound=false;

		for (Value value: recArray[0].getValues()) {
