Package org.jboss.arquillian.spring.integration.context

Examples of org.jboss.arquillian.spring.integration.context.RemoteTestScopeApplicationContext


        instance = new ContainerApplicationContextLifecycleHandler();

        supportedApplicationContextProducer = mock(RemoteApplicationContextProducer.class);
        when(supportedApplicationContextProducer.supports(any(TestClass.class))).thenReturn(true);
        when(supportedApplicationContextProducer.createApplicationContext(any(TestClass.class)))
                .thenReturn(new RemoteTestScopeApplicationContext(new GenericApplicationContext(), testClass, true));

        notSupportedApplicationContextProducer = mock(RemoteApplicationContextProducer.class);
        when(notSupportedApplicationContextProducer.supports(any(TestClass.class))).thenReturn(false);

        applicationContextDestroyer = mock(ApplicationContextDestroyer.class);
View Full Code Here


        Instance<ServiceLoader> mockServiceLoader = mock(Instance.class);
        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

        Instance<ServiceLoader> mockServiceLoader = mock(Instance.class);
        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

        Instance<ServiceLoader> mockServiceLoader = mock(Instance.class);
        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 shouldCreateApplicationContextFromDefaultLocation() {
        // given
        TestClass testClass = new TestClass(XmlAnnotatedClassWithDefaultContextLocationDefined.class);

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

        // then
        assertNotNull("Created context was null", applicationContext);
        assertThat(applicationContext.getApplicationContext().getBeanDefinitionCount()).isEqualTo(1);
    }
View Full Code Here

    public void shouldUseCustomResourceLocationsFileInsteadOfDefaultLocation() {
        // given
        TestClass testClass = new TestClass(XmlAnnotatedClassWithBothCustomAndDefaultContextLocationsDefined.class);

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

        // then
        assertNotNull("Created context was null", applicationContext);
        assertThat(applicationContext.getApplicationContext().getBeanDefinitionNames()).isEmpty();
    }
View Full Code Here

        instance = new SpringEmbeddedApplicationContextLifeCycleHandler();

        supportedApplicationContextProducer = mock(RemoteApplicationContextProducer.class);
        when(supportedApplicationContextProducer.supports(any(TestClass.class))).thenReturn(true);
        when(supportedApplicationContextProducer.createApplicationContext(any(TestClass.class)))
                .thenReturn(new RemoteTestScopeApplicationContext(new GenericApplicationContext(), testClass, true));

        notSupportedApplicationContextProducer = mock(RemoteApplicationContextProducer.class);
        when(notSupportedApplicationContextProducer.supports(any(TestClass.class))).thenReturn(false);

        applicationContextDestroyer = mock(ApplicationContextDestroyer.class);
View Full Code Here

        Instance<ServiceLoader> mockServiceLoader = mock(Instance.class);
        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

        Instance<ServiceLoader> mockServiceLoader = mock(Instance.class);
        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

        Instance<ServiceLoader> mockServiceLoader = mock(Instance.class);
        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

TOP

Related Classes of org.jboss.arquillian.spring.integration.context.RemoteTestScopeApplicationContext

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.