use of org.jboss.test.audit.annotations.SpecAssertion in project cdi-tck by eclipse-ee4j.
the class ClientConversationContextTest method testEndTransientConversationThrowsException.
@Test(groups = INTEGRATION)
@SpecAssertion(section = CONVERSATION, id = "q")
public void testEndTransientConversationThrowsException() throws Exception {
WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("cumulus.jsf"));
assert !isLongRunning(page);
// try ending a transient conversation
HtmlSubmitInput endConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class, "endConversationAndSwallowException");
page = endConversationButton.click();
assert page.getBody().getTextContent().contains("Hello world!");
}
use of org.jboss.test.audit.annotations.SpecAssertion in project cdi-tck by eclipse-ee4j.
the class ClientConversationContextTest method testSetConversationTimeoutOverride.
@Test(groups = INTEGRATION)
@SpecAssertion(section = CONVERSATION, id = "m")
@SpecAssertion(section = CONVERSATION, id = "n")
public void testSetConversationTimeoutOverride() throws Exception {
WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("cumulus.jsf"));
assert !isLongRunning(page);
// begin a conversation and set a custom timeout
HtmlSubmitInput beginConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class, "beginConversationAndSetTimeout");
page = beginConversationButton.click();
assert page.getBody().getTextContent().contains("Cumulonimbus");
}
use of org.jboss.test.audit.annotations.SpecAssertion in project cdi-tck by eclipse-ee4j.
the class ClientConversationContextTest method testConversationHasDefaultTimeout.
@Test(groups = INTEGRATION)
@SpecAssertion(section = CONVERSATION, id = "m")
public void testConversationHasDefaultTimeout() 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 page.getBody().getTextContent().contains("Stratocumulus");
}
use of org.jboss.test.audit.annotations.SpecAssertion in project cdi-tck by eclipse-ee4j.
the class ClientConversationContextTest method testConversationIdMayBeSetByApplication.
@Test(groups = INTEGRATION)
@SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "ha")
@SpecAssertion(section = CONVERSATION, id = "j")
public void testConversationIdMayBeSetByApplication() throws Exception {
WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("cumulus.jsf"));
assertFalse(isLongRunning(page));
// begin a conversation
HtmlSubmitInput beginConversationButton = (HtmlSubmitInput) page.getElementById("form:beginConversationIdentifiedByCustomIdentifier");
page = beginConversationButton.click();
assertTrue(isLongRunning(page));
assertEquals(getCid(page), "humilis");
assertTrue(page.getBody().getTextContent().contains("Cumulus humilis"));
HtmlPage nextPage = client.getPage(getPath("cumulus.jsf?cid=humilis"));
assertTrue(isLongRunning(nextPage));
assertEquals(getCid(page), "humilis");
}
use of org.jboss.test.audit.annotations.SpecAssertion in project cdi-tck by eclipse-ee4j.
the class ClientConversationContextTest method testConversationIdSetByContainerIsUnique.
@Test(groups = INTEGRATION)
@SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "hb")
@SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "o")
public void testConversationIdSetByContainerIsUnique() throws Exception {
WebClient client = new WebClient();
HtmlPage storm = client.getPage(getPath("storm.jsf"));
HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "beginConversationButton");
storm = beginConversationButton.click();
String c1 = getCid(storm);
storm = client.getPage(getPath("storm.jsf"));
beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "beginConversationButton");
storm = beginConversationButton.click();
String c2 = getCid(storm);
assertNotEquals(c1, c2);
}
Aggregations