Search in sources :

Example 16 with SpecAssertion

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);
}
Also used : HtmlPage(com.gargoylesoftware.htmlunit.html.HtmlPage) HtmlSubmitInput(com.gargoylesoftware.htmlunit.html.HtmlSubmitInput) WebClient(com.gargoylesoftware.htmlunit.WebClient) Test(org.testng.annotations.Test) SpecAssertion(org.jboss.test.audit.annotations.SpecAssertion)

Example 17 with SpecAssertion

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);
}
Also used : HtmlPage(com.gargoylesoftware.htmlunit.html.HtmlPage) HtmlSubmitInput(com.gargoylesoftware.htmlunit.html.HtmlSubmitInput) WebClient(com.gargoylesoftware.htmlunit.WebClient) Test(org.testng.annotations.Test) SpecAssertion(org.jboss.test.audit.annotations.SpecAssertion)

Example 18 with SpecAssertion

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);
}
Also used : HtmlPage(com.gargoylesoftware.htmlunit.html.HtmlPage) HtmlSubmitInput(com.gargoylesoftware.htmlunit.html.HtmlSubmitInput) WebClient(com.gargoylesoftware.htmlunit.WebClient) Test(org.testng.annotations.Test) SpecAssertion(org.jboss.test.audit.annotations.SpecAssertion)

Example 19 with SpecAssertion

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"));
}
Also used : TextPage(com.gargoylesoftware.htmlunit.TextPage) WebClient(com.gargoylesoftware.htmlunit.WebClient) AbstractTest(org.jboss.cdi.tck.AbstractTest) Test(org.testng.annotations.Test) SpecAssertion(org.jboss.test.audit.annotations.SpecAssertion)

Example 20 with SpecAssertion

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");
}
Also used : WebClient(com.gargoylesoftware.htmlunit.WebClient) AbstractTest(org.jboss.cdi.tck.AbstractTest) Test(org.testng.annotations.Test) SpecAssertion(org.jboss.test.audit.annotations.SpecAssertion)

Aggregations

SpecAssertion (org.jboss.test.audit.annotations.SpecAssertion)943 Test (org.testng.annotations.Test)893 AbstractTCKTest (org.hibernate.beanvalidation.tck.tests.AbstractTCKTest)595 ConstraintViolation (jakarta.validation.ConstraintViolation)265 Validator (jakarta.validation.Validator)216 AbstractTest (org.jboss.cdi.tck.AbstractTest)212 WebClient (com.gargoylesoftware.htmlunit.WebClient)190 Method (java.lang.reflect.Method)152 TextPage (com.gargoylesoftware.htmlunit.TextPage)80 HtmlPage (com.gargoylesoftware.htmlunit.html.HtmlPage)73 Test (org.junit.Test)49 MethodDescriptor (jakarta.validation.metadata.MethodDescriptor)44 BeanDescriptor (jakarta.validation.metadata.BeanDescriptor)40 ConstructorDescriptor (jakarta.validation.metadata.ConstructorDescriptor)38 NotNull (jakarta.validation.constraints.NotNull)35 ValidatorFactory (jakarta.validation.ValidatorFactory)32 PropertyDescriptor (jakarta.validation.metadata.PropertyDescriptor)31 Context (jakarta.enterprise.context.spi.Context)30 SeContainer (jakarta.enterprise.inject.se.SeContainer)30 WebResponse (com.gargoylesoftware.htmlunit.WebResponse)28