use of org.jboss.test.audit.annotations.SpecAssertion in project cdi-tck by eclipse-ee4j.
the class InjectionIntoNonContextualComponentTest method testFilterInitCalledAfterResourceInjection.
@Test(groups = INTEGRATION)
@SpecAssertion(section = FIELDS_INITIALIZER_METHODS_EE, id = "br")
public void testFilterInitCalledAfterResourceInjection() throws Exception {
WebClient webClient = new WebClient();
webClient.getPage(contextPath + "TestFilter?test=resource");
webClient.getPage(contextPath + "TestFilter?test=ejb");
}
use of org.jboss.test.audit.annotations.SpecAssertion in project cdi-tck by eclipse-ee4j.
the class ClientConversationContextTest method testConversationIdMayBeSetByContainer.
@Test(groups = INTEGRATION)
@SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "hb")
@SpecAssertion(section = CONVERSATION, id = "j")
public void testConversationIdMayBeSetByContainer() 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);
assert getCid(page) != null;
assert page.getBody().getTextContent().contains("Cumulus congestus");
}
use of org.jboss.test.audit.annotations.SpecAssertion in project cdi-tck by eclipse-ee4j.
the class ClientConversationContextTest method testConversationsDontCrossSessionBoundary2.
@Test(groups = INTEGRATION)
@SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "p")
public void testConversationsDontCrossSessionBoundary2() throws Exception {
WebClient client = new WebClient();
// Load the page
HtmlPage rain = client.getPage(getPath("rain.jsf"));
// begin a conversation
HtmlSubmitInput beginConversationButton = getFirstMatchingElement(rain, HtmlSubmitInput.class, "beginConversationButton");
rain = beginConversationButton.click();
String cid = getCid(rain);
// Cause rain
HtmlSubmitInput rainButton = getFirstMatchingElement(rain, HtmlSubmitInput.class, "rain");
rain = rainButton.click();
// Re-request the page, inside the conversation and check it has rained
rain = client.getPage(getPath("rain.jsf", cid));
assertTrue(hasRained(rain));
// Create a new web client and load the page
WebClient client2 = new WebClient();
verifyNonexistentConversationExceptionThrown(client2.getPage(getPath("rain.jsf", cid)));
}
use of org.jboss.test.audit.annotations.SpecAssertion in project cdi-tck by eclipse-ee4j.
the class ClientConversationContextTest method testBeanWithDefaultQualifier.
@Test(groups = INTEGRATION)
@SpecAssertion(section = CONVERSATION, id = "id")
public void testBeanWithDefaultQualifier() throws Exception {
WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("builtin.jsf"));
assert page.getBody().getTextContent().contains("Correct qualifier: true");
}
use of org.jboss.test.audit.annotations.SpecAssertion in project cdi-tck by eclipse-ee4j.
the class ClientConversationContextTest method testBeginConversationWithExplicitIdAlreadyUsedByDifferentConversation.
@Test(groups = INTEGRATION)
@SpecAssertion(section = CONVERSATION, id = "s")
public void testBeginConversationWithExplicitIdAlreadyUsedByDifferentConversation() throws Exception {
WebClient client = new WebClient();
HtmlPage page = client.getPage(getPath("cumulus.jsf"));
assertFalse(isLongRunning(page));
// Begin a conversation with explicit id
HtmlSubmitInput beginConversationButton = (HtmlSubmitInput) page.getElementById("form:beginNextConversationIdentifiedByCustomIdentifier");
page = beginConversationButton.click();
assertTrue(isLongRunning(page));
// Try it again with the same id
page = client.getPage(getPath("cumulus.jsf"));
beginConversationButton = (HtmlSubmitInput) page.getElementById("form:beginConversationIdentifiedByCustomIdentifierAndSwallowException");
page = beginConversationButton.click();
// Exception is swallowed and the browser is redirected to home
assertTrue(page.getBody().getTextContent().contains("Hello world!"));
}
Aggregations