/** * Runs {@link #testMethod} on every instance method of the class of {@code instance} with at * least {@code minimalVisibility}, including those inherited from superclasses of the same * package. */ public void testInstanceMethods(Object instance, Visibility minimalVisibility) { for (Method method : getInstanceMethodsToTest(instance.getClass(), minimalVisibility)) { testMethod(instance, method); } }
/** * Runs {@link #testMethod} on every static method of class {@code c} that has at least {@code * minimalVisibility}, including those "inherited" from superclasses of the same package. */ public void testStaticMethods(Class<?> c, Visibility minimalVisibility) { for (Method method : minimalVisibility.getStaticMethods(c)) { if (!isIgnored(method)) { testMethod(null, method); } } }
public void verifyBarFail(Method method, TwoArg bar) { try { new NullPointerTester().testMethod(bar, method); } catch (AssertionFailedError expected) { return; // good...we wanted a failure } String errorMessage = rootLocaleFormat("Should have flagged method %s for %s", method.getName(), bar); fail(errorMessage); }
public void verifyBarPass(Method method, TwoArg bar) { try { new NullPointerTester().testMethod(bar, method); } catch (AssertionFailedError incorrectError) { String errorMessage = rootLocaleFormat("Should not have flagged method %s for %s", method.getName(), bar); assertNull(errorMessage, incorrectError); } }
/** * Runs {@link #testMethod} on every instance method of the class of * {@code instance} with at least {@code minimalVisibility}, including those * inherited from superclasses of the same package. */ public void testInstanceMethods(Object instance, Visibility minimalVisibility) { for (Method method : getInstanceMethodsToTest(instance.getClass(), minimalVisibility)) { testMethod(instance, method); } }
/** * Runs {@link #testMethod} on every instance method of the class of {@code instance} with at * least {@code minimalVisibility}, including those inherited from superclasses of the same * package. */ public void testInstanceMethods(Object instance, Visibility minimalVisibility) { for (Method method : getInstanceMethodsToTest(instance.getClass(), minimalVisibility)) { testMethod(instance, method); } }
/** * Runs {@link #testMethod} on every static method of class {@code c} that has * at least {@code minimalVisibility}, including those "inherited" from * superclasses of the same package. */ public void testStaticMethods(Class<?> c, Visibility minimalVisibility) { for (Method method : minimalVisibility.getStaticMethods(c)) { if (!isIgnored(method)) { testMethod(null, method); } } }
/** * Runs {@link #testMethod} on every static method of class {@code c} that has at least {@code * minimalVisibility}, including those "inherited" from superclasses of the same package. */ public void testStaticMethods(Class<?> c, Visibility minimalVisibility) { for (Method method : minimalVisibility.getStaticMethods(c)) { if (!isIgnored(method)) { testMethod(null, method); } } }
public void verifyBarFail(Method method, TwoArg bar) { try { new NullPointerTester().testMethod(bar, method); } catch (AssertionFailedError expected) { return; // good...we wanted a failure } String errorMessage = String.format( "Should have flagged method %s for %s", method.getName(), bar); fail(errorMessage); }
public void verifyBarPass(Method method, TwoArg bar) { try { new NullPointerTester().testMethod(bar, method); } catch (AssertionFailedError incorrectError) { String errorMessage = String.format( "Should not have flagged method %s for %s", method.getName(), bar); assertNull(errorMessage, incorrectError); } }
public void verifyBarFail(Method method, TwoArg bar) { try { new NullPointerTester().testMethod(bar, method); } catch (AssertionFailedError expected) { return; // good...we wanted a failure } String errorMessage = rootLocaleFormat("Should have flagged method %s for %s", method.getName(), bar); fail(errorMessage); }
public void verifyBarPass(Method method, TwoArg bar) { try { new NullPointerTester().testMethod(bar, method); } catch (AssertionFailedError incorrectError) { String errorMessage = rootLocaleFormat("Should not have flagged method %s for %s", method.getName(), bar); assertNull(errorMessage, incorrectError); } }