List of usage examples for org.apache.commons.validator ValidatorException ValidatorException
public ValidatorException()
From source file:jp.terasoluna.fw.validation.springmodules.DefaultBeanValidatorExTest.java
/** * testCleanupValidator01() <br>/* ww w .j a v a 2 s . com*/ * <br> * () <br> * A,E <br> * <br> * () validator:CommonsValidatorEx<br> * (????) validator.getValidatorException():ValidatorException<br> * <br> * () :ValidatorExceptionterasoluna-spring-validator)<br> * ?ValidatorException(commons)<br> * <br> * validator?ValidatorException????????????? <br> * @throws Exception ????? */ @Test public void testCleanupValidator01() throws Exception { // ?? ValidatorResources resources = new ValidatorResources(); CommonsValidatorEx commonsValidatorEx = new CommonsValidatorEx(resources, null); ValidatorException validatorException = new ValidatorException(); ReflectionTestUtils.setField(commonsValidatorEx, "validatorException", validatorException); DefaultBeanValidatorEx defaultBeanValidatorEx = new DefaultBeanValidatorEx(); try { // defaultBeanValidatorEx.cleanupValidator(commonsValidatorEx); fail(); } catch (jp.terasoluna.fw.validation.springmodules.ValidatorException e) { // assertSame(validatorException, e.getCause()); } }
From source file:jp.terasoluna.fw.validation.springmodules.CommonsValidatorExTest.java
/** * testGetValidatorException01() <br> * <br>/* ww w. java2 s . c o m*/ * * () <br> * A,C <br> * <br> * (????) this.validatorException:ValidatorException<br> * * <br> * () * ValidatorException:this.validatorException???ValidatorException<br> * * <br> * ????validatorException????? <br> * * @throws Exception * ????? */ @Test public void testGetValidatorException01() throws Exception { // ?? ValidatorResources resources = new ValidatorResources(); CommonsValidatorEx commonsValidatorEx = new CommonsValidatorEx(resources, null); ValidatorException validatorException = new ValidatorException(); ReflectionTestUtils.setField(commonsValidatorEx, "validatorException", validatorException); // ValidatorException resultValidatorException = commonsValidatorEx.getValidatorException(); // assertSame(validatorException, resultValidatorException); }
From source file:jp.terasoluna.fw.validation.springmodules.CommonsValidatorExTest.java
/** * testValidate02() <br>/*from ww w. j ava 2s . com*/ * <br> * * () <br> * A,G <br> * <br> * (????) super.validate():ValidatorException?<br> * * <br> * () :super.validate()???ValidatorException<br> * () this.validatorException:super.validate()???ValidatorException<br> * * <br> * super.validate()?ValidatorException??????????????????? * <br> * * @throws Exception * ????? */ @Test public void testValidate02() throws Exception { // ?? CommonsValidatorEx_ValidatorResourcesStub01 resources = new CommonsValidatorEx_ValidatorResourcesStub01(); Form form = new Form(); resources.setForm(form); // super.validate()??????????? // Field????? // super.validate()????field.validate()? // ??? // super.validate()??field.validate()???validatorException // ???????? CommonsValidatorEx_FieldStub01 field = new CommonsValidatorEx_FieldStub01(); List<Field> lFields = new ArrayList<Field>(); lFields.add(field); ReflectionTestUtils.setField(form, "lFields", lFields); field.validatorException = new ValidatorException(); CommonsValidatorEx commonsValidatorEx = new CommonsValidatorEx(resources, "formName"); // try { commonsValidatorEx.validate(); fail(); } catch (ValidatorException e) { // // field.validate()???ValidatorException????? assertSame(field.validatorException, e); assertSame(e, commonsValidatorEx.getValidatorException()); } }
From source file:jp.terasoluna.fw.validation.springmodules.CommonsValidatorExTest.java
/** * testClear01()// w w w . j a v a2s.co m * <br><br> * * () * <br> * A,C * <br><br> * (????) this.validatorException:ValidatorException<br> * * <br> * () this.validatorException:null<br> * * <br> * ????validatorException???? * <br> * * @throws Exception ????? */ @Test public void testClear01() throws Exception { // ?? ValidatorResources resources = new ValidatorResources(); CommonsValidatorEx commonsValidatorEx = new CommonsValidatorEx(resources, null); ValidatorException validatorException = new ValidatorException(); ReflectionTestUtils.setField(commonsValidatorEx, "validatorException", validatorException); // commonsValidatorEx.clear(); ValidatorException result = (ValidatorException) ReflectionTestUtils.getField(commonsValidatorEx, "validatorException"); // assertNull(result); }