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

How to use
InvokeMethod
in
org.junit.internal.runners.statements

Best Java code snippets using org.junit.internal.runners.statements.InvokeMethod (Showing top 16 results out of 315)

origin: junit-team/junit4

/**
 * Returns a {@link Statement} that invokes {@code method} on {@code test}
 */
protected Statement methodInvoker(FrameworkMethod method, Object test) {
  return new InvokeMethod(method, test);
}
origin: apache/zookeeper

  @Override
  public void evaluate() throws Throwable {
    LOG.info("RUNNING TEST METHOD {}", name);
    try {
      super.evaluate();
      Runtime rt = Runtime.getRuntime();
      long usedKB = (rt.totalMemory() - rt.freeMemory()) / 1024;
      LOG.info("Memory used {}", usedKB);
      ThreadGroup tg = Thread.currentThread().getThreadGroup();
      while (tg.getParent() != null) {
        tg = tg.getParent();
      }
      LOG.info("Number of threads {}", tg.activeCount());
    } catch (Throwable t) {
      // The test method threw an exception, but it might be an
      // expected exception as defined in the @Test annotation.
      // Check the annotation and log an appropriate message.
      Test annotation = this.method.getAnnotation(Test.class);
      if (annotation != null && annotation.expected() != null &&
          annotation.expected().isAssignableFrom(t.getClass())) {
        LOG.info("TEST METHOD {} THREW EXPECTED EXCEPTION {}", name,
          annotation.expected());
      } else {
        LOG.info("TEST METHOD FAILED {}", name, t);
      }
      throw t;
    }
    LOG.info("FINISHED TEST METHOD {}", name);
  }
}
origin: google/j2objc

/**
 * Returns a {@link Statement} that invokes {@code method} on {@code test}
 */
protected Statement methodInvoker(FrameworkMethod method, Object test) {
  return new InvokeMethod(method, test);
}
origin: com.consol.citrus/citrus-core

  @Override
  public void evaluate() throws Throwable {
    if (AbstractJUnit4CitrusTest.class.isAssignableFrom(testInstance.getClass()) &&
        frameworkMethod instanceof CitrusFrameworkMethod) {
      ((AbstractJUnit4CitrusTest)testInstance).run((CitrusFrameworkMethod) frameworkMethod);
    } else {
      super.evaluate();
    }
  }
}
origin: camunda/camunda-bpm-platform

/**
 * Returns a {@link Statement} that invokes {@code method} on {@code test}
 */
protected Statement methodInvoker(FrameworkMethod method, Object test) {
  return new InvokeMethod(method, test);
}
origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.junit

/**
 * Returns a {@link Statement} that invokes {@code method} on {@code test}
 */
protected Statement methodInvoker(FrameworkMethod method, Object test) {
  return new InvokeMethod(method, test);
}
origin: org.kuali.rice/rice-it-internal-tools

/**
 * Returns a {@link org.junit.runners.model.Statement} that invokes {@code method} on {@code test}
 */
protected Statement methodInvoker(FrameworkMethod method, Object test) {
  return new InvokeMethod(method, test);
}
origin: bechte/junit-hierarchicalcontextrunner

  protected Statement buildStatement(final TestClass testClass, final FrameworkMethod method, final Object target,
                    final Description description, final RunNotifier notifier) {
    return new InvokeMethod(method, target);
  }
}
origin: org.junit/com.springsource.org.junit

/**
 * Returns a {@link Statement} that invokes {@code method} on {@code test}
 */
protected Statement methodInvoker(FrameworkMethod method, Object test) {
  return new InvokeMethod(method, test);
}
origin: com.github.XDean/JUnit-EX

/**
 * Returns a {@link Statement} that invokes {@code method} on {@code test}
 */
protected Statement methodInvoker(FrameworkMethod method, Object test) {
 return new InvokeMethod(method, test);
}
origin: com.oracle/truffle-tck

/**
 * Returns a {@link Statement} that invokes {@code method} on {@code test}
 */
protected Statement methodInvoker(FrameworkMethod method, Object test) {
  return new InvokeMethod(method, test);
}
origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Returns a {@link Statement} that invokes {@code method} on {@code test}
 */
protected Statement methodInvoker(FrameworkMethod method, Object test) {
  return new InvokeMethod(method, test);
}
origin: org.n52.sensorweb.sos/test-suite-common

@Override
protected Statement methodInvoker(FrameworkMethod method, Object test) {
  ComplianceSuiteTest eTest = (ComplianceSuiteTest) test;
  eTest.setExecutor(executor);
  return new InvokeMethod(method, test);
}
origin: com.opentable.components/otj-lifecycle

  @Override
  protected Statement methodInvoker(final FrameworkMethod method, final Object test)
  {
    Statement s = new InvokeMethod(method, test);
    s = withLifecycleBefore(method, test, s);
    s = withLifecycleAfter(method, test, s);
    s = withLifecycleRules(method, test, s);
    return s;
  }
}
origin: com.nesscomputing.components/ness-lifecycle

  @Override
  protected Statement methodInvoker(final FrameworkMethod method, final Object test)
  {
    Statement s = new InvokeMethod(method, test);
    s = withLifecycleBefore(method, test, s);
    s = withLifecycleAfter(method, test, s);
    s = withLifecycleRules(method, test, s);
    return s;
  }
}
origin: SergeyPirogov/video-recorder-java

  public static void runRule(TestRule rule, Object target, String methodName) {
    Class<?> clazz = target.getClass();
    Method method = TestUtils.getMethod(clazz, methodName);
    Description description = Description.createTestDescription(clazz, method.getName(), method.getDeclaredAnnotations());
    try {
      InvokeMethod invokeMethod = new InvokeMethod(new FrameworkMethod(method), target);
      rule.apply(invokeMethod, description).evaluate();
    } catch (Throwable throwable) {
      logger.warning(Arrays.toString(throwable.getStackTrace()));
    }
  }
}
org.junit.internal.runners.statementsInvokeMethod

Most used methods

  • <init>
  • evaluate

Popular in Java

  • Reactive rest calls using spring rest template
  • putExtra (Intent)
  • addToBackStack (FragmentTransaction)
  • notifyDataSetChanged (ArrayAdapter)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • JLabel (javax.swing)
  • Top plugins for WebStorm
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