Package org.jboss.arquillian.test.spi

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


     *
     * @throws Exception if any error occurs
     */
    @Test(expected = RuntimeException.class)
    public void testCreateApplicationContextCustomContextPackagesConfigurationAndAnnotation() throws Exception {
        TestClass testClass = new TestClass(AnnotatedPackagesCustomContextClass.class);

        Map<String, String> properties = new HashMap<String, String>();
        properties.put("customAnnotationContextClass",
                "invalid class name");
        remoteConfiguration = new SpringIntegrationConfiguration(properties);
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

        // given
        applicationContextDataSourceProvider = new ApplicationContextDataSourceProvider();

        bind(ApplicationScoped.class, RemoteTestScopeApplicationContext.class,
                new RemoteTestScopeApplicationContext(applicationContext, new TestClass(this.getClass()), false));

        getManager().inject(applicationContextDataSourceProvider);
    }
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 ClientApplicationContextLifecycleHandler();

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

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

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

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

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

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

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

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

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

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

    /**
     * Creates Warp archive
     */
    @Override
    public Archive<?> createAuxiliaryArchive() {
        TestClass testClass = this.testClass.get();

        if (testClass.isAnnotationPresent(WarpTest.class)) {
            JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "arquillian-warp.jar");

            // API
            archive.addClass(Inspection.class);
            archive.addClasses(BeforeServlet.class, AfterServlet.class);
View Full Code Here

     *
     * (test class will be suplied by transformed asserions)
     */
    @Override
    public void process(TestDeployment testDeployment, Archive<?> protocolArchive) {
        TestClass testClass = this.testClass.get();

        if (testClass.isAnnotationPresent(WarpTest.class)) {
            Archive<?> applicationArchive = testDeployment.getApplicationArchive();
            List<ArchivePath> classPathsToRemove = new LinkedList<ArchivePath>();
            for (ArchivePath archivePath : applicationArchive.getContent().keySet()) {
                String path = archivePath.get();
                String classPath = testClass.getName().replace(".", "/");
                // remove TestClass and its anonymous classes - do not remove static inner classes
                if (path.matches("/WEB-INF/classes/" + classPath + "(\\$[0-9]*)?\\.class")) {
                    classPathsToRemove.add(archivePath);
                }
            }
View Full Code Here

    }

    @Test
    public void nonNullMetaDataTest() throws Exception {
        FakeResourceMetaData fmd = new FakeResourceMetaData();
        fmd.setTestClass(new TestClass(FakeTestClass.class)).setTestMethod(FakeTestClass.class.getMethod("fakeTestMethod"));

        Assert.assertEquals("fakeTestMethod", fileNameBuilder.withMetaData(fmd).build());
    }
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.