Tabnine Logo
Result
Code IndexAdd Tabnine to your IDE (free)

How to use
Result
in
org.apache.wicket.util.tester

Best Java code snippets using org.apache.wicket.util.tester.Result (Showing top 20 results out of 315)

origin: org.apache.wicket/wicket-core

/**
 * 
 * @param result
 */
private void assertResult(Result result)
{
  if (result.wasFailed())
  {
    throw new AssertionFailedError(result.getMessage());
  }
}
origin: org.apache.wicket/wicket-core

/**
 * Returns a <code>Result</code> which failed.
 * 
 * @param message
 *            an error message
 * @return a <code>Result</code> which failed
 */
public static Result fail(String message)
{
  return new Result(true, message);
}
origin: org.ops4j.pax.wicket/pax-wicket-service

private Result isTrue(String message, boolean condition)
{
  if (condition)
  {
    return Result.pass();
  }
  return Result.fail(message);
}
origin: org.apache.wicket/wicket-core

/**
 * 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;
}
origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * assert component class
 * 
 * @param <C>
 * 
 * @param path
 *            path to component
 * @param expectedComponentClass
 *            expected component class
 * @return a <code>Result</code>
 */
public <C extends Component> Result isComponent(String path, Class<C> expectedComponentClass)
{
  Component component = getComponentFromLastRenderedPage(path);
  if (component == null)
  {
    return Result.fail("Component not found: " + path);
  }
  return isTrue("component '" + Classes.simpleName(component.getClass()) + "' is not type:" +
    Classes.simpleName(expectedComponentClass),
    expectedComponentClass.isAssignableFrom(component.getClass()));
}
origin: org.ops4j.pax.wicket/pax-wicket-service

    + " will not be rendered at all and thus won't be accessible for subsequent AJAX interaction";
  result = isTrue(failMessage, component.getOutputMarkupPlaceholderTag());
  if (result.wasFailed())
  .find();
result = isTrue(failMessage, isAjaxResponse);
if (result.wasFailed())
  + "which means that it can't have been added to the AJAX response";
result = isTrue(failMessage, !Strings.isEmpty(markupId));
if (result.wasFailed())
origin: apache/wicket

/**
 * 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;
}
origin: apache/wicket

assertResult(Result.fail("Missing expected feedback message: " + expected));
origin: org.apache.wicket/wicket-core

      componentInfo;
  result = isTrue(failMessage, component.getOutputMarkupPlaceholderTag());
  if (result.wasFailed())
  .find();
result = isTrue(failMessage, isAjaxResponse);
if (result.wasFailed())
    componentInfo;
result = isTrue(failMessage, !Strings.isEmpty(markupId));
if (result.wasFailed())
result = isTrue(failMessage, isComponentInAjaxResponse);
if (!result.wasFailed()) {
  return result;
boolean isEnclosureInAjaxResponse = !isComponentOnAjaxResponse(enclosure).wasFailed();
return isTrue(failMessage, isEnclosureInAjaxResponse);
origin: org.ops4j.pax.wicket/pax-wicket-service

private Result isNull(String message, Object object)
{
  if (object != null)
  {
    return Result.fail(message);
  }
  return Result.pass();
}
origin: org.ops4j.pax.wicket/pax-wicket-service

private void assertResult(Result result)
{
  if (result.wasFailed())
  {
    throw new AssertionFailedError(result.getMessage());
  }
}
origin: org.apache.wicket/wicket-core

assertResult(Result.fail("Missing expected feedback message: " + expected));
origin: apache/wicket

    componentInfo;
  result = isTrue(failMessage, component.getOutputMarkupPlaceholderTag());
  if (result.wasFailed())
  .find();
result = isTrue(failMessage, isAjaxResponse);
if (result.wasFailed())
  "which means that it can't have been added to the AJAX response. " + componentInfo;
result = isTrue(failMessage, !Strings.isEmpty(markupId));
if (result.wasFailed())
result = isTrue(failMessage, isComponentInAjaxResponse);
if (!result.wasFailed())
boolean isEnclosureInAjaxResponse = !isComponentOnAjaxResponse(enclosure).wasFailed();
return isTrue(failMessage, isEnclosureInAjaxResponse);
origin: apache/wicket

/**
 * Returns a <code>Result</code> which failed.
 * 
 * @param message
 *            an error message
 * @return a <code>Result</code> which failed
 */
public static Result fail(String message)
{
  return new Result(true, message);
}
origin: org.ops4j.pax.wicket/pax-wicket-service

private Result isFalse(String message, boolean condition)
{
  if (!condition)
  {
    return Result.pass();
  }
  return Result.fail(message);
}
origin: org.apache.wicket/com.springsource.org.apache.wicket

  private void assertResult(Result result)
  {
    if (result.wasFailed())
    {
      throw new AssertionFailedError(result.getMessage());
    }
  }
}
origin: apache/wicket

/**
 * assert component visible.
 *
 * @param path
 *            path to component
 * @return a <code>Result</code>
 */
public Result isVisible(final String path)
{
  final Result result;
  Component component = getComponentFromLastRenderedPage(path, false);
  if (component == null)
  {
    result = Result.fail("path: '" + path + "' does not exist for page: " +
      Classes.simpleName(getLastRenderedPage().getClass()));
  }
  else
  {
    result = isTrue("component '" + path + "' is not visible",
      component.isVisibleInHierarchy());
  }
  return result;
}
origin: org.apache.wicket/com.springsource.org.apache.wicket

    + " will not be rendered at all and thus won't be accessible for subsequent AJAX interaction";
  result = isTrue(failMessage, component.getOutputMarkupPlaceholderTag());
  if (result.wasFailed())
boolean isAjaxResponse = ajaxResponse.startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\"?><ajax-response>");
result = isTrue(failMessage, isAjaxResponse);
if (result.wasFailed())
  + "which means that it can't have been added to the AJAX response";
result = isTrue(failMessage, !Strings.isEmpty(markupId));
if (result.wasFailed())
origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * Returns a <code>Result</code> which failed.
 * 
 * @param message
 *            an error message
 * @return a <code>Result</code> which failed
 */
static Result fail(String message)
{
  return new Result(true, message);
}
origin: org.apache.wicket/wicket-core

/**
 *
 * @param message
 * @param condition
 * @return fail with message if false
 */
private Result isTrue(String message, boolean condition)
{
  if (condition)
  {
    return Result.pass();
  }
  return Result.fail(message);
}
org.apache.wicket.util.testerResult

Javadoc

A Result class.

Most used methods

  • wasFailed
    Returns true if the Result was a failure.
  • <init>
  • fail
    Returns a Result which failed.
  • getMessage
    Retrieves the error message.
  • pass
    Returns a Result which passed.

Popular in Java

  • Creating JSON documents from java classes using gson
  • addToBackStack (FragmentTransaction)
  • getSystemService (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now