DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
Overview
Other MyFaces Extensions
- ExtVal
- Ext-Script
- [Orchestra]
- [Portlet Bridge]
Community
Development
Sponsorship
Your browser does not support iframes
DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
If just plain unit testing is needed without JEE APIs it's possible to use the AbstractCdiAwareTest
@RunWith(JUnit4.class)
public class SimpleJUnitTest extends org.apache.myfaces.extensions.cdi.test.junit4.AbstractCdiAwareTest
{
@Inject
private Logger logger;
@Test
public void testLogger()
{
assertNotNull(this.logger);
this.logger.info("I'm a JUnit test-case and I can use dependency injection!");
}
}
If it's required to test e.g. request scoped beans it's possible to use the AbstractServletAwareTest
@RunWith(JUnit4.class)
public class SimpleJUnitTest extends org.apache.myfaces.extensions.cdi.test.junit4.AbstractServletAwareTest
{
@Inject
private RequestScopedBean requestScopedBean;
@Test
public void testLogger()
{
assertNotNull(this.requestScopedBean.getValue());
}
}
If it's required to test e.g. grouped conversation scoped beans it's possible to use the AbstractServletAwareTest
@RunWith(JUnit4.class)
public class SimpleJUnitTest extends org.apache.myfaces.extensions.cdi.test.junit4.AbstractJsfAwareTest
{
@Inject
private ViewAccessScopedBean viewAccessScopedBean;
@Test
public void testLogger()
{
assertNotNull(this.viewAccessScopedBean.getValue());
}
}
An example is available here.