Java Doc for BaseTestCase.java in  » Database-JDBC-Connection-Pool » mysql-connector-java-5.1.3 » testsuite » 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 JDBC Connection Pool » mysql connector java 5.1.3 » testsuite 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


testsuite.BaseTestCase

BaseTestCase
abstract public class BaseTestCase extends TestCase (Code)
Base class for all test cases. Creates connections, statements, etc. and closes them.
author:
   Mark Matthews
version:
   $Id: BaseTestCase.java 5440 2006-06-27 17:00:53 +0000 (Tue, 27 Jun
version:
   2006) mmatthews $


Field Summary
protected  Connectionconn
     Connection to server, initialized in setUp() Cleaned up in tearDown().
protected  StringdbClass
    
protected static  StringdbUrl
    
protected  PreparedStatementpstmt
     PreparedStatement to be used in tests, not initialized.
protected  ResultSetrs
     ResultSet to be used in tests, not initialized.
protected  Statementstmt
     Statement to be used in tests, initialized in setUp().

Constructor Summary
public  BaseTestCase(String name)
     Creates a new BaseTestCase object.

Method Summary
protected  voidcleanupTempFiles(File exampleTempFile, String tempfilePrefix)
    
protected  voidcloseMemberJDBCResources()
    
protected  voidcreateFunction(String functionName, String functionDefn)
    
protected  voidcreateProcedure(String procedureName, String procedureDefn)
    
protected  voidcreateSchemaObject(String objectType, String objectName, String columnsAndOtherStuff)
    
protected  voidcreateTable(String tableName, String columnsAndOtherStuff)
    
protected  voiddropFunction(String functionName)
    
protected  voiddropProcedure(String procedureName)
    
protected  voiddropSchemaObject(String objectType, String objectName)
    
protected  voiddropTable(String tableName)
    
protected  ConnectiongetAdminConnection()
    
protected  ConnectiongetAdminConnectionWithProps(Properties props)
    
protected  ConnectiongetConnectionWithProps(String propsList)
    
protected  ConnectiongetConnectionWithProps(String url, String propsList)
    
protected  ConnectiongetConnectionWithProps(Properties props)
     Returns a new connection with the given properties
Parameters:
  props - the properties to use (the URL will come from the standard forthis testcase).
protected  ConnectiongetConnectionWithProps(String url, Properties props)
    
protected  intgetInstanceNumber()
    
protected  StringgetMysqlVariable(Connection c, String variableName)
    
protected  StringgetMysqlVariable(String variableName)
     Returns the named MySQL variable from the currently connected server.
protected  PropertiesgetPropertiesFromTestsuiteUrl()
     Returns the properties that represent the default URL used for connections for all testcases.
protected  intgetRowCount(String tableName)
    
protected  ObjectgetSingleIndexedValueWithQuery(Connection c, int columnIndex, String query)
    
protected  ObjectgetSingleIndexedValueWithQuery(int columnIndex, String query)
    
protected  ObjectgetSingleValue(String tableName, String columnName, String whereClause)
    
protected  ObjectgetSingleValueWithQuery(String query)
    
protected  booleanisAdminConnectionConfigured()
    
protected  booleanisClassAvailable(String classname)
    
protected  booleanisRunningOnJRockit()
    
protected  booleanisRunningOnJdk131()
    
protected  booleanisServerRunningOnWindows()
    
public  voidlogDebug(String message)
    
protected  FilenewTempBinaryFile(String name, long size)
    
protected  StringrandomString()
    
final protected  booleanrunLongTests()
    
protected  booleanrunMultiHostTests()
    
protected  booleanrunTestIfSysPropDefined(String propName)
    
public  voidsetUp()
     Creates resources used by all tests.
public  voidtearDown()
     Destroys resources created during the test case.
protected  booleanversionMeetsMinimum(int major, int minor)
    
protected  booleanversionMeetsMinimum(int major, int minor, int subminor)
    

Field Detail
conn
protected Connection conn(Code)
Connection to server, initialized in setUp() Cleaned up in tearDown().



dbClass
protected String dbClass(Code)
The driver to use



dbUrl
protected static String dbUrl(Code)
JDBC URL, initialized from com.mysql.jdbc.testsuite.url system property, or defaults to jdbc:mysql:///test



pstmt
protected PreparedStatement pstmt(Code)
PreparedStatement to be used in tests, not initialized. Cleaned up in tearDown().



rs
protected ResultSet rs(Code)
ResultSet to be used in tests, not initialized. Cleaned up in tearDown().



stmt
protected Statement stmt(Code)
Statement to be used in tests, initialized in setUp(). Cleaned up in tearDown().




Constructor Detail
BaseTestCase
public BaseTestCase(String name)(Code)
Creates a new BaseTestCase object.
Parameters:
  name - The name of the JUnit test case




Method Detail
cleanupTempFiles
protected void cleanupTempFiles(File exampleTempFile, String tempfilePrefix)(Code)



closeMemberJDBCResources
protected void closeMemberJDBCResources()(Code)



createFunction
protected void createFunction(String functionName, String functionDefn) throws SQLException(Code)



createProcedure
protected void createProcedure(String procedureName, String procedureDefn) throws SQLException(Code)



createSchemaObject
protected void createSchemaObject(String objectType, String objectName, String columnsAndOtherStuff) throws SQLException(Code)



createTable
protected void createTable(String tableName, String columnsAndOtherStuff) throws SQLException(Code)



dropFunction
protected void dropFunction(String functionName) throws SQLException(Code)



dropProcedure
protected void dropProcedure(String procedureName) throws SQLException(Code)



dropSchemaObject
protected void dropSchemaObject(String objectType, String objectName) throws SQLException(Code)



dropTable
protected void dropTable(String tableName) throws SQLException(Code)



getAdminConnection
protected Connection getAdminConnection() throws SQLException(Code)



getAdminConnectionWithProps
protected Connection getAdminConnectionWithProps(Properties props) throws SQLException(Code)



getConnectionWithProps
protected Connection getConnectionWithProps(String propsList) throws SQLException(Code)



getConnectionWithProps
protected Connection getConnectionWithProps(String url, String propsList) throws SQLException(Code)



getConnectionWithProps
protected Connection getConnectionWithProps(Properties props) throws SQLException(Code)
Returns a new connection with the given properties
Parameters:
  props - the properties to use (the URL will come from the standard forthis testcase). a new connection using the given properties.
throws:
  SQLException - DOCUMENT ME!



getConnectionWithProps
protected Connection getConnectionWithProps(String url, Properties props) throws SQLException(Code)



getInstanceNumber
protected int getInstanceNumber()(Code)
Returns the per-instance counter (for messages when multi-threading stress tests) int the instance number



getMysqlVariable
protected String getMysqlVariable(Connection c, String variableName) throws SQLException(Code)



getMysqlVariable
protected String getMysqlVariable(String variableName) throws SQLException(Code)
Returns the named MySQL variable from the currently connected server.
Parameters:
  variableName - the name of the variable to return the value of the given variable, or NULL if it doesn't exist
throws:
  SQLException - if an error occurs



getPropertiesFromTestsuiteUrl
protected Properties getPropertiesFromTestsuiteUrl() throws SQLException(Code)
Returns the properties that represent the default URL used for connections for all testcases. properties parsed from com.mysql.jdbc.testsuite.url
throws:
  SQLException - if parsing fails



getRowCount
protected int getRowCount(String tableName) throws SQLException(Code)



getSingleIndexedValueWithQuery
protected Object getSingleIndexedValueWithQuery(Connection c, int columnIndex, String query) throws SQLException(Code)



getSingleIndexedValueWithQuery
protected Object getSingleIndexedValueWithQuery(int columnIndex, String query) throws SQLException(Code)



getSingleValue
protected Object getSingleValue(String tableName, String columnName, String whereClause) throws SQLException(Code)



getSingleValueWithQuery
protected Object getSingleValueWithQuery(String query) throws SQLException(Code)



isAdminConnectionConfigured
protected boolean isAdminConnectionConfigured()(Code)



isClassAvailable
protected boolean isClassAvailable(String classname)(Code)



isRunningOnJRockit
protected boolean isRunningOnJRockit()(Code)



isRunningOnJdk131
protected boolean isRunningOnJdk131()(Code)



isServerRunningOnWindows
protected boolean isServerRunningOnWindows() throws SQLException(Code)



logDebug
public void logDebug(String message)(Code)



newTempBinaryFile
protected File newTempBinaryFile(String name, long size) throws IOException(Code)



randomString
protected String randomString()(Code)



runLongTests
final protected boolean runLongTests()(Code)



runMultiHostTests
protected boolean runMultiHostTests()(Code)



runTestIfSysPropDefined
protected boolean runTestIfSysPropDefined(String propName)(Code)
Checks whether a certain system property is defined, in order to run/not-run certain tests
Parameters:
  propName - the property name to check for true if the property is defined.



setUp
public void setUp() throws Exception(Code)
Creates resources used by all tests.
throws:
  Exception - if an error occurs.



tearDown
public void tearDown() throws Exception(Code)
Destroys resources created during the test case.
throws:
  Exception - DOCUMENT ME!



versionMeetsMinimum
protected boolean versionMeetsMinimum(int major, int minor) throws SQLException(Code)
Checks whether the database we're connected to meets the given version minimum
Parameters:
  major - the major version to meet
Parameters:
  minor - the minor version to meet boolean if the major/minor is met
throws:
  SQLException - if an error occurs.



versionMeetsMinimum
protected boolean versionMeetsMinimum(int major, int minor, int subminor) throws SQLException(Code)
Checks whether the database we're connected to meets the given version minimum
Parameters:
  major - the major version to meet
Parameters:
  minor - the minor version to meet boolean if the major/minor is met
throws:
  SQLException - if an error occurs.



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