assertTrue("Found a reference", r1 != null);
assertTrue("Could not find a reference", r1 != null);
    public void testDatabaseReader()        throws Exception    {        DatabaseReader reader = new DatabaseReader();        InputStream in = getXMLInput();        try        {            Database database = (Database) reader.parse(in);            assertTrue("Parsed a Database object", database != null);            assertEquals("bookstore", database.getName());                        assertTrue("more than one table found", database.getTables().size() > 0 );                        // Test our first table which is the 'book' table            Table t1 = database.getTable(1);            assertEquals("book", t1.getName());                        Column c0 = t1.getColumn(0);            assertEquals("book_id", c0.getName());            assertTrue("book_id is required", c0.isRequired());            assertTrue("book_id is primary key", c0.isPrimaryKey());                        Column c1 = t1.getColumn(1);            assertEquals("isbn", c1.getName());            assertTrue("isbn is required", c1.isRequired());            assertTrue("isbn is not primary key", ! c1.isPrimaryKey());            List keyList1 = t1.getForeignKeys();            assertEquals( "Foreign key count", 1, keyList1.size() );                        ForeignKey key0 = (ForeignKey) keyList1.get(0);            assertEquals("foreignTable is correct", "author", key0.getForeignTable());                        List refList1 = key0.getReferences();            assertEquals( "Reference count", 1, refList1.size() );                        Reference r1 = (Reference) refList1.get(0);            assertTrue("Found a reference", r1 != null);                                    assertEquals("local is correct", "author_id", r1.getLocal());            assertEquals("foreign is correct", "author_id", r1.getForeign());                        // Write out the bean            //writeBean(database);        }        catch (Exception e)        {            e.printStackTrace();            fail();        }        finally        {            if (in != null)            {                in.close();            }        }    }