Search in sources :

Example 1 with FilterFactoryParams

use of org.junit.runner.FilterFactoryParams in project junit4 by junit-team.

the class CategoryFilterFactoryTest method shouldCreateFilter.

@Test
public void shouldCreateFilter() throws Exception {
    FilterFactoryParams params = new FilterFactoryParams(createSuiteDescription(testName.getMethodName()), CategoryFilterFactoryStub.class.getName());
    Filter filter = categoryFilterFactory.createFilter(params);
    assertThat(filter, instanceOf(DummyFilter.class));
}
Also used : Filter(org.junit.runner.manipulation.Filter) FilterFactoryParams(org.junit.runner.FilterFactoryParams) Test(org.junit.Test)

Example 2 with FilterFactoryParams

use of org.junit.runner.FilterFactoryParams in project junit4 by junit-team.

the class CategoryFilterFactoryTest method shouldThrowException.

@Test
public void shouldThrowException() throws Exception {
    FilterFactoryParams params = new FilterFactoryParams(createSuiteDescription(testName.getMethodName()), "NonExistentFilter");
    expectedException.expect(FilterFactory.FilterNotCreatedException.class);
    categoryFilterFactory.createFilter(params);
}
Also used : FilterFactoryParams(org.junit.runner.FilterFactoryParams) FilterFactory(org.junit.runner.FilterFactory) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 FilterFactoryParams (org.junit.runner.FilterFactoryParams)2 FilterFactory (org.junit.runner.FilterFactory)1 Filter (org.junit.runner.manipulation.Filter)1