Tabnine Logo
TestMethod.invoke
Code IndexAdd Tabnine to your IDE (free)

How to use
invoke
method
in
org.junit.internal.runners.TestMethod

Best Java code snippets using org.junit.internal.runners.TestMethod.invoke (Showing top 10 results out of 315)

origin: junit-team/junit4

protected void runTestMethod() {
  try {
    testMethod.invoke(test);
    if (testMethod.expectsException()) {
      addFailure(new AssertionError("Expected exception: " + testMethod.getExpectedException().getName()));
    }
  } catch (InvocationTargetException e) {
    Throwable actual = e.getTargetException();
    if (actual instanceof AssumptionViolatedException) {
      return;
    } else if (!testMethod.expectsException()) {
      addFailure(actual);
    } else if (testMethod.isUnexpected(actual)) {
      String message = "Unexpected exception, expected<" + testMethod.getExpectedException().getName() + "> but was<"
          + actual.getClass().getName() + ">";
      addFailure(new Exception(message, actual));
    }
  } catch (Throwable e) {
    addFailure(e);
  }
}
origin: google/j2objc

protected void runTestMethod() {
  try {
    fTestMethod.invoke(fTest);
    if (fTestMethod.expectsException()) {
      addFailure(new AssertionError("Expected exception: " + fTestMethod.getExpectedException().getName()));
    }
  } catch (InvocationTargetException e) {
    Throwable actual = e.getTargetException();
    if (actual instanceof AssumptionViolatedException) {
      return;
    } else if (!fTestMethod.expectsException()) {
      addFailure(actual);
    } else if (fTestMethod.isUnexpected(actual)) {
      String message = "Unexpected exception, expected<" + fTestMethod.getExpectedException().getName() + "> but was<"
          + actual.getClass().getName() + ">";
      addFailure(new Exception(message, actual));
    }
  } catch (Throwable e) {
    addFailure(e);
  }
}
origin: camunda/camunda-bpm-platform

protected void runTestMethod() {
  try {
    fTestMethod.invoke(fTest);
    if (fTestMethod.expectsException()) {
      addFailure(new AssertionError("Expected exception: " + fTestMethod.getExpectedException().getName()));
    }
  } catch (InvocationTargetException e) {
    Throwable actual = e.getTargetException();
    if (actual instanceof AssumptionViolatedException) {
      return;
    } else if (!fTestMethod.expectsException()) {
      addFailure(actual);
    } else if (fTestMethod.isUnexpected(actual)) {
      String message = "Unexpected exception, expected<" + fTestMethod.getExpectedException().getName() + "> but was<"
          + actual.getClass().getName() + ">";
      addFailure(new Exception(message, actual));
    }
  } catch (Throwable e) {
    addFailure(e);
  }
}
origin: org.apache.isis.viewer/junit

  @Override
  public void invoke(final Object testFixture) throws IllegalAccessException, InvocationTargetException {
    super.invoke(testFixture);
    if (mockeryField != null) {
      mockeryOf(testFixture).assertIsSatisfied();
    }
  }
};
origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.junit

protected void runTestMethod() {
  try {
    testMethod.invoke(test);
    if (testMethod.expectsException()) {
      addFailure(new AssertionError("Expected exception: " + testMethod.getExpectedException().getName()));
    }
  } catch (InvocationTargetException e) {
    Throwable actual = e.getTargetException();
    if (actual instanceof AssumptionViolatedException) {
      return;
    } else if (!testMethod.expectsException()) {
      addFailure(actual);
    } else if (testMethod.isUnexpected(actual)) {
      String message = "Unexpected exception, expected<" + testMethod.getExpectedException().getName() + "> but was<"
          + actual.getClass().getName() + ">";
      addFailure(new Exception(message, actual));
    }
  } catch (Throwable e) {
    addFailure(e);
  }
}
origin: com.impetus.fabric/fabric-jdbc-driver-shaded

protected void runTestMethod() {
  try {
    testMethod.invoke(test);
    if (testMethod.expectsException()) {
      addFailure(new AssertionError("Expected exception: " + testMethod.getExpectedException().getName()));
    }
  } catch (InvocationTargetException e) {
    Throwable actual = e.getTargetException();
    if (actual instanceof AssumptionViolatedException) {
      return;
    } else if (!testMethod.expectsException()) {
      addFailure(actual);
    } else if (testMethod.isUnexpected(actual)) {
      String message = "Unexpected exception, expected<" + testMethod.getExpectedException().getName() + "> but was<"
          + actual.getClass().getName() + ">";
      addFailure(new Exception(message, actual));
    }
  } catch (Throwable e) {
    addFailure(e);
  }
}
origin: org.junit/com.springsource.org.junit

protected void runTestMethod() {
  try {
    fTestMethod.invoke(fTest);
    if (fTestMethod.expectsException()) {
      addFailure(new AssertionError("Expected exception: " + fTestMethod.getExpectedException().getName()));
    }
  } catch (InvocationTargetException e) {
    Throwable actual = e.getTargetException();
    if (actual instanceof AssumptionViolatedException) {
      return;
    } else if (!fTestMethod.expectsException()) {
      addFailure(actual);
    } else if (fTestMethod.isUnexpected(actual)) {
      String message = "Unexpected exception, expected<" + fTestMethod.getExpectedException().getName() + "> but was<"
          + actual.getClass().getName() + ">";
      addFailure(new Exception(message, actual));
    }
  } catch (Throwable e) {
    addFailure(e);
  }
}
origin: com.oracle/truffle-tck

protected void runTestMethod() {
  try {
    fTestMethod.invoke(fTest);
    if (fTestMethod.expectsException()) {
      addFailure(new AssertionError("Expected exception: " + fTestMethod.getExpectedException().getName()));
    }
  } catch (InvocationTargetException e) {
    Throwable actual = e.getTargetException();
    if (actual instanceof AssumptionViolatedException) {
      return;
    } else if (!fTestMethod.expectsException()) {
      addFailure(actual);
    } else if (fTestMethod.isUnexpected(actual)) {
      String message = "Unexpected exception, expected<" + fTestMethod.getExpectedException().getName() + "> but was<"
          + actual.getClass().getName() + ">";
      addFailure(new Exception(message, actual));
    }
  } catch (Throwable e) {
    addFailure(e);
  }
}
origin: org.nakedobjects/headless-viewer

  @Override
  public void invoke(final Object testFixture) throws IllegalAccessException, InvocationTargetException {
    super.invoke(testFixture);
    if (mockeryField != null) {
      mockeryOf(testFixture).assertIsSatisfied();
    }
  }
};
origin: org.nakedobjects/headlessviewer-viewer

  @Override
  public void invoke(final Object testFixture) throws IllegalAccessException, InvocationTargetException {
    super.invoke(testFixture);
    if (mockeryField != null) {
      mockeryOf(testFixture).assertIsSatisfied();
    }
  }
};
org.junit.internal.runnersTestMethodinvoke

Popular methods of TestMethod

  • <init>
  • expectsException
  • getAfters
  • getBefores
  • getExpectedException
  • getTimeout
  • isIgnored
  • isUnexpected

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (ScheduledExecutorService)
  • requestLocationUpdates (LocationManager)
  • setRequestProperty (URLConnection)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • From CI to AI: The AI layer in your organization
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