Package org.jboss.arquillian.test.spi

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


     *
     * <p>{@link RuntimeException} is expected.</p>
     */
    @Test(expected = RuntimeException.class)
    public void testCreateApplicationContextMissingResource() {
        TestClass testClass = new TestClass(XmlAnnotatedMissingResourceClass.class);

        instance.createApplicationContext(testClass);
    }
View Full Code Here


    }

    @Test
    public void customContextShouldBeChosenWhenBothDefaultAndCustomResourcesExist() {
        // given
        TestClass testClass = new TestClass(ClientXmlAnnotatedClassWithBothCustomAndDefaultLocations.class);

        // when
        ClientTestScopeApplicationContext applicationContext = instance.createApplicationContext(testClass);

        // then
View Full Code Here

    }

    @Test
    public void createdApplicationContextCreatedFromDefaultResourceShouldContainSingleBean() {
        // given
        TestClass testClass = new TestClass(ClientXmlAnnotatedClass.class);

        // when
        ClientTestScopeApplicationContext applicationContext = instance.createApplicationContext(testClass);

        // then
View Full Code Here

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

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

        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

        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

        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

        public void startup(@Observes(precedence = -100) ManagerStarted event, ArquillianDescriptor descriptor) {
            deploymentClass = getDeploymentClass(descriptor);

            executeInClassScope(new Callable<Void>() {
                public Void call() throws Exception {
                    generateDeploymentEvent.fire(new GenerateDeployment(new TestClass(deploymentClass)));
                    suiteDeploymentScenario = classDeploymentScenario.get();
                    return null;
                }
            });
        }
View Full Code Here

    InstanceProducer<PortletArchiveMetadata> portletMetadata;

    public void parsePortletXml(@Observes BeforeDeploy event) {
        boolean processed = false;
        Archive applicationArchive = event.getDeployment().getArchive();
        TestClass testClass = testClassInstance.get();

        for (Field field : testClass.getJavaClass().getDeclaredFields()) {
            if (field.isAnnotationPresent(PortalURL.class)) {
                processed = processPortletXml(applicationArchive);
                if (processed) {
                    break;
                }
            }
        }

        if (!processed) {
            for (Method method : testClass.getJavaClass().getDeclaredMethods()) {
                Annotation[][] methodParameterAnnotations = method.getParameterAnnotations();
                for (Annotation[] parameterAnnotations : methodParameterAnnotations) {
                    for (Annotation annotation : parameterAnnotations) {
                        if (annotation instanceof PortalURL) {
                            processed = processPortletXml(applicationArchive);
View Full Code Here

    /**
     * <p>Tests the {@link AnnotationClientApplicationContextProducer#supports(TestClass)} method.</p>
     */
    @Test
    public void testSupportsFalse() {
        TestClass testClass = new TestClass(PlainClass.class);

        assertFalse("Class without annotations shouldn't be supported.", instance.supports(testClass));
    }
View Full Code Here

TOP

Related Classes of org.jboss.arquillian.test.spi.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.