Search in sources :

Example 1 with CreditCardValidator

use of com.opensymphony.xwork2.validator.validators.CreditCardValidator in project struts by apache.

the class CreditCardAction method setUp.

protected void setUp() throws Exception {
    super.setUp();
    validator = new CreditCardValidator();
    action = new CreditCardAction();
    TextProviderFactory tpf = container.getInstance(TextProviderFactory.class);
    context = new DummyValidatorContext(action, tpf);
    validator.setValidatorContext(context);
    ValueStack valueStack = container.getInstance(ValueStackFactory.class).createValueStack();
    valueStack.push(action);
    validator.setValueStack(valueStack);
}
Also used : TextProviderFactory(com.opensymphony.xwork2.TextProviderFactory) ValueStack(com.opensymphony.xwork2.util.ValueStack) DummyValidatorContext(com.opensymphony.xwork2.validator.DummyValidatorContext) ValueStackFactory(com.opensymphony.xwork2.util.ValueStackFactory)

Aggregations

TextProviderFactory (com.opensymphony.xwork2.TextProviderFactory)1 ValueStack (com.opensymphony.xwork2.util.ValueStack)1 ValueStackFactory (com.opensymphony.xwork2.util.ValueStackFactory)1 DummyValidatorContext (com.opensymphony.xwork2.validator.DummyValidatorContext)1