aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/junit/runners/model/FrameworkMethod.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/junit/runners/model/FrameworkMethod.java')
-rw-r--r--src/main/java/org/junit/runners/model/FrameworkMethod.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/org/junit/runners/model/FrameworkMethod.java b/src/main/java/org/junit/runners/model/FrameworkMethod.java
index 3580052..4471407 100644
--- a/src/main/java/org/junit/runners/model/FrameworkMethod.java
+++ b/src/main/java/org/junit/runners/model/FrameworkMethod.java
@@ -28,6 +28,15 @@ public class FrameworkMethod extends FrameworkMember<FrameworkMethod> {
"FrameworkMethod cannot be created without an underlying method.");
}
this.method = method;
+
+ if (isPublic()) {
+ // This method could be a public method in a package-scope base class
+ try {
+ method.setAccessible(true);
+ } catch (SecurityException e) {
+ // We may get an IllegalAccessException when we try to call the method
+ }
+ }
}
/**
@@ -149,6 +158,11 @@ public class FrameworkMethod extends FrameworkMember<FrameworkMethod> {
}
@Override
+ boolean isBridgeMethod() {
+ return method.isBridge();
+ }
+
+ @Override
public boolean equals(Object obj) {
if (!FrameworkMethod.class.isInstance(obj)) {
return false;