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

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

Best Java code snippets using org.junit.internal.runners.TestMethod.isUnexpected (Showing top 7 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.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: 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.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: 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);
  }
}
org.junit.internal.runnersTestMethodisUnexpected

Popular methods of TestMethod

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

Popular in Java

  • Reading from database using SQL prepared statement
  • getContentResolver (Context)
  • onRequestPermissionsResult (Fragment)
  • getApplicationContext (Context)
  • Kernel (java.awt.image)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Table (org.hibernate.mapping)
    A relational table
  • Best plugins for Eclipse
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