Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 85533 invoked from network); 8 Apr 2008 19:24:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Apr 2008 19:24:10 -0000 Received: (qmail 31743 invoked by uid 500); 8 Apr 2008 19:24:10 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 31585 invoked by uid 500); 8 Apr 2008 19:24:10 -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 31488 invoked by uid 99); 8 Apr 2008 19:24:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Apr 2008 12:24:09 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Apr 2008 19:23:35 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 57F96234C0C2 for ; Tue, 8 Apr 2008 12:21:24 -0700 (PDT) Message-ID: <1527417810.1207682484359.JavaMail.jira@brutus> Date: Tue, 8 Apr 2008 12:21:24 -0700 (PDT) From: "Mamta A. Satoor (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Created: (DERBY-3608) Add test cases for missing Collator support during the reboot of a territory based database MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Add test cases for missing Collator support during the reboot of a territor= y based database ---------------------------------------------------------------------------= ---------------- Key: DERBY-3608 URL: https://issues.apache.org/jira/browse/DERBY-3608 Project: Derby Issue Type: Test Components: Test Affects Versions: 10.3.2.2, 10.4.0.0, 10.5.0.0 Reporter: Mamta A. Satoor Changes into Derby engine for missing Collator support went in as part of D= ERBY-3320. A test case was added in DERBY-3320 if the required Collator was= not available during the database create time. But it will be nice to add = 2 more test cases to cover the reboot of the territory based database. I am= copying following from DERBY-3320 which explains what test cases need to b= e added(also, in order to add the 2 test cases, we need to have a way of re= moving Collator support. Vemund =C3=98stgaard had a suggestion on how that = can be done. I will copy his suggestion towards the end of this field. *******************************Copied from DERBY-3320**********************= **** The test cases that will be nice to have are 1)create a territory based dat= abase, then crash it, then make sure that the Collator support for the dat= abase's locale is not available anymore and then try to reboot the database= , This should make the database go through the recovery and the recovery co= de should fail because Collator support does not exist 2)create a territory= based database, then shut it down, then make sure that the Collator suppor= t for the database's locale is not available anymore and then reboot the da= tabase. The database reboot should succeed because it did not need access t= o Collator. Now, issue a SQL which will do a collation operation and then c= ollation operation should fail because Collator is not available. The manual steps in ij for test case 1 would be connect 'jdbc:derby:c:/dellater/dbTerritory;create=3Dtrue;territory=3Dno;co= llation=3DTERRITORY_BASED'; create table t1(c11 int, c12 char(4)); create index i1 on t1(c12); autocommit off; insert into t1 values (1,'11'),(2,'22'); insert into t1 values (3,'33'),(4,'44'); delete from t1 where c11=3D1; --IMPORTANT STEP. Ctrl-C out of ij. ie do not exit but instead, force a dat= abase crash by doing Ctrl-C. Now, remove the Collator support for Norway an= d restart ij again and following reboot of the db should fail connect 'jdbc:derby:c:/dellater/dbTerritory'; The manual steps in ij for test case 2 would be connect 'jdbc:derby:c:/dellater/dbTerritory;create=3Dtrue;territory=3Dno;co= llation=3DTERRITORY_BASED'; create table t1(c11 int, c12 char(4)); insert into t1 values (1,'11'),(2,'22'); exit; --IMPORTANT STEP Remove the Collator support for Norway and restart ij and = connect to the database connect 'jdbc:derby:c:/dellater/dbTerritory'; --following SQL will fail because it requires acces to Collator select * from t1; I have not spent the time on Vemund's suggestion about creating and adding = a custom Collator and removing it. This jira entry can be used for explorin= g custom Collator code and then using it to add the 2 test cases mentioned = above. In the mean time, I did hand tweaked the Derby code to make sure tha= t the above 2 test cases fail in my client as expected. In both the test cases above, before we restart the ij, I changed DataValue= FactoryImpl.verifyCollatorSupport code to always throw an exception that Co= llator is not found. So, my changes in DataValueFactoryImpl.verifyCollatorS= upport would look as follows Locale[] availLocales =3D Collator.getAvailableLocales(); //Verify that Collator can be instantiated for the given locale. boolean localeFound =3D false; for (int i=3D0; i