Package org.junit.runners.model

Examples of org.junit.runners.model.TestClass


    }

    @Test
    public void isNotEqualToTestWithDifferentTestClass() {
        TestWithParameters firstTest = new TestWithParameters(DUMMY_NAME,
                new TestClass(DummyClass.class), DUMMY_PARAMETERS);
        TestWithParameters secondTest = new TestWithParameters(DUMMY_NAME,
                new TestClass(AnotherDummyClass.class), DUMMY_PARAMETERS);
        assertNotEquals(firstTest, secondTest);
    }
View Full Code Here


        assertEquals(firstTest.hashCode(), secondTest.hashCode());
    }

    @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]",
View Full Code Here

    public static final String OPENEJB_APPLICATION_COMPOSER_CONTEXT = "openejb.application.composer.context";
    private final TestClass testClass;

    public ApplicationComposer(Class<?> klass) throws InitializationError {
        super(klass);
        testClass = new TestClass(klass);
        validate();
    }
View Full Code Here

    public void boot()
    {
        final ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();

        this.mockedMyFacesTestContainer = new MyFacesContainer(new TestClass(this.testClass))
        {
            @Override
            protected String getWebappResourcePath()
            {
                TestConfig testConfig = testClass.getJavaClass().getAnnotation(TestConfig.class);
View Full Code Here

    protected List<Runner> runners = new ArrayList<Runner>();

    public FeatureVariations(Class<?> clazz) throws InitializationError {
        super(clazz, Collections.<Runner> emptyList());

        TestClass testClass = new TestClass(clazz);

        VariationSetBuilder<? extends Feature> permutation = getPermutationFromMethod(testClass);
        if (permutation == null) {
            throw new IllegalStateException("You have to place a @" + Variations.class.getSimpleName()
                    + " annotation one the class: " + clazz.getName());
View Full Code Here

        this.testClass = createTestClass(testClass);
        validate();
    }

    protected TestClass createTestClass(Class<?> testClass) {
        return new TestClass(testClass);
    }
View Full Code Here

    private final TestClass testClass;

    public ApplicationComposer(Class<?> klass) throws InitializationError {
        super(klass);
        testClass = new TestClass(klass);
        validate();
    }
View Full Code Here

     * By default JUnit includes all methods annotated with @Test. This method only allows methods annotated with @Keys to be included in the list of methods to be run in a
     * TestCase. Any @Test methods will be ignored
     */
    @Override
    protected List<FrameworkMethod> computeTestMethods() {
        TestClass testClass = getTestClass();
        List<FrameworkMethod> methods = testClass.getAnnotatedMethods(MetaTest.class);
        return methods;
    }
View Full Code Here

  /**
   * Constructs a new {@code ParentRunner} that will run {@code @TestClass}
   * @throws InitializationError
   */
  protected ParentRunner(Class<?> testClass) throws InitializationError {
    fTestClass= new TestClass(testClass);
    validate();
  }
View Full Code Here

     * @param errors The list where to report any problem found.
     */
    @Override
    protected void validateTestMethods(final List<Throwable> errors) {
        super.validateTestMethods(errors);
        final TestClass testClass = getTestClass();
        final List<FrameworkMethod> depends = testClass.getAnnotatedMethods(DependsOnMethod.class);
        if (!isNullOrEmpty(depends)) {
            final Set<String> dependencies = new HashSet<String>(hashMapCapacity(depends.size()));
            for (final FrameworkMethod method : depends) {
                for (final String value : method.getAnnotation(DependsOnMethod.class).value()) {
                    dependencies.add(value);
                }
            }
            for (final FrameworkMethod method : testClass.getAnnotatedMethods(Test.class)) {
                dependencies.remove(method.getName());
            }
            for (final String notFound : dependencies) {
                errors.add(new NoSuchMethodException("@DependsOnMethod(\"" + notFound + "\"): "
                        + "method not found in " + testClass.getName()));
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.junit.runners.model.TestClass

Copyright © 2018 www.massapicom. 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.