boolean gotproc1 = false; boolean gotproc2 = false; while (rs.next()) { String name = rs.getString(3); String lit_name = rs.getString("PROCEDURE_NAME"); assertTrue("result set from getProcedures schema mismatch: field 3 should be PROCEDURE_NAME", name.equals(lit_name)); String remarks = rs.getString(7); String lit_remarks = rs.getString("REMARKS"); if (remarks == null || lit_remarks == null) if (remarks != null || lit_remarks != null) assertTrue("result set from getProcedures schema mismatch only one of field 7 or 'REMARKS' returned null", false); else assertTrue("all OK on the western front", true); else assertTrue ("result set from getProcedures schema mismatch: field 7 should be REMARKS", remarks.equals(lit_remarks)); short type = rs.getShort(8); short lit_type = rs.getShort("PROCEDURE_TYPE"); assertTrue("result set from getProcedures schema mismatch: field 8 should be PROCEDURE_TYPE", type == lit_type); if (log !=null) log.info(" got procedure " + name); if (name.equals("TESTPROC1")){ assertTrue("result set from getProcedures had duplicate entry for TESTPROC1", !gotproc1); gotproc1 = true; assertTrue("result set from getProcedures had wrong procedure type for TESTPROC1 " + "(should be procedureReturnsResult)", type == DatabaseMetaData.procedureReturnsResult); assertTrue("result set from getProcedures did not return a value for REMARKS.", remarks != null); assertTrue("result set from getProcedures did not return correct REMARKS section.", remarks.equals("Test description")); } else if (name.equals("TESTPROC2")) { assertTrue("result set from getProcedures had duplicate entry for TESTPROC2", !gotproc2); gotproc2 = true; assertTrue("result set from getProcedures had wrong procedure type for TESTPROC2 " + "(should be procedureNoResult)", type == DatabaseMetaData.procedureNoResult); } else assertTrue("result set from getProcedures returned unknown procedure " + name, false); } assertTrue ("result set from getProcedures did not return procedure testproc1", gotproc1); assertTrue ("result set from getProcedures did not return procedure testproc2", gotproc2); rs.close(); dropProcedure("testproc1"); dropProcedure("testproc2"); if (ex != null) throw ex;
    public void testGetProcedures() throws Exception {        if (log != null) log.info("testGetProcedures");        ResultSet rs = dmd.getProcedures(null, null, "%");        assertTrue("No resultset returned from getProcedures", rs != null);    }