forked from phoedos/pmd
junit assert failures should not be converted into errors
AssertionError was caught by Throwable and rethrown as RuntimeException git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5575 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -72,17 +72,20 @@ public abstract class RuleTst {
|
||||
Properties ruleProperties = rule.getProperties();
|
||||
Properties oldProperties = (Properties)ruleProperties.clone();
|
||||
try {
|
||||
if (test.getProperties() != null) {
|
||||
oldProperties = (Properties)ruleProperties.clone();
|
||||
ruleProperties.putAll(test.getProperties());
|
||||
int res;
|
||||
try {
|
||||
if (test.getProperties() != null) {
|
||||
oldProperties = (Properties)ruleProperties.clone();
|
||||
ruleProperties.putAll(test.getProperties());
|
||||
}
|
||||
|
||||
res = processUsingStringReader(test.getCode(), rule, test.getSourceType()).size();
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
throw new RuntimeException("Test \"" + test.getDescription() + "\" on Rule \"" + test.getRule().getName() + "\"failed");
|
||||
}
|
||||
|
||||
int res = processUsingStringReader(test.getCode(), rule, test.getSourceType()).size();
|
||||
assertEquals("\"" + test.getDescription() + "\" test resulted in wrong number of failures,",
|
||||
test.getNumberOfProblemsExpected(), res);
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
throw new RuntimeException("Test \"" + test.getDescription() + "\" on Rule \"" + test.getRule().getName() + "\"failed");
|
||||
test.getNumberOfProblemsExpected(), res);
|
||||
} finally {
|
||||
//Restore old properties
|
||||
ruleProperties.clear();
|
||||
|
Reference in New Issue
Block a user