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

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


  }

  @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", 0l };

    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

  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  @SpecAssertion(section = "5.1.2", id = "c")
  public void testNullPassedForMethodCausesException() throws Exception {
    Object object = new User();
    Method method = null;
    Object[] parameterValues = new Object[] { null };

    executableValidator.validateParameters(
        object,
View Full Code Here

  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  @SpecAssertion(section = "5.1.2", id = "c")
  public void testNullPassedForParameterValuesCausesException() throws Exception {
    Object object = new User();
    Method method = User.class.getMethod( "setFirstName", String.class );
    Object[] parameterValues = null;

    executableValidator.validateParameters(
        object,
View Full Code Here

  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  @SpecAssertion(section = "5.1.2", id = "c")
  public void testNullPassedForGroupsCausesException() throws Exception {
    Object object = new User();
    Method method = User.class.getMethod( "setFirstName", String.class );
    Object[] parameterValues = new Object[] { null };

    executableValidator.validateParameters(
        object,
View Full Code Here

  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  @SpecAssertion(section = "5.1.2", id = "c")
  public void testNullPassedAsSingleGroupCausesException() throws Exception {
    Object object = new User();
    Method method = User.class.getMethod( "setFirstName", String.class );
    Object[] parameterValues = new Object[] { null };

    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.