Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAXEXAM-674 Configurations and probe builders do not need to be static #45

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@
import org.ops4j.pax.exam.TestAddress;

/**
* Decorates a framework method with a parameter index. Used for parameterized tests
* with {@code PaxExamParameterized}.
*
* Decorates a framework method with a parameter index. Used for parameterized tests with
* {@code PaxExamParameterized}.
*
* @author Harald Wellmann
*
*/
class ParameterizedFrameworkMethod extends DecoratedFrameworkMethod {

Expand All @@ -34,6 +33,16 @@ class ParameterizedFrameworkMethod extends DecoratedFrameworkMethod {

@Override
public String getName() {
return String.format("%s[%d]", frameworkMethod.getName(), address.arguments()[0]);

// arg[0] must be an integer (at least, for the JUnit runner).
// The customized (parameterized) name is given as a second argument.

String result;
if (this.address.arguments().length > 1)
result = String.format("%s", this.address.arguments()[1]);
else result = String.format("%s[%d]", this.frameworkMethod.getName(),
this.address.arguments()[0]);

return result;
}
}
Loading