From derby-dev-return-45861-apmail-db-derby-dev-archive=db.apache.org@db.apache.org Mon Jul 02 17:10:00 2007 Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 79897 invoked from network); 2 Jul 2007 17:09:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Jul 2007 17:09:59 -0000 Received: (qmail 84702 invoked by uid 500); 2 Jul 2007 17:10:01 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 84671 invoked by uid 500); 2 Jul 2007 17:10:01 -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 84662 invoked by uid 99); 2 Jul 2007 17:10:01 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jul 2007 10:10:01 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of msatoor@gmail.com designates 209.85.132.247 as permitted sender) Received: from [209.85.132.247] (HELO an-out-0708.google.com) (209.85.132.247) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jul 2007 10:09:57 -0700 Received: by an-out-0708.google.com with SMTP id c8so360911ana for ; Mon, 02 Jul 2007 10:09:37 -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:references; b=aKu4nTEIy9kORXZnBdZxhegVTEvhNn55tB3BMTWCijkFJUEyhGEvUmkSOnokKBQ59pX5SzeEGpVGJir67VyyG0Dy9pPIImmgHvgtWqvLqHrSjn+zwcwQg5JC0SFNj2YqaWEKo98J2ZECA/RgsOGzWTs6/nlrgXJJuDGLwF0FYDs= 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:references; b=mkUfyWq8I39awvM4E9299z42UHIXehcSc9AA5jm1sqV5XdituRB6yK/ZomhTrhwvnttx5P9YJWIne0ICLLrQfJTSmdwHOqE0jVxM5wLuw8TQ/yP5Jr961zfQObnlhLyqEJwUhQOrBcmJTIW5BoPTNCGTAaJE4u82VQb0Uol3K6g= Received: by 10.100.165.9 with SMTP id n9mr3806278ane.1183396176922; Mon, 02 Jul 2007 10:09:36 -0700 (PDT) Received: by 10.100.131.1 with HTTP; Mon, 2 Jul 2007 10:09:36 -0700 (PDT) Message-ID: Date: Mon, 2 Jul 2007 10:09:36 -0700 From: "Mamta Satoor" To: "Ravinder Reddy" , "Derby Development" Subject: Re: Regarding DERBY-2750 In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_120444_17279524.1183396176877" References: <56a83cd00706081436s47ad6e1fma2db1f1e7ff19701@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_120444_17279524.1183396176877 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Ravinder, I have more of a junit framework question for this particular test(for DERBY-1706) change. This test in the non-junit test framework made sure that it was executed before anyone physically created the SESSION schema. The reason for that is we wanted to make sure that if the SESSION schema didn't exist, we should be able to create a table inside that schema and that table creation should automatically create SESSION schema. Just like what would happen for any other user schema. Now in the junit framework, there is no way (I could be wrong) to ensure that this test fixture (ie the test for DERBY-1706) gets run before other test fixtures and hence it is possible that the SESSION schema has already been created by other test fixtures by the time this particular test fixture gets called and hence we won't really be testing what the original test intended to run. I guess one way would be drop the SESSION schema at the beginning of this test fixture and then run rest of the code in this test fixture. This will not test exactly what the original test was testing but will be close enough. Hope this helps, Mamta On 7/2/07, Ravinder Reddy wrote: > > > hi, > I am converting lang/declareGlobalTempTableJava.java to > junit. > One of the tests test the Derby1706 which was handled by You. > plzz look at the fixture and let me know If I am going something wrong. > > public void testDerby1706() throws SQLException { > Statement s = createStatement(); > s.executeUpdate("set schema SESSION"); > try{ > s.executeUpdate("create table DERBY1706(c11 int)"); > } > catch(SQLException e){ > assertFalse( "XJ001" == e.getSQLState()); > } > s.executeUpdate("drop table DERBY1706"); > s.executeUpdate("set schema APP"); > s.executeUpdate("drop schema SESSION restrict"); > > s.close(); > } > > Thanks in Advance. > > -- > > ****************************************************************************** > > Every problem that has been solved can be solved again in a better way > > - Ravinder Reddy > > > ******************************************************************************* > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > ------=_Part_120444_17279524.1183396176877 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
Hi Ravinder,
 
I have more of a junit framework question for this particular test(for DERBY-1706) change. This test in the non-junit test framework made sure that it was executed before anyone physically created the SESSION schema. The reason for that is we wanted to make sure that if the SESSION schema didn't exist, we should be able to create a table inside that schema and that table creation should automatically create SESSION schema. Just like what would happen for any other user schema.
 
Now in the junit framework, there is no way (I could be wrong) to ensure that this test fixture (ie the test for DERBY-1706) gets run before other test fixtures and hence it is possible that the SESSION schema has already been created by other test fixtures by the time this particular test fixture gets called and hence we won't really be testing what the original test intended to run. I guess one way would be drop the SESSION schema at the beginning of this test fixture and then run rest of the code in this test fixture. This will not test exactly what the original test was testing but will be close enough.
 
Hope this helps,
Mamta

 
On 7/2/07, Ravinder Reddy <pandiri@students.iiit.ac.in> wrote:

       hi,
               I am converting lang/declareGlobalTempTableJava.java to junit.
One of the tests test the Derby1706 which was handled by You.
plzz look at the fixture and let me know If I am going something wrong.

public void testDerby1706() throws SQLException {
               Statement s = createStatement();
               s.executeUpdate("set schema SESSION");
               try{
                       s.executeUpdate("create table DERBY1706(c11 int)");
               }
               catch(SQLException e){
                       assertFalse( "XJ001" == e.getSQLState());
               }
                s.executeUpdate("drop table DERBY1706");
                s.executeUpdate("set schema APP");
                s.executeUpdate("drop schema SESSION restrict");

          s.close();
       }

Thanks in Advance.

--
******************************************************************************

   Every problem that has been solved can be solved again in a better way

                                                  - Ravinder Reddy

*******************************************************************************


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


------=_Part_120444_17279524.1183396176877--