Examples of After


Examples of org.jboss.arquillian.spi.event.suite.After

   }

   @Test
   public void shouldInvokeAfterInContainerDeploymentContext() throws Exception
   {
      fire(new After(this, testMethod()));
     
      assertEventFiredInContext(After.class, ContainerContext.class);
      assertEventFiredInContext(After.class, DeploymentContext.class);
   }
View Full Code Here

Examples of org.jboss.arquillian.spi.event.suite.After

   public void after(Object testInstance, Method testMethod) throws Exception
   {
      Validate.notNull(testInstance, "TestInstance must be specified");
      Validate.notNull(testMethod, "TestMethod must be specified");

      contextLifecycle.createRestoreTestContext(testInstance).fire(new After(testInstance, testMethod));
      try
      {
         contextLifecycle.destroyTestContext(testInstance);
      }
      finally
View Full Code Here

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

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

        testDummyMethod.invoke(instance, dummyParameters);

        fire(new After(instance, testDummyMethod));

        // will be destroyed in after class
        assertEventFired(BeforeDroneDestroyed.class, 0);
        assertEventFired(AfterDroneDestroyed.class, 0);
View Full Code Here

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

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

        instance.afterTest(new After(TEST_OBJECT, testMethod));

        verifyZeroInteractions(applicationContextDestroyer);
    }
View Full Code Here

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

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

        instance.afterTest(new After(TEST_OBJECT, testMethod));

        verifyZeroInteractions(applicationContextDestroyer);
    }
View Full Code Here

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

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

        instance.afterTest(new After(new TestMethodTest(), TestMethodTest.class.getMethod("testMethod")));

        verify(applicationContextDestroyer).destroyApplicationContext(any(TestScopeApplicationContext.class));
    }
View Full Code Here

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

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

        instance.afterTest(new After(TEST_OBJECT, testMethod));

        verifyZeroInteractions(applicationContextDestroyer);
    }
View Full Code Here

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

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

        instance.afterTest(new After(TEST_OBJECT, testMethod));

        verifyZeroInteractions(applicationContextDestroyer);
    }
View Full Code Here

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

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

        instance.afterTest(new After(new TestMethodTest(), TestMethodTest.class.getMethod("testMethod")));

        verify(applicationContextDestroyer).destroyApplicationContext(any(TestScopeApplicationContext.class));
    }
View Full Code Here

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

   public void after(Object testInstance, Method testMethod, LifecycleMethodExecutor executor) throws Exception
   {
      Validate.notNull(testInstance, "TestInstance must be specified");
      Validate.notNull(testMethod, "TestMethod must be specified");

      manager.fire(new After(testInstance, testMethod, executor));
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.