Package org.jboss.arquillian.test.spi.event.suite

Examples of org.jboss.arquillian.test.spi.event.suite.BeforeClass


                registry.getEntryFor(MockDrone.class, Configurator.class));

        Assert.assertTrue("Configurator is of MockDronePriorityFactory type",
                registry.getEntryFor(MockDrone.class, Configurator.class) instanceof MockDronePriorityFactory);

        getManager().fire(new BeforeClass(this.getClass()));

        DroneContext context = getManager().getContext(ApplicationContext.class).getObjectStore().get(DroneContext
                .class);
        Assert.assertNotNull("Drone object holder was created in the context", context);
View Full Code Here


        assertEventFired(BeforeDroneConfigured.class, 0);
        assertEventFired(AfterDroneConfigured.class, 0);
        assertEventFired(BeforeDroneCallableCreated.class, 0);
        assertEventFired(AfterDroneCallableCreated.class, 0);

        fire(new BeforeClass(DummyClass.class));

        assertEventFired(PrepareDrone.class, 2);
        assertEventFired(BeforeDroneConfigured.class, 2);
        assertEventFired(AfterDroneConfigured.class, 2);
        assertEventFired(BeforeDroneCallableCreated.class, 2);
View Full Code Here

        TestReflectionHelper.setFieldValue(instance, "serviceLoaderInstance", mockServiceLoader);

        InstanceProducer<RemoteTestScopeApplicationContext> mockApplicationContext = mock(InstanceProducer.class);
        TestReflectionHelper.setFieldValue(instance, "applicationContextInstance", mockApplicationContext);

        instance.beforeClass(new BeforeClass(TEST_OBJECT.getClass()));

        verify(mockApplicationContextCreatedEvent).fire(any(ApplicationContextCreatedEvent.class));
        verify(mockApplicationContext).set((RemoteTestScopeApplicationContext) notNull());
    }
View Full Code Here

        InstanceProducer<RemoteTestScopeApplicationContext> mockApplicationContext = mock(InstanceProducer.class);
        when(mockApplicationContext.get()).thenReturn(null);
        TestReflectionHelper.setFieldValue(instance, "applicationContextInstance", mockApplicationContext);

        instance.beforeClass(new BeforeClass(TEST_OBJECT.getClass()));

        verifyNoMoreInteractions(mockApplicationContextCreatedEvent);
    }
View Full Code Here

        TestReflectionHelper.setFieldValue(instance, "serviceLoaderInstance", mockServiceLoader);

        InstanceProducer<RemoteTestScopeApplicationContext> mockApplicationContext = mock(InstanceProducer.class);
        TestReflectionHelper.setFieldValue(instance, "applicationContextInstance", mockApplicationContext);

        instance.beforeClass(new BeforeClass(TEST_OBJECT.getClass()));

        verify(mockApplicationContextCreatedEvent).fire(any(ApplicationContextCreatedEvent.class));
        verify(mockApplicationContext).set((RemoteTestScopeApplicationContext) notNull());
    }
View Full Code Here

        InstanceProducer<RemoteTestScopeApplicationContext> mockApplicationContext = mock(InstanceProducer.class);
        when(mockApplicationContext.get()).thenReturn(null);
        TestReflectionHelper.setFieldValue(instance, "applicationContextInstance", mockApplicationContext);

        instance.beforeClass(new BeforeClass(TEST_OBJECT.getClass()));

        verifyNoMoreInteractions(mockApplicationContextCreatedEvent);
    }
View Full Code Here

   public void beforeClass(Class<?> testClass, LifecycleMethodExecutor executor) throws Exception
   {
      Validate.notNull(testClass, "TestClass must be specified");
     
      manager.fire(new BeforeClass(testClass, executor));
   }
View Full Code Here

        TestReflectionHelper.setFieldValue(instance, "serviceLoaderInstance", mockServiceLoader);

        InstanceProducer<ClientTestScopeApplicationContext> mockApplicationContext = mock(InstanceProducer.class);
        TestReflectionHelper.setFieldValue(instance, "applicationContextInstance", mockApplicationContext);

        instance.beforeClass(new BeforeClass(TEST_OBJECT.getClass()));

        verify(mockApplicationContextCreatedEvent).fire(any(ApplicationContextCreatedEvent.class));
        verify(mockApplicationContext).set((ClientTestScopeApplicationContext) notNull());
    }
View Full Code Here

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

        instance.beforeClass(new BeforeClass(TEST_OBJECT.getClass()));

        verifyNoMoreInteractions(mockApplicationContextCreatedEvent);
    }
View Full Code Here

    }

    @Test
    public void testConfigurationViaDescriptor() {
        getManager().bind(SuiteScoped.class, ArquillianDescriptor.class, descriptor);
        fire(new BeforeClass(Object.class));
        assertEventFired(GrapheneConfigured.class);
        GrapheneConfiguration configuration = getManager().resolve(GrapheneConfiguration.class);
        assertNotNull("Configuration instance has to be available.", configuration);
        configuration.validate();
        assertEquals("'waitGuiInterval' should be 5", 5, configuration.getWaitGuiInterval());
View Full Code Here

TOP

Related Classes of org.jboss.arquillian.test.spi.event.suite.BeforeClass

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.