db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kathey Marsden (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-3663) Convert store/streamingColumn to JUnit
Date Wed, 28 May 2008 18:01:45 GMT

    [ https://issues.apache.org/jira/browse/DERBY-3663?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12600545#action_12600545
] 

Kathey Marsden commented on DERBY-3663:
---------------------------------------

I looked at the new patch. Thank you for converting this big test.  In general I think you
need to review the places where you catch exceptions and make sure there is a fail call if
the exception is expected and assertSQLState for the expected exceptions.  I have a few specific
comments below. 


-- Where you have code that catches an exception and rethrows it or prints the stack trace,
you can eliminate the try catch block and just let the exception be thrown.
.... e.g.

} catch (Exception e) {
			throw e;
		}

			} catch (SQLException sqle) {
				println("UNEXPECTED EXCEPTION - update should have actually gone through");
				throw sqle;
			}

-- You can eliminate the unused local variables for ResultSetMetaData and ResultSet.


-- We could probably use java.util.Arrays.equals() instead of byteArrayEquals


-- insertDataUsingConcat 
we have:
		// for varchars, trailing blank truncation will not throw an exception.
		// Only non-blank characters will cause truncation error
		// for long varchars, any character truncation will throw an exception.
	try {
			stmt.execute(sql);
			println("No truncation and hence no error.");
		} catch (SQLException e) {
			assertSQLState("22001", e); // truncation error
			println("expected exception for data > " + maxValueAllowed
					+ " in length");
		}

There is Is no fail call after stmt.execute(sql) for the cases that are expected to fail.
 Similar problem in insertDataUsingCharacterStream, insertDataUsingAsciiStream, testStream1.

--testDerby500
Need a fail before catching the expected SQLException.
and should assertSQLState for the expected exception
			println("DERBY500 #1 Rows updated  =" + rowCount);

			} catch (SQLException sqle) {
				println("EXPECTED EXCEPTION - streams cannot be re-used");
				// expectedException(sqle);
				rollback();
			}



> Convert store/streamingColumn to JUnit
> --------------------------------------
>
>                 Key: DERBY-3663
>                 URL: https://issues.apache.org/jira/browse/DERBY-3663
>             Project: Derby
>          Issue Type: Test
>          Components: Test
>            Reporter: Suran Jayathilaka
>            Assignee: Suran Jayathilaka
>         Attachments: derby-3663-1.diff, derby-3663-2.diff
>
>
> Convert org.apache.derbyTesting.functionTests.tests.store.streamingColumn to a JUnit
testcase.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message