diff options
author | Roland Grunberg | 2018-08-02 16:52:06 +0000 |
---|---|---|
committer | Noopur Gupta | 2018-11-23 07:26:56 +0000 |
commit | 3207b1338106d8d6df839b3ddf5a264fd7e4bd15 (patch) | |
tree | 62e09bfb3314608922c83a688db1f305efbf94c7 | |
parent | fbffda96f908f514a03a0413e7d8f3d8a99b74ed (diff) | |
download | eclipse.jdt.ui-3207b1338106d8d6df839b3ddf5a264fd7e4bd15.tar.gz eclipse.jdt.ui-3207b1338106d8d6df839b3ddf5a264fd7e4bd15.tar.xz eclipse.jdt.ui-3207b1338106d8d6df839b3ddf5a264fd7e4bd15.zip |
Bug 537286 - Fix test method parameter format for JUnit 4 test runs.
When a test method has parameters, org.eclipse.jdt.junit.core.TESTNAME
is the method simple name, followed by the comma-separated fully
qualified parameter types surround by round brackets. This is needed to
support JUnit 5, but the JUnit 4 test loader expects the round bracket
enclosed value to be the fully qualified declaring type of the method.
The issue can be resolved by ignoring the round bracket-enclosed value
on JUnit 4.
Change-Id: I8919700610e787b11e0fee62ba5c6b888719b700
Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
-rw-r--r-- | org.eclipse.jdt.junit4.runtime/src/org/eclipse/jdt/internal/junit4/runner/DescriptionMatcher.java | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/org.eclipse.jdt.junit4.runtime/src/org/eclipse/jdt/internal/junit4/runner/DescriptionMatcher.java b/org.eclipse.jdt.junit4.runtime/src/org/eclipse/jdt/internal/junit4/runner/DescriptionMatcher.java index 9e5c66e75b..fabe275cf2 100644 --- a/org.eclipse.jdt.junit4.runtime/src/org/eclipse/jdt/internal/junit4/runner/DescriptionMatcher.java +++ b/org.eclipse.jdt.junit4.runtime/src/org/eclipse/jdt/internal/junit4/runner/DescriptionMatcher.java @@ -135,16 +135,15 @@ public abstract class DescriptionMatcher { * @return A matcher object. */ public static DescriptionMatcher create(Class<?> clazz, String matchString) { + String className= clazz.getName(); List<DescriptionMatcher> matchers= new ArrayList<DescriptionMatcher>(); matchers.add(new ExactMatcher(matchString)); Matcher parsed= METHOD_AND_CLASS_NAME_PATTERN.matcher(matchString); if (parsed.matches()) { - String className= parsed.group(2); String testName= parsed.group(1); if (testName.equals(extractLeadingIdentifier(testName))) matchers.add(new LeadingIdentifierMatcher(className, testName)); } else { - String className= clazz.getName(); if (!className.equals(matchString)) { matchers.add(new ExactMatcher(className, matchString)); if (matchString.equals(extractLeadingIdentifier(matchString))) |