Java Doc for ResultSetTest.java in  » Database-JDBC-Connection-Pool » jTDS » net » sourceforge » jtds » test » 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 » jTDS » net.sourceforge.jtds.test 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


net.sourceforge.jtds.test.TestBase
   net.sourceforge.jtds.test.DatabaseTestCase
      net.sourceforge.jtds.test.ResultSetTest

ResultSetTest
public class ResultSetTest extends DatabaseTestCase (Code)

version:
   1.0



Constructor Summary
public  ResultSetTest(String name)
    

Method Summary
public static  voidmain(String[] args)
    
public  voidtestAbsoluteLargeValue()
     Test that calling absolute() with very large positive values positions the cursor after the last row and with very large negative values positions the cursor before the first row.
public  voidtestAbsoluteMinusOne()
     Test that absolute(-1) works the same as last().
public  voidtestCancelResultSet()
     Test for bug [1246270] Closing a statement after canceling it throws an exception.
public  voidtestCursorFallback()
     Test that the cursor fallback logic correctly discriminates between "real" sql errors and cursor open failures.
public  voidtestCursorFetch()
     Test the behavior of sp_cursorfetch with fetch sizes greater than 1.
public  voidtestCursorMaxRows()
     Test that Statement.setMaxRows() works on cursor ResultSets.
public  voidtestCursorPrevious()
     Test that ResultSet.previous() works correctly on cursor ResultSets.
public  voidtestCursorWarning()
     Test for bug [1022445] Cursor downgrade warning not raised.
public  voidtestDeleteRowMarksDeleted()
     Test that deleted rows are not removed but rather marked as deleted.
public  voidtestDistinctBug()
     Test bug with Sybase where readonly scrollable result set based on a SELECT DISTINCT returns duplicate rows.
public  voidtestDynamicCursors()
     Test if dynamic cursors (ResultSet.TYPE_SCROLL_SENSITIVE+1) see others' updates.
public  voidtestEmptyInsertRow()
     Test that insertRow() works with no values set.
public  voidtestGetByName()
     Test whether retrieval by name returns the first occurence (that's what the spec requires).
public  voidtestGetObject1()
     Test BIT data type.
public  voidtestGetObject2()
     Test TINYINT data type.
public  voidtestGetObject3()
     Test SMALLINT data type.
public  voidtestGetObject4()
     Test INT data type.
public  voidtestGetObject5()
     Test BIGINT data type.
public  voidtestInsertRowVisible()
     Test that inserted rows are visible in a scroll sensitive ResultSet and that they show up at the end.
public  voidtestMoreThan255Columns()
     Test if COL_INFO packets are processed correctly for ResultSets with over 255 columns.
public  voidtestOutOfMemory()
     Test the behavior of the ResultSet/Statement/Connection when the JVM runs out of memory (hopefully) in the middle of a packet.
public  voidtestPessimisticConcurrency()
     Test pessimistic concurrency for SQL Server (for Sybase optimistic concurrency will always be used).
public  voidtestRelative()
     Test for bug [1182066] regression bug resultset: relative() not working as expected.
public  voidtestRelativeLargeValue()
     Test that calling absolute() with very large positive values positions the cursor after the last row and with very large negative values positions the cursor before the first row.
public  voidtestResultSetColumnName1()
    
public  voidtestResultSetMetaData()
     Test for fixed bugs in ResultSetMetaData:
  1. isNullable() always returns columnNoNulls.
public  voidtestResultSetScroll1()
     Test for bug [961594] ResultSet.
public  voidtestResultSetScroll2()
     Test for bug [945462] getResultSet() return null if you use scrollable/updatable.
public  voidtestResultSetScroll3()
     Test for bug [1028881] statement.execute() causes wrong ResultSet type.
public  voidtestResultSetUpdate1()
     Test for bug [1008208] 0.9-rc1 updateNull doesn't work.
public  voidtestRowstat()
     Test for bug [1329765] Pseudo column ROWSTAT is back with SQL 2005 (September CTP).
public  voidtestSetObjectScale()
     Test for bug [1075977] setObject() causes SQLException.
public  voidtestUnicodeStream()
     Test that read() works ok on the stream returned by ResultSet.getUnicodeStream() (i.e.
public  voidtestUpdateRowDuplicatesRow()
     Test that updated rows are marked as deleted and the new values inserted at the end of the ResultSet if the primary key is updated.
public  voidtestUpdateRowNoChanges()
     Test for bug [1170777] resultSet.updateRow() fails if no row has been changed.
public  voidtestUpdateRowPosition()
     Test that after updateRow() the cursor is positioned correctly.
public  voidtestUpdateRowUpdatesRow()
     Test that updated rows are modified in place if the primary key is not updated.
public  voidtestUpdateableClientCursor()
     Test for bug [1197603] Cursor downgrade error in CachedResultSet -- updateable result sets were incorrectly downgraded to read only forward only ones when client side cursors were used.
public  voidtestZeroFetchSize()
     Test for bug [1232733] setFetchSize(0) causes exception.


Constructor Detail
ResultSetTest
public ResultSetTest(String name)(Code)




Method Detail
main
public static void main(String[] args)(Code)



testAbsoluteLargeValue
public void testAbsoluteLargeValue() throws SQLException(Code)
Test that calling absolute() with very large positive values positions the cursor after the last row and with very large negative values positions the cursor before the first row.



testAbsoluteMinusOne
public void testAbsoluteMinusOne() throws Exception(Code)
Test that absolute(-1) works the same as last().



testCancelResultSet
public void testCancelResultSet() throws Exception(Code)
Test for bug [1246270] Closing a statement after canceling it throws an exception.



testCursorFallback
public void testCursorFallback() throws Exception(Code)
Test that the cursor fallback logic correctly discriminates between "real" sql errors and cursor open failures.

This illustrates the logic added to fix:

  1. [1323363] Deadlock Exception not reported (SQL Server)
  2. [1283472] Unable to cancel statement with cursor resultset



testCursorFetch
public void testCursorFetch() throws Exception(Code)
Test the behavior of sp_cursorfetch with fetch sizes greater than 1.

Assertions tested:

  • The current row is always the first row returned by the last fetch, regardless of what fetch type was used.
  • Row number parameter is ignored by fetch types other than absolute and relative.
  • Refresh fetch type simply reruns the previous request (it ignores both row number and number of rows) and will not affect the current row.
  • Fetch next returns the packet of rows right after the last row returned by the last fetch (regardless of what type of fetch that was).
  • Fetch previous returns the packet of rows right before the first row returned by the last fetch (regardless of what type of fetch that was).
  • If a fetch previous tries to read before the start of the ResultSet the requested number of rows is returned, starting with row 1 and the error code returned is non-zero (2).



testCursorMaxRows
public void testCursorMaxRows() throws Exception(Code)
Test that Statement.setMaxRows() works on cursor ResultSets.



testCursorPrevious
public void testCursorPrevious() throws Exception(Code)
Test that ResultSet.previous() works correctly on cursor ResultSets.



testCursorWarning
public void testCursorWarning() throws Exception(Code)
Test for bug [1022445] Cursor downgrade warning not raised.



testDeleteRowMarksDeleted
public void testDeleteRowMarksDeleted() throws Exception(Code)
Test that deleted rows are not removed but rather marked as deleted.



testDistinctBug
public void testDistinctBug() throws Exception(Code)
Test bug with Sybase where readonly scrollable result set based on a SELECT DISTINCT returns duplicate rows.



testDynamicCursors
public void testDynamicCursors() throws Exception(Code)
Test if dynamic cursors (ResultSet.TYPE_SCROLL_SENSITIVE+1) see others' updates. SQL Server only.



testEmptyInsertRow
public void testEmptyInsertRow() throws Exception(Code)
Test that insertRow() works with no values set.



testGetByName
public void testGetByName() throws Exception(Code)
Test whether retrieval by name returns the first occurence (that's what the spec requires).



testGetObject1
public void testGetObject1() throws Exception(Code)
Test BIT data type.



testGetObject2
public void testGetObject2() throws Exception(Code)
Test TINYINT data type.



testGetObject3
public void testGetObject3() throws Exception(Code)
Test SMALLINT data type.



testGetObject4
public void testGetObject4() throws Exception(Code)
Test INT data type.



testGetObject5
public void testGetObject5() throws Exception(Code)
Test BIGINT data type.



testInsertRowVisible
public void testInsertRowVisible() throws Exception(Code)
Test that inserted rows are visible in a scroll sensitive ResultSet and that they show up at the end.



testMoreThan255Columns
public void testMoreThan255Columns() throws Exception(Code)
Test if COL_INFO packets are processed correctly for ResultSets with over 255 columns.



testOutOfMemory
public void testOutOfMemory() throws SQLException(Code)
Test the behavior of the ResultSet/Statement/Connection when the JVM runs out of memory (hopefully) in the middle of a packet.

Previously jTDS was not able to close a ResultSet/Statement/Connection after an OutOfMemoryError because the input stream pointer usually remained inside a packet and further attempts to dump the rest of the response failed because of "protocol confusions".




testPessimisticConcurrency
public void testPessimisticConcurrency() throws Exception(Code)
Test pessimistic concurrency for SQL Server (for Sybase optimistic concurrency will always be used).



testRelative
public void testRelative() throws Exception(Code)
Test for bug [1182066] regression bug resultset: relative() not working as expected.



testRelativeLargeValue
public void testRelativeLargeValue() throws SQLException(Code)
Test that calling absolute() with very large positive values positions the cursor after the last row and with very large negative values positions the cursor before the first row.



testResultSetColumnName1
public void testResultSetColumnName1() throws Exception(Code)
Test for bug [1009233] ResultSet getColumnName, getColumnLabel return wrong values



testResultSetMetaData
public void testResultSetMetaData() throws Exception(Code)
Test for fixed bugs in ResultSetMetaData:
  1. isNullable() always returns columnNoNulls.
  2. isSigned returns true in error for TINYINT columns.
  3. Type names for numeric / decimal have (prec,scale) appended in error.
  4. Type names for auto increment columns do not have "identity" appended.
NB: This test assumes getColumnName has been fixed to work as per the suggestion in bug report [1009233].
throws:
  Exception -



testResultSetScroll1
public void testResultSetScroll1() throws Exception(Code)
Test for bug [961594] ResultSet.



testResultSetScroll2
public void testResultSetScroll2() throws Exception(Code)
Test for bug [945462] getResultSet() return null if you use scrollable/updatable.



testResultSetScroll3
public void testResultSetScroll3() throws Exception(Code)
Test for bug [1028881] statement.execute() causes wrong ResultSet type.



testResultSetUpdate1
public void testResultSetUpdate1() throws Exception(Code)
Test for bug [1008208] 0.9-rc1 updateNull doesn't work.



testRowstat
public void testRowstat() throws Exception(Code)
Test for bug [1329765] Pseudo column ROWSTAT is back with SQL 2005 (September CTP).



testSetObjectScale
public void testSetObjectScale() throws Exception(Code)
Test for bug [1075977] setObject() causes SQLException.

Conversion of float values to String adds grouping to the value, which cannot then be parsed.




testUnicodeStream
public void testUnicodeStream() throws Exception(Code)
Test that read() works ok on the stream returned by ResultSet.getUnicodeStream() (i.e. it doesn't always fill the buffer, regardless of whether there's available data or not).



testUpdateRowDuplicatesRow
public void testUpdateRowDuplicatesRow() throws Exception(Code)
Test that updated rows are marked as deleted and the new values inserted at the end of the ResultSet if the primary key is updated.



testUpdateRowNoChanges
public void testUpdateRowNoChanges() throws Exception(Code)
Test for bug [1170777] resultSet.updateRow() fails if no row has been changed.



testUpdateRowPosition
public void testUpdateRowPosition() throws Exception(Code)
Test that after updateRow() the cursor is positioned correctly.



testUpdateRowUpdatesRow
public void testUpdateRowUpdatesRow() throws Exception(Code)
Test that updated rows are modified in place if the primary key is not updated.



testUpdateableClientCursor
public void testUpdateableClientCursor() throws Exception(Code)
Test for bug [1197603] Cursor downgrade error in CachedResultSet -- updateable result sets were incorrectly downgraded to read only forward only ones when client side cursors were used.



testZeroFetchSize
public void testZeroFetchSize() throws Exception(Code)
Test for bug [1232733] setFetchSize(0) causes exception.



Methods inherited from net.sourceforge.jtds.test.DatabaseTestCase
static int compareBytes(byte a1, byte a2)(Code)(Java Doc)
protected void dropFunction(String procname) throws SQLException(Code)(Java Doc)
protected void dropProcedure(String procname) throws SQLException(Code)(Java Doc)
protected void dropProcedure(Statement stmt, String procname) throws SQLException(Code)(Java Doc)
protected void dropTable(String tableName) throws SQLException(Code)(Java Doc)
protected String getLongString(int length)(Code)(Java Doc)
protected String getLongString(char ch)(Code)(Java Doc)
protected static int getType(Object o) throws SQLException(Code)(Java Doc)
protected static Map getTypemap()(Code)(Java Doc)

Fields inherited from net.sourceforge.jtds.test.TestBase
Connection con(Code)(Java Doc)
final public static Properties props(Code)(Java Doc)

Methods inherited from net.sourceforge.jtds.test.TestBase
public void compareInputStreams(InputStream is1, InputStream is2) throws IOException(Code)(Java Doc)
public void compareReaders(Reader r1, Reader r2) throws IOException(Code)(Java Doc)
protected void connect() throws Exception(Code)(Java Doc)
public void dump(ResultSet rs) throws SQLException(Code)(Java Doc)
public void dumpRow(ResultSet rs) throws SQLException(Code)(Java Doc)
public Connection getConnection() throws Exception(Code)(Java Doc)
public Connection getConnection(Properties override) throws Exception(Code)(Java Doc)
public void makeObjects(Statement stmt, int count) throws SQLException(Code)(Java Doc)
protected void makeTestTables(Statement stmt) throws SQLException(Code)(Java Doc)
public void setUp() throws Exception(Code)(Java Doc)
public void tearDown() throws Exception(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.