Tabnine Logo
org.junit.runner
Code IndexAdd Tabnine to your IDE (free)

How to use org.junit.runner

Best Java code snippets using org.junit.runner (Showing top 20 results out of 50,238)

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

  /**
   * @return the number of tests to be run by the receiver
   */
  public int testCount() {
    return getDescription().testCount();
  }
}
origin: junit-team/junit4

/**
 * Run all the tests contained in <code>request</code>.
 *
 * @param request the request describing tests
 * @return a {@link Result} describing the details of the test run and the failed tests.
 */
public Result run(Request request) {
  return run(request.getRunner());
}
origin: spring-projects/spring-framework

@RunWith(SpringRunner.class)
public static abstract class BaseTestCase {
  @Test
  public void testNothing() {
  }
}
origin: junit-team/junit4

private void configureRunner(Runner runner) throws InvalidOrderingException {
  Description description = runner.getDescription();
  OrderWith orderWith = description.getAnnotation(OrderWith.class);
  if (orderWith != null) {
    Ordering ordering = Ordering.definedBy(orderWith.value(), description);
    ordering.apply(runner);
  }
}
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

/**
 * Run all the tests in <code>classes</code>.
 *
 * @param classes the classes containing tests
 * @return a {@link Result} describing the details of the test run and the failed tests.
 */
public Result run(Class<?>... classes) {
  return run(Request.classes(defaultComputer(), classes));
}
origin: junit-team/junit4

/**
 * Run all the tests in <code>classes</code>.
 *
 * @param computer Helps construct Runners from classes
 * @param classes the classes containing tests
 * @return a {@link Result} describing the details of the test run and the failed tests.
 */
public Result run(Computer computer, Class<?>... classes) {
  return run(Request.classes(computer, classes));
}
origin: junit-team/junit4

/**
 * Create a <code>Request</code> that, when processed, will run all the tests
 * in a set of classes with the default <code>Computer</code>.
 *
 * @param classes the classes containing the tests
 * @return a <code>Request</code> that will cause all tests in the classes to be run
 */
public static Request classes(Class<?>... classes) {
  return classes(JUnitCore.defaultComputer(), classes);
}
origin: junit-team/junit4

/**
 * Creates a {@link Filter}.
 *
 * @param filterFactoryFqcn The fully qualified class name of the {@link FilterFactory}
 * @param params The arguments to the {@link FilterFactory}
 */
public static Filter createFilter(String filterFactoryFqcn, FilterFactoryParams params)
    throws FilterFactory.FilterNotCreatedException {
  FilterFactory filterFactory = createFilterFactory(filterFactoryFqcn);
  return filterFactory.createFilter(params);
}
origin: bumptech/glide

@RunWith(JUnit4.class)
public class UnitTranscoderTest {

 @Test
 public void testReturnsTheGivenResource() {
  Resource<Object> resource = mockResource();
  ResourceTranscoder<Object, Object> unitTranscoder = UnitTranscoder.get();

  assertEquals(resource, unitTranscoder.transcode(resource, new Options()));
 }
}

origin: google/j2objc

/**
 * Run all the tests contained in <code>request</code>.
 *
 * @param request the request describing tests
 * @return a {@link Result} describing the details of the test run and the failed tests.
 */
public Result run(Request request) {
  return run(request.getRunner());
}
origin: google/j2objc

/**
 * Run all the tests in <code>classes</code>.
 *
 * @param computer Helps construct Runners from classes
 * @param classes the classes containing tests
 * @return a {@link Result} describing the details of the test run and the failed tests.
 */
public Result run(Computer computer, Class<?>... classes) {
  return run(Request.classes(computer, classes));
}
origin: google/j2objc

  /**
   * @return the number of tests to be run by the receiver
   */
  public int testCount() {
    return getDescription().testCount();
  }
}
origin: google/j2objc

/**
 * Create a <code>Request</code> that, when processed, will run all the tests
 * in a set of classes with the default <code>Computer</code>.
 *
 * @param classes the classes containing the tests
 * @return a <code>Request</code> that will cause all tests in the classes to be run
 */
public static Request classes(Class<?>... classes) {
  return classes(JUnitCore.defaultComputer(), classes);
}
origin: junit-team/junit4

/**
 * Creates a {@link Filter}.
 *
 * @param filterFactoryClass The class of the {@link FilterFactory}
 * @param params             The arguments to the {@link FilterFactory}
 *
 */
public static Filter createFilter(Class<? extends FilterFactory> filterFactoryClass, FilterFactoryParams params)
    throws FilterFactory.FilterNotCreatedException {
  FilterFactory filterFactory = createFilterFactory(filterFactoryClass);
  return filterFactory.createFilter(params);
}
origin: bumptech/glide

@RunWith(JUnit4.class)
public class FileResourceTest {

 private File file;
 private FileResource resource;

 @Before
 public void setUp() {
  file = new File("Test");
  resource = new FileResource(file);
 }

 @Test
 public void testReturnsGivenFile() {
  assertEquals(file, resource.get());
 }
}

origin: greenrobot/EventBus

@RunWith(AndroidJUnit4.class)
public class EventBusAndroidCancelEventDeliveryTest extends EventBusCancelEventDeliveryTest {

  @UiThreadTest
  @Test
  public void testCancelInMainThread() {
    SubscriberMainThread subscriber = new SubscriberMainThread();
    eventBus.register(subscriber);
    eventBus.post("42");
    awaitLatch(subscriber.done, 10);
    assertEquals(0, eventCount.intValue());
    assertNotNull(failed);
  }

}

origin: spring-projects/spring-framework

/**
 * @author Sam Brannen
 * @since 4.3
 */
@RunWith(SpringRunner.class)
public class BootstrapWithInterfaceTests implements BootstrapWithTestInterface {

  @Autowired
  String foo;


  @Test
  public void injectedBean() {
    assertEquals("foo", foo);
  }

}

origin: spring-projects/spring-framework

/**
 * @author Sam Brannen
 * @since 4.3
 */
@RunWith(SpringRunner.class)
public class WebAppConfigurationInterfaceTests implements WebAppConfigurationTestInterface {

  @Autowired
  WebApplicationContext wac;


  @Test
  public void wacLoaded() {
    assertNotNull(wac);
  }

}

org.junit.runner

Most used classes

  • RunWith
  • Parameterized$Parameters
  • Description
    A Description describes a test which is to be run or has been run. Descriptions can be atomic (a si
  • Statement
    Represents one or more actions to be taken at runtime in the course of running a JUnit test suite.
  • Suite$SuiteClasses
  • TestClass,
  • BlockJUnit4ClassRunner,
  • RunNotifier,
  • Failure,
  • JUnitCore,
  • InitializationError,
  • Result,
  • Parameterized$Parameter,
  • Runner,
  • MultipleFailureException,
  • ParentRunner,
  • Request,
  • Filter,
  • RunListener
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