Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
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"));
        }
        ...
    }

Because,
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. 

Thanks,
Edwin 

-----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
LRG/SRG


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.

org.eclipse.persistence.testing.tests.tableswithspacesmodel.EmployeeWithSpacesTestModel

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

Thanks,
Dies


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@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev


Back to the top