Examples of TestClass


Examples of org.jboss.arquillian.test.spi.TestClass

     * @throws Exception if any error occurs
     */
    @Before
    public void setUp() throws Exception {

        testClass = new TestClass(TEST_OBJECT.getClass());
        testMethod = TEST_OBJECT.getClass().getMethod("testMethod");

        instance = new ContainerApplicationContextLifecycleHandler();

        supportedApplicationContextProducer = mock(RemoteApplicationContextProducer.class);
View Full Code Here

Examples of org.jboss.arquillian.test.spi.TestClass

        when(mockServiceLoader.get()).thenReturn(serviceLoader);
        TestReflectionHelper.setFieldValue(instance, "serviceLoaderInstance", mockServiceLoader);

        ApplicationContext applicationContext = mock(ApplicationContext.class);
        RemoteTestScopeApplicationContext containerTestScopeApplicationContext =
                new RemoteTestScopeApplicationContext(applicationContext, new TestClass(Object.class), true);

        InstanceProducer<RemoteTestScopeApplicationContext> mockApplicationContext = mock(InstanceProducer.class);
        when(mockApplicationContext.get()).thenReturn(containerTestScopeApplicationContext);
        TestReflectionHelper.setFieldValue(instance, "applicationContextInstance", mockApplicationContext);
View Full Code Here

Examples of org.junit.internal.runners.TestClass

    }

    @Override
    protected void invokeTestMethod(final Method method, final RunNotifier notifier) {

        final TestClass testClass = getTestClass();
        final String configDirIfAny = getConfigDir(testClass.getJavaClass());

        final Description description = methodDescription(method);

        final IsisConfigurationBuilder isisConfigurationBuilder = new IsisConfigurationBuilderDefault(configDirIfAny);
        isisConfigurationBuilder.add(SystemConstants.NOSPLASH_KEY, "" + true); // switch
View Full Code Here

Examples of org.junit.runners.model.TestClass

     *
     * @throws InitializationError
     */
    private void validateTestClass() throws InitializationError
    {
        TestClass test = getTestClass();
        List<Throwable> errors= new ArrayList<Throwable>();
        if (!FileTest.class.isAssignableFrom(test.getJavaClass())) {
            errors.add(new Exception("The test class " + test.getName() + " should implement FileTest"));
        }
        if (test.getOnlyConstructor().getParameterTypes().length != 0) {
            errors.add(new Exception("Constructor of " + test.getName() + " should have no parameters"));
        }
        validatePublicVoidNoArgMethods(Test.class, false, errors);
        if (errors.size() != 0) {
            throw new InitializationError(errors);
        }
View Full Code Here

Examples of org.junit.runners.model.TestClass

        {
            classLoader = new TestClassLoader();

        }

        testClassFromClassLoader = new TestClass(classLoader
                .loadClass(getTestClass().getJavaClass().getName()));
        // See withAfters and withBefores for the reason.
        beforeFromClassLoader = classLoader.loadClass(Before.class.getName());
        afterFromClassLoader = classLoader.loadClass(After.class.getName());
    }
View Full Code Here

Examples of org.junit.runners.model.TestClass

                .getChildren().size(), is(1));
    }

    @Test
    public void theoryAnnotationsAreRetained() throws Exception {
        assertThat(new TestClass(HasAFailingTheory.class).getAnnotatedMethods(
                Theory.class).size(), is(1));
    }
View Full Code Here

Examples of org.junit.runners.model.TestClass

        allMemberValuesFor(HasFailingDataPointsArrayMethod.class, Object.class);
    }

    private List<PotentialAssignment> allMemberValuesFor(Class<?> testClass,
            Class<?>... constructorParameterTypes) throws Throwable {
        return new AllMembersSupplier(new TestClass(testClass))
                .getValueSources(ParameterSignature.signatures(
                        testClass.getConstructor(constructorParameterTypes))
                        .get(0));
    }
View Full Code Here

Examples of org.junit.runners.model.TestClass

        }
    }

    @Test
    public void shouldReturnOnlyTheNamedDataPoints() throws Throwable {
        SpecificDataPointsSupplier supplier = new SpecificDataPointsSupplier(new TestClass(TestClassWithNamedDataPoints.class));

        List<PotentialAssignment> assignments = supplier.getValueSources(signature("methodWantingAllNamedStrings"));
        List<String> assignedStrings = getStringValuesFromAssignments(assignments);

        assertEquals(4, assignedStrings.size());
View Full Code Here

Examples of org.junit.runners.model.TestClass

        assertThat(assignedStrings, hasItems("named field", "named method", "named single value", "named single method value"));
    }
   
    @Test
    public void shouldReturnOnlyTheNamedFieldDataPoints() throws Throwable {
        SpecificDataPointsSupplier supplier = new SpecificDataPointsSupplier(new TestClass(TestClassWithNamedDataPoints.class));

        List<PotentialAssignment> assignments = supplier.getValueSources(signature("methodWantingNamedFieldString"));
        List<String> assignedStrings = getStringValuesFromAssignments(assignments);

        assertEquals(1, assignedStrings.size());
View Full Code Here

Examples of org.junit.runners.model.TestClass

        assertThat(assignedStrings, hasItem("named field"));
    }

    @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());
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.