use of org.junit.runners.model.TestClass in project junit4 by junit-team.
the class PublicClassValidatorTest method acceptsPublicClass.
@Test
public void acceptsPublicClass() {
TestClass testClass = new TestClass(PublicClass.class);
List<Exception> validationErrors = validator.validateTestClass(testClass);
assertThat(validationErrors, is(equalTo(Collections.<Exception>emptyList())));
}
use of org.junit.runners.model.TestClass in project junit4 by junit-team.
the class BlockJUnit4ClassRunnerWithParametersTest method hasAllAnnotationsExceptRunWith.
@Test
public void hasAllAnnotationsExceptRunWith() throws Exception {
TestWithParameters testWithParameters = new TestWithParameters("dummy name", new TestClass(ClassWithParameterizedAnnotation.class), NO_PARAMETERS);
BlockJUnit4ClassRunnerWithParameters runner = new BlockJUnit4ClassRunnerWithParameters(testWithParameters);
Annotation[] annotations = runner.getRunnerAnnotations();
assertEquals(1, annotations.length);
assertEquals(annotations[0].annotationType(), DummyAnnotation.class);
}
use of org.junit.runners.model.TestClass in project junit4 by junit-team.
the class TestWithParametersTest method hasMeaningfulToString.
@Test
public void hasMeaningfulToString() {
TestWithParameters test = new TestWithParameters("name", new TestClass(DummyClass.class), Arrays.<Object>asList("first parameter", "second parameter"));
assertEquals("Wrong toString().", "org.junit.runners.parameterized.TestWithParametersTest$DummyClass 'name' with parameters [first parameter, second parameter]", test.toString());
}
use of org.junit.runners.model.TestClass in project junit4 by junit-team.
the class SpecificDataPointsSupplierTest method shouldReturnOnlyTheNamedSingleFieldDataPoints.
@Test
public void shouldReturnOnlyTheNamedSingleFieldDataPoints() throws Throwable {
SpecificDataPointsSupplier supplier = new SpecificDataPointsSupplier(new TestClass(TestClassWithNamedDataPoints.class));
List<PotentialAssignment> assignments = supplier.getValueSources(signature("methodWantingNamedSingleFieldString"));
List<String> assignedStrings = getStringValuesFromAssignments(assignments);
assertEquals(1, assignedStrings.size());
assertThat(assignedStrings, hasItem("named single value"));
}
use of org.junit.runners.model.TestClass in project junit4 by junit-team.
the class SpecificDataPointsSupplierTest method shouldReturnOnlyTheNamedMethodDataPoints.
@Test
public void shouldReturnOnlyTheNamedMethodDataPoints() throws Throwable {
SpecificDataPointsSupplier supplier = new SpecificDataPointsSupplier(new TestClass(TestClassWithNamedDataPoints.class));
List<PotentialAssignment> assignments = supplier.getValueSources(signature("methodWantingNamedMethodString"));
List<String> assignedStrings = getStringValuesFromAssignments(assignments);
assertEquals(1, assignedStrings.size());
assertThat(assignedStrings, hasItem("named method"));
}
Aggregations