Package org.jboss.arquillian.test.spi

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


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

        assertTrue("Class should be supported.", instance.supports(testClass));
    }
View Full Code Here


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

        assertTrue("Class should be supported.", instance.supports(testClass));
    }
View Full Code Here

     *
     * @throws Exception if any error occurs
     */
    @Test
    public void testCreateApplicationContextClasses() throws Exception {
        TestClass testClass = new TestClass(ClientClassesAnnotatedClass.class);

        TestScopeApplicationContext result = instance.createApplicationContext(testClass);

        assertNotNull("The result was null.", result);
        assertTrue("The application context should be marked as closable.", result.isClosable());
View Full Code Here

     *
     * @throws Exception if any error occurs
     */
    @Test
    public void testCreateApplicationContextPackages() throws Exception {
        TestClass testClass = new TestClass(ClientClassesAnnotatedClass.class);

        TestScopeApplicationContext result = instance.createApplicationContext(testClass);

        assertNotNull("The result was null.", result);
        assertTrue("The application context should be marked as closable.", result.isClosable());
View Full Code Here

    }

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

        // when
        thrownException.expect(RuntimeException.class);
        instance.createApplicationContext(testClass);
View Full Code Here

    }

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

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

        // then
View Full Code Here

    }

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

        // when
        thrownException.expect(RuntimeException.class);
        thrownException.expectMessage(DefaultConfigurationClassesProcessor.VALIDATION_MESSAGE_SUFFIX_INNER_CLASS_DECLARED_NOT_STATIC);
        instance.createApplicationContext(testClass);
View Full Code Here

    }

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

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

        // then
View Full Code Here

    }

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

        // when
        thrownException.expect(RuntimeException.class);
        thrownException.expectMessage(DefaultConfigurationClassesProcessor.VALIDATION_MESSAGE_SUFFIX_INNER_CONFIGURATION_CLASS_DECLARED_FINAL);
        instance.createApplicationContext(testClass);
View Full Code Here

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

        instance.createApplicationContext(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.