use of org.apache.jena.jdbc.metadata.results.MetaResultSet in project jena by apache.
the class TestMetaResultSet method meta_result_set_movement_01.
/**
* Test movement within meta results
*
* @throws SQLException
*/
@Test
public void meta_result_set_movement_01() throws SQLException {
MetaResultSet results = createMetaResultSet(0);
Assert.assertTrue(results.isBeforeFirst());
Assert.assertFalse(results.next());
Assert.assertTrue(results.isAfterLast());
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_date_02.
/**
* Test retrieving meta column values
*
* @throws SQLException
*/
@Test
public void meta_result_set_date_02() throws SQLException {
MetaResultSet results = new MetaResultSet(new ColumnInfo[] { new DateColumn("Test", ResultSetMetaData.columnNullable) }, new Object[][] { { null } });
Assert.assertTrue(results.next());
Date value = results.getDate(1);
Assert.assertEquals(null, value);
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_long_integer_02.
/**
* Test retrieving meta column values
*
* @throws SQLException
*/
@Test
public void meta_result_set_long_integer_02() throws SQLException {
MetaResultSet results = new MetaResultSet(new ColumnInfo[] { new LongIntegerColumn("Test", ResultSetMetaData.columnNullable, true) }, new Object[][] { { null } });
Assert.assertTrue(results.next());
long value = results.getLong(1);
Assert.assertEquals(0, value);
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_byte_02.
/**
* Test retrieving meta column values
*
* @throws SQLException
*/
@Test
public void meta_result_set_byte_02() throws SQLException {
MetaResultSet results = new MetaResultSet(new ColumnInfo[] { new ByteColumn("Test", ResultSetMetaData.columnNullable, true) }, new Object[][] { { null } });
Assert.assertTrue(results.next());
byte value = results.getByte(1);
Assert.assertEquals(0x0, value);
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_date_01.
/**
* Test retrieving meta column values
*
* @throws SQLException
*/
@SuppressWarnings("deprecation")
@Test
public void meta_result_set_date_01() throws SQLException {
MetaResultSet results = new MetaResultSet(new ColumnInfo[] { new DateColumn("Test", ResultSetMetaData.columnNullable) }, new Object[][] { { new Date(2013, 4, 24) } });
Assert.assertTrue(results.next());
Date value = results.getDate(1);
Assert.assertEquals(new Date(2013, 4, 24), value);
Assert.assertFalse(results.wasNull());
Assert.assertFalse(results.next());
results.close();
Assert.assertTrue(results.isClosed());
}
Aggregations