use of org.jboss.test.audit.annotations.SpecAssertion in project cdi-tck by eclipse-ee4j.
the class ClientConversationContextTest method testSuppressedConversationPropagation.
@Test(groups = INTEGRATION)
@SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "oa")
public void testSuppressedConversationPropagation() throws Exception {
WebClient client = new WebClient();
// Access the start page
HtmlPage cloud = client.getPage(getPath("cloud.jsf"));
assertEquals(getFirstMatchingElement(cloud, HtmlSpan.class, "cloudName").getTextContent(), Cloud.NAME);
// Now start a conversation and check the cloud name changes
HtmlPage page1 = getFirstMatchingElement(cloud, HtmlSubmitInput.class, Cloud.CUMULUS).click();
assertEquals(getFirstMatchingElement(page1, HtmlSpan.class, "cloudName").getTextContent(), Cloud.CUMULUS);
String cid = getCid(page1);
// Activate the conversation from a GET request
HtmlPage page2 = client.getPage(getPath("cloud.jsf", cid));
assertEquals(getFirstMatchingElement(page2, HtmlSpan.class, "cloudName").getTextContent(), Cloud.CUMULUS);
// Send a GET request with the "cid" parameter and suppressed conversation propagation (using
// conversationPropagation=none)
HtmlPage page3 = client.getPage(getPath("cloud.jsf", cid) + "&conversationPropagation=none");
assertEquals(getFirstMatchingElement(page3, HtmlSpan.class, "cloudName").getTextContent(), Cloud.NAME);
}
use of org.jboss.test.audit.annotations.SpecAssertion in project cdi-tck by eclipse-ee4j.
the class ClientConversationContextTest method testConversationEndMakesConversationTransient.
@Test(groups = INTEGRATION)
@SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "g")
@SpecAssertion(section = CONVERSATION, id = "k")
@SpecAssertion(section = CONVERSATION, id = "o")
public void testConversationEndMakesConversationTransient() throws Exception {
WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("cumulus.jsf"));
assert !isLongRunning(page);
// begin a conversation
HtmlSubmitInput beginConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class, "beginConversationButton");
page = beginConversationButton.click();
assert isLongRunning(page);
// end a conversation
HtmlSubmitInput endConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class, "endConversationButton");
page = endConversationButton.click();
assert !isLongRunning(page);
}
use of org.jboss.test.audit.annotations.SpecAssertion in project cdi-tck by eclipse-ee4j.
the class ClientConversationContextTest method testConversationBeginMakesConversationLongRunning.
@Test(groups = INTEGRATION)
@SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "f")
public void testConversationBeginMakesConversationLongRunning() throws Exception {
WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("cumulus.jsf"));
assert !isLongRunning(page);
// begin a conversation
HtmlSubmitInput beginConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class, "beginConversationButton");
page = beginConversationButton.click();
assert isLongRunning(page);
}
use of org.jboss.test.audit.annotations.SpecAssertion in project cdi-tck by eclipse-ee4j.
the class ActivateRequestContextinEETest method requestContextCannotBeActivatedTwice.
@Test
@SpecAssertion(section = ACTIVATING_REQUEST_CONTEXT, id = "db")
public void requestContextCannotBeActivatedTwice() throws Exception {
WebClient webClient = new WebClient();
TextPage results = webClient.getPage(contextPath + "test");
assertTrue(results.getContent().contains("Activated: false"));
assertTrue(results.getContent().contains("Active: true"));
}
use of org.jboss.test.audit.annotations.SpecAssertion in project cdi-tck by eclipse-ee4j.
the class ApplicationContextTest method testApplicationScopeActiveDuringServletContextListenerInvocation.
@Test(groups = INTEGRATION)
@SpecAssertion(section = APPLICATION_CONTEXT_EE, id = "ac")
public void testApplicationScopeActiveDuringServletContextListenerInvocation() throws Exception {
WebClient webClient = new WebClient();
webClient.getPage(contextPath + "TestServlet?test=servletContextListener");
}
Aggregations