Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
AW: [eclipselink-dev] recommended ways to exclude tests from LRG/SRG

Hi Edwin,


in the eclipselink.jpa.wdf.test testsuite, we are using jUnit 4 and a custom test runner. The test runner looks for a @Skip annotation:



public @interface Skip {



     * The databases on which this test should be skipped. Default: skip on all databases


    Class<? extends DatabasePlatform>[] databases() default {};



For example



@Skip(databases = MySQLPlatform.class)

public void testPersistFlock() {





skips "testPersistFlock" on MySQLPlatform.


In the jUnit-Eclipse plugin, the skipped tests show up as skipped (x-ed out):




Unfortunately we have not found a way to make the skipped tests show up in the XML reports produced

by the <junit> ant task and hence not in the html-reports.



Maybe that’s something to consider for eclipselink.jpa.test as well.




Adrian Görler



Pflichtangaben/Mandatory Disclosure Statements:




-----Ursprüngliche Nachricht-----
Von: eclipselink-dev-bounces@xxxxxxxxxxx [mailto:eclipselink-dev-bounces@xxxxxxxxxxx] Im Auftrag von Edwin Tang
Gesendet: Donnerstag, 21. Januar 2010 15:04
An: Dev mailing list for Eclipse Persistence Services
Betreff: RE: [eclipselink-dev] recommended ways to exclude tests from LRG/SRG


Actually, I encountered the same issue several days ago, I wanted to skip some tests on Derby. I tried option #1 and #3 Dies mentioned, but I chose to implement in method suite() like:

    public static Test suite() {


        // Derby does not support simple CASE

        if (!((Session) JUnitTestCase.getServerSession()).getPlatform().isDerby())


            suite.addTest(new JUnitCriteriaSimpleTestSuite("simpleCaseInWhereTest"));

            suite.addTest(new JUnitCriteriaSimpleTestSuite("simpleCaseInSelectTest"));






Option #1: the JUnit report shows SUCCESS for the tests, which is not exactly true.

Option #3: the JUnit report shows FAILURE with the warning info for the tests, that is informative, but not good if we want clean results.


Let us discuss about this, and come up with a standardized solution.





-----Original Message-----

From: Dies Koper [mailto:diesk@xxxxxxxxxxxxxxxxxxx]

Sent: Thursday, January 21, 2010 3:45 AM

To: Dev mailing list for Eclipse Persistence Services

Subject: Re: [eclipselink-dev] recommended ways to exclude tests from




Also, how do I skip a whole suite (TestModel)?


I'd like to skip the following one completely as Symfoware doesn't allow

spaces in table names so none of its tests will pass.




I can't put an isSymfoware() around the tests.add method in because the session is not initialized at this moment.






On 21/01/2010 18:07, Dies Koper wrote:

> Hi,


> What's the recommended way to skip tests in the LRG and SRG test sets

> that won't run on a platform because of a documented limitation (of

> either EclipseLink/platform class or the db/driver itself)?


> I have been trying to follow what's being done so far but there seem to

> be different ways.


> For example, we have simple returns with a log message:


>      if (!(dbPlatform.isOracle() || dbPlatform.isMySQL() ||

> dbPlatform.isPostgreSQL() || dbPlatform.isSymfoware())) {

>          getServerSession().logMessage("Test testLeftTrimWithTrimChar

> skipped for this platform");

>          return;

>      }


> And we have TestWarningExceptions:


>      if (getSession().getPlatform().isTimesTen() ||

> getSession().getPlatform().isSymfoware()) {

>           throw new TestWarningException("This test is not supported on

> this platform.");

>       }


> And Assert,assertFalse():


>      Assert.assertFalse("Warning Sybase Driver does not work with

> DriverWrapper, testEMCloseAndOpen can't run on this platform.",

> JUnitTestCase.getServerSession().getPlatform().isSybase());


> Are there any rules for when to use which?


> Thanks,

> Dies



eclipselink-dev mailing list



eclipselink-dev mailing list


Back to the top