Package org.hibernate.beanvalidation.tck.tests.methodvalidation.model

Examples of org.hibernate.beanvalidation.tck.tests.methodvalidation.model.User


      @SpecAssertion(section = "5.2", id = "i")
  })
  public void testOneViolation() throws Exception {
    String methodName = "setFirstName";

    Object object = new User();
    Method method = User.class.getMethod( methodName, String.class );
    String arg0 = "B";
    Object[] parameterValues = new Object[] { arg0 };

    Set<ConstraintViolation<Object>> violations = executableValidator.validateParameters(
View Full Code Here


      @SpecAssertion(section = "5.2", id = "j")
  })
  public void testOneViolationFromCrossParameterConstraint() throws Exception {
    String methodName = "setAddress";

    Object object = new User();
    Method method = User.class.getMethod( methodName, String.class, String.class );
    Object[] parameterValues = new Object[] { null, null };

    Set<ConstraintViolation<Object>> violations = executableValidator.validateParameters(
        object,
View Full Code Here

  @Test
  @SpecAssertion(section = "5.1.2", id = "b")
  public void testTwoViolations() throws Exception {
    String methodName = "setNames";

    Object object = new User();
    Method method = User.class.getMethod( methodName, String.class, CharSequence.class );
    Object[] parameterValues = new Object[] { null, "S" };

    Set<ConstraintViolation<Object>> violations = executableValidator.validateParameters(
        object,
View Full Code Here

  @Test
  @SpecAssertion(section = "5.1.2", id = "b")
  public void testTwoViolationsOnSameParameter() throws Exception {
    String methodName = "setFirstNameStrict";

    Object object = new User();
    Method method = User.class.getMethod( methodName, String.class, int.class );
    Object[] parameterValues = new Object[] { "S" };

    Set<ConstraintViolation<Object>> violations = executableValidator.validateParameters(
        object,
View Full Code Here

  @Test
  @SpecAssertion(section = "5.1.2", id = "b")
  public void testTwoConstraintsOfSameType() throws Exception {
    String methodName = "setLastNameStrict";

    Object object = new User();
    Method method = User.class.getMethod( methodName, CharSequence.class );
    Object[] parameterValues = new Object[] { "S" };

    Set<ConstraintViolation<Object>> violations = executableValidator.validateParameters(
        object,
View Full Code Here

  @Test
  @SpecAssertion(section = "5.1.2", id = "b")
  public void testCrossParameterConstraintGivenSeveralTimes() throws Exception {
    String methodName = "setAddress";

    Object object = new User();
    Method method = User.class.getMethod(
        methodName,
        String.class,
        String.class,
        String.class
View Full Code Here

  }

  @Test
  @SpecAssertion(section = "5.1.2", id = "b")
  public void testNoViolations() throws Exception {
    Object object = new User();
    Method method = User.class.getMethod( "setNames", String.class, CharSequence.class );
    Object[] parameterValues = new Object[] { "Bob", "Smith" };

    Set<ConstraintViolation<Object>> violations = executableValidator.validateParameters(
        object,
View Full Code Here

  @Test
  @SpecAssertion(section = "5.1.2", id = "b")
  public void testValidationWithGroup() throws Exception {
    String methodName = "setLastName";

    Object object = new User();
    Method method = User.class.getMethod( methodName, String.class, long.class );
    Object[] parameterValues = new Object[] { "S" };

    Set<ConstraintViolation<Object>> violations = executableValidator.validateParameters(
        object,
View Full Code Here

  @Test
  @SpecAssertion(section = "5.1.2", id = "b")
  public void testCrossParameterConstraintValidationWithGroup() throws Exception {
    String methodName = "setAddressExtended";

    Object object = new User();
    Method method = User.class.getMethod( methodName, CharSequence.class, String.class );
    Object[] parameterValues = new Object[] { null, null };

    Set<ConstraintViolation<Object>> violations = executableValidator.validateParameters(
        object,
View Full Code Here

  @Test
  @SpecAssertion(section = "5.1.2", id = "b")
  public void testValidationWithSeveralGroups() throws Exception {
    String methodName = "setAllData";

    Object object = new User();
    Method method = User.class.getMethod( methodName, String.class, String.class, Date.class );
    Object[] parameterValues = new Object[] { null, "S", null };

    Set<ConstraintViolation<Object>> violations = executableValidator.validateParameters(
        object,
View Full Code Here

TOP

Related Classes of org.hibernate.beanvalidation.tck.tests.methodvalidation.model.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.