assertEquals(0, table.getColumnCount());
}
public void testExampleSimple1() throws Exception {
FixedWidthConfiguration conf = new FixedWidthConfiguration(10);
FixedWidthDataContext dc = new FixedWidthDataContext(new File("src/test/resources/example_simple1.txt"), conf);
String[] schemaNames = dc.getSchemaNames();
assertEquals(2, schemaNames.length);
assertEquals("[information_schema, resources]", Arrays.toString(schemaNames));
Schema schema = dc.getDefaultSchema();
assertEquals("Schema[name=resources]", schema.toString());
assertEquals(1, schema.getTableCount());
Table table = schema.getTableByName("example_simple1.txt");
assertEquals("Table[name=example_simple1.txt,type=TABLE,remarks=null]", table.toString());
assertEquals("[greeting, greeter]", Arrays.toString(table.getColumnNames()));
assertEquals(10, table.getColumnByName("greeting").getColumnSize().intValue());
assertEquals(10, table.getColumnByName("greeter").getColumnSize().intValue());
Query q = dc.query().from(table).select(table.getColumns()).toQuery();
DataSet ds = dc.executeQuery(q);
assertTrue(ds.next());
assertEquals("[hello, world]", Arrays.toString(ds.getRow().getValues()));
assertTrue(ds.next());
assertEquals("[hi, there]", Arrays.toString(ds.getRow().getValues()));