@ArquillianResource
private URL contextPath;
@Deployment(testable = false)
public static WebArchive createDeployment() {
RichDeployment deployment = new RichDeployment(ITValidatorMessageWithLabel.class);
deployment.archive().addClass(ValidatorBean.class);
final String messageBundle = ITValidatorMessageWithLabel.class.getPackage().getName() + ".MessagesWithLabels";
final String messageBundleResource = messageBundle.replace('.', '/') + ".properties";
addIndexPage(deployment);
deployment.archive().addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
deployment.archive().addAsResource(messageBundleResource);
deployment.facesConfig(new Function<WebFacesConfigDescriptor, WebFacesConfigDescriptor>() {
@Override
public WebFacesConfigDescriptor apply(@Nullable WebFacesConfigDescriptor input) {
return input.getOrCreateApplication()
.messageBundle(messageBundle).up();
}
});
return deployment.getFinalArchive();
}