Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 26451 invoked from network); 4 Jun 2007 17:29:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Jun 2007 17:29:34 -0000 Received: (qmail 45779 invoked by uid 500); 4 Jun 2007 17:29:37 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 45757 invoked by uid 500); 4 Jun 2007 17:29:37 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 45748 invoked by uid 99); 4 Jun 2007 17:29:37 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Jun 2007 10:29:37 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of rmoazeni@gmail.com designates 209.85.146.183 as permitted sender) Received: from [209.85.146.183] (HELO wa-out-1112.google.com) (209.85.146.183) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Jun 2007 10:29:32 -0700 Received: by wa-out-1112.google.com with SMTP id k40so2023855wah for ; Mon, 04 Jun 2007 10:29:12 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=YewpImX2ynC3zjyAo6AMgP7RVZywt0BgUAxPUB/KnGKmA9EzE0yf2MA4CUv7N8iom9Y/3z6KQbu5L/JDl163B3ZlAe94tqmVlOKD+44CHgSkhekCzU2vILixc+iQuACA7Y7Rr6IIyhX585yOk9WvE72ukmJtZaZQDc5X5zwdMj4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=nDC3hW66y+X7PpRx/tXCSI2W/xaS7gSK7bL4OTpYazI/XsgYzx/jDo5jMCQCmFWW7QYxpAco7W5TwNzg12+QPozgFx1HRz4VXdQhF7Y7bxIr6BLznrgrIfG5siP9bKgyL5t7mIwaBiBF3BXftzzSRs49Ju/1ybGqjqZtjIhQKKw= Received: by 10.114.144.1 with SMTP id r1mr5082595wad.1180978152150; Mon, 04 Jun 2007 10:29:12 -0700 (PDT) Received: by 10.114.176.2 with HTTP; Mon, 4 Jun 2007 10:29:12 -0700 (PDT) Message-ID: <926963240706041029t3f41d4e3n94c4fb737c3b05da@mail.gmail.com> Date: Mon, 4 Jun 2007 10:29:12 -0700 From: "Ramin Moazeni" To: derby-dev@db.apache.org Subject: Re: [jira] Commented: (DERBY-2658) Convert jdbcapi/parameterMetaDataJdbc30.java to JUnit In-Reply-To: <23091891.1180558335731.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <25545928.1179301936619.JavaMail.jira@brutus> <23091891.1180558335731.JavaMail.jira@brutus> X-Virus-Checked: Checked by ClamAV on apache.org Hi I need to confirm that for converting the System.out's from the old tests into assertions for example System.out.println("parameters count for callable statement is: " + paramMetaData.getParameterCount()); I have to look up the expected value in the functionTests/master/parameterMetaDataJdbc30.out when I translate this to assertEquals? Thanks Ramin On 5/30/07, Kathey Marsden (JIRA) wrote: > > [ https://issues.apache.org/jira/browse/DERBY-2658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12500234 ] > > Kathey Marsden commented on DERBY-2658: > --------------------------------------- > > Thanks Ramin for looking at this test conversion. The main thing I think is that we really need to make sure that we are testing everything the old test tested. Below are some specific comments, but it would be good to do a close review comparing the old and new test to make sure that we have assertions for all of the cases that were tested by canon comparison before. Anyway, here are some comments .... > > Typically the test class name for the junit tests starts with a capital letter. e.g. ParameterMetaDataJdbc30Test > > parameterMetaDataJdbc30_app.properties and master/parameterMetaDataJdbc30.out should be deleted. > > Attach the output of svn stat to your next patch. > > > When I run the test all the tests fail with > parameterMetaDataJdbc30Test)java.sql.SQLException: Schema 'SAMPLE' does not exist > This is I think because setUp attempts to drop the table that is not there. > I think you would be better off using CleanDatabaseSetup and the decorateSQL method to create your table and function, rather than creating it with each fixture. There are lots of examples of CleanDatabaseSetup usage in other tests. > > The dumpExpectedSQLExceptions method only checks an SQLException's sqlstate against itself, so would always pass. Instead of calls to dumpExpectedSQLExceptions > you should have assertSQLState("XXXXX",e) where XXXX is the hardcoded expected SQLState. You can see the expected states by looking at the canon in functionTests/master/parameterMetaDataJdbc30.out or just temporarily printing SQLState to see what it is. > > > Calls like assertTrue ("Jira 44 failed.", "22019".equals(e.getSQLState()) can be replaced by assertSQLState > > The System.out's in the old test need to be translated into assertions. e.g. > //System.out.println("parameters count for callable statement is: " + paramMetaData.getParameterCount()); > should be replaced with an assertEquals call. > > dumpParameterMetaDataNegative doesn't look quite right to me. It seems like it would always fail. Instead of > > try { > fail("parameter isNullable " + paramMetaData.isNullable(-1)); > } catch (SQLException e) { > dumpExpectedSQLExceptions(e); > } > > I would expect something like. > try { > parameterMetaData.isNullable(-1); > fail("parameterMetaData.isNullable(-1) should have failed); > } catch (SQLException se) > { > assertSQLState("XCL13",se.getSQLState()); > } > > For the code where we have if(!usingDerbyNetClient()) there should be an explanation of why we don't run with client with a Jira reference. If there is a bug and it is not filed, file one. > > The fixtures testParameterMetadataWithXXXParameters () doesn't actually seem to test the parameterMetaData. I don't know if that is an artifact of the old test but we should add in some testing. > > > > > > Convert jdbcapi/parameterMetaDataJdbc30.java to JUnit > > ----------------------------------------------------- > > > > Key: DERBY-2658 > > URL: https://issues.apache.org/jira/browse/DERBY-2658 > > Project: Derby > > Issue Type: Test > > Components: Test > > Affects Versions: 10.3.0.0 > > Reporter: Ramin Moazeni > > Assignee: Ramin Moazeni > > Fix For: 10.3.0.0 > > > > Attachments: DERBY-2658.diff > > > > > > Convert jdbcapi/parameterMetaDataJdbc30.java to JUnit. > > -- > This message is automatically generated by JIRA. > - > You can reply to this email to add a comment to the issue online. > >