Search in sources :

Example 11 with SpecAssertion

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!");
}
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 12 with SpecAssertion

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");
}
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 13 with SpecAssertion

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");
}
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 14 with SpecAssertion

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");
}
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 15 with SpecAssertion

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);
}
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)

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