Java Doc for TestUtil.java in  » Database-DBMS » db-derby-10.2 » org » apache » derbyTesting » functionTests » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » db derby 10.2 » org.apache.derbyTesting.functionTests.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.derbyTesting.functionTests.util.TestUtil

TestUtil
public class TestUtil (Code)
Utility methods for tests, in order to bring some consistency to test output and handle testing framework differences


Field Summary
final public static  intDB2JCC_FRAMEWORK
    
final public static  intDERBY_NET_CLIENT_FRAMEWORK
    
final public static  intDERBY_NET_FRAMEWORK
    
final public static  intEMBEDDED_FRAMEWORK
    
public static  StringEND_HTML_PAGE
    
public static  booleanHAVE_DRIVER_CLASS
    
final public static  intOLD_NET_FRAMEWORK
     framework = DB2jNet OLD_NET_FRAMEWORK is for tests that have not yet been contributed.
public static  StringTABLE_END_TAG
    
public static  StringTABLE_START_TAG
    
public static  StringTD_CENTER
    
public static  StringTD_END
    
public static  StringTD_INVERSE
    
public static  StringTD_LEFT
    
final public static  intUNKNOWN_FRAMEWORK
    


Method Summary
public static  StringcheckForJDBC40Implementation(String classname)
     returns the class name for the JDBC40 implementation if present.
public static  voidcleanUpTest(Statement s, String[] testObjects)
     Drop the test objects passed in as a string identifying the type of object (e.g.
public static  booleancompareURL(String url)
    
public static  voiddumpSQLExceptions(SQLException sqle)
    
public static  voiddumpSQLExceptions(SQLException sqle, boolean expected)
    
public static  voidendHTMLPage()
    
public static  ConnectiongetConnection(String databaseName, String connAttrs)
     Get connection to given database using the connection attributes.
public static  javax.sql.ConnectionPoolDataSourcegetConnectionPoolDataSource(Properties attrs)
    
public static  javax.sql.DataSourcegetDataSource(Properties attrs)
    
public static  ConnectiongetDataSourceConnection(Properties prop)
    
public static  StringgetDataSourcePrefix()
    
public static  StringgetGetterName(String attribute)
    
public static  StringgetHostName()
    
public static  intgetJDBCMajorVersion(Connection conn)
     Get the JDBC version, inferring it from the driver.
public static  StringgetJdbcUrlPrefix()
     Get URL prefix for current framework.
public static  StringgetJdbcUrlPrefix(String server, int port)
    
public static  StringgetNameFromJdbcType(int jdbcType)
    
public static  StringgetSetterName(String attribute)
    
public static  DataSourcegetSimpleDataSource(Properties attrs)
    
public static  javax.sql.XADataSourcegetXADataSource(Properties attrs)
    
public static  booleanisDerbyNetClientFramework()
    
public static  booleanisEmbeddedFramework()
    
public static  booleanisJCCFramework()
    
public static  booleanisNetFramework()
    
public static  voidloadDriver()
    
public static  voidprintBoolArrayHTMLTable(String rowDescription, String columnDescription, String[] rowLabels, String[] colLabels, boolean[][] array, String tableInfo)
     Converts 2 dimensional boolean array into an HTML table.
public static  voidshutdownUsingDataSource(String dbName)
    
public static  StringsqlNameFromJdbc(int jdbcType)
    
public static  voidstartHTMLPage(String title, String author)
    
public static  StringstringToHexLiteral(String s)
     Just converts a string to a hex literal to assist in converting test cases that used to insert strings into bit data tables Converts using UTF-16BE just like the old casts used to.

Field Detail
DB2JCC_FRAMEWORK
final public static int DB2JCC_FRAMEWORK(Code)
framework = DB2JCC for testing JCC against DB2 for debugging jcc problems jdbc:db2://



DERBY_NET_CLIENT_FRAMEWORK
final public static int DERBY_NET_CLIENT_FRAMEWORK(Code)
framework = DerbyNetClient for Derby cient jdbc:derby://



DERBY_NET_FRAMEWORK
final public static int DERBY_NET_FRAMEWORK(Code)
framework = DerbyNet for JCC jdbc:derby:net:



EMBEDDED_FRAMEWORK
final public static int EMBEDDED_FRAMEWORK(Code)
framework = embedded (or null) jdbc:derby:



END_HTML_PAGE
public static String END_HTML_PAGE(Code)



HAVE_DRIVER_CLASS
public static boolean HAVE_DRIVER_CLASS(Code)



OLD_NET_FRAMEWORK
final public static int OLD_NET_FRAMEWORK(Code)
framework = DB2jNet OLD_NET_FRAMEWORK is for tests that have not yet been contributed. it can be removed once all tests are at apache



TABLE_END_TAG
public static String TABLE_END_TAG(Code)



TABLE_START_TAG
public static String TABLE_START_TAG(Code)
Some routines for printing test information to html *



TD_CENTER
public static String TD_CENTER(Code)



TD_END
public static String TD_END(Code)



TD_INVERSE
public static String TD_INVERSE(Code)



TD_LEFT
public static String TD_LEFT(Code)



UNKNOWN_FRAMEWORK
final public static int UNKNOWN_FRAMEWORK(Code)





Method Detail
checkForJDBC40Implementation
public static String checkForJDBC40Implementation(String classname)(Code)
returns the class name for the JDBC40 implementation if present. otherwise returns the class name of the class written for the lower jdk versions
Parameters:
  classname - String String containing the name of the appropriate implementation



cleanUpTest
public static void cleanUpTest(Statement s, String[] testObjects) throws SQLException(Code)
Drop the test objects passed in as a string identifying the type of object (e.g. TABLE, PROCEDURE) and its name. Thus, for example, a testObject array could be: {"TABLE MYSCHEMA.MYTABLE", "PROCEDURE THISDUMMY"} The statement passed in must be a 'live' statement in the test.



compareURL
public static boolean compareURL(String url)(Code)



dumpSQLExceptions
public static void dumpSQLExceptions(SQLException sqle)(Code)



dumpSQLExceptions
public static void dumpSQLExceptions(SQLException sqle, boolean expected)(Code)



endHTMLPage
public static void endHTMLPage()(Code)



getConnection
public static Connection getConnection(String databaseName, String connAttrs) throws SQLException(Code)
Get connection to given database using the connection attributes. This method is used by tests to get a secondary connection with different set of attributes. It does not use what is specified in app_properties file or system properties. This method uses DataSource class for CDC/Foundation Profile environments, which are based on JSR169. Using DataSource will not work with other j9 profiles. So DriverManager is used for non-JSR169. The method is used as a wrapper to hide this difference in getting connections in different environments.
Parameters:
  databaseName -
Parameters:
  connAttrs - Connection to database
throws:
  SQLException - on failure to connect.
throws:
  ClassNotFoundException - on failure to load driver.
throws:
  InstantiationException - on failure to load driver.
throws:
  IllegalAccessException - on failure to load driver.



getConnectionPoolDataSource
public static javax.sql.ConnectionPoolDataSource getConnectionPoolDataSource(Properties attrs)(Code)
Get a ConnectionPoolDataSource for the appropriate framework
Parameters:
  attrs - A set of attribute values to set on the datasource.The appropriate setter method wil bFor example the property databaseName with value wombat,will mean ds.setDatabaseName("wombat") will be called datasource for current framework



getDataSource
public static javax.sql.DataSource getDataSource(Properties attrs)(Code)
Get a data source for the appropriate framework
Parameters:
  attrs - A set of attribute values to set on the datasource.The appropriate setter method wil bFor example the property databaseName with value wombat,will mean ds.setDatabaseName("wombat") will be called datasource for current framework



getDataSourceConnection
public static Connection getDataSourceConnection(Properties prop) throws SQLException(Code)



getDataSourcePrefix
public static String getDataSourcePrefix()(Code)



getGetterName
public static String getGetterName(String attribute)(Code)



getHostName
public static String getHostName()(Code)
Get hostName as passed in - if not, set it to "localhost" hostName, as passed into system properties, or "localhost"



getJDBCMajorVersion
public static int getJDBCMajorVersion(Connection conn)(Code)
Get the JDBC version, inferring it from the driver.



getJdbcUrlPrefix
public static String getJdbcUrlPrefix()(Code)
Get URL prefix for current framework. url, assume localhost - unless set differently in System property - and assume port 1527 for Network Tests
See Also:    getJdbcUrlPrefix(String server, int port)



getJdbcUrlPrefix
public static String getJdbcUrlPrefix(String server, int port)(Code)
Get URL prefix for current framework
Parameters:
  server - host to connect to with client driver ignored for embedded driver
Parameters:
  port - port to connect to with client driverignored with embedded driver URL prefixEMBEDDED_FRAMEWORK returns "jdbc:derby"DERBY_NET_FRAMEWORK = "jdbc:derby:net://:port/"DERBY_NET_CLIENT_FRAMEWORK = "jdbc:derby://:port/"DB2_JCC_FRAMEWORK = "jdbc:db2://:port/"



getNameFromJdbcType
public static String getNameFromJdbcType(int jdbcType)(Code)



getSetterName
public static String getSetterName(String attribute)(Code)



getSimpleDataSource
public static DataSource getSimpleDataSource(Properties attrs)(Code)



getXADataSource
public static javax.sql.XADataSource getXADataSource(Properties attrs)(Code)
Get an xa data source for the appropriate framework
Parameters:
  attrs - A set of attribute values to set on the datasource.The appropriate setter method wil bFor example the property databaseName with value wombat,will mean ds.setDatabaseName("wombat") will be called datasource for current framework



isDerbyNetClientFramework
public static boolean isDerbyNetClientFramework()(Code)



isEmbeddedFramework
public static boolean isEmbeddedFramework()(Code)



isJCCFramework
public static boolean isJCCFramework()(Code)
Is the JCC driver being used true for JCC driver



isNetFramework
public static boolean isNetFramework()(Code)
Is this a network testingframework? return true if the System Property framework is set to Derby Network client or JCC true if this is a Network Server test



loadDriver
public static void loadDriver() throws Exception(Code)
Load the appropriate driver for the current framework



printBoolArrayHTMLTable
public static void printBoolArrayHTMLTable(String rowDescription, String columnDescription, String[] rowLabels, String[] colLabels, boolean[][] array, String tableInfo)(Code)
Converts 2 dimensional boolean array into an HTML table. used by casting.java to print out casting doc
Parameters:
  rowLabels - - Row labels
Parameters:
  colLabels - - Column labels



shutdownUsingDataSource
public static void shutdownUsingDataSource(String dbName) throws SQLException(Code)



sqlNameFromJdbc
public static String sqlNameFromJdbc(int jdbcType)(Code)



startHTMLPage
public static void startHTMLPage(String title, String author)(Code)



stringToHexLiteral
public static String stringToHexLiteral(String s)(Code)
Just converts a string to a hex literal to assist in converting test cases that used to insert strings into bit data tables Converts using UTF-16BE just like the old casts used to.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.