Package org.jboss.arquillian.test.spi

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


                registry.getEntryFor(MockDrone.class, Instantiator.class) instanceof MockDroneFactory);

        fire(new BeforeClass(MethodEnrichedClassUnregistered.class));
        fire(new Before(instance, testMethod));

        TestEnricher testEnricher = serviceLoader.onlyOne(TestEnricher.class);
        testEnricher.enrich(instance);
        Object[] parameters = testEnricher.resolve(testMethod);

        DronePoint<Object> dronePoint = new DronePointImpl<Object>(Object.class, DronePoint.Lifecycle.METHOD,
                AnnotationMocks.drone());
        Assert.assertTrue("Drone created", context.get(dronePoint).isInstantiated());
View Full Code Here


        DroneContext context = getManager().getContext(ApplicationContext.class).getObjectStore().get(DroneContext
                .class);
        Assert.assertNotNull("DroneContext was created in the context", context);

        TestEnricher testEnricher = serviceLoader.onlyOne(TestEnricher.class);
        testEnricher.enrich(instance);
        Object[] parameters = testEnricher.resolve(testMethod);

        DronePoint<MockDrone> classDronePoint = new DronePointImpl<MockDrone>(MockDrone.class,
                DronePoint.Lifecycle.CLASS, AnnotationMocks.drone());
        Assert.assertTrue("Class drone created", context.get(classDronePoint).isInstantiated());
View Full Code Here

    public void testClassWithoutArquillianLifecycleWithDeploymentDrone() throws Exception {
        Object instance = new NonArquillianClassWithDeploymentDrone();

        fire(new BeforeSuite());

        TestEnricher testEnricher = serviceLoader.onlyOne(TestEnricher.class);

        exception.expect(IllegalStateException.class);
        exception.expectMessage("has deployment lifecycle");
        testEnricher.enrich(instance);
    }
View Full Code Here

    @org.junit.Before
    public void setMocks() {
        ArquillianDescriptor desc = Descriptors.create(ArquillianDescriptor.class).extension("mockdrone")
                .property("field", "foobar");

        TestEnricher testEnricher = new DroneTestEnricher();
        getManager().inject(testEnricher);

        bind(ApplicationScoped.class, ServiceLoader.class, serviceLoader);
        bind(ApplicationScoped.class, ArquillianDescriptor.class, desc);
        Mockito.when(serviceLoader.all(Configurator.class)).thenReturn(
View Full Code Here

        assertEventFired(AfterDroneCallableCreated.class, 2);

        assertEventFired(BeforeDroneInstantiated.class, 0);
        assertEventFired(AfterDroneInstantiated.class, 0);

        TestEnricher testEnricher = serviceLoader.onlyOne(TestEnricher.class);
        testEnricher.enrich(instance);

        assertEventFired(BeforeDroneInstantiated.class, 2);
        assertEventFired(AfterDroneInstantiated.class, 2);

        Object[] dummyParameters = testEnricher.resolve(testDummyMethod);

        assertEventFired(BeforeDroneInstantiated.class, 2);
        assertEventFired(AfterDroneInstantiated.class, 2);

        testDummyMethod.invoke(instance, dummyParameters);

        fire(new After(instance, testDummyMethod));

        assertEventFired(BeforeDroneDestroyed.class, 0);
        assertEventFired(AfterDroneDestroyed.class, 0);

        fire(new Before(instance, testDummyMethodWithParameters));

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

        assertEventFired(BeforeDroneInstantiated.class, 2);
        assertEventFired(AfterDroneInstantiated.class, 2);

        Object[] parameters = testEnricher.resolve(testDummyMethodWithParameters);

        assertEventFired(BeforeDroneInstantiated.class, 3);
        assertEventFired(AfterDroneInstantiated.class, 3);

        testDummyMethodWithParameters.invoke(instance, parameters);
View Full Code Here

   protected <X, T> X execute(Class<X> enrichType, Class<T> contextualType, T type) throws Exception
   {
      bind(ApplicationScoped.class, contextualType, type);

      TestEnricher enricher = new ArquillianResourceTestEnricher();
      injector.get().inject(enricher);

      X test = enrichType.cast(enrichType.newInstance());
      enricher.enrich(test);
      return test;
   }
View Full Code Here

         deploymentContext.activate(deploymentZ);
         deploymentContext.getObjectStore().add(contextualType, outerType);

         containerContext.activate("TEST");

         TestEnricher enricher = new ArquillianResourceTestEnricher();
         injector.get().inject(enricher);

         X test = enrichType.cast(enrichType.newInstance());
         enricher.enrich(test);

         return test;
      }
      catch (RuntimeException e)
      {
View Full Code Here

TOP

Related Classes of org.jboss.arquillian.test.spi.TestEnricher

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.