use of org.junit.runners.model.TestClass in project junit4 by junit-team.
the class CategoryValidatorTest method errorIsAddedWhenCategoryIsUsedWithBefore.
@Test
public void errorIsAddedWhenCategoryIsUsedWithBefore() {
FrameworkMethod method = new TestClass(CategoryTest.class).getAnnotatedMethods(Before.class).get(0);
testAndAssertErrorMessage(method, "@Before can not be combined with @Category");
}
use of org.junit.runners.model.TestClass in project junit4 by junit-team.
the class CategoryValidatorTest method errorIsAddedWhenCategoryIsUsedWithAfterClass.
@Test
public void errorIsAddedWhenCategoryIsUsedWithAfterClass() {
FrameworkMethod method = new TestClass(CategoryTest.class).getAnnotatedMethods(AfterClass.class).get(0);
testAndAssertErrorMessage(method, "@AfterClass can not be combined with @Category");
}
use of org.junit.runners.model.TestClass in project junit4 by junit-team.
the class CategoryValidatorTest method errorIsAddedWhenCategoryIsUsedWithAfter.
@Test
public void errorIsAddedWhenCategoryIsUsedWithAfter() {
FrameworkMethod method = new TestClass(CategoryTest.class).getAnnotatedMethods(After.class).get(0);
testAndAssertErrorMessage(method, "@After can not be combined with @Category");
}
use of org.junit.runners.model.TestClass in project junit4 by junit-team.
the class SpecificDataPointsSupplierTest method shouldReturnOnlyTheNamedSingleMethodDataPoints.
@Test
public void shouldReturnOnlyTheNamedSingleMethodDataPoints() throws Throwable {
SpecificDataPointsSupplier supplier = new SpecificDataPointsSupplier(new TestClass(TestClassWithNamedDataPoints.class));
List<PotentialAssignment> assignments = supplier.getValueSources(signature("methodWantingNamedSingleMethodString"));
List<String> assignedStrings = getStringValuesFromAssignments(assignments);
assertEquals(1, assignedStrings.size());
assertThat(assignedStrings, hasItem("named single method value"));
}
use of org.junit.runners.model.TestClass in project junit4 by junit-team.
the class SpecificDataPointsSupplierTest method shouldReturnNothingIfTheNamedDataPointsAreMissing.
@Test
public void shouldReturnNothingIfTheNamedDataPointsAreMissing() throws Throwable {
SpecificDataPointsSupplier supplier = new SpecificDataPointsSupplier(new TestClass(TestClassWithNamedDataPoints.class));
List<PotentialAssignment> assignments = supplier.getValueSources(signature("methodWantingWrongNamedString"));
List<String> assignedStrings = getStringValuesFromAssignments(assignments);
assertEquals(0, assignedStrings.size());
}
Aggregations