Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 18E4475AD for ; Tue, 26 Jul 2011 06:50:00 +0000 (UTC) Received: (qmail 79285 invoked by uid 500); 26 Jul 2011 06:50:00 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 79072 invoked by uid 500); 26 Jul 2011 06:49:41 -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 79063 invoked by uid 99); 26 Jul 2011 06:49:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jul 2011 06:49:34 +0000 X-ASF-Spam-Status: No, hits=-2001.2 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jul 2011 06:49:31 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 8F22F86272 for ; Tue, 26 Jul 2011 06:49:09 +0000 (UTC) Date: Tue, 26 Jul 2011 06:49:09 +0000 (UTC) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Message-ID: <1632545149.6778.1311662949583.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (DERBY-4249) Create a simple store recovery test in JUnit MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-4249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13070975#comment-13070975 ] Knut Anders Hatlen commented on DERBY-4249: ------------------------------------------- Some comments in addition to what Dag said: - On the terminology: My understanding is that "fixture" refers to the fixed state created by the setUp() method, so it's not something one can launch. It would probably be clearer to call the method something like "assertLaunchedJUnitTestMethod". - I think the assert method should throw any exceptions it encounters, not catch them and print them. - Perhaps we could take advantage of the existing assertExecJavaCmdAsExpected() method? That method checks both the exit status and the presence of expected strings in the output, and it only prints the output from the nested test if it's not what we expected, so it would probably address Dag's first two comments. Something like this might work: String[] cmd = new String[] { "junit.textui.TestRunner", "-m", testMethod }; assertExecJavaCmdAsExpected(new String[] { "OK (1 test)" }, cmd, 0); > Create a simple store recovery test in JUnit > -------------------------------------------- > > Key: DERBY-4249 > URL: https://issues.apache.org/jira/browse/DERBY-4249 > Project: Derby > Issue Type: Improvement > Components: Test > Affects Versions: 10.6.1.0 > Reporter: Kathey Marsden > Assignee: Siddharth Srivastava > Priority: Minor > Attachments: d4249.diff, d4249_1.diff, d4249_2.diff, d4249_3.diff > > > It would be good to be able to start converting the store recovery tests or at least be able to write new recovery tests in JUnit. We could start by writing a simple recovery test just to establish the framework. The test should. > - Connect, create a table, commit and shutdown the database. > - fork a jvm, add one row, commit, add another row, exit the jvm. > - Reconnect with the first jvm and verify that the first row is there and the second is not. > I guess the main thing to decide is how to spawn the second jvm and check results. I tend to think the second jvm should actually execute another JUnit test, verify the exit code (assuming a failed test has a non-zero exit code) and then put the output in the fail assertion if it fails so it shows up in the report at the end of the Suite execution. I think we could create a test runner that takes a class and a specific test to run instead of the whole suite, so we could keep our methods consolidated in a single class for the test, but all pure conjecture at this point. I'll have to give it a try, but wanted to first see if folks thought this was a reasonable approach. > -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira