diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/Accessor.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/Accessor.java
index 38a53fb77b5..ced211fe782 100644
--- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/Accessor.java
+++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/testplugin/Accessor.java
@@ -33,6 +33,31 @@ public class Accessor extends Assert {
/** The instance to access. */
private Object fInstance;
+ /**
+ * Creates an accessor for the given instance
and its
+ * class
. Only non-inherited members that particular
+ * class
can be accessed.
+ *
+ * @param instance the instance
+ */
+ public Accessor(Object instance) {
+ assertNotNull(instance);
+ fInstance= instance;
+ fClass= instance.getClass();
+ }
+
+ /**
+ * Creates an accessor for the given class
.
+ * Only static members of that particular class
can be accessed.
+ *
+ * @param clazz the class
+ */
+ public Accessor(Class> clazz) {
+ assertNotNull(clazz);
+ fInstance= null;
+ fClass= clazz;
+ }
+
/**
* Creates an accessor for the given instance
and
* class
. Only non-inherited members that particular
@@ -145,6 +170,17 @@ public class Accessor extends Assert {
}
}
+ /**
+ * Invokes the method with the given method name and no arguments.
+ *
+ * + * @param methodName the method name + * @return the method return value + */ + public Object invoke(String methodName) { + return invoke(methodName, null, new Object[0]); + } + /** * Invokes the method with the given method name and arguments. *