use of org.jboss.test.audit.annotations.SpecAssertion in project cdi-tck by eclipse-ee4j.
the class RequestContextAsyncListenerTest method testRequestContextActiveOnError.
@Test(groups = { INTEGRATION, ASYNC_SERVLET })
@SpecAssertion(section = REQUEST_CONTEXT_EE, id = "ad")
public void testRequestContextActiveOnError() throws Exception {
WebClient webClient = new WebClient();
webClient.getPage(getPath(AsyncServlet.TEST_ERROR));
TextPage results = webClient.getPage(contextPath + "Status");
assertTrue(results.getContent().contains("onError: true"));
}
use of org.jboss.test.audit.annotations.SpecAssertion in project cdi-tck by eclipse-ee4j.
the class RequestContextAsyncListenerTest method testRequestContextActiveOnStartAsync.
@Test(groups = { INTEGRATION, ASYNC_SERVLET })
@SpecAssertion(section = REQUEST_CONTEXT_EE, id = "ad")
public void testRequestContextActiveOnStartAsync() throws Exception {
WebClient webClient = new WebClient();
webClient.getPage(getPath(AsyncServlet.TEST_LOOP));
TextPage results = webClient.getPage(contextPath + "Status");
assertTrue(results.getContent().contains("onStartAsync: true"));
}
use of org.jboss.test.audit.annotations.SpecAssertion in project cdi-tck by eclipse-ee4j.
the class RequestContextTest method testRequestScopeActiveDuringServiceMethod.
/**
* The request scope is active during the service() method of any Servlet in the web application.
*/
@Test
@SpecAssertion(section = REQUEST_CONTEXT_EE, id = "aa")
@SpecAssertion(section = REQUEST_CONTEXT_EE, id = "ac")
public void testRequestScopeActiveDuringServiceMethod() throws Exception {
WebClient webClient = new WebClient();
webClient.getPage(contextPath + "test");
}
use of org.jboss.test.audit.annotations.SpecAssertion in project cdi-tck by eclipse-ee4j.
the class DestroyedInstanceReturnedByGetTest method testDestroyedInstanceMustNotBeReturnedByGet.
@Test(groups = TestGroups.CDI_FULL)
@SpecAssertion(section = CONTEXT, id = "q")
@SpecAssertion(section = BEAN, id = "aa")
public void testDestroyedInstanceMustNotBeReturnedByGet() {
assert getBeans(MySessionBean.class).size() == 1;
Bean<MySessionBean> mySessionBean = getBeans(MySessionBean.class).iterator().next();
CreationalContext<MySessionBean> sessionCreationalContext = getCurrentManager().createCreationalContext(mySessionBean);
MySessionBean beanInstance = mySessionBean.create(sessionCreationalContext);
assert beanInstance != null;
Context sessionContext = getCurrentManager().getContext(SessionScoped.class);
destroyContext(sessionContext);
setContextActive(sessionContext);
beanInstance = sessionContext.get(mySessionBean);
assert beanInstance == null;
}
use of org.jboss.test.audit.annotations.SpecAssertion in project cdi-tck by eclipse-ee4j.
the class DecoratorDefinitionTest method testEmptyTypeSetOnResolveDecoratorsFails.
@Test(expectedExceptions = IllegalArgumentException.class)
@SpecAssertion(section = BM_DECORATOR_RESOLUTION, id = "e")
public void testEmptyTypeSetOnResolveDecoratorsFails() {
Annotation binding = new AnnotationLiteral<NonMeta>() {
};
getCurrentManager().resolveDecorators(new HashSet<Type>(), binding);
}
Aggregations