Author: hardy.ferentschik
Date: 2009-06-24 10:42:43 -0400 (Wed, 24 Jun 2009)
New Revision: 16943
Modified:
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/ActorArrayBased.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/ActorListBased.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/ValidateTest.java
Log:
Updated test. There are actuall tow possible violations.
Modified:
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/ActorArrayBased.java
===================================================================
---
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/ActorArrayBased.java 2009-06-24
06:52:42 UTC (rev 16942)
+++
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/ActorArrayBased.java 2009-06-24
14:42:43 UTC (rev 16943)
@@ -47,4 +47,9 @@
this.playedWith[currentPointer] = playedWith;
currentPointer++;
}
+
+ @Override
+ public String toString() {
+ return super.toString();
+ }
}
\ No newline at end of file
Modified:
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/ActorListBased.java
===================================================================
---
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/ActorListBased.java 2009-06-24
06:52:42 UTC (rev 16942)
+++
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/ActorListBased.java 2009-06-24
14:42:43 UTC (rev 16943)
@@ -40,4 +40,9 @@
public void addPlayedWith(Actor playedWith) {
this.playedWith.add( playedWith );
}
+
+ @Override
+ public String toString() {
+ return super.toString();
+ }
}
\ No newline at end of file
Modified:
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/ValidateTest.java
===================================================================
---
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/ValidateTest.java 2009-06-24
06:52:42 UTC (rev 16942)
+++
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/ValidateTest.java 2009-06-24
14:42:43 UTC (rev 16943)
@@ -193,12 +193,12 @@
Set<ConstraintViolation<Actor>> constraintViolations = validator.validate(
clint );
- assertEquals( constraintViolations.size(), 1, "Wrong number of constraints"
);
+ assertEquals( constraintViolations.size(), 2, "Wrong number of constraints"
);
ConstraintViolation constraintViolation = constraintViolations.iterator().next();
assertEquals( "Everyone has a last name.", constraintViolation.getMessage(),
"Wrong message" );
- org.testng.Assert.assertEquals( constraintViolation.getRootBean(), clint, "Wrong
root entity" );
- org.testng.Assert.assertEquals( constraintViolation.getInvalidValue(),
morgan.getLastName(), "Wrong value" );
- assertCorrectPropertyPaths( constraintViolations,
"playedWith[0].playedWith[1].lastName" );
+ assertEquals( constraintViolation.getRootBean(), clint, "Wrong root entity"
);
+ assertEquals( constraintViolation.getInvalidValue(), morgan.getLastName(), "Wrong
value" );
+ assertCorrectPropertyPaths( constraintViolations,
"playedWith[0].playedWith[1].lastName", "playedWith[1].lastName" );
}
@Test
@@ -218,12 +218,12 @@
clint.addPlayedWith( morgan );
Set<ConstraintViolation<Actor>> constraintViolations = validator.validate(
clint );
- assertEquals( constraintViolations.size(), 1, "Wrong number of constraints"
);
+ assertEquals( constraintViolations.size(), 2, "Wrong number of constraints"
);
ConstraintViolation constraintViolation = constraintViolations.iterator().next();
assertEquals( "Everyone has a last name.", constraintViolation.getMessage(),
"Wrong message" );
assertEquals( constraintViolation.getRootBean(), clint, "Wrong root entity"
);
assertEquals( constraintViolation.getInvalidValue(), morgan.getLastName(), "Wrong
value" );
- assertCorrectPropertyPaths( constraintViolations,
"playedWith[0].playedWith[1].lastName" );
+ assertCorrectPropertyPaths( constraintViolations,
"playedWith[0].playedWith[1].lastName", "playedWith[1].lastName" );
}
@Test(expectedExceptions = IllegalArgumentException.class)
Show replies by date