Examples of TestClass


Examples of org.junit.runners.model.TestClass

        assertThat(assignedStrings, hasItem("named method"));
    }
   
    @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());
View Full Code Here

Examples of org.junit.runners.model.TestClass

        assertThat(assignedStrings, hasItem("named single value"));
    }

    @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());
View Full Code Here

Examples of org.junit.runners.model.TestClass

        assertThat(assignedStrings, hasItem("named single method value"));
    }   
   
    @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());
View Full Code Here

Examples of org.junit.runners.model.TestClass

        }
    }

    @Test
    public void errorIsAddedWhenCategoryIsUsedWithBeforeClass() {
        FrameworkMethod method = new TestClass(CategoryTest.class).getAnnotatedMethods(BeforeClass.class).get(0);
        testAndAssertErrorMessage(method, "@BeforeClass can not be combined with @Category");
    }
View Full Code Here

Examples of org.junit.runners.model.TestClass

        testAndAssertErrorMessage(method, "@BeforeClass can not be combined with @Category");
    }

    @Test
    public void errorIsAddedWhenCategoryIsUsedWithAfterClass() {
        FrameworkMethod method = new TestClass(CategoryTest.class).getAnnotatedMethods(AfterClass.class).get(0);
        testAndAssertErrorMessage(method, "@AfterClass can not be combined with @Category");
    }
View Full Code Here

Examples of org.junit.runners.model.TestClass

        testAndAssertErrorMessage(method, "@AfterClass can not be combined with @Category");
    }

    @Test
    public void errorIsAddedWhenCategoryIsUsedWithBefore() {
        FrameworkMethod method = new TestClass(CategoryTest.class).getAnnotatedMethods(Before.class).get(0);
        testAndAssertErrorMessage(method, "@Before can not be combined with @Category");
    }
View Full Code Here

Examples of org.junit.runners.model.TestClass

        testAndAssertErrorMessage(method, "@Before can not be combined with @Category");
    }

    @Test
    public void errorIsAddedWhenCategoryIsUsedWithAfter() {
        FrameworkMethod method = new TestClass(CategoryTest.class).getAnnotatedMethods(After.class).get(0);
        testAndAssertErrorMessage(method, "@After can not be combined with @Category");
    }
View Full Code Here

Examples of org.junit.runners.model.TestClass

    private TheoryTestUtils() { }
   
    public static List<PotentialAssignment> potentialAssignments(Method method)
            throws Throwable {
        return Assignments.allUnassigned(method,
                new TestClass(method.getDeclaringClass()))
                .potentialsForNextUnassigned();
    }
View Full Code Here

Examples of org.junit.runners.model.TestClass

public class RuleMemberValidatorTest {
    private final List<Throwable> errors = new ArrayList<Throwable>();

    @Test
    public void rejectProtectedClassRule() {
        TestClass target = new TestClass(TestWithProtectedClassRule.class);
        CLASS_RULE_VALIDATOR.validate(target, errors);
        assertOneErrorWithMessage("The @ClassRule 'temporaryFolder' must be public.");
    }
View Full Code Here

Examples of org.junit.runners.model.TestClass

        protected static TestRule temporaryFolder = new TemporaryFolder();
    }

    @Test
    public void rejectNonStaticClassRule() {
        TestClass target = new TestClass(TestWithNonStaticClassRule.class);
        CLASS_RULE_VALIDATOR.validate(target, errors);
        assertOneErrorWithMessage("The @ClassRule 'temporaryFolder' must be static.");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.