Codota Logo
Request.filterWith
Code IndexAdd Codota to your IDE (free)

How to use
filterWith
method
in
org.junit.runner.Request

Best Java code snippets using org.junit.runner.Request.filterWith (Showing top 20 results out of 315)

  • Common ways to obtain Request
private void myMethod () {
Request r =
  • Codota IconClass testClass;new ClassRequest(testClass)
  • Codota IconClass testClass;new ClassRequest(testClass, false)
  • Codota IconClass clazz;Description desiredDescription;Request.aClass(clazz).filterWith(desiredDescription)
  • Smart code suggestions by Codota
}
origin: google/j2objc

/**
 * Returns a Request that only runs contains tests whose {@link Description}
 * equals <code>desiredDescription</code>
 *
 * @param desiredDescription {@link Description} of those tests that should be run
 * @return the filtered Request
 */
public Request filterWith(final Description desiredDescription) {
  return filterWith(Filter.matchMethodDescription(desiredDescription));
}
origin: junit-team/junit4

/**
 * Returns a Request that only runs tests whose {@link Description}
 * matches the given description.
 *
 * <p>Returns an empty {@code Request} if {@code desiredDescription} is not a single test and filters all but the single
 * test if {@code desiredDescription} is a single test.</p>
 *
 * @param desiredDescription {@code Description} of those tests that should be run
 * @return the filtered Request
 */
public Request filterWith(Description desiredDescription) {
  return filterWith(Filter.matchMethodDescription(desiredDescription));
}
origin: junit-team/junit4

private Request applyFilterSpecs(Request request) {
  try {
    for (String filterSpec : filterSpecs) {
      Filter filter = FilterFactories.createFilterFromFilterSpec(
          request, filterSpec);
      request = request.filterWith(filter);
    }
    return request;
  } catch (FilterNotCreatedException e) {
    return errorReport(e);
  }
}
origin: junit-team/junit4

/**
 * Create a <code>Request</code> that, when processed, will run a single test.
 * This is done by filtering out all other tests. This method is used to support rerunning
 * single tests.
 *
 * @param clazz the class of the test
 * @param methodName the name of the test
 * @return a <code>Request</code> that will cause a single test be run
 */
public static Request method(Class<?> clazz, String methodName) {
  Description method = Description.createTestDescription(clazz, methodName);
  return Request.aClass(clazz).filterWith(method);
}
origin: google/j2objc

/**
 * Create a <code>Request</code> that, when processed, will run a single test.
 * This is done by filtering out all other tests. This method is used to support rerunning
 * single tests.
 *
 * @param clazz the class of the test
 * @param methodName the name of the test
 * @return a <code>Request</code> that will cause a single test be run
 */
public static Request method(Class<?> clazz, String methodName) {
  Description method = Description.createTestDescription(clazz, methodName);
  return Request.aClass(clazz).filterWith(method);
}
origin: org.junit.vintage/junit-vintage-engine

private RunnerTestDescriptor determineRunnerTestDescriptor(Class<?> testClass, Runner runner,
    List<RunnerTestDescriptorAwareFilter> filters, UniqueId engineId) {
  RunnerTestDescriptor runnerTestDescriptor = createCompleteRunnerTestDescriptor(testClass, runner, engineId);
  if (!filters.isEmpty()) {
    if (runner instanceof Filterable) {
      Filter filter = createOrFilter(filters, runnerTestDescriptor);
      Runner filteredRunner = runnerTestDescriptor.toRequest().filterWith(filter).getRunner();
      runnerTestDescriptor = createCompleteRunnerTestDescriptor(testClass, filteredRunner, engineId);
    }
    else {
      Runner runnerToReport = (runner instanceof RunnerDecorator)
          ? ((RunnerDecorator) runner).getDecoratedRunner()
          : runner;
      logger.warn(() -> "Runner " + runnerToReport.getClass().getName() //
          + " (used on " + testClass.getName() + ") does not support filtering" //
          + " and will therefore be run completely.");
    }
  }
  return runnerTestDescriptor;
}
origin: org.testng/testng

core.addListener(new RL());
Request r = Request.aClass(testCase);
return core.run(r.filterWith(new Filter() {
origin: cbeust/testng

Request r = Request.aClass(testCase);
return core.run(
  r.filterWith(
    new Filter() {
origin: apache/geode

@Test
public void testWorkingCategoryAndParameterized() {
 Request request = Request.aClass(WorkingCategoryClass.class);
 ExposedParameterized runner = (ExposedParameterized) request.getRunner();
 request =
   request.filterWith(new CategoryFilter((ExposedGetAnnotations) runner.getChildren().get(0)));
 Result result = new JUnitCore().run(request);
 assertEquals(2, result.getRunCount());
}
origin: apache/geode

@Test
public void testBrokenCategoryAndParameterized() {
 Request request = Request.aClass(BrokenCategoryClass.class);
 ExposedParameterized runner = (ExposedParameterized) request.getRunner();
 request = request.filterWith(new CategoryFilter(
   (ExposedBlockJUnit4ClassRunnerWithParameters) runner.getChildren().get(0)));
 Result result = new JUnitCore().run(request);
 assertEquals(
   "Yeah!! This might actually mean we've upgraded to JUnit 4.13. Hurry up already and delete this hack.",
   1, result.getRunCount());
}
origin: camunda/camunda-bpm-platform

/**
 * Returns a Request that only runs contains tests whose {@link Description}
 * equals <code>desiredDescription</code>
 *
 * @param desiredDescription {@link Description} of those tests that should be run
 * @return the filtered Request
 */
public Request filterWith(final Description desiredDescription) {
  return filterWith(Filter.matchMethodDescription(desiredDescription));
}
origin: camunda/camunda-bpm-platform

/**
 * Create a <code>Request</code> that, when processed, will run a single test.
 * This is done by filtering out all other tests. This method is used to support rerunning
 * single tests.
 *
 * @param clazz the class of the test
 * @param methodName the name of the test
 * @return a <code>Request</code> that will cause a single test be run
 */
public static Request method(Class<?> clazz, String methodName) {
  Description method = Description.createTestDescription(clazz, methodName);
  return Request.aClass(clazz).filterWith(method);
}
origin: stackoverflow.com

 Request request = ...
Categories.CategoryFilter filter =
  Categories.CategoryFilter.include(
    testutils.SlowTests.class); 
request = request.filterWith(filter);
Result result = JUnitCore.run(request);
origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Returns a Request that only runs contains tests whose {@link Description}
 * equals <code>desiredDescription</code>
 *
 * @param desiredDescription {@link Description} of those tests that should be run
 * @return the filtered Request
 */
public Request filterWith(final Description desiredDescription) {
  return filterWith(Filter.matchMethodDescription(desiredDescription));
}
origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.junit

/**
 * Returns a Request that only runs contains tests whose {@link Description}
 * equals <code>desiredDescription</code>
 *
 * @param desiredDescription {@link Description} of those tests that should be run
 * @return the filtered Request
 */
public Request filterWith(final Description desiredDescription) {
  return filterWith(Filter.matchMethodDescription(desiredDescription));
}
origin: org.junit/com.springsource.org.junit

/**
 * Returns a Request that only runs contains tests whose {@link Description}
 * equals <code>desiredDescription</code>
 *
 * @param desiredDescription {@link Description} of those tests that should be run
 * @return the filtered Request
 */
public Request filterWith(final Description desiredDescription) {
  return filterWith(Filter.matchMethodDescription(desiredDescription));
}
origin: com.impetus.fabric/fabric-jdbc-driver-shaded

private Request applyFilterSpecs(Request request) {
  try {
    for (String filterSpec : filterSpecs) {
      Filter filter = FilterFactories.createFilterFromFilterSpec(
          request, filterSpec);
      request = request.filterWith(filter);
    }
    return request;
  } catch (FilterNotCreatedException e) {
    return errorReport(e);
  }
}
origin: dakusui/jcunit

private JUnit4Runner(Class clazz, String methodName, int startInclusive, int endExclusive) {
 this.request = Request.classes(clazz).filterWith(
   createFilter(methodName, startInclusive, endExclusive)
 );
}
origin: com.oracle/truffle-tck

/**
 * Create a <code>Request</code> that, when processed, will run a single test.
 * This is done by filtering out all other tests. This method is used to support rerunning
 * single tests.
 *
 * @param clazz the class of the test
 * @param methodName the name of the test
 * @return a <code>Request</code> that will cause a single test be run
 */
public static Request method(Class<?> clazz, String methodName) {
  Description method = Description.createTestDescription(clazz, methodName);
  return Request.aClass(clazz).filterWith(method);
}
origin: infinitest/infinitest

private Request junitTestsToRunFrom(Class<?> classUnderTest) {
  if (isJUnit3TestCaseWithWarnings(classUnderTest)) {
    return new UninstantiableJUnit3TestRequest(classUnderTest);
  }
  Request request = Request.classWithoutSuiteMethod(classUnderTest);
  Class<?>[] junitCategoriesToExclude = readExcludedGroupsFromConfiguration();
  CategoryFilter excludeCategoriesFilter = CategoryFilter.exclude(junitCategoriesToExclude);
  return request.filterWith(excludeCategoriesFilter);
}
org.junit.runnerRequestfilterWith

Javadoc

Returns a Request that only runs contains tests whose Descriptionequals desiredDescription

Popular methods of Request

  • method
    Create a Request that, when processed, will run a single test. This is done by filtering out all oth
  • getRunner
    Returns a Runner for this Request
  • aClass
    Create a Request that, when processed, will run all the tests in a class. The odd name is necessary
  • classes
    Create a Request that, when processed, will run all the tests in a set of classes with the default C
  • runner
  • classWithoutSuiteMethod
    Create a Request that, when processed, will run all the tests in a class. If the class has a suite()
  • errorReport
    Not used within JUnit. Clients should simply instantiate ErrorReportingRunner themselves

Popular in Java

  • Reactive rest calls using spring rest template
  • findViewById (Activity)
  • startActivity (Activity)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • Menu (java.awt)
  • LinkedHashMap (java.util)
    Hash table and linked list implementation of the Map interface, with predictable iteration order. Th
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Table (org.hibernate.mapping)
    A relational table
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.This exception may include information for locating the er
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now