Example usage for org.apache.commons.validator Msg setName

List of usage examples for org.apache.commons.validator Msg setName

Introduction

In this page you can find the example usage for org.apache.commons.validator Msg setName.

Prototype

public void setName(String name) 

Source Link

Document

Sets the name of the dependency.

Usage

From source file:jp.terasoluna.fw.web.struts.form.FieldChecksExTest05.java

/**
 * testValidateByteLength10()/*from  ww w . java  2s  . c o  m*/
 * <br><br>
 *
 * (??n)
 * <br>
 * _?FF
 * <br><br>
 * l?F(?) bean:String:""<br>
 *         (?) va:not null<br>
 *         (?) field:not null<br>
 *                var:byteLength="2"<br>
 *                encoding="test-encoding"<br>
 *                Msg("message","message")<br>
 *         (?) errors:not null<br>
 *                ActionMessage("testMessage")<br>
 *         (?) validator:not null<br>
 *         (?) request:not null<br>
 *
 * <br>
 * l?F(l) boolean:true<br>
 *         (?) ?O:?Ox?Fx??<br>
 *                    ?bZ?[W?F<br>
 *                    "test-encoding is not supported."<br>
 *         (?) errors:not null<br>
 *                    (vf)<br>
 *
 * <br>
 * fieldencodingT|?[gGR?[fBO???A
 * VMftHgGR?[fBOoCg?vZmF?B<br>
 * ?getByteLength?\bheXg?B
 * <br>
 *
 * @throws Exception ?\bh?O
 */
public void testValidateByteLength10() throws Exception {
    //eXgf?[^?
    // ++++ beanIuWFNg ++++
    String bean = "";
    // ++++ ??IuWFNg
    ValidatorAction va = new ValidatorAction();
    va.setName("message");
    // ++++ ?tB?[h?
    Field field = new Field();
    Var var = new Var();
    var.setName("byteLength");
    var.setValue("2");
    field.addVar(var);
    // GR?[fBO?
    var = new Var();
    var.setName("encoding");
    var.setValue("test-encoding");
    field.addVar(var);
    // ?bZ?[W?
    Msg msg = new Msg();
    msg.setKey("message");
    msg.setName("message");
    msg.setResource(false);
    field.addMsg(msg);
    // G?[?
    ActionMessages errors = new ActionMessages();
    // [HTTPNGXg
    MockHttpServletRequest request = new MockHttpServletRequest();
    // ValidatorResourcesCX^X
    ValidatorResources validatorResources = new ValidatorResources();
    // ValidatorCX^X
    Validator validator = new Validator(validatorResources);

    // eXg?s
    boolean result = FieldChecksEx.validateByteLength(bean, va, field, errors, validator, request);
    // eXgmF
    // truep?B
    assertTrue(result);
    // G?[??B
    assertTrue(errors.isEmpty());

    // x???O`FbN
    assertTrue(LogUTUtil.checkWarn("test-encoding is not supported."));
}

From source file:jp.terasoluna.fw.web.struts.form.FieldChecksExTest05.java

/**
 * testValidateByteLength12()/*from   w  w  w .j a  va 2  s.  c om*/
 * <br><br>
 *
 * (??n)
 * <br>
 * _?FF
 * <br><br>
 * l?F(?) bean:Map:["field1"="1234"]<br>
 *         (?) va:not null<br>
 *         (?) field:not null<br>
 *                var:byteLength="5"<br>
 *                encoding="Windows-31J"<br>
 *                Msg("message","message")<br>
 *                property?="field1"<br>
 *         (?) errors:not null<br>
 *                (vf)<br>
 *         (?) validator:not null<br>
 *         (?) request:not null<br>
 *
 * <br>
 * l?F(l) boolean:false<br>
 *         (?) errors:ActionMessage("message")<br>
 *
 * <br>
 * ?beanString^???AfieldOv?peB
 * `FbN?smF?B
 * <br>
 *
 * @throws Exception ?\bh?O
 */
public void testValidateByteLength12() throws Exception {
    //eXgf?[^?
    // ++++ beanIuWFNg ++++
    Map<String, String> bean = new HashMap<String, String>();
    bean.put("field1", "1234");
    // ++++ ??IuWFNg
    ValidatorAction va = new ValidatorAction();
    va.setName("message");
    // ++++ ?tB?[h?
    Field field = new Field();
    field.setProperty("field1");
    Var var = new Var();
    var.setName("byteLength");
    var.setValue("5");
    field.addVar(var);
    // GR?[fBO?
    var = new Var();
    var.setName("encoding");
    var.setValue("Windows-31J");
    field.addVar(var);
    // ?bZ?[W?
    Msg msg = new Msg();
    msg.setKey("message");
    msg.setName("message");
    msg.setResource(false);
    field.addMsg(msg);
    // G?[?
    ActionMessages errors = new ActionMessages();
    // [HTTPNGXg
    MockHttpServletRequest request = new MockHttpServletRequest();
    // ValidatorResourcesCX^X
    ValidatorResources validatorResources = new ValidatorResources();
    // ValidatorCX^X
    Validator validator = new Validator(validatorResources);

    // eXg?s
    boolean result = FieldChecksEx.validateByteLength(bean, va, field, errors, validator, request);
    // eXgmF
    // falsep?B
    assertFalse(result);
    // G?[?1??B
    assertEquals(1, errors.size());

    // ?bZ?[WIuWFNg?
    Iterator it = errors.get();
    ActionMessage message = (ActionMessage) it.next();
    assertEquals("message", message.getKey());
}

From source file:jp.terasoluna.fw.web.struts.form.FieldChecksExTest05.java

/**
 * testValidateStringLength07()/*from  w ww.  j av  a  2s .c om*/
 * <br><br>
 *
 * (??n)
 * <br>
 * _?FF
 * <br><br>
 * l?F(?) bean:String:"abc0#"<br>
 *         (?) va:not null<br>
 *         (?) field:not null<br>
 *                var:stringLength="4"<br>
 *                Msg("message","message")<br>
 *         (?) errors:not null<br>
 *                ActionMessage("testMessage")<br>
 *         (?) validator:not null<br>
 *         (?) request:not null<br>
 *
 * <br>
 * l?F(l) boolean:false<br>
 *         (?) errors:ActionMessage("testMessage")<br>
 *                    ActionMessage("message")<br>
 *
 * <br>
 * fieldstringLengthwl?A?bean?v???A
 * falsepmF?B
 * <br>
 *
 * @throws Exception ?\bh?O
 */
public void testValidateStringLength07() throws Exception {
    //eXgf?[^?
    // ++++ beanIuWFNg ++++
    String bean = "abc0#";
    // ++++ ??IuWFNg
    ValidatorAction va = new ValidatorAction();
    va.setName("message");
    // ++++ ?tB?[h?
    Field field = new Field();
    // ?bZ?[W?
    Msg msg = new Msg();
    msg.setKey("message");
    msg.setName("message");
    msg.setResource(false);
    field.addMsg(msg);
    Var var = new Var();
    var.setName("stringLength");
    var.setValue("4");
    field.addVar(var);

    // G?[??iActionMessage1???j
    ActionMessages errors = new ActionMessages();
    ActionMessage error = new ActionMessage("testMessage");
    errors.add(Globals.ERROR_KEY, error);

    // [HTTPNGXg
    MockHttpServletRequest request = new MockHttpServletRequest();
    // ValidatorResourcesCX^X
    ValidatorResources validatorResources = new ValidatorResources();
    // ValidatorCX^X
    Validator validator = new Validator(validatorResources);

    // eXg?s
    boolean result = FieldChecksEx.validateStringLength(bean, va, field, errors, validator, request);

    // eXgmF
    // falsep?B
    assertFalse(result);
    // G?[?G?[IuWFNg2o^?B
    assertEquals(2, errors.size());
    // G?[???bZ?[Wo^?B
    // ActionMessage???B
    Iterator it = errors.get();
    List<String> list = new ArrayList<String>();
    while (it.hasNext()) {
        ActionMessage retError = (ActionMessage) it.next();
        list.add(retError.getKey());
    }
    assertTrue(list.contains("testMessage"));
    assertTrue(list.contains("message"));
}

From source file:jp.terasoluna.fw.web.struts.form.FieldChecksExTest05.java

/**
 * testValidateByteLength07()//from  w w w  . j  av a2s. com
 * <br><br>
 *
 * (??n)
 * <br>
 * _?FF
 * <br><br>
 * l?F(?) bean:String:""<br>
 *         (?) va:not null<br>
 *         (?) field:not null<br>
 *                var:byteLength="3"<br>
 *                encoding="Windows-31J"<br>
 *                Msg("message","message")<br>
 *         (?) errors:not null<br>
 *                ActionMessage("testMessage")<br>
 *         (?) validator:not null<br>
 *         (?) request:not null<br>
 *
 * <br>
 * l?F(l) boolean:false<br>
 *         (?) errors:ActionMessage("testMessage")<br>
 *                    ActionMessage("message")<br>
 *
 * <br>
 * fieldbyteLengthwl?A?bean?v???A
 * falsepmF?B
 * <br>
 *
 * @throws Exception ?\bh?O
 */
public void testValidateByteLength07() throws Exception {
    //eXgf?[^?
    // ++++ beanIuWFNg ++++
    String bean = "";
    // ++++ ??IuWFNg
    ValidatorAction va = new ValidatorAction();
    va.setName("message");
    // ++++ ?tB?[h?
    Field field = new Field();
    Var var = new Var();
    var.setName("byteLength");
    var.setValue("3");
    field.addVar(var);
    // GR?[fBO?
    var = new Var();
    var.setName("encoding");
    var.setValue("Windows-31J");
    field.addVar(var);
    // ?bZ?[W?
    Msg msg = new Msg();
    msg.setKey("message");
    msg.setName("message");
    msg.setResource(false);
    field.addMsg(msg);

    // G?[??iActionMessage1???j
    ActionMessages errors = new ActionMessages();
    ActionMessage error = new ActionMessage("testMessage");
    errors.add(Globals.ERROR_KEY, error);

    // [HTTPNGXg
    MockHttpServletRequest request = new MockHttpServletRequest();
    // ValidatorResourcesCX^X
    ValidatorResources validatorResources = new ValidatorResources();
    // ValidatorCX^X
    Validator validator = new Validator(validatorResources);

    // eXg?s
    boolean result = FieldChecksEx.validateByteLength(bean, va, field, errors, validator, request);
    // eXgmF
    // falsep?B
    assertFalse(result);
    // G?[?1??B
    assertEquals(2, errors.size());
    // ?bZ?[WIuWFNg?
    Iterator it = errors.get();
    List<String> list = new ArrayList<String>();
    while (it.hasNext()) {
        ActionMessage retError = (ActionMessage) it.next();
        list.add(retError.getKey());
    }
    assertTrue(list.contains("testMessage"));
    assertTrue(list.contains("message"));
}

From source file:jp.terasoluna.fw.web.struts.form.FieldChecksExTest08.java

/**
 * testValidateMultiField01()/*from w w  w.  ja  va  2  s.c om*/
 * <br><br>
 *
 * (??n)
 * <br>
 * _?FC,F
 * <br><br>
 * l?F(?) bean:null<br>
 *         (?) va:not null<br>
 *         (?) field:not null<br>
 *                Msg("message","message")<br>
 *         (?) errors:not null<br>
 *                (vf)<br>
 *         (?) validator:not null<br>
 *         (?) request:not null<br>
 *
 * <br>
 * l?F(l) boolean:true<br>
 *         (?) MultiFieldValidator:?o<br>
 *         (?) ?O:?Ox?F<br>
 *                    G?[<br>
 *                    ?bZ?[W?F<br>
 *                    bean is null.<br>
 *         (?) errors:not null<br>
 *                    (vf)<br>
 *
 * <br>
 * ?beannull?AG?[?O?otruep
 * mF?B
 * <br>
 *
 * @throws Exception ?\bh?O
 */
public void testValidateMultiField01() throws Exception {
    //eXgf?[^?
    // ++++ beanIuWFNg ++++
    String bean = null;
    // ++++ ??IuWFNg
    ValidatorAction va = new ValidatorAction();
    // ++++ ?tB?[h?
    Field field = new Field();
    // ?bZ?[W?
    Msg msg = new Msg();
    msg.setKey("message");
    msg.setName("message");
    msg.setResource(false);
    field.addMsg(msg);
    // G?[?
    ActionMessages errors = new ActionMessages();
    // [HTTPNGXg
    MockHttpServletRequest request = new MockHttpServletRequest();
    // ValidatorResourcesCX^X
    ValidatorResources validatorResources = new ValidatorResources();
    // ValidatorCX^X
    Validator validator = new Validator(validatorResources);

    // eXg?s
    boolean result = FieldChecksEx.validateMultiField(bean, va, field, errors, validator, request);
    // eXgmF
    // truep?B
    assertTrue(result);
    // G?[??B
    assertTrue(errors.isEmpty());

    // G?[?OmF
    assertTrue(LogUTUtil.checkError("bean is null."));
}

From source file:jp.terasoluna.fw.web.struts.form.FieldChecksExTest08.java

/**
 * testValidateMultiField03()//  w ww . java2s  . c  o m
 * <br><br>
 *
 * (?n)
 * <br>
 * _?FC,F
 * <br><br>
 * l?F(?) bean:""<br>
 *         (?) va:not null<br>
 *         (?) field:not null<br>
 *                var:multiFieldValidator=null<br>
 *                Msg("message","message")<br>
 *         (?) errors:not null<br>
 *                (vf)<br>
 *         (?) validator:not null<br>
 *         (?) request:not null<br>
 *
 * <br>
 * l?F(?) MultiFieldValidator:?o<br>
 *         (?) O:IllegalArgumentException<br>
 *                    ?bZ?[W?F<br>
 *                    "var value[multiFieldValidator] is required."<br>
 *         (?) ?O:?Ox?FG?[<br>
 *                    ?bZ?[W?F<br>
 *                    "var value[multiFieldValidator] is required."<br>
 *         (?) errors:not null<br>
 *                    (vf)<br>
 *
 * <br>
 * bean?A`FbN???s?B<br>
 * fieldmultiFieldValidatornull?AIllegalArgumentException
 * ?mF?B
 * <br>
 *
 * @throws Exception ?\bh?O
 */
public void testValidateMultiField03() throws Exception {
    //eXgf?[^?
    // ++++ beanIuWFNg ++++
    String bean = "";
    // ++++ ??IuWFNg
    ValidatorAction va = new ValidatorAction();
    // ++++ ?tB?[h?
    Field field = new Field();
    Var var = new Var();
    var.setName("multiFieldValidator");
    var.setValue(null);
    field.addVar(var);
    // ?bZ?[W?
    Msg msg = new Msg();
    msg.setKey("message");
    msg.setName("message");
    msg.setResource(false);
    field.addMsg(msg);
    // G?[?
    ActionMessages errors = new ActionMessages();
    // [HTTPNGXg
    MockHttpServletRequest request = new MockHttpServletRequest();
    // ValidatorResourcesCX^X
    ValidatorResources validatorResources = new ValidatorResources();
    // ValidatorCX^X
    Validator validator = new Validator(validatorResources);

    // eXg?s
    try {
        FieldChecksEx.validateMultiField(bean, va, field, errors, validator, request);
        fail();
    } catch (IllegalArgumentException e) {
        assertTrue(errors.isEmpty());
        assertEquals("var value[multiFieldValidator] is required.", e.getMessage());
        assertTrue(LogUTUtil.checkError("var value[multiFieldValidator] is required."));
    }
}

From source file:jp.terasoluna.fw.web.struts.form.FieldChecksExTest08.java

/**
 * testValidateMultiField04()//ww w. j  a v  a 2 s .  c o m
 * <br><br>
 *
 * (?n)
 * <br>
 * _?FF,G
 * <br><br>
 * l?F(?) bean:"abc"<br>
 *         (?) va:not null<br>
 *         (?) field:not null<br>
 *                var:multiFieldValidator=""<br>
 *                Msg("message","message")<br>
 *         (?) errors:not null<br>
 *                (vf)<br>
 *         (?) validator:not null<br>
 *         (?) request:not null<br>
 *
 * <br>
 * l?F(?) MultiFieldValidator:?o<br>
 *         (?) O:IllegalArgumentException<br>
 *                    ?bZ?[W?F<br>
 *                    "var value[multiFieldValidator] is required."<br>
 *         (?) ?O:?Ox?FG?[<br>
 *                    ?bZ?[W?F<br>
 *                    "var value[multiFieldValidator] is required."<br>
 *         (?) errors:not null<br>
 *                    (vf)<br>
 *
 * <br>
 * fieldmultiFieldValidator?A
 * IllegalArgumentException?mF?B
 * <br>
 *
 * @throws Exception ?\bh?O
 */
public void testValidateMultiField04() throws Exception {
    //eXgf?[^?
    // ++++ beanIuWFNg ++++
    String bean = "abc";
    // ++++ ??IuWFNg
    ValidatorAction va = new ValidatorAction();
    // ++++ ?tB?[h?
    Field field = new Field();
    Var var = new Var();
    var.setName("multiFieldValidator");
    var.setValue("");
    field.addVar(var);
    // ?bZ?[W?
    Msg msg = new Msg();
    msg.setKey("message");
    msg.setName("message");
    msg.setResource(false);
    field.addMsg(msg);
    // G?[?
    ActionMessages errors = new ActionMessages();
    // [HTTPNGXg
    MockHttpServletRequest request = new MockHttpServletRequest();
    // ValidatorResourcesCX^X
    ValidatorResources validatorResources = new ValidatorResources();
    // ValidatorCX^X
    Validator validator = new Validator(validatorResources);

    // eXg?s
    try {
        FieldChecksEx.validateMultiField(bean, va, field, errors, validator, request);
        fail();
    } catch (IllegalArgumentException e) {
        assertTrue(errors.isEmpty());
        assertEquals("var value[multiFieldValidator] is required.", e.getMessage());
        assertTrue(LogUTUtil.checkError("var value[multiFieldValidator] is required."));
    }
}

From source file:jp.terasoluna.fw.web.struts.form.FieldChecksExTest08.java

/**
 * testValidateMultiField05()/*w  w w . j a  v a  2s  . c o m*/
 * <br><br>
 *
 * (?n)
 * <br>
 * _?FF,G
 * <br><br>
 * l?F(?) bean:"abc"<br>
 *         (?) va:not null<br>
 *         (?) field:not null<br>
 *                var:multiFieldValidator="abc"<br>
 *                Msg("message","message")<br>
 *         (?) errors:not null<br>
 *                (vf)<br>
 *         (?) validator:not null<br>
 *         (?) request:not null<br>
 *
 * <br>
 * l?F(?) MultiFieldValidator:?o<br>
 *         (?) O:IllegalArgumentException<br>
 *                    ?bZ?[W?F<br>
 *                    "var value[multiFieldValidator] is invalid."<br>
 *         (?) ?O:?Ox?FG?[<br>
 *                    ?bZ?[W?F<br>
 *                    "var value[multiFieldValidator] is invalid."<br>
 *                    O?F<br>
 *                    ClassLoadException(ClassNotFoundException)
 *         (?) errors:not null<br>
 *                    (vf)<br>
 *
 * <br>
 * fieldmultiFieldValidatorNXpX??NX?A
 * IllegalArgumentException?mF?B
 * <br>
 *
 * @throws Exception ?\bh?O
 */
public void testValidateMultiField05() throws Exception {
    //eXgf?[^?
    // ++++ beanIuWFNg ++++
    String bean = "abc";
    // ++++ ??IuWFNg
    ValidatorAction va = new ValidatorAction();
    // ++++ ?tB?[h?
    Field field = new Field();
    Var var = new Var();
    var.setName("multiFieldValidator");
    var.setValue("abc");
    field.addVar(var);
    // ?bZ?[W?
    Msg msg = new Msg();
    msg.setKey("message");
    msg.setName("message");
    msg.setResource(false);
    field.addMsg(msg);
    // G?[?
    ActionMessages errors = new ActionMessages();
    // [HTTPNGXg
    MockHttpServletRequest request = new MockHttpServletRequest();
    // ValidatorResourcesCX^X
    ValidatorResources validatorResources = new ValidatorResources();
    // ValidatorCX^X
    Validator validator = new Validator(validatorResources);

    // eXg?s
    try {
        FieldChecksEx.validateMultiField(bean, va, field, errors, validator, request);
        fail();
    } catch (IllegalArgumentException e) {
        assertTrue(errors.isEmpty());
        assertEquals("var value[multiFieldValidator] is invalid.", e.getMessage());
        assertTrue(LogUTUtil.checkError("var value[multiFieldValidator] is invalid.",
                new ClassLoadException(new ClassNotFoundException())));
    }
}

From source file:jp.terasoluna.fw.web.struts.form.FieldChecksExTest08.java

/**
 * testValidateMultiField06()//from w  w  w .  ja  v a 2s .c om
 * <br><br>
 *
 * (?n)
 * <br>
 * _?FF,G
 * <br><br>
 * l?F(?) bean:"abc"<br>
 *         (?) va:not null<br>
 *         (?) field:not null<br>
 *                var:multiFieldValidator="java.lang.String"<br>
 *                Msg("message","message")<br>
 *         (?) errors:not null<br>
 *                (vf)<br>
 *         (?) validator:not null<br>
 *         (?) request:not null<br>
 *
 * <br>
 * l?F(?) MultiFieldValidator:?o<br>
 *         (?) O:IllegalArgumentException<br>
 *                    ?bZ?[W?F<br>
 *                    "var value[multiFieldValidator] is invalid."<br>
 *         (?) ?O:?Ox?FG?[<br>
 *                    ?bZ?[W?F<br>
 *                    "var value[multiFieldValidator] is invalid."<br>
 *                    O?F<br>
 *                    ClassCastException<br>
 *         (?) errors:not null<br>
 *                    (vf)<br>
 *
 * <br>
 * fieldmultiFieldValidatorMultiFieldValidatorNX
 * ?AIllegalArgumentException?mF?B
 * <br>
 *
 * @throws Exception ?\bh?O
 */
public void testValidateMultiField06() throws Exception {
    //eXgf?[^?
    // ++++ beanIuWFNg ++++
    String bean = "abc";
    // ++++ ??IuWFNg
    ValidatorAction va = new ValidatorAction();
    // ++++ ?tB?[h?
    Field field = new Field();
    Var var = new Var();
    var.setName("multiFieldValidator");
    var.setValue("java.lang.String");
    field.addVar(var);
    // ?bZ?[W?
    Msg msg = new Msg();
    msg.setKey("message");
    msg.setName("message");
    msg.setResource(false);
    field.addMsg(msg);
    // G?[?
    ActionMessages errors = new ActionMessages();
    // [HTTPNGXg
    MockHttpServletRequest request = new MockHttpServletRequest();
    // ValidatorResourcesCX^X
    ValidatorResources validatorResources = new ValidatorResources();
    // ValidatorCX^X
    Validator validator = new Validator(validatorResources);

    // eXg?s
    try {
        FieldChecksEx.validateMultiField(bean, va, field, errors, validator, request);
        fail();
    } catch (IllegalArgumentException e) {
        assertTrue(errors.isEmpty());
        assertEquals("var value[multiFieldValidator] is invalid.", e.getMessage());
        assertTrue(
                LogUTUtil.checkError("var value[multiFieldValidator] is invalid.", new ClassCastException()));
    }
}

From source file:jp.terasoluna.fw.web.struts.form.FieldChecksExTest08.java

/**
 * testValidateByteRange02()/*from   w w  w. ja  va 2s.  c  om*/
 * <br><br>
 *
 * (??n)
 * <br>
 * _?FC,F
 * <br><br>
 * l?F(?) bean:""<br>
 *         (?) va:not null<br>
 *         (?) field:not null<br>
 *                var:maxByte="1"<br>
 *                var:minByte="4"<br>
 *                Msg("message","message")<br>
 *         (?) errors:not null<br>
 *                (vf)<br>
 *         (?) validator:not null<br>
 *         (?) request:not null<br>
 *
 * <br>
 * l?F(l) boolean:true<br>
 *         (?) errors:not null<br>
 *                    (vf)<br>
 *
 * <br>
 * ?bean?AtruepmF?B
 * <br>
 *
 * @throws Exception ?\bh?O
 */
public void testValidateByteRange02() throws Exception {
    //eXgf?[^?
    // ++++ beanIuWFNg ++++
    String bean = "";
    // ++++ ??IuWFNg
    ValidatorAction va = new ValidatorAction();
    // ++++ ?tB?[h?
    Field field = new Field();
    Var var = new Var();
    var.setName("maxByte");
    var.setValue("1");
    field.addVar(var);
    var = new Var();
    var.setName("minByte");
    var.setValue("4");
    field.addVar(var);
    // ?bZ?[W?
    Msg msg = new Msg();
    msg.setKey("message");
    msg.setName("message");
    msg.setResource(false);
    field.addMsg(msg);
    // G?[?
    ActionMessages errors = new ActionMessages();
    // [HTTPNGXg
    MockHttpServletRequest request = new MockHttpServletRequest();
    // ValidatorResourcesCX^X
    ValidatorResources validatorResources = new ValidatorResources();
    // ValidatorCX^X
    Validator validator = new Validator(validatorResources);

    // eXg?s
    boolean result = FieldChecksEx.validateByteRange(bean, va, field, errors, validator, request);
    // eXgmF
    // truep?B
    assertTrue(result);
    // G?[??B
    assertTrue(errors.isEmpty());
}