/** * * @param result */ private void assertResult(Result result) { if (result.wasFailed()) { throw new AssertionFailedError(result.getMessage()); } }
private void assertResult(Result result) { if (result.wasFailed()) { throw new AssertionFailedError(result.getMessage()); } }
private void assertResult(Result result) { if (result.wasFailed()) { throw new AssertionFailedError(result.getMessage()); } } }
/** * * @param result */ private void assertResult(Result result) { if (result.wasFailed()) { fail(result.getMessage()); } }
/** * Asserts there are no feedback messages with a certain level. * * @param level * the level to check for */ public void assertNoFeedbackMessage(int level) { Result result = hasNoFeedbackMessage(level); assertFalse(result.wasFailed(), result.getMessage()); }
/** * Asserts there are no feedback messages with a certain level. * * @param level * the level to check for */ public void assertNoFeedbackMessage(int level) { Result result = hasNoFeedbackMessage(level); assertFalse(result.getMessage(), result.wasFailed()); }
/** * Checks whether a component is visible and/or enabled before usage * * @param component * @param throwException * @return result */ protected Result checkUsability(final Component component, boolean throwException) { Result res = Result.pass(); if (component.isVisibleInHierarchy() == false) { res = Result.fail( "The component is currently not visible in the hierarchy and thus you can not be used." + " Component: " + component); } if (component.isEnabledInHierarchy() == false) { res = Result.fail( "The component is currently not enabled in the hierarchy and thus you can not be used." + " Component: " + component); } if (throwException && res.wasFailed()) { throw new AssertionError(res.getMessage()); } return res; }
/** * Checks whether a component is visible and/or enabled before usage * * @param component * @param throwException * @return result */ protected Result checkUsability(final Component component, boolean throwException) { Result res = Result.pass(); if (component.isVisibleInHierarchy() == false) { res = Result.fail("The component is currently not visible in the hierarchy and thus you can not be used." + " Component: " + component); } if (component.isEnabledInHierarchy() == false) { res = Result.fail("The component is currently not enabled in the hierarchy and thus you can not be used." + " Component: " + component); } if (throwException && res.wasFailed()) { throw new AssertionFailedError(res.getMessage()); } return res; }