db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dag H. Wanvik (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-6590) Make JUnit tests run the fixtures in a deterministic order.
Date Wed, 02 Jul 2014 23:10:27 GMT

     [ https://issues.apache.org/jira/browse/DERBY-6590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Dag H. Wanvik updated DERBY-6590:

    Attachment: derby-6590-1.diff

Attaching a patch for this issue: [^derby-6590-1.diff]. From its local Git commit message:

A new test suite class is introduced to replace the standard JUnit TestSuite: DerbyTestSuite.
From its Javadoc:

 * Derby replacement for TestSuite. This version, when provided with a
 * {@code Class} argument in a constructor or method, wraps a {@code TestSuite}
 * around a lexicographically sorted set of fixtures to avoid random fixture
 * ordering after Java 6. It is a somewhat leaky abstraction: a call to
 * {@code tests()} will return the wrapped {@code TestSuite} instead of
 * the tests of the provided class argument}. So in order to locate the
 * tests, a client of this class must step one further step down, i.e. ask for
 * the tests of that wrapped {@code TestSuite}. Except for this, its usage
 * should be straight forward, similar to the original TestSuite.
For an example of the changed semantics in "tests()", cf the change to StatementEventsTest
in this patch.

If we decide to commit this patch, new JUnit tests should all use the new test suite class
in order to retain the deterministic ordering of the regression tests. I have verified that
all tests are still performed (manually: in my environment I see 19023 tests in suites.All
and 122 in the harness derbyall - with Java 8). 

> Make JUnit tests run the fixtures in a deterministic order.
> -----------------------------------------------------------
>                 Key: DERBY-6590
>                 URL: https://issues.apache.org/jira/browse/DERBY-6590
>             Project: Derby
>          Issue Type: Improvement
>            Reporter: Dag H. Wanvik
>         Attachments: derby-6590-1.diff
> Since JDK 7, when we use the standard decorator for JUnit tests, e.g.
> return TestConfiguration.defaultSuite(AggBuiltinTest.class);
> the order in which the test fixtures get run is indeterministic. This is undesirable
because it doesn't add much coverage to the product and makes the tests more brittle than
they need to be.
> We should use TestConfiguration#orderedSuite instead.

This message was sent by Atlassian JIRA

View raw message