MCPcopy Create free account
hub / github.com/LibreOffice/core / getMethodFor

Method getMethodFor

qadevOOo/runner/lib/MultiMethodTest.java:428–447  ·  view source on GitHub ↗

Finds a testing method for the method of the interface. @return the testing method, if found, null otherwise

(String method)

Source from the content-addressed store, hash-verified

426 * @return the testing method, if found, <tt>null</tt> otherwise
427 */
428 private Method getMethodFor(String method)
429 {
430 String mName = "_" + method;
431
432 if (mName.endsWith("()"))
433 {
434 mName = mName.substring(0, mName.length() - 2);
435 }
436
437 final Class<?>[] paramTypes = new Class[0];
438
439 try
440 {
441 return this.getClass().getDeclaredMethod(mName, paramTypes);
442 }
443 catch (NoSuchMethodException nsmE)
444 {
445 return null;
446 }
447 }
448
449 /**
450 * @return the name of the interface tested

Callers 1

callMethodMethod · 0.95

Calls 4

endsWithMethod · 0.80
substringMethod · 0.80
getClassMethod · 0.80
lengthMethod · 0.45

Tested by

no test coverage detected