Package org.jboss.arquillian.test.spi

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


     *
     * @param event
     */
    public void verifyThatRunAsClientClassIsNotTestable(@Observes BeforeClass event) {

        TestClass testClass = event.getTestClass();

        // run-as-client class
        if (testClass.getAnnotation(RunAsClient.class) != null) {

            // non-warp class
            if (testClass.getAnnotation(WarpTest.class) == null) {
                Method method = testClass.getMethod(Deployment.class);
                Deployment deployment = method.getAnnotation(Deployment.class);

                // deployment is testable
                if (deployment.testable()) {
                    throw new IllegalArgumentException("Non-Warp test that is marked as @RunAsClient should not be testable: "
                            + testClass.getJavaClass().getName());
                }
            }
        }
    }
View Full Code Here


    @Before
    public void setUp() {

        test = new StrategyTest();

        testClass = new TestClass(StrategyTest.class);

        ClassPathXmlApplicationContext applicationContext =
                new ClassPathXmlApplicationContext("testApplicationContext.xml");

        TestScopeApplicationContext testScopeApplicationContext =
View Full Code Here

     * <p>Sets up the test environment.</p>
     */
    @Before
    public void setUp() {

        testClass = new TestClass(Object.class);

        instance = new DefaultApplicationContextDestroyer();
    }
View Full Code Here

     * <p>Sets up the test environment.</p>
     */
    @Before
    public void setUp() {

        testClass = new TestClass(Object.class);

        applicationContext = mock(ApplicationContext.class);
    }
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 ContainerApplicationContextLifecycleHandler();

        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

    /**
     * <p>Tests the {@link XmlRemoteApplicationContextProducer#supports(org.jboss.arquillian.test.spi.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

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

        assertTrue("Class should 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.