Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 4744 invoked from network); 4 Feb 2008 17:41:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Feb 2008 17:41:44 -0000 Received: (qmail 39609 invoked by uid 500); 4 Feb 2008 17:41:35 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 39586 invoked by uid 500); 4 Feb 2008 17:41:35 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 39577 invoked by uid 99); 4 Feb 2008 17:41:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Feb 2008 09:41:35 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of marcel.reutegger@gmx.net designates 213.165.64.20 as permitted sender) Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 04 Feb 2008 17:41:06 +0000 Received: (qmail invoked by alias); 04 Feb 2008 17:41:12 -0000 Received: from adsl-84-226-60-53.adslplus.ch (EHLO [10.0.1.199]) [84.226.60.53] by mail.gmx.net (mp042) with SMTP; 04 Feb 2008 18:41:12 +0100 X-Authenticated: #894343 X-Provags-ID: V01U2FsdGVkX18X4x82d5UXX2rv5PB9Wcdb4R1AZg49M34nrMvOCX TILwV20NA+8+vP Message-ID: <47A74E37.80300@gmx.net> Date: Mon, 04 Feb 2008 18:41:11 +0100 From: Marcel Reutegger User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: dev@jackrabbit.apache.org Subject: Re: Running all Jackrabbit tests with multiple configurations References: <5f211bd50801300150l2c50b87bicdbc45de4ab8006d@mail.gmail.com> In-Reply-To: <5f211bd50801300150l2c50b87bicdbc45de4ab8006d@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Virus-Checked: Checked by ClamAV on apache.org Hi Thomas, I would rather parametrize the current test setup and invoke the test suites multiple times. without having looked at it in detail, that requires the following steps: - create multiple repository.xml and workspace.xml files in src/test/repository/** - for each repository.xml file the default workspace will be different -> different workspace.xml file (e.g. different persistence manager) - change JackrabbitRepositoryStub to also take into account system properties, like it already does for the jaas config. > mvn install will run just like today, but > mvn -Dorg.apache.jackrabbit.repository.config=target/repository/repository-with-data-store.xml install will now run the tests with a datastore configured. if needed we can specify different repository homes similarly. regards marcel Thomas Mueller wrote: > Hi, > > Currently the Jackrabbit core tests are only run with the default > configuration (with the default persistence manager, without data > store). The tests should be run with different configurations as well > (for example with the BundleFsPersistenceManager, with data store). To > do that, we need to do two things: the test repository.xml must be > 'dynamic', that is, generated / modified / replaced while the tests > run. Second, the tests must be invoked multiple times. It would be bad > to loop in each test case (run the first test with all persistence > managers, then the second, and so on), because it would be very slow. > Better is to run all tests with the default configuration, and then a > second time with different settings, and so on. To do that, we could > use a 'super test suite' (uber test suite). I found a way to do that. > If somebody has a better idea please help (I'm not a JUnit > specialist)! > > // new "super test suite" > package unit; > import junit.framework.*; > public class TestEverything extends TestCase { > public static int config = 0; > public static Test suite() { > TestSuite suite = new TestSuite("All tests with all configs"); > suite.addTest(unit.sub.TestAll.suite()); > suite.addTestSuite(TestEverything.class); > suite.addTest(unit.sub.TestAll.suite()); > suite.addTestSuite(TestEverything.class); > suite.addTest(unit.sub.TestAll.suite()); > return suite; > } > public void testNext() { > config++; > } > } > > // current test suite > package unit.sub; > import junit.framework.*; > public class TestAll extends TestCase { > public static Test suite() { > TestSuite suite = new TestSuite("Subproject Tests"); > suite.addTestSuite(TestOne.class); > return suite; > } > } > > // single test > package unit.sub; > import junit.framework.TestCase; > public class TestOne extends TestCase { > public void testIt() { > System.out.println("config: " + unit.TestEverything.config); > } > } > > Regards, > Thomas >