test/java/sql/util/BaseTest.java

Print this page

        

*** 26,40 **** --- 26,42 ---- import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.security.Policy; + import java.sql.JDBCType; import java.sql.SQLException; import org.testng.annotations.AfterClass; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; + import org.testng.annotations.DataProvider; public class BaseTest { protected final String reason = "reason"; protected final String state = "SQLState";
*** 94,99 **** --- 96,126 ---- * Utility Method used to set the current Policy */ protected static void setPolicy(Policy p) { Policy.setPolicy(p); } + + /* + * DataProvider used to specify the value to set and check for + * methods using boolean values + */ + @DataProvider(name = "trueFalse") + protected Object[][] trueFalse() { + return new Object[][]{ + {true}, + {false} + }; + } + + /* + * DataProvider used to specify the standard JDBC Types + */ + @DataProvider(name = "jdbcTypes") + protected Object[][] jdbcTypes() { + Object[][] o = new Object[JDBCType.values().length][1]; + int pos = 0; + for (JDBCType c : JDBCType.values()) { + o[pos++][0] = c.getVendorTypeNumber(); + } + return o; + } }