|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.apache.derbyTesting.junit.BaseTestCase
org.apache.derbyTesting.junit.BaseJDBCTestCase
org.apache.derbyTesting.functionTests.tests.jdbcapi.SURBaseTest
org.apache.derbyTesting.functionTests.tests.jdbcapi.SURQueryMixTest
public class SURQueryMixTest
Tests for Scrollable Updatable ResultSet (SUR). This TestCase tests scrolling (navigation), updates (using updateXXX() and updateRow() or positioned updates), deletion of records (using deleteRow() or positioned deletes) of ResultSets.
| Field Summary | |
|---|---|
private boolean |
checkRowDeleted
|
private boolean |
checkRowUpdated
|
private java.lang.String |
cursorName
|
private boolean |
positioned
|
private static java.lang.String[] |
projectConditions
|
private java.lang.String |
query
|
private static java.lang.String[] |
selectConditions
|
| Fields inherited from class org.apache.derbyTesting.functionTests.tests.jdbcapi.SURBaseTest |
|---|
CURSOR_NOT_POSITIONED_ON_INSERT_ROW, CURSOR_NOT_UPDATABLE_SQL_STATE, CURSOR_OPERATION_CONFLICT, FOR_UPDATE_NOT_PERMITTED_SQL_STATE, INVALID_CURSOR_STATE_NO_CURRENT_ROW, LOCK_TIMEOUT_EXPRESSION_SQL_STATE, LOCK_TIMEOUT_SQL_STATE, QUERY_NOT_QUALIFIED_FOR_UPDATABLE_RESULTSET, recordCount, RESULTSET_NOT_UPDATABLE_SQL_STATE |
| Fields inherited from class org.apache.derbyTesting.junit.BaseTestCase |
|---|
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE |
| Constructor Summary | |
|---|---|
SURQueryMixTest(java.lang.String model,
java.lang.String query,
java.lang.String cursorName,
boolean positioned)
Constructor |
|
| Method Summary | |
|---|---|
private static junit.framework.Test |
baseSuite(java.lang.String name)
The suite contains all testcases in this class running on different data models |
private java.util.List |
createRandomSample(java.util.Map rows,
int k)
Create a random sample of rows |
private java.util.Map |
createRowMap(java.sql.ResultSet rs)
Creates a Map of the values in the ResultSet. |
private static junit.framework.TestSuite |
createTestCases(java.lang.String modelName)
|
private void |
deleteRandomSampleOfNRecords(java.sql.ResultSet rs,
java.util.Map rows,
java.util.Set deletedRows,
int k)
Delete a random sample of n records in the resultset |
private java.lang.String |
getRowString(java.sql.ResultSet rs)
Get a concatenation of the values of the current Row in the ResultSet |
void |
runTest()
Test SUR properties of the query |
static junit.framework.Test |
suite()
Run in client and embedded. |
private void |
testNavigation(java.sql.ResultSet rs,
java.util.Map rows,
java.util.Set updatedRows,
java.util.Set deletedRows)
Tests navigation in ResultSet. |
private void |
updatePositioned(java.sql.ResultSet rs,
java.sql.ResultSetMetaData meta)
Updates the current row in the ResultSet using updateRow() |
private void |
updateRandomSampleOfNRecords(java.sql.ResultSet rs,
java.util.Map rows,
java.util.Set updatedRows,
int k)
Update a random sample of n records in the resultset |
private void |
updateRow(java.sql.ResultSet rs,
java.sql.ResultSetMetaData meta)
Updates the current row in the ResultSet using updateRow() |
| Methods inherited from class org.apache.derbyTesting.functionTests.tests.jdbcapi.SURBaseTest |
|---|
assertFailOnUpdate, assertWarning, initializeConnection, scrollBackward, scrollBackwardAndUpdate, scrollBackwardAndUpdatePositioned, scrollForward, scrollForwardAndUpdate, scrollForwardAndUpdatePositioned, updateTuple, updateTuplePositioned, verifyTuple |
| Methods inherited from class org.apache.derbyTesting.junit.BaseTestCase |
|---|
alarm, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertSecurityManager, assertThrowableEquals, execJavaCmd, fail, getFailureFolder, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeSystemProperty, runBare, setSystemProperty, traceit |
| Methods inherited from class junit.framework.TestCase |
|---|
countTestCases, createResult, getName, run, run, setName, setUp, toString |
| Methods inherited from class junit.framework.Assert |
|---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private final java.lang.String query
private final java.lang.String cursorName
private final boolean positioned
private boolean checkRowUpdated
private boolean checkRowDeleted
private static final java.lang.String[] selectConditions
private static final java.lang.String[] projectConditions
| Constructor Detail |
|---|
public SURQueryMixTest(java.lang.String model,
java.lang.String query,
java.lang.String cursorName,
boolean positioned)
model - name of data model for this TestCasequery - to use for producing the resultsetcursorName - name of cursorpositioned - flag to determine if the Test should use positioned
updates/deletes instead of updateRow() and deleteRow()| Method Detail |
|---|
public void runTest()
throws java.sql.SQLException
runTest in class junit.framework.TestCasejava.sql.SQLException
private java.util.Map createRowMap(java.sql.ResultSet rs)
throws java.sql.SQLException
java.sql.SQLException
private java.util.List createRandomSample(java.util.Map rows,
int k)
rows - Map to create sample fromk - number of rows in the sample
private void deleteRandomSampleOfNRecords(java.sql.ResultSet rs,
java.util.Map rows,
java.util.Set deletedRows,
int k)
throws java.sql.SQLException
rs - result set to be updatedrows - map of rows, will also be updateddeletedRows - set of rows being deleted (position in RS)k - number of records to be deleted
java.sql.SQLException
private void updateRandomSampleOfNRecords(java.sql.ResultSet rs,
java.util.Map rows,
java.util.Set updatedRows,
int k)
throws java.sql.SQLException
rs - result set to be updatedrows - map of rows, will also be updatedupdatedRows - set of being updated (position in RS)k - number of records to be updated
java.sql.SQLException
private void updateRow(java.sql.ResultSet rs,
java.sql.ResultSetMetaData meta)
throws java.sql.SQLException
rs - ResultSet to be updatedmeta - meta for the ResultSet
java.sql.SQLException
private void updatePositioned(java.sql.ResultSet rs,
java.sql.ResultSetMetaData meta)
throws java.sql.SQLException
rs - ResultSet to be updatedmeta - meta for the ResultSet
java.sql.SQLException
private void testNavigation(java.sql.ResultSet rs,
java.util.Map rows,
java.util.Set updatedRows,
java.util.Set deletedRows)
throws java.sql.SQLException
rs - ResultSet to test navigation of.
Needs to be scrollablerows - a sample of the rows which are in the ResultSet. Maps
position to a concatenation of the string valuesupdatedRows - a integer set of which rows that have been
updated. Used to test rowUpdated()deletedRows - a integer set of which rows that have been
deleted. Used to test rowDeleted()
java.sql.SQLException
private java.lang.String getRowString(java.sql.ResultSet rs)
throws java.sql.SQLException
java.sql.SQLExceptionprivate static junit.framework.TestSuite createTestCases(java.lang.String modelName)
public static junit.framework.Test suite()
private static junit.framework.Test baseSuite(java.lang.String name)
|
Built on Sat 2009-11-28 18:44:18-0800, from revision 885187 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||