harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Beyer <ndbe...@apache.org>
Subject Re: Rethinking testing conventions
Date Wed, 10 Mar 2010 03:34:35 GMT
On Tue, Mar 9, 2010 at 8:50 PM, Charles Lee <littlee1032@gmail.com> wrote:
> That's great. But most old test case is in JUnit 3.8 style. We can follow
> the latest junit when we add the new test cases. What about the old ones?

We've been using JUnit 4 runners for a long time now. JUnit 4 style
tests could be added at any time and will run perfectly fine with the
other JUnit 3.8 style tests. The runner/launcher would have to be
customized to handle this stuff I'm proposing, but we'd continue to
run both styles of tests.

-Nathan

>
> On Wed, Mar 10, 2010 at 9:01 AM, Nathan Beyer <ndbeyer@apache.org> wrote:
>
>> I've been experimenting with JUnit4 extensions in an attempt to find a
>> more simple approach to our basic testing needs. The two major
>> requirements that I see in Harmony's test infrastructure (at least the
>> classlib stuff) are - exclusions and platform-specific tests. (I'm
>> ignoring the bootstrap-classpath stuff for now.) To handle these
>> today, we have exclusion files, which are loaded and used to exclude
>> certain files and then we branch the test folders by  platform. Each
>> of these has issues - exclusions are skipping whole files, not just
>> specific failing tests; exclusions aren't well reported on; test files
>> in multiple branches can have duplicate code, etc.
>>
>> One concept I've been working with is using annotations to describe
>> the tests for the purposes of exclusions and for platform definition.
>> The annotations can then be utilized in many ways via JUnit - method
>> rules, request processing filters and others. Here's an example of how
>> the tests might look.
>>
>> class FileTest {
>>  @Test
>>  @Platform(os="windows")
>>  public void testSomethingOnWindows { }
>>
>>  @Test
>>  @Platform(os="linux", arch="x86_64")
>>  public void testSomethingOnLinuxX86_64 {}
>>
>>  @Test
>>  @Exclude(os="windows",vm="drlvm")
>>  public void testSomethingExcludedOnWindowsDRLVM {}
>> }
>>
>> Thoughts? Comments?
>>
>
>
>
> --
> Yours sincerely,
> Charles Lee
>

Mime
View raw message