use of org.apache.jena.jdbc.metadata.results.MetaResultSet in project jena by apache.
the class TestMetaResultSet method meta_result_set_boolean_02.
/**
* Test retrieving meta column values
*
* @throws SQLException
*/
@Test
public void meta_result_set_boolean_02() throws SQLException {
MetaResultSet results = new MetaResultSet(new ColumnInfo[] { new BooleanColumn("Test", ResultSetMetaData.columnNullable) }, new Object[][] { { null } });
Assert.assertTrue(results.next());
Assert.assertFalse(results.getBoolean(1));
Assert.assertTrue(results.wasNull());
Assert.assertFalse(results.next());
results.close();
Assert.assertTrue(results.isClosed());
}
use of org.apache.jena.jdbc.metadata.results.MetaResultSet in project jena by apache.
the class TestMetaResultSet method meta_result_set_integer_01.
/**
* Test retrieving meta column values
*
* @throws SQLException
*/
@Test
public void meta_result_set_integer_01() throws SQLException {
MetaResultSet results = new MetaResultSet(new ColumnInfo[] { new IntegerColumn("Test", ResultSetMetaData.columnNullable, true) }, new Object[][] { { 1234 } });
Assert.assertTrue(results.next());
int value = results.getInt(1);
Assert.assertEquals(1234, value);
Assert.assertFalse(results.wasNull());
Assert.assertFalse(results.next());
results.close();
Assert.assertTrue(results.isClosed());
}
use of org.apache.jena.jdbc.metadata.results.MetaResultSet in project jena by apache.
the class TestMetaResultSet method meta_result_set_double_01.
/**
* Test retrieving meta column values
*
* @throws SQLException
*/
@Test
public void meta_result_set_double_01() throws SQLException {
MetaResultSet results = new MetaResultSet(new ColumnInfo[] { new DoubleColumn("Test", ResultSetMetaData.columnNullable) }, new Object[][] { { 0.123d } });
Assert.assertTrue(results.next());
double value = results.getDouble(1);
Assert.assertEquals(0.123d, value, 0d);
Assert.assertFalse(results.wasNull());
Assert.assertFalse(results.next());
results.close();
Assert.assertTrue(results.isClosed());
}
use of org.apache.jena.jdbc.metadata.results.MetaResultSet in project jena by apache.
the class TestMetaResultSet method meta_result_set_float_02.
/**
* Test retrieving meta column values
*
* @throws SQLException
*/
@Test
public void meta_result_set_float_02() throws SQLException {
MetaResultSet results = new MetaResultSet(new ColumnInfo[] { new FloatColumn("Test", ResultSetMetaData.columnNullable) }, new Object[][] { { null } });
Assert.assertTrue(results.next());
float value = results.getFloat(1);
Assert.assertEquals(0f, value, 0f);
Assert.assertTrue(results.wasNull());
Assert.assertFalse(results.next());
results.close();
Assert.assertTrue(results.isClosed());
}
use of org.apache.jena.jdbc.metadata.results.MetaResultSet in project jena by apache.
the class TestMetaResultSet method meta_result_set_integer_02.
/**
* Test retrieving meta column values
*
* @throws SQLException
*/
@Test
public void meta_result_set_integer_02() throws SQLException {
MetaResultSet results = new MetaResultSet(new ColumnInfo[] { new IntegerColumn("Test", ResultSetMetaData.columnNullable, true) }, new Object[][] { { null } });
Assert.assertTrue(results.next());
int value = results.getInt(1);
Assert.assertEquals(0, value);
Assert.assertTrue(results.wasNull());
Assert.assertFalse(results.next());
results.close();
Assert.assertTrue(results.isClosed());
}
Aggregations