Package org.jboss.cdi.tck.util

Examples of org.jboss.cdi.tck.util.ActionSequence


    @Test(groups = INTEGRATION)
    @SpecAssertion(section = INIT_EVENTS, id = "bc")
    public void testEvents() {

        // Fired by alpha, recorder by beta
        ActionSequence patSeq = ActionSequence.getSequence(EventBase.PAT_SEQ);
        assertNotNull(patSeq);
        assertTrue(patSeq.containsAll(Foo.class.getName(), Bar.class.getName(), EventBase.class.getName(),
                PatEvent.class.getName(), PbEvent.class.getName(), ExtensionAlpha.class.getName(),
                ExtensionBeta.class.getName()));

        // Fired by beta, recorder by alpha
        ActionSequence pbSeq = ActionSequence.getSequence(EventBase.PB_SEQ);
        assertNotNull(pbSeq);
        assertEquals(pbSeq.getData().size(), 2);
        assertTrue(pbSeq.containsAll(Foo.class.getName(), Bar.class.getName()));
    }
View Full Code Here


        CreationalContext<Rocket> ctx = getCurrentManager().createCreationalContext(bean);
        Rocket rocket = bean.create(ctx);
        rocket.fire();
        bean.destroy(rocket, ctx);

        ActionSequence postConstruct = ActionSequence.getSequence("postConstruct");
        postConstruct.assertDataEquals(AirborneInterceptor.class, SuperDestructionInterceptor.class,
                DestructionInterceptor.class, Weapon.class, Rocket.class);

        ActionSequence preDestroy = ActionSequence.getSequence("preDestroy");
        preDestroy.assertDataEquals(AirborneInterceptor.class, SuperDestructionInterceptor.class, DestructionInterceptor.class,
                Weapon.class, Rocket.class);

        ActionSequence aroundConstruct = ActionSequence.getSequence("aroundConstruct");
        aroundConstruct.assertDataEquals(AirborneInterceptor.class, SuperDestructionInterceptor.class,
                DestructionInterceptor.class);
    }
View Full Code Here

    @Test(groups = INTEGRATION)
    @SpecAssertion(section = INIT_EVENTS, id = "bc")
    public void testEvents() {

        // Fired by alpha, recorder by beta
        ActionSequence patSeq = ActionSequence.getSequence(EventBase.PAT_SEQ);
        assertNotNull(patSeq);
        assertTrue(patSeq.containsAll(Foo.class.getName(), Bar.class.getName(), EventBase.class.getName(),
                PatEvent.class.getName(), PbEvent.class.getName(), ExtensionAlpha.class.getName(),
                ExtensionBeta.class.getName()));

        // Fired by beta, recorder by alpha
        ActionSequence pbSeq = ActionSequence.getSequence(EventBase.PB_SEQ);
        assertNotNull(pbSeq);
        assertEquals(pbSeq.getData().size(), 2);
        assertTrue(pbSeq.containsAll(Foo.class.getName(), Bar.class.getName()));
    }
View Full Code Here

        deployer.undeploy(FOO);

        // 1. Destroy contexts (the order is not set)
        // 2. BeforeShutdown event
        TextPage info = webClient.getPage(infoContext + "info?action=get");
        ActionSequence actual = ActionSequence.buildFromCsvData(info.getContent());
        assertTrue(actual.endsWith(BeforeShutdown.class.getName()));
        assertTrue(actual.containsAll(RequestScoped.class.getName(), SessionScoped.class.getName(),
                ApplicationScoped.class.getName(), ConversationScoped.class.getName(), Foo.class.getName(),
                Bar.class.getName(), Baz.class.getName(), Qux.class.getName()));

        // Undeploy info
        deployer.undeploy(INFO);
View Full Code Here

    // Verify context is destroyed after all filters and
    // ServletRequestListeners
    TextPage verifyResult = webClient.getPage(contextPath
        + "introspect?mode=verify");
    ActionSequence correctSequence = new ActionSequence()
        .add(IntrospectServlet.class.getName())
        .add(IntrospectHttpSessionListener.class.getName())
        .add(IntrospectFilter.class.getName())
        .add(IntrospectServletRequestListener.class.getName())
        .add(SimpleSessionBean.class.getName());
    assertEquals(verifyResult.getContent(), correctSequence.toString());
  }
View Full Code Here

    // Verify context is destroyed after all filters and
    // ServletRequestListeners
    TextPage verifyResult = webClient.getPage(contextPath
        + "introspect?mode=verify");
    ActionSequence correctSequence = new ActionSequence()
        .add(IntrospectHttpSessionListener.class.getName())
        .add(SimpleSessionBean.class.getName());
    assertEquals(verifyResult.getContent(), correctSequence.toString());
  }
View Full Code Here

        assertNotNull(secondRequestResult.getContent());
        assertNotEquals(secondRequestResult.getContent().trim(), firstRequestResult.getContent().trim());

        // Make sure request context is destroyed after service(), doFilter(), requestDestroyed()
        webClient.getPage(contextPath + "introspect?mode=collect");
        ActionSequence correctSequence = new ActionSequence().add(IntrospectServlet.class.getName())
                .add(IntrospectFilter.class.getName()).add(TestServletRequestListener.class.getName())
                .add(ContextDestructionObserver.class.getName());
        TextPage destroyRequestResult = webClient.getPage(contextPath + "introspect?mode=verify");
        assertNotNull(destroyRequestResult.getContent());
        assertEquals(destroyRequestResult.getContent(), correctSequence.toString());
    }
View Full Code Here

TOP

Related Classes of org.jboss.cdi.tck.util.ActionSequence

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.