use of org.jboss.test.audit.annotations.SpecAssertion in project cdi-tck by eclipse-ee4j.
the class SessionContextListenerShutdownTest method testApplicationContextDestroyed.
/**
* Note that this test method depends on (must be run after) {@link #deployArchives()}.
*
* @param alphaContext
* @param bravoContext
* @throws Exception
*/
@Test(groups = INTEGRATION, dataProvider = ARQUILLIAN_DATA_PROVIDER)
@SpecAssertion(section = SESSION_CONTEXT_EE, id = "ac")
public void testApplicationContextDestroyed(@ArquillianResource @OperateOnDeployment(ALPHA_DEPLOYMENT_NAME) URL alphaContext, @ArquillianResource @OperateOnDeployment(BRAVO_ARCHIVE_NAME) URL bravoContext) throws Exception {
// Init SessionScopedTestFlagClient - set bravo archive deployment url
WebClient webClient = new WebClient();
webClient.getPage(alphaContext + "init?url=" + URLEncoder.encode(bravoContext.toExternalForm(), "UTF-8"));
deployer.undeploy(ALPHA_DEPLOYMENT_NAME);
TextPage info = webClient.getPage(bravoContext + "info?action=get");
assertEquals(info.getContent(), "true");
deployer.undeploy(BRAVO_ARCHIVE_NAME);
}
use of org.jboss.test.audit.annotations.SpecAssertion in project cdi-tck by eclipse-ee4j.
the class EagerSingletonPostConstructCallbackTest method testEagerSingletonPostConstructCallback.
@Test(groups = INTEGRATION)
@SpecAssertion(section = REQUEST_CONTEXT, id = "db")
@SpecAssertion(section = REQUEST_CONTEXT, id = "eb")
public void testEagerSingletonPostConstructCallback() throws Exception {
WebClient client = new WebClient();
TextPage page = client.getPage(contextPath + "eager");
// Context was active
assertTrue(page.getContent().contains("Active:true"));
// Only singleton callback, current request not destroyed yet
assertTrue(page.getContent().contains("Destroyed requests:1"));
}
use of org.jboss.test.audit.annotations.SpecAssertion in project cdi-tck by eclipse-ee4j.
the class SyntheticBeanTest method testRegisteredBean.
@Test
@SpecAssertion(section = BM_OBTAIN_BEAN, id = "a")
public void testRegisteredBean() {
Bean<Office> bean = getUniqueBean(Office.class, Large.Literal.INSTANCE);
assertEquals(bean.getInjectionPoints().size(), 3);
for (InjectionPoint ip : bean.getInjectionPoints()) {
assertEquals(bean, ip.getBean());
}
testOffice(bean);
}
use of org.jboss.test.audit.annotations.SpecAssertion in project cdi-tck by eclipse-ee4j.
the class LifecycleEventOrderingTest method testEventsWereFiredInCorrectOrderForManagedBean.
@Test
@SpecAssertion(section = BEAN_DISCOVERY_STEPS, id = "e")
@SpecAssertion(section = BEAN_DISCOVERY_STEPS, id = "f")
@SpecAssertion(section = BEAN_DISCOVERY_STEPS, id = "h")
@SpecAssertion(section = BEAN_DISCOVERY_STEPS, id = "i")
public void testEventsWereFiredInCorrectOrderForManagedBean() {
ActionSequence producerEventsSeq = ActionSequence.getSequence(ProductManagement.BEAN_SEQ);
producerEventsSeq.assertDataEquals("PIP", "PIT", "PBA", "PB");
}
use of org.jboss.test.audit.annotations.SpecAssertion in project cdi-tck by eclipse-ee4j.
the class LongRunningConversationPropagatedByFacesContextTest method testConversationPropagatedAjax.
@Test
@SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "l")
public void testConversationPropagatedAjax() throws Exception {
WebClient webClient = new WebClient();
webClient.setAjaxController(new NicelyResynchronizingAjaxController());
HtmlPage storm = webClient.getPage(getPath("storm-ajax.jsf"));
// Begin long-running conversation - note that we use ajax
HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "beginConversationButton");
storm = beginConversationButton.click();
String cid = getFirstMatchingElement(storm, HtmlInput.class, "conversationId").getValueAttribute();
assertFalse(cid.isEmpty());
// Set input value
HtmlTextInput stormStrength = getFirstMatchingElement(storm, HtmlTextInput.class, "stormStrength");
stormStrength.setValueAttribute(AJAX_STORM_STRENGTH);
// Submit value - note that we use ajax
HtmlSubmitInput thunderButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "thunderButton");
thunderButton.click();
HtmlPage thunder = webClient.getPage(getPath("thunder.jsf", cid));
stormStrength = getFirstMatchingElement(thunder, HtmlTextInput.class, "stormStrength");
assertEquals(stormStrength.getValueAttribute(), AJAX_STORM_STRENGTH);
}
Aggregations