[
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
|
For the JUnit JPA tests it is normally best to call test.warning("The test <name> is not supported on Symfoware, <reason>") on the test if it is not supported and then return. The test will pass, but the log will show the warning, so this allows someone to review all of the warnings to ensure they are valid.
Many of the tests are already checking platform flags in JUnitTestCase such as isSelectForUpateSupported().
For the foundation tests you should throw a TestWarningException, test.throwWarning("This test is not supported on Symfoware, <reason>"); If the whole model is not supported then the warning should be thrown from the TestModel setup() method or configureSystem() method. These warnings are recorded and logged in the results, so can be checked.
Some of the tests have a supported platforms list, so you can call addSupportedPlatform() or addUnsupportedPlatform().
There are a lot of tests, many defined in very different ways, so some tests may require different mechanisms.
-----Original Message-----
From: Dies Koper [mailto:diesk@xxxxxxxxxxxxxxxxxxx]
Sent: Thursday, January 21, 2010 2:08 AM
To: Dev mailing list for Eclipse Persistence Services
Subject: [eclipselink-dev] recommended ways to exclude tests from LRG/SRG
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