db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Waagan <Kristian.Waa...@Sun.COM>
Subject Re: [jira] Commented: (DERBY-1303) The test of derbynet/SuicideOfStreaming.java is failed when programs are build as Insane.
Date Tue, 09 May 2006 08:09:17 GMT
Andrew McIntyre wrote:

> On 5/8/06, Sunitha Kambhampati <ksunithaghm@gmail.com> wrote:
>
>>
>> Not sure if this will solve this test diff issue, but I think at one
>> point, there used to be a way to have separate master files for sane and
>> insane jars.
>>
>> Maybe someone more familiar with the test harness can confirm if that is
>> still possible or not.
>
>
> Actually, it was for running with classes instead of packaged jar
> files, not sane/insane. Although, that functionality is still in
> FileCompare.java, just unused at the moment.
>
> Instead of trying to make the test harness skip it on insane, what if
> the test was rewritten as a junit test, replacing the main method
> with:
>
> public void testStreamingBlobSuicide() throws Exception {
>  if (SanityManager.DEBUG {
>    ij.getPropertyArg(args);
>    startServer();
>    createTestTable();
>    testInterruptedReadOfLob();
>    shutdownServer();
>  }
> }
>
> In an insane build, this will get compiled down to the equivalent of:
>
> public void testStreamingBlobSuicide() throws Exception {
> }
>
I'm not a fan of running tests that does nothing. These will be included 
in the list of successful tests etc.

An option to you solution, is to use your approach in the suite command. 
If all such logic is in the suite command, it is a lot easier to see 
what tests will be run (instead of looking through all the test methods).

To illustrate, something like this:
public static Test suite() {
    // Add all methods starting with 'test' as usual
    TestSuite suite = new TestSuite(TestClass.class,
                                                            "Name of 
suite");
    if (SanityManager.DEBUG) {
        // Name of test method must not start with 'test'  
        suite.addTest(new TestClass("saneStreamingBlobSuicide"));
    }
    return suite;
}



--
Kristian

> And since junit tests have no masters, there won't be any diff that
> occurs between the sane and insane builds.
>
> andrew



Mime
View raw message