Hibernate SVN: r17494 - beanvalidation/trunk/validation-tck/src/main/resources.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2009-09-09 06:27:33 -0400 (Wed, 09 Sep 2009)
New Revision: 17494
Modified:
beanvalidation/trunk/validation-tck/src/main/resources/tck-audit.xml
Log:
add assertion for payload being ignored in composing constraints
Modified: beanvalidation/trunk/validation-tck/src/main/resources/tck-audit.xml
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/resources/tck-audit.xml 2009-09-08 16:07:18 UTC (rev 17493)
+++ beanvalidation/trunk/validation-tck/src/main/resources/tck-audit.xml 2009-09-09 10:27:33 UTC (rev 17494)
@@ -970,6 +970,13 @@
<text>getPayload returns the payloads the constraint hosts or an empty set if
none</text>
</assertion>
+ <assertion id="h">
+ <text>Likewise, payload from the main constraint annotation is inherited by the
+ composing annotations.</text>
+ </assertion>
+ <assertion id="i">
+ <text>Any payload definition on a composing annotation is ignored</text>
+ </assertion>
</section>
16 years
Hibernate SVN: r17493 - validator/trunk/hibernate-validator/src/main/docbook/en-US/modules.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-09-08 12:07:18 -0400 (Tue, 08 Sep 2009)
New Revision: 17493
Modified:
validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml
validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/xmlconfiguration.xml
Log:
HV-220
Modified: validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml
===================================================================
--- validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml 2009-09-08 13:44:27 UTC (rev 17492)
+++ validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml 2009-09-08 16:07:18 UTC (rev 17493)
@@ -938,7 +938,7 @@
</example>
</section>
- <section>
+ <section id="section-default-group-class">
<title>Redefining the default group sequence of a class</title>
<para>The @GroupSequence annotation also fulfills a second purpose. It
Modified: validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/xmlconfiguration.xml
===================================================================
--- validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/xmlconfiguration.xml 2009-09-08 13:44:27 UTC (rev 17492)
+++ validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/xmlconfiguration.xml 2009-09-08 16:07:18 UTC (rev 17493)
@@ -140,7 +140,6 @@
xmlns="http://jboss.org/xml/ns/javax/validation/mapping">
<default-package>org.hibernate.validator.quickstart</default-package>
<bean class="Car" ignore-annotations="true">
- <class ignore-annotations="true">
<field name="manufacturer">
<constraint annotation="javax.validation.constraints.NotNull"/>
</field>
@@ -173,7 +172,7 @@
</group-sequence>
</class>
</bean>
- <constraint-definition annotation="org.mycompany.CheckCase">
+ <constraint-definition annotation="org.mycompany.CheckCase" include-existing-validator="false">
<validated-by include-existing-validators="false">
<value>org.mycompany.CheckCaseValidator</value>
</validated-by>
@@ -181,8 +180,50 @@
</constraint-mappings></programlisting>
</example>
- <para>The mapping xml is closely related to the programmatic API. For this
- reason it should suffice to add some comments regarding the
- configuration.</para>
+ <para>The xml configurtion is closely mirroring the programmatic API. For
+ this reason it should suffice to just add some comments.
+ <property>default-package</property> is used for all fields where a
+ classname is expected. If the specified class is not fully qualified the
+ configured default package will be used. Every mapping file can then have
+ several <property>bean</property> nodes, each describing the constraints
+ on the entity with the specified class name.<warning>
+ <para>A given entity can only be configured once across all
+ configuration files. If the same class is configured more than once an
+ exception is thrown.</para>
+ </warning>Settings <property>ignore-annotations</property> to true means
+ that constraint annotations placed on the configured bean are ignored. The
+ default for this value is <constant>true</constant>. ignore-annotations is
+ also available for the nodes <property>class</property>,
+ <property>fields</property> and <property>getter</property>. If not
+ explicitly specified on these levels the configured
+ <property>bean</property> value applies. Otherwise do the nodes
+ <property>class</property>, <property>fields</property> and
+ <property>getter</property> determine on which level the constraints are
+ placed (see <xref linkend="validator-usingvalidator-annotate" />). The
+ <property>constraint</property> node is then used to add a constraint on
+ the corresponding level. Each constraint definition must define the class
+ via the annotation attribute. The constraint attributes required by the
+ Bean Validation specification (<property>message</property>,
+ <property>groups</property> and <property>payload</property>) have
+ dedicated nodes. All other constraint specific attributes are configured
+ using the the <property>element</property> node.</para>
+
+ <para>The class node also allows to reconfigure the default group sequence
+ (see <xref linkend="section-default-group-class" />) via the
+ <property>group-sequence</property> node.</para>
+
+ <para>Last but not least, constraint annotations cannot be configured in
+ xml. However, the list of <classname>ConstraintValidator</classname>s
+ associated to a given constraint can be altered via the
+ <property>constraint-definition</property> node. The
+ <property>annotation</property> attribute represents the constraint
+ annotation being altered. The <property>validated-by</property> elements
+ represent the (ordered) list of <classname>ConstraintValidator</classname>
+ implementations associated to the constraint. If
+ <property>include-existing-validator</property> is set to
+ <constant>false</constant>, validators defined on the constraint
+ annotation are ignored. If set to <constant>true</constant>, the list of
+ ConstraintValidators described in XML are concatenated to the list of
+ validators described on the annotation.</para>
</section>
</chapter>
16 years
Hibernate SVN: r17481 - validator/trunk/hibernate-validator/src/main/docbook/en-US/modules.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-09-04 15:14:11 -0400 (Fri, 04 Sep 2009)
New Revision: 17481
Modified:
validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/integration.xml
validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml
validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/xmlconfiguration.xml
Log:
HV-220
Modified: validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/integration.xml
===================================================================
--- validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/integration.xml 2009-09-04 14:31:32 UTC (rev 17480)
+++ validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/integration.xml 2009-09-04 19:14:11 UTC (rev 17481)
@@ -103,7 +103,7 @@
</event>
</hibernate-configuration></programlisting>
</section>
-
+<!--
<section id="validator-checkconstraints-orm-jpaevent">
<title>Java Persistence event-based validation</title>
@@ -133,8 +133,8 @@
reflect the constraints.</para>
</note></para>
</section>
+ -->
</section>
-
<section>
<title>Presentation layer validation</title>
Modified: validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml
===================================================================
--- validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml 2009-09-04 14:31:32 UTC (rev 17480)
+++ validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml 2009-09-04 19:14:11 UTC (rev 17481)
@@ -271,8 +271,7 @@
<example>
<title>Class Person</title>
- <programlisting>
-package com.mycompany;
+ <programlisting>package com.mycompany;
import javax.validation.constraints.NotNull;
@@ -743,8 +742,9 @@
<classname>DriverChecks</classname> and last but not least
<property>Car.passedVehicleInspection</property> belongs to the group
<classname>CarChecks</classname>. The following example shows how passing
- different group combinations to the Validator.validate method result in
- different validation results.<example>
+ different group combinations to the
+ <methodname>Validator.validate</methodname> method result in different
+ validation results.<example>
<title>Drive away</title>
<programlisting>public class GroupTest {
@@ -789,8 +789,25 @@
assertEquals( 0, validator.validate( car, Default.class, CarChecks.class, DriverChecks.class ).size() );
}
}</programlisting>
- </example></para>
+ </example>First we create a car and validate it using no explicit group.
+ There are no validation errors, even though the property
+ <property>passedVehicleInspection</property> is false. However, the
+ constraint defined on this property does not belong to the default
+ group.</para>
+ <para>Next we just validate the <classname>CarChecks</classname> group
+ which will fail until we make sure that the case passes the vehicle
+ inspection.</para>
+
+ <para>When we then add a driver to the car and validate against
+ <classname>DriverChecks</classname> we get again a constraint violation
+ due to the fact that the driver has not yet passed the driving test. Only
+ after setting <property>passedDrivingTest</property> to true the
+ validation against <classname>DriverChecks</classname> will pass.</para>
+
+ <para>Last but not least, we show that all constraints are passing by
+ validating against all defined groups.</para>
+
<section revision="1">
<title>Group sequences</title>
@@ -873,7 +890,7 @@
<classname>BigInteger</classname>, <classname>String</classname>,
<classname>byte</classname>, <classname>short</classname>,
<classname>int</classname>, <classname>long</classname> and the
- respective warppers of the primtive types. </entry>
+ respective warppers of the primtive types.</entry>
<entry>The annotated element must be a number whose value must be
lower or equal to the specified maximum. The parameter value is
@@ -913,7 +930,7 @@
<classname>BigInteger</classname>, <classname>String</classname>,
<classname>byte</classname>, <classname>short</classname>,
<classname>int</classname>, <classname>long</classname> and the
- respective warppers of the primtive types. </entry>
+ respective warppers of the primtive types.</entry>
<entry>Check whether the property is a number having up to
<literal>integer</literal> digits and <literal>fraction</literal>
@@ -1007,7 +1024,7 @@
<entry>field/property. Needs to be a string.</entry>
<entry>Check if the string is not <constant>null</constant> nor
- empty. </entry>
+ empty.</entry>
<entry>Column(s) are not null (for String).</entry>
</row>
Modified: validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/xmlconfiguration.xml
===================================================================
--- validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/xmlconfiguration.xml 2009-09-04 14:31:32 UTC (rev 17480)
+++ validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/xmlconfiguration.xml 2009-09-04 19:14:11 UTC (rev 17481)
@@ -30,7 +30,17 @@
<section>
<title><filename>validation.xml</filename></title>
- <para><mediaobject>
+ <para>The key to enable XML configuration for Hibernate Validator the the
+ file <filename>validation.xml</filename>. If this file exists in the
+ classpath the configuration specified in it will be considered when the
+ <classname>ValidationFactory</classname> gets created. <warning>
+ <para>There can only be one <filename>validation.xml</filename> in the
+ classpath. If more than one is found an exception is thrown.</para>
+ </warning>The <xref linkend="image-validation-configuration" /> shows a
+ model view of the validation-configuration xsd and <xref
+ linkend="example-validation-xml" /> shows a valid
+ <filename>validation.xml</filename>. Let's have a look at the different
+ settings. <mediaobject id="image-validation-configuration">
<imageobject role="fo">
<imagedata align="center" fileref="validation-configuration-1.0.png"
scalefit="1" />
@@ -44,6 +54,21 @@
<caption><para>Model view
validation-configuration-1.0.xsd</para></caption>
</mediaobject></para>
+
+ <para></para>
+
+ <example id="example-validation-xml">
+ <title>validation.xml</title>
+
+ <programlisting><?xml version="1.0" encoding="UTF-8"?>
+<validation-config xmlns="http://jboss.org/xml/ns/javax/validation/configuration"
+ xsi:schemaLocation="http://jboss.org/xml/ns/javax/validation/configuration validation-configuration-1.0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <constraint-mapping>org/hibernate/jsr303/tck/tests/xmlconfiguration/order-constraints.xml</constraint-mapping>
+ <constraint-mapping>org/hibernate/jsr303/tck/tests/xmlconfiguration/user-constraints.xml</constraint-mapping>
+ <property name="javax.validation.test">foobar</property>
+</validation-config></programlisting>
+ </example>
</section>
<section>
@@ -61,6 +86,73 @@
</imageobject>
<caption><para>Model view validation-mapping-1.0.xsd</para></caption>
- </mediaobject></para>
+ </mediaobject><example>
+ <title>XML configuration of Car TODO!</title>
+
+ <programlisting><constraint-mappings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.org/xml/ns/javax/validation/mapping validation-mapping-1.0.xsd"
+ xmlns="http://jboss.org/xml/ns/javax/validation/mapping">
+ <default-package>org.hibernate.jsr303.tck.tests.xmlconfiguration</default-package>
+ <bean class="User" ignore-annotations="false">
+ <class ignore-annotations="true">
+ <group-sequence>
+ <value>User</value>
+ <value>Optional</value>
+ </group-sequence>
+ <constraint annotation="org.hibernate.jsr303.tck.tests.xmlconfiguration.ConsistentUserInformation">
+ <message>Message from xml</message>
+ <groups>
+ <value>javax.validation.groups.Default</value>
+ </groups>
+ <payload>
+ <value>org.hibernate.jsr303.tck.tests.xmlconfiguration.Error</value>
+ </payload>
+ <element name="stringParam">foobar</element>
+ <element name="classParam">java.lang.String</element>
+ <element name="stringArrayParam">
+ <value>foo</value>
+ <value>bar</value>
+ </element>
+ <element name="intParam">
+ <value>42</value>
+ </element>
+ <element name="patterns">
+ <annotation>
+ <element name="regexp">myRegExp1</element>
+ </annotation>
+ <annotation>
+ <element name="regexp">myRegExp2</element>
+ </annotation>
+ </element>
+ <element name="userType">SELLER</element>
+ </constraint>
+ </class>
+ <field name="lastname">
+ <constraint annotation="javax.validation.constraints.Pattern">
+ <message>Last name has to start with with a capital letter.</message>
+ <element name="regexp">^[A-Z][a-z]+</element>
+ </constraint>
+ </field>
+ <field name="creditcard">
+ <valid/>
+ </field>
+ <getter name="firstname" ignore-annotations="true">
+ <constraint annotation="javax.validation.constraints.Size">
+ <message>Size is limited!</message>
+ <groups>
+ <value>org.hibernate.jsr303.tck.tests.xmlconfiguration.TestGroup</value>
+ <value>javax.validation.groups.Default</value>
+ </groups>
+ <element name="max">10</element>
+ </constraint>
+ </getter>
+ </bean>
+ <constraint-definition annotation="ConsistentUserInformation">
+ <validated-by include-existing-validators="false">
+ <value>org.hibernate.jsr303.tck.tests.xmlconfiguration.CustomConsistentUserValidator</value>
+ </validated-by>
+ </constraint-definition>
+</constraint-mappings></programlisting>
+ </example></para>
</section>
</chapter>
16 years
Hibernate SVN: r17480 - validator/trunk/hibernate-validator/src/main/docbook/en-US/modules.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-09-04 10:31:32 -0400 (Fri, 04 Sep 2009)
New Revision: 17480
Modified:
validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/integration.xml
validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml
Log:
HV-220
Modified: validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/integration.xml
===================================================================
--- validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/integration.xml 2009-09-04 12:30:03 UTC (rev 17479)
+++ validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/integration.xml 2009-09-04 14:31:32 UTC (rev 17480)
@@ -49,28 +49,31 @@
<para>If, for some reason, the feature needs to be disabled, set
<literal>hibernate.validator.apply_to_ddl</literal> to
- <literal>false</literal>.</para>
+ <literal>false</literal>. See also <xref
+ linkend="table-builtin-constraints" /></para>
</section>
<section id="validator-checkconstraints-orm">
<title>ORM integration</title>
<para>Hibernate Validator integrates with both Hibernate and all pure Java
- Persistence providers</para>
+ Persistence providers.</para>
<section id="validator-checkconstraints-orm-hibernateevent" revision="1">
<title>Hibernate event-based validation</title>
- <para>Hibernate Validator has two built-in Hibernate event listeners.
- Whenever a <literal>PreInsertEvent</literal> or
- <literal>PreUpdateEvent</literal> occurs, the listeners will verify all
- constraints of the entity instance and throw an exception if any
- constraint is violated. Basically, objects will be checked before any
- inserts and before any updates made by Hibernate. This includes changes
- applied by cascade! This is the most convenient and the easiest way to
- activate the validation process. On constraint violation, the event will
- raise a runtime <classname>InvalidStateException</classname> which
- contains an array of <literal>InvalidValue</literal>s describing each
+ <para>Hibernate Validator has a built-in Hibernate event listener -
+ <classname>org.hibernate.cfg.beanvalidation.BeanValidationEventListener</classname>
+ - which is part of Hibernate Annotations. Whenever a
+ <literal>PreInsertEvent</literal> or <literal>PreUpdateEvent</literal>
+ occurs, the listener will verify all constraints of the entity instance
+ and throw an exception if any constraint is violated. Basically, objects
+ will be checked before any inserts and before any updates are made by
+ Hibernate. This includes changes applied by cascade! This is the most
+ convenient and the easiest way to activate the validation process. On
+ constraint violation, the event will raise a runtime
+ <classname>ConstraintViolationException</classname> which contains a set
+ of <literal>ConstraintViolation</literal>s describing each
failure.</para>
<para>If Hibernate Validator is present in the classpath, Hibernate
@@ -92,11 +95,11 @@
...
<event type="pre-update">
<listener
- class="org.hibernate.validator.event.ValidateEventListener"/>
+ class="<classname>org.hibernate.cfg.beanvalidation.BeanValidationEventListener</classname>"/>
</event>
<event type="pre-insert">
<listener
- class="org.hibernate.validator.event.ValidateEventListener"/>
+ class="<classname>org.hibernate.cfg.beanvalidation.BeanValidationEventListener</classname>"/>
</event>
</hibernate-configuration></programlisting>
</section>
@@ -133,40 +136,6 @@
</section>
<section>
- <title>Application-level validation</title>
-
- <para>Hibernate Validator can be applied anywhere in your application
- code.</para>
-
- <programlisting>ClassValidator personValidator = new ClassValidator( Person.class );
-ClassValidator addressValidator = new ClassValidator( Address.class, ResourceBundle.getBundle("messages", Locale.ENGLISH) );
-
-InvalidValue[] validationMessages = addressValidator.getInvalidValues(address);</programlisting>
-
- <para>The first two lines prepare the Hibernate Validator for class
- checking. The first one relies upon the error messages embedded in
- Hibernate Validator (see <xref
- linkend="validator-defineconstraints-error" />), the second one uses a
- resource bundle for these messages. It is considered a good practice to
- execute these lines once and cache the validator instances.</para>
-
- <para>The third line actually validates the <literal>Address</literal>
- instance and returns an array of <literal>InvalidValue</literal>s. Your
- application logic will then be able to react to the failure.</para>
-
- <para>You can also check a particular property instead of the whole bean.
- This might be useful for property per property user interaction</para>
-
- <programlisting>ClassValidator addressValidator = new ClassValidator( Address.class, ResourceBundle.getBundle("messages", Locale.ENGLISH) );
-
-//only get city property invalid values
-InvalidValue[] validationMessages = addressValidator.getInvalidValues(address, "city");
-
-//only get potential city property invalid values
-InvalidValue[] validationMessages = addressValidator.getPotentialInvalidValues("city", "Paris")</programlisting>
- </section>
-
- <section>
<title>Presentation layer validation</title>
<para>When working with JSF and <productname>JBoss Seam</productname>, one
Modified: validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml
===================================================================
--- validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml 2009-09-04 12:30:03 UTC (rev 17479)
+++ validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml 2009-09-04 14:31:32 UTC (rev 17480)
@@ -633,17 +633,21 @@
<title>Using groups</title>
<para>Groups allow you to restrict the set of constraints applied during
- validation. This allows for example for wizard like validation where for
- each step only a specified subset of the defined constraints get
- validated. The groups targeted are passed as var-args parameters to
+ validation. This allows for example for wizard like validation where in
+ each step only a specified subset of constraints get validated. The groups
+ targeted are passed as var-args parameters to
<methodname>validate</methodname>,
<methodname>validateProperty</methodname> and
<methodname>validateValue</methodname>. When more than one group is
requested, the order in which the groups are evaluated is not
deterministic. If no group is specified the default group
<classname>javax.validation.Default</classname> is assumed. Let's have a
- look at a slightly extended <classname>Car</classname> with
- <classname>Driver</classname> example.</para>
+ look at an extended <classname>Car</classname> with
+ <classname>Driver</classname> example. First we have the class
+ <classname>Person</classname> which has a <classname>@NotNull
+ </classname>constraint on name. Since no group is specified for this
+ annoation its default groups is
+ <classname>javax.validation.Default</classname>.</para>
<para><example>
<title>Person</title>
@@ -658,7 +662,16 @@
// getters and setters ...
}</programlisting>
- </example><example>
+ </example>Next we have the class <classname>Driver</classname> extending
+ <classname>Person</classname>. Here we are adding the properties
+ <property>age</property> and <property>hasDrivingLicense</property>. In
+ order to drive you must be at least 18 (<classname>@Min(18)</classname>)
+ and you must have a driving license (<classname>@AssertTrue</classname>).
+ Both of consraints defined on these properties belong to the group
+ <classname>DriverChecks</classname>. As you can the group is just a simple
+ interface. Using interfaces makes the group feature type safe and allows
+ for easy refactoring. It also means that groups can inherit from each
+ other by simple class inheritance.<example>
<title>Driver</title>
<programlisting>public class Driver extends Person {
@@ -685,6 +698,17 @@
}
}</programlisting>
</example><example>
+ <title>The actual group interfaces</title>
+
+ <programlisting>public interface DriverChecks {
+}
+
+public interface CarChecks {
+}</programlisting>
+ </example>Last but not least we add the property
+ <property>passedVehicleInspection</property> to the
+ <classname>Car</classname> class indecating whether a car passed the road
+ worthy tests.<example>
<title>Car</title>
<programlisting>public class Car {
@@ -710,16 +734,17 @@
this.seatCount = seatCount;
}
}</programlisting>
- </example><example>
- <title>The actual group interfaces</title>
-
- <programlisting>public interface DriverChecks {
-}
-
-
-public interface CarChecks {
-}</programlisting>
- </example><example>
+ </example>Overall three different groups are used in our example.
+ <property>Person.name</property>, <property>Car.manufacturer</property>,
+ <property>Car.licenseplate</property> and
+ <property>Car.seatCount</property> all belong to the
+ <classname>Default</classname> group. <property>Driver.age</property> and
+ <property>Driver.hasDrivingLicense</property> belong to
+ <classname>DriverChecks</classname> and last but not least
+ <property>Car.passedVehicleInspection</property> belongs to the group
+ <classname>CarChecks</classname>. The following example shows how passing
+ different group combinations to the Validator.validate method result in
+ different validation results.<example>
<title>Drive away</title>
<programlisting>public class GroupTest {
@@ -774,6 +799,12 @@
some situations to control the order of constraints evaluation. There
are often scenarios where a preliminary set of constraints should be
evaluated prior to other constraints. ...</para>
+
+ <section>
+ <title>Redefining the default group sequence of a class</title>
+
+ <para></para>
+ </section>
</section>
</section>
@@ -849,7 +880,7 @@
the string representation of the max value according to the
<classname>BigDecimal</classname> string representation.</entry>
- <entry></entry>
+ <entry>none</entry>
</row>
<row>
@@ -869,7 +900,7 @@
the string representation of the min value according to the
<classname>BigDecimal</classname> string representation.</entry>
- <entry></entry>
+ <entry>none</entry>
</row>
<row>
16 years
Hibernate SVN: r17479 - in validator/trunk/hibernate-validator/src/main/docbook/en-US: images and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-09-04 08:30:03 -0400 (Fri, 04 Sep 2009)
New Revision: 17479
Added:
validator/trunk/hibernate-validator/src/main/docbook/en-US/images/validation-configuration-1.0.png
validator/trunk/hibernate-validator/src/main/docbook/en-US/images/validation-mapping-1.0.png
Modified:
validator/trunk/hibernate-validator/src/main/docbook/en-US/master.xml
validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml
validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/xmlconfiguration.xml
Log:
HV-220
Added: validator/trunk/hibernate-validator/src/main/docbook/en-US/images/validation-configuration-1.0.png
===================================================================
(Binary files differ)
Property changes on: validator/trunk/hibernate-validator/src/main/docbook/en-US/images/validation-configuration-1.0.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: validator/trunk/hibernate-validator/src/main/docbook/en-US/images/validation-mapping-1.0.png
===================================================================
(Binary files differ)
Property changes on: validator/trunk/hibernate-validator/src/main/docbook/en-US/images/validation-mapping-1.0.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: validator/trunk/hibernate-validator/src/main/docbook/en-US/master.xml
===================================================================
--- validator/trunk/hibernate-validator/src/main/docbook/en-US/master.xml 2009-09-04 07:39:20 UTC (rev 17478)
+++ validator/trunk/hibernate-validator/src/main/docbook/en-US/master.xml 2009-09-04 12:30:03 UTC (rev 17479)
@@ -41,18 +41,6 @@
<productnumber>&versionNumber;</productnumber>
- <issuenum>1</issuenum>
-
- <mediaobject>
- <imageobject role="fo">
- <imagedata align="center" fileref="hibernate_logo_a.png" />
- </imageobject>
-
- <imageobject role="html">
- <imagedata depth="3cm" fileref="hibernate_logo_a.png" />
- </imageobject>
- </mediaobject>
-
<copyright>
<year>©rightYear;</year>
@@ -103,4 +91,15 @@
<xi:include href="modules/integration.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+
+ <chapter>
+ <title>Further reading</title>
+
+ <para>Last but not least, a few pointers to further information. A great
+ source for examples is the Bean Validation TCK which can is available for
+ anonymous access in the Hibernate SVN repository - <ulink
+ url="https://svn.jboss.org/repos/hibernate/validator/trunk">https://svn.jboss.org/repos/hibernate/validator/trunk</ulink>.
+ Alternatively you can view the tests using fisheye and this url: <ulink
+ url="http://fisheye.jboss.org/browse/Hibernate/beanvalidation/trunk/validation...">http://fisheye.jboss.org/browse/Hibernate/beanvalidation/trunk/validation...</ulink>.</para>
+ </chapter>
</book>
Modified: validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml
===================================================================
--- validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml 2009-09-04 07:39:20 UTC (rev 17478)
+++ validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml 2009-09-04 12:30:03 UTC (rev 17479)
@@ -621,6 +621,12 @@
</tgroup>
</table>
</section>
+
+ <section>
+ <title>A word about message interpolation</title>
+
+ <para></para>
+ </section>
</section>
<section id="validator-usingvalidator-validationgroups" revision="1">
Modified: validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/xmlconfiguration.xml
===================================================================
--- validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/xmlconfiguration.xml 2009-09-04 07:39:20 UTC (rev 17478)
+++ validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/xmlconfiguration.xml 2009-09-04 12:30:03 UTC (rev 17479)
@@ -26,4 +26,41 @@
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<chapter id="validator-xmlconfiguration">
<title>XML configuration</title>
+
+ <section>
+ <title><filename>validation.xml</filename></title>
+
+ <para><mediaobject>
+ <imageobject role="fo">
+ <imagedata align="center" fileref="validation-configuration-1.0.png"
+ scalefit="1" />
+ </imageobject>
+
+ <imageobject role="html">
+ <imagedata depth="" fileref="validation-configuration-1.0.png"
+ scalefit="1" />
+ </imageobject>
+
+ <caption><para>Model view
+ validation-configuration-1.0.xsd</para></caption>
+ </mediaobject></para>
+ </section>
+
+ <section>
+ <title>Constraints mapped in XML</title>
+
+ <para><mediaobject>
+ <imageobject role="fo">
+ <imagedata align="center" fileref="validation-mapping-1.0.png"
+ scalefit="1" />
+ </imageobject>
+
+ <imageobject role="html">
+ <imagedata depth="" fileref="validation-mapping-1.0.png"
+ scalefit="1" />
+ </imageobject>
+
+ <caption><para>Model view validation-mapping-1.0.xsd</para></caption>
+ </mediaobject></para>
+ </section>
</chapter>
16 years
Hibernate SVN: r17478 - validator/trunk/hibernate-validator/src/main/docbook/en-US/modules.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-09-04 03:39:20 -0400 (Fri, 04 Sep 2009)
New Revision: 17478
Modified:
validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml
Log:
HV-220
Modified: validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml
===================================================================
--- validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml 2009-09-03 14:29:22 UTC (rev 17477)
+++ validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml 2009-09-04 07:39:20 UTC (rev 17478)
@@ -705,6 +705,15 @@
}
}</programlisting>
</example><example>
+ <title>The actual group interfaces</title>
+
+ <programlisting>public interface DriverChecks {
+}
+
+
+public interface CarChecks {
+}</programlisting>
+ </example><example>
<title>Drive away</title>
<programlisting>public class GroupTest {
16 years
Hibernate SVN: r17477 - in validator/trunk/hibernate-validator-archetype/src: test/java/org/hibernate/validator/quickstart and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-09-03 10:29:22 -0400 (Thu, 03 Sep 2009)
New Revision: 17477
Added:
validator/trunk/hibernate-validator-archetype/src/main/java/org/hibernate/validator/quickstart/CarChecks.java
validator/trunk/hibernate-validator-archetype/src/main/java/org/hibernate/validator/quickstart/Driver.java
validator/trunk/hibernate-validator-archetype/src/main/java/org/hibernate/validator/quickstart/DriverChecks.java
validator/trunk/hibernate-validator-archetype/src/main/java/org/hibernate/validator/quickstart/Person.java
validator/trunk/hibernate-validator-archetype/src/test/java/org/hibernate/validator/quickstart/BootstrapTest.java
validator/trunk/hibernate-validator-archetype/src/test/java/org/hibernate/validator/quickstart/GroupTest.java
Modified:
validator/trunk/hibernate-validator-archetype/src/main/java/org/hibernate/validator/quickstart/Car.java
validator/trunk/hibernate-validator-archetype/src/test/java/org/hibernate/validator/quickstart/CarTest.java
Log:
HV-220 - some more test for the archetype and the documentation
Modified: validator/trunk/hibernate-validator-archetype/src/main/java/org/hibernate/validator/quickstart/Car.java
===================================================================
--- validator/trunk/hibernate-validator-archetype/src/main/java/org/hibernate/validator/quickstart/Car.java 2009-09-03 14:28:08 UTC (rev 17476)
+++ validator/trunk/hibernate-validator-archetype/src/main/java/org/hibernate/validator/quickstart/Car.java 2009-09-03 14:29:22 UTC (rev 17477)
@@ -13,20 +13,23 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.hibernate.validator.quickstart;
+import javax.validation.Valid;
+import javax.validation.constraints.AssertTrue;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
/**
- * An exemplary model class, which is enriched with constraint annotations from
+ * An example entity class enriched with constraint annotations from
* the Bean Validation API (<a href="http://jcp.org/en/jsr/detail?id=303">JSR
- * 303</a>). Have a look at {@link CarTest} to learn, how the Bean Validation
- * API can be used to validate Car instances.
- *
+ * 303</a>). Have a look at {@link org.hibernate.validator.quickstart.CarTest} to learn, how the Bean Validation
+ * API can be used to validate {@code Car} instances.
+ *
* @author Gunnar Morling
+ * @author Hardy Ferentschik
*/
public class Car {
@@ -34,30 +37,35 @@
* By annotating the field with @NotNull we specify, that null is not a valid
* value.
*/
- @NotNull
- private String manufacturer;
+ @NotNull
+ private String manufacturer;
- /**
- * This String field shall not only not allowed to be null, it shall also between
- * 2 and 14 characters long.
- */
- @NotNull
- @Size(min = 2, max = 14)
- private String licensePlate;
+ /**
+ * This String field shall not only not allowed to be null, it shall also between
+ * 2 and 14 characters long.
+ */
+ @NotNull
+ @Size(min = 2, max = 14)
+ private String licensePlate;
- /**
- * This int field shall have a value of at least 2.
- */
- @Min(2)
- private int seatCount;
-
- public Car(String manufacturer, String licencePlate, int seatCount) {
+ /**
+ * This int field shall have a value of at least 2.
+ */
+ @Min(2)
+ private int seatCount;
- this.manufacturer = manufacturer;
- this.licensePlate = licencePlate;
- this.seatCount = seatCount;
- }
+ @AssertTrue(message = "The car has to pass the vehicle inspection first", groups = CarChecks.class)
+ private boolean passedVehicleInspection;
+ @Valid
+ private Driver driver;
+
+ public Car(String manufacturer, String licencePlate, int seatCount) {
+ this.manufacturer = manufacturer;
+ this.licensePlate = licencePlate;
+ this.seatCount = seatCount;
+ }
+
public String getManufacturer() {
return manufacturer;
}
@@ -82,4 +90,19 @@
this.seatCount = seatCount;
}
+ public boolean getPassedVehicleInspection() {
+ return passedVehicleInspection;
+ }
+
+ public void setPassedVehicleInspection(boolean passed) {
+ this.passedVehicleInspection = passed;
+ }
+
+ public Driver getDriver() {
+ return driver;
+ }
+
+ public void setDriver(Driver driver) {
+ this.driver = driver;
+ }
}
\ No newline at end of file
Added: validator/trunk/hibernate-validator-archetype/src/main/java/org/hibernate/validator/quickstart/CarChecks.java
===================================================================
--- validator/trunk/hibernate-validator-archetype/src/main/java/org/hibernate/validator/quickstart/CarChecks.java (rev 0)
+++ validator/trunk/hibernate-validator-archetype/src/main/java/org/hibernate/validator/quickstart/CarChecks.java 2009-09-03 14:29:22 UTC (rev 17477)
@@ -0,0 +1,24 @@
+// $Id:$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validator.quickstart;
+
+/**
+ * @author Hardy Ferentschik
+ */
+public interface CarChecks {
+}
Property changes on: validator/trunk/hibernate-validator-archetype/src/main/java/org/hibernate/validator/quickstart/CarChecks.java
___________________________________________________________________
Name: svn:keywords
+ Id
Added: validator/trunk/hibernate-validator-archetype/src/main/java/org/hibernate/validator/quickstart/Driver.java
===================================================================
--- validator/trunk/hibernate-validator-archetype/src/main/java/org/hibernate/validator/quickstart/Driver.java (rev 0)
+++ validator/trunk/hibernate-validator-archetype/src/main/java/org/hibernate/validator/quickstart/Driver.java 2009-09-03 14:29:22 UTC (rev 17477)
@@ -0,0 +1,48 @@
+// $Id:$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validator.quickstart;
+
+import javax.validation.constraints.AssertTrue;
+import javax.validation.constraints.Min;
+
+/**
+ * @author Hardy Ferentschik
+ */
+public class Driver extends Person {
+ @Min(value = 18, message = "You have to be 18 to drive a car", groups = DriverChecks.class)
+ public int age;
+
+ @AssertTrue(message = "You first have to pass the driving test", groups = DriverChecks.class)
+ public boolean hasDrivingLicense;
+
+ public Driver(String name) {
+ super( name );
+ }
+
+ public void passedDrivingTest(boolean b) {
+ hasDrivingLicense = b;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+}
Property changes on: validator/trunk/hibernate-validator-archetype/src/main/java/org/hibernate/validator/quickstart/Driver.java
___________________________________________________________________
Name: svn:keywords
+ Id
Added: validator/trunk/hibernate-validator-archetype/src/main/java/org/hibernate/validator/quickstart/DriverChecks.java
===================================================================
--- validator/trunk/hibernate-validator-archetype/src/main/java/org/hibernate/validator/quickstart/DriverChecks.java (rev 0)
+++ validator/trunk/hibernate-validator-archetype/src/main/java/org/hibernate/validator/quickstart/DriverChecks.java 2009-09-03 14:29:22 UTC (rev 17477)
@@ -0,0 +1,24 @@
+// $Id:$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validator.quickstart;
+
+/**
+ * @author Hardy Ferentschik
+ */
+public interface DriverChecks {
+}
Property changes on: validator/trunk/hibernate-validator-archetype/src/main/java/org/hibernate/validator/quickstart/DriverChecks.java
___________________________________________________________________
Name: svn:keywords
+ Id
Added: validator/trunk/hibernate-validator-archetype/src/main/java/org/hibernate/validator/quickstart/Person.java
===================================================================
--- validator/trunk/hibernate-validator-archetype/src/main/java/org/hibernate/validator/quickstart/Person.java (rev 0)
+++ validator/trunk/hibernate-validator-archetype/src/main/java/org/hibernate/validator/quickstart/Person.java 2009-09-03 14:29:22 UTC (rev 17477)
@@ -0,0 +1,42 @@
+// $Id:$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.validator.quickstart;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author Hardy Ferentschik
+ */
+public class Person {
+ @NotNull
+ private String name;
+
+ public Person(String name) {
+ super();
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
+
Property changes on: validator/trunk/hibernate-validator-archetype/src/main/java/org/hibernate/validator/quickstart/Person.java
___________________________________________________________________
Name: svn:keywords
+ Id
Copied: validator/trunk/hibernate-validator-archetype/src/test/java/org/hibernate/validator/quickstart/BootstrapTest.java (from rev 17471, validator/trunk/hibernate-validator-archetype/src/test/java/org/hibernate/validator/quickstart/CarTest.java)
===================================================================
--- validator/trunk/hibernate-validator-archetype/src/test/java/org/hibernate/validator/quickstart/BootstrapTest.java (rev 0)
+++ validator/trunk/hibernate-validator-archetype/src/test/java/org/hibernate/validator/quickstart/BootstrapTest.java 2009-09-03 14:29:22 UTC (rev 17477)
@@ -0,0 +1,106 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.hibernate.validator.quickstart;
+
+import java.lang.annotation.ElementType;
+import java.util.Locale;
+import javax.validation.Configuration;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorFactory;
+import javax.validation.MessageInterpolator;
+import javax.validation.Path;
+import javax.validation.TraversableResolver;
+import javax.validation.Validation;
+import javax.validation.Validator;
+import javax.validation.ValidatorFactory;
+
+import static org.junit.Assert.assertNotNull;
+import org.junit.Test;
+
+import org.hibernate.validator.HibernateValidator;
+import org.hibernate.validator.engine.ValidatorConfiguration;
+
+/**
+ * A module test that shows the different bootstrap possibilities of Hibernate Validator.
+ *
+ * @author Hardy Ferentschik
+ */
+public class BootstrapTest {
+
+ @Test
+ public void testBuildDefaultValidatorFactory() {
+ ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
+ Validator validator = factory.getValidator();
+
+ assertNotNull( validator );
+ }
+
+ @Test
+ public void testByDefaultProvider() {
+ Configuration<?> config = Validation.byDefaultProvider().configure();
+ config.messageInterpolator( new MyMessageInterpolator() )
+ .traversableResolver( new MyTraversableResolver() )
+ .constraintValidatorFactory( new MyConstraintValidatorFactory() );
+
+ ValidatorFactory factory = config.buildValidatorFactory();
+ Validator validator = factory.getValidator();
+
+ assertNotNull( validator );
+ }
+
+ @Test
+ public void testByProvider() {
+ ValidatorConfiguration config = Validation.byProvider( HibernateValidator.class ).configure();
+ config.messageInterpolator( new MyMessageInterpolator() )
+ .traversableResolver( new MyTraversableResolver() )
+ .constraintValidatorFactory( new MyConstraintValidatorFactory() );
+
+ ValidatorFactory factory = config.buildValidatorFactory();
+ Validator validator = factory.getValidator();
+
+ assertNotNull( validator );
+ }
+
+ public class MyMessageInterpolator implements MessageInterpolator {
+
+ public String interpolate(String messageTemplate, Context context) {
+ return null;
+ }
+
+ public String interpolate(String messageTemplate, Context context, Locale locale) {
+ return null;
+ }
+ }
+
+ public class MyTraversableResolver implements TraversableResolver {
+
+ public boolean isReachable(Object traversableObject, Path.Node traversableProperty, Class<?> rootBeanType, Path pathToTraversableObject, ElementType elementType) {
+ return true;
+ }
+
+ public boolean isCascadable(Object traversableObject, Path.Node traversableProperty, Class<?> rootBeanType, Path pathToTraversableObject, ElementType elementType) {
+ return true;
+ }
+ }
+
+ public class MyConstraintValidatorFactory implements ConstraintValidatorFactory {
+
+ public <T extends ConstraintValidator<?, ?>> T getInstance(Class<T> key) {
+ return null;
+ }
+ }
+}
\ No newline at end of file
Modified: validator/trunk/hibernate-validator-archetype/src/test/java/org/hibernate/validator/quickstart/CarTest.java
===================================================================
--- validator/trunk/hibernate-validator-archetype/src/test/java/org/hibernate/validator/quickstart/CarTest.java 2009-09-03 14:28:08 UTC (rev 17476)
+++ validator/trunk/hibernate-validator-archetype/src/test/java/org/hibernate/validator/quickstart/CarTest.java 2009-09-03 14:29:22 UTC (rev 17477)
@@ -13,18 +13,16 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.hibernate.validator.quickstart;
-import static org.junit.Assert.*;
-
import java.util.Set;
-
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;
+import static org.junit.Assert.assertEquals;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -43,8 +41,9 @@
* In case the object in question could be validated successfully this set will
* be empty.
* </p>
- *
+ *
* @author Gunnar Morling
+ * @author Hardy Ferentschik
*/
public class CarTest {
@@ -52,80 +51,69 @@
* The validator to be used for object validation. Will be retrieved once
* for all test methods.
*/
- private static Validator validator;
+ private static Validator validator;
- /**
- * Retrieves the validator instance.
- */
- @BeforeClass
- public static void setUp() {
- ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
- validator = factory.getValidator();
- }
+ /**
+ * Retrieves the validator instance.
+ */
+ @BeforeClass
+ public static void setUp() {
+ ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
+ validator = factory.getValidator();
+ }
- /**
+ /**
* One constraint violation due to the manufacturer field being null
* expected.
*/
- @Test
- public void manufacturerIsNull() {
+ @Test
+ public void manufacturerIsNull() {
+ Car car = new Car( null, "DD-AB-123", 4 );
- Car car = new Car(null, "DD-AB-123", 4);
+ Set<ConstraintViolation<Car>> constraintViolations = validator.validate( car );
- Set<ConstraintViolation<Car>> constraintViolations =
- validator.validate(car);
+ assertEquals( 1, constraintViolations.size() );
+ assertEquals( "may not be null", constraintViolations.iterator().next().getMessage() );
+ }
- assertEquals(1, constraintViolations.size());
- assertEquals(
- "may not be null", constraintViolations.iterator().next().getMessage());
- }
-
- /**
+ /**
* One constraint violation due to the licensePlate field being too short
* expected.
*/
- @Test
- public void licensePlateTooShort() {
+ @Test
+ public void licensePlateTooShort() {
+ Car car = new Car( "Morris", "D", 4 );
- Car car = new Car("Morris", "D", 4);
+ Set<ConstraintViolation<Car>> constraintViolations = validator.validate( car );
- Set<ConstraintViolation<Car>> constraintViolations =
- validator.validate(car);
+ assertEquals( 1, constraintViolations.size() );
+ assertEquals( "size must be between 2 and 14", constraintViolations.iterator().next().getMessage() );
+ }
- assertEquals(1, constraintViolations.size());
- assertEquals(
- "size must be between 2 and 14", constraintViolations.iterator().next().getMessage());
- }
-
- /**
+ /**
* One constraint violation due to the seatCount field being too low
* expected.
*/
- @Test
- public void seatCountTooLow() {
+ @Test
+ public void seatCountTooLow() {
+ Car car = new Car( "Morris", "DD-AB-123", 1 );
- Car car = new Car("Morris", "DD-AB-123", 1);
+ Set<ConstraintViolation<Car>> constraintViolations = validator.validate( car );
- Set<ConstraintViolation<Car>> constraintViolations =
- validator.validate(car);
+ assertEquals( 1, constraintViolations.size() );
+ assertEquals( "must be greater than or equal to 2", constraintViolations.iterator().next().getMessage() );
+ }
- assertEquals(1, constraintViolations.size());
- assertEquals(
- "must be greater than or equal to 2", constraintViolations.iterator().next().getMessage());
- }
-
- /**
+ /**
* No constraint violation expected, as all fields of the validated Car
* instance have proper values.
*/
- @Test
- public void carIsValid() {
+ @Test
+ public void carIsValid() {
+ Car car = new Car( "Morris", "DD-AB-123", 2 );
- Car car = new Car("Morris", "DD-AB-123", 2);
+ Set<ConstraintViolation<Car>> constraintViolations = validator.validate( car );
- Set<ConstraintViolation<Car>> constraintViolations =
- validator.validate(car);
-
- assertEquals(0, constraintViolations.size());
- }
+ assertEquals( 0, constraintViolations.size() );
+ }
}
\ No newline at end of file
Copied: validator/trunk/hibernate-validator-archetype/src/test/java/org/hibernate/validator/quickstart/GroupTest.java (from rev 17471, validator/trunk/hibernate-validator-archetype/src/test/java/org/hibernate/validator/quickstart/CarTest.java)
===================================================================
--- validator/trunk/hibernate-validator-archetype/src/test/java/org/hibernate/validator/quickstart/GroupTest.java (rev 0)
+++ validator/trunk/hibernate-validator-archetype/src/test/java/org/hibernate/validator/quickstart/GroupTest.java 2009-09-03 14:29:22 UTC (rev 17477)
@@ -0,0 +1,79 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.hibernate.validator.quickstart;
+
+import java.util.Set;
+import javax.validation.ConstraintViolation;
+import javax.validation.Validation;
+import javax.validation.Validator;
+import javax.validation.ValidatorFactory;
+import javax.validation.groups.Default;
+
+import static org.junit.Assert.assertEquals;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * A module test that shows how to use the grouping functionality of Bean Validation.
+ *
+ * @author Hardy Ferentschik
+ */
+public class GroupTest {
+
+
+ private static Validator validator;
+
+ @BeforeClass
+ public static void setUp() {
+ ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
+ validator = factory.getValidator();
+ }
+
+ @Test
+ public void driveAway() {
+ // create a car and check that everything is ok with it.
+ Car car = new Car( "Morris", "DD-AB-123", 2 );
+ Set<ConstraintViolation<Car>> constraintViolations = validator.validate( car );
+ assertEquals( 0, constraintViolations.size() );
+
+ // but has it passed the vehicle inspection?
+ constraintViolations = validator.validate( car, CarChecks.class );
+ assertEquals( 1, constraintViolations.size() );
+ assertEquals(
+ "The car has to pass the vehicle inspection first", constraintViolations.iterator().next().getMessage()
+ );
+
+ // let's go to the vehicle inspection
+ car.setPassedVehicleInspection( true );
+ assertEquals( 0, validator.validate( car ).size() );
+
+ // now let's add a driver. He is 18, but has not passed the driving test yet
+ Driver john = new Driver( "John Doe" );
+ john.setAge( 18 );
+ car.setDriver( john );
+ constraintViolations = validator.validate( car, DriverChecks.class );
+ assertEquals( 1, constraintViolations.size() );
+ assertEquals( "You first have to pass the driving test", constraintViolations.iterator().next().getMessage() );
+
+ // ok, John passes the test
+ john.passedDrivingTest( true );
+ assertEquals( 0, validator.validate( car, DriverChecks.class ).size() );
+
+ // just checking that everything is in order now
+ assertEquals( 0, validator.validate( car, Default.class, CarChecks.class, DriverChecks.class ).size() );
+ }
+}
\ No newline at end of file
16 years
Hibernate SVN: r17476 - validator/trunk/hibernate-validator/src/main/docbook/en-US/modules.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-09-03 10:28:08 -0400 (Thu, 03 Sep 2009)
New Revision: 17476
Modified:
validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml
Log:
HV-220
Modified: validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml
===================================================================
--- validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml 2009-09-03 14:27:32 UTC (rev 17475)
+++ validator/trunk/hibernate-validator/src/main/docbook/en-US/modules/usingvalidator.xml 2009-09-03 14:28:08 UTC (rev 17476)
@@ -278,7 +278,7 @@
public class Person {
- @NotNull
+ <emphasis role="bold">@NotNull</emphasis>
private String name;
public Person(String name) {
@@ -306,8 +306,8 @@
public class Car {
- @NotNull
- @Valid
+ <emphasis role="bold">@NotNull</emphasis>
+ <emphasis role="bold">@Valid</emphasis>
private Person driver;
public Car(Person driver) {
@@ -407,18 +407,26 @@
<classname>ValidatorFactory</classname>. The by far easiest way is to
use the static
<methodname>Validation.buildDefaultValidatorFactory()</methodname>
- method:<programlisting>ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
-Validator validator = factory.getValidator();</programlisting>You can also use
- the method <methodname>Validation.byDefaultProvider()</methodname> which
- will allow you to configure several aspects of the created Validator
- instance:<programlisting>Configuration<?> config = Validation.byDefaultProvider().configure();
+ method:<example>
+ <title>Validation.buildDefaultValidatorFactory()</title>
+
+ <programlisting>ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
+Validator validator = factory.getValidator();</programlisting>
+ </example>You can also use the method
+ <methodname>Validation.byDefaultProvider()</methodname> which will allow
+ you to configure several aspects of the created Validator
+ instance:<example>
+ <title>Validation.byDefaultProvider()</title>
+
+ <programlisting>Configuration<?> config = Validation.byDefaultProvider().configure();
config.messageInterpolator(new MyMessageInterpolator())
.traversableResolver( new MyTraversableResolver())
.constraintValidatorFactory(new MyConstraintValidatorFactory());
ValidatorFactory factory = config.buildValidatorFactory();
Validator validator = factory.getValidator();
-</programlisting>We will learn more about
+</programlisting>
+ </example>We will learn more about
<classname>MessageInterpolator</classname> and
<classname>TraversableResolver</classname> in later chapters.</para>
@@ -426,14 +434,17 @@
specific Bean Validation provider. This is useful if you have more than
one Bean Validation provider in your classpath. In this situation you
can make an explicit choice about which implementation to use. In the
- case of Hibernate Validator the Validator creation looks
- like:<programlisting>ValidatorConfiguration configuration = Validation.byProvider( HibernateValidator.class )
+ case of Hibernate Validator the Validator creation looks like:<example>
+ <title>Validation.byProvider( HibernateValidator.class )</title>
+
+ <programlisting>ValidatorConfiguration config = Validation.byProvider( HibernateValidator.class ).configure;
config.messageInterpolator(new MyMessageInterpolator())
.traversableResolver( new MyTraversableResolver())
.constraintValidatorFactory(new MyConstraintValidatorFactory());
ValidatorFactory factory = config.buildValidatorFactory();
-Validator validator = factory.getValidator();</programlisting></para>
+Validator validator = factory.getValidator();</programlisting>
+ </example></para>
<para><note>
<para>The generated <classname>Validator</classname> instance is
@@ -505,11 +516,10 @@
assertEquals(1, constraintViolations.size());
assertEquals("may not be null", constraintViolations.iterator().next().getMessage());</programlisting>
+ </example>
- <para><methodname>Validator.validateProperty</methodname> is for
- example used in the integration of Bean Validation into JSF
- 2.</para>
- </example>
+ <para><methodname>Validator.validateProperty</methodname> is for
+ example used in the integration of Bean Validation into JSF 2.</para>
</section>
<section>
@@ -529,9 +539,9 @@
assertEquals(1, constraintViolations.size());
assertEquals("may not be null", constraintViolations.iterator().next().getMessage());</programlisting>
+ </example>
- <para>@Valid is not honored by this method.</para>
- </example>
+ <para>@Valid is not honored by this method.</para>
</section>
</section>
@@ -549,13 +559,15 @@
methods</title>
<tgroup cols="2">
- <tbody>
+ <thead>
<row>
<entry>Method</entry>
<entry>Usage</entry>
</row>
+ </thead>
+ <tbody>
<row>
<entry><methodname>getMessage()</methodname></entry>
@@ -616,19 +628,137 @@
<para>Groups allow you to restrict the set of constraints applied during
validation. This allows for example for wizard like validation where for
- each step of the wizard only a specified subset of all defined constraints
- get validated. The groups targeted are passed as var-args parameters to
+ each step only a specified subset of the defined constraints get
+ validated. The groups targeted are passed as var-args parameters to
<methodname>validate</methodname>,
<methodname>validateProperty</methodname> and
- <methodname>validateValue</methodname>. All constraints belonging to the
- targeted group are applied during the Section 3.5. When more than one
- group is requested, the order in which the groups are evaluated is not
- deterministic.</para>
+ <methodname>validateValue</methodname>. When more than one group is
+ requested, the order in which the groups are evaluated is not
+ deterministic. If no group is specified the default group
+ <classname>javax.validation.Default</classname> is assumed. Let's have a
+ look at a slightly extended <classname>Car</classname> with
+ <classname>Driver</classname> example.</para>
+ <para><example>
+ <title>Person</title>
+
+ <programlisting>public class Person {
+ @NotNull
+ private String name;
+
+ public Person(String name) {
+ this.name = name;
+ }
+
+ // getters and setters ...
+}</programlisting>
+ </example><example>
+ <title>Driver</title>
+
+ <programlisting>public class Driver extends Person {
+ <emphasis role="bold">@Min(value = 18, message = "You have to be 18 to drive a car", groups = DriverChecks.class)</emphasis>
+ public int age;
+
+ <emphasis role="bold">@AssertTrue(message = "You first have to pass the driving test", groups = DriverChecks.class)</emphasis>
+ public boolean hasDrivingLicense;
+
+ public Driver(String name) {
+ super( name );
+ }
+
+ public void passedDrivingTest(boolean b) {
+ hasDrivingLicense = b;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+}</programlisting>
+ </example><example>
+ <title>Car</title>
+
+ <programlisting>public class Car {
+ @NotNull
+ private String manufacturer;
+
+ @NotNull
+ @Size(min = 2, max = 14)
+ private String licensePlate;
+
+ @Min(2)
+ private int seatCount;
+
+ <emphasis role="bold">@AssertTrue(message = "The car has to pass the vehicle inspection first", groups = CarChecks.class)</emphasis>
+ private boolean passedVehicleInspection;
+
+ <emphasis role="bold">@Valid</emphasis>
+ private Driver driver;
+
+ public Car(String manufacturer, String licencePlate, int seatCount) {
+ this.manufacturer = manufacturer;
+ this.licensePlate = licencePlate;
+ this.seatCount = seatCount;
+ }
+}</programlisting>
+ </example><example>
+ <title>Drive away</title>
+
+ <programlisting>public class GroupTest {
+
+ private static Validator validator;
+
+ @BeforeClass
+ public static void setUp() {
+ ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
+ validator = factory.getValidator();
+ }
+
+ @Test
+ public void driveAway() {
+ // create a car and check that everything is ok with it.
+ Car car = new Car( "Morris", "DD-AB-123", 2 );
+ Set<ConstraintViolation<Car>> constraintViolations = validator.validate( car );
+ assertEquals( 0, constraintViolations.size() );
+
+ // but has it passed the vehicle inspection?
+ constraintViolations = validator.validate( car, CarChecks.class );
+ assertEquals( 1, constraintViolations.size() );
+ assertEquals("The car has to pass the vehicle inspection first", constraintViolations.iterator().next().getMessage());
+
+ // let's go to the vehicle inspection
+ car.setPassedVehicleInspection( true );
+ assertEquals( 0, validator.validate( car ).size() );
+
+ // now let's add a driver. He is 18, but has not passed the driving test yet
+ Driver john = new Driver( "John Doe" );
+ john.setAge( 18 );
+ car.setDriver( john );
+ constraintViolations = validator.validate( car, DriverChecks.class );
+ assertEquals( 1, constraintViolations.size() );
+ assertEquals( "You first have to pass the driving test", constraintViolations.iterator().next().getMessage() );
+
+ // ok, John passes the test
+ john.passedDrivingTest( true );
+ assertEquals( 0, validator.validate( car, DriverChecks.class ).size() );
+
+ // just checking that everything is in order now
+ assertEquals( 0, validator.validate( car, Default.class, CarChecks.class, DriverChecks.class ).size() );
+ }
+}</programlisting>
+ </example></para>
+
<section revision="1">
<title>Group sequences</title>
- <para></para>
+ <para>By default, constraints are evaluated in no particular order and
+ this regardless of which groups they belong to. It is however useful in
+ some situations to control the order of constraints evaluation. There
+ are often scenarios where a preliminary set of constraints should be
+ evaluated prior to other constraints. ...</para>
</section>
</section>
@@ -636,11 +766,11 @@
<title>Built-in constraints</title>
<para>Hibernate Validator implements all of the constraints specified in
- Bean Validation and also includes some custom constraints. As we'll see
- later, you're not limited to them, you can literally in a minute write
- your own constraints.</para>
+ Bean Validation as well as some custom constraints. <xref
+ linkend="table-builtin-constraints" /> list all built-in constraints
+ available in Hibernate Validator.</para>
- <table>
+ <table id="table-builtin-constraints">
<title>Built-in constraints</title>
<tgroup cols="5">
@@ -666,7 +796,7 @@
<entry>yes</entry>
- <entry>field/property</entry>
+ <entry>field/propertyß</entry>
<entry>check that the annotated element is
<constant>false</constant>.</entry>
@@ -688,7 +818,7 @@
</row>
<row>
- <entry>@DecimalMax(value=)</entry>
+ <entry>@DecimalMax</entry>
<entry>yes</entry>
@@ -704,11 +834,11 @@
the string representation of the max value according to the
<classname>BigDecimal</classname> string representation.</entry>
- <entry>?</entry>
+ <entry></entry>
</row>
<row>
- <entry>@DecimalMin(value=)</entry>
+ <entry>@DecimalMin</entry>
<entry>yes</entry>
@@ -724,7 +854,7 @@
the string representation of the min value according to the
<classname>BigDecimal</classname> string representation.</entry>
- <entry>?</entry>
+ <entry></entry>
</row>
<row>
@@ -775,7 +905,7 @@
</row>
<row>
- <entry>@Max(value=)</entry>
+ <entry>@Max</entry>
<entry>yes</entry>
@@ -793,7 +923,7 @@
</row>
<row>
- <entry>@Min(value=)</entry>
+ <entry>@Min</entry>
<entry>yes</entry>
@@ -894,5 +1024,17 @@
</tbody>
</tgroup>
</table>
+
+ <note>
+ <para>On top of the parameters indicated in <xref
+ linkend="table-builtin-constraints" /> each constraint supports the
+ parameters <parameter>message</parameter>, <parameter>groups</parameter>
+ and <parameter>payload</parameter>.</para>
+ </note>
+
+ <para>In some cases these built-in constraints will not fulfill your
+ requirements. In this case you can literally in a minute write your own
+ constraints. We will discuss this in <xref
+ linkend="validator-customconstraints" /></para>
</section>
</chapter>
16 years
Hibernate SVN: r17475 - in validator/trunk/hibernate-validator/src: test/java/org/hibernate/validator/constraints and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-09-03 10:27:32 -0400 (Thu, 03 Sep 2009)
New Revision: 17475
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/xml/ValidationXmlParser.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/Coordinate.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/PostCodeList.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/Suburb.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/ValidatorResolutionTest.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/xml/Customer.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/xml/Person.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/xml/XmlMappingTest.java
Log:
svn:keywords
Fixed some typos
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/xml/ValidationXmlParser.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/xml/ValidationXmlParser.java 2009-09-03 13:06:31 UTC (rev 17474)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validator/xml/ValidationXmlParser.java 2009-09-03 14:27:32 UTC (rev 17475)
@@ -36,12 +36,10 @@
import org.slf4j.Logger;
import org.xml.sax.SAXException;
+import org.hibernate.validator.util.GetClassLoader;
+import org.hibernate.validator.util.LoadClass;
import org.hibernate.validator.util.LoggerFactory;
import org.hibernate.validator.util.NewInstance;
-import org.hibernate.validator.util.GetClassLoader;
-import org.hibernate.validator.util.LoadClass;
-import org.hibernate.validator.xml.PropertyType;
-import org.hibernate.validator.xml.ValidationConfigType;
/**
* Parser for <i>validation.xml</i> using JAXB.
@@ -64,7 +62,7 @@
ValidationConfigType config = getValidationConfig();
ValidationBootstrapParameters xmlParameters = new ValidationBootstrapParameters();
if ( config != null ) {
- // collect the paramters from the xml file
+ // collect the parameters from the xml file
setProviderClassFromXml( config, xmlParameters );
setMessageInterpolatorFromXml( config, xmlParameters );
setTraversableResolverFromXml( config, xmlParameters );
@@ -83,7 +81,9 @@
Class<ConstraintValidatorFactory> clazz = ( Class<ConstraintValidatorFactory> ) loadClass(
constraintFactoryClass, this.getClass()
);
- NewInstance<ConstraintValidatorFactory> newInstance = NewInstance.action( clazz, "constraint factory class" );
+ NewInstance<ConstraintValidatorFactory> newInstance = NewInstance.action(
+ clazz, "constraint factory class"
+ );
if ( System.getSecurityManager() != null ) {
xmlParameters.constraintValidatorFactory = AccessController.doPrivileged( newInstance );
}
@@ -102,7 +102,7 @@
private Class<?> loadClass(String className, Class<?> caller) {
LoadClass action = LoadClass.action( className, caller );
- if (System.getSecurityManager() != null) {
+ if ( System.getSecurityManager() != null ) {
return AccessController.doPrivileged( action );
}
else {
@@ -252,9 +252,9 @@
GetClassLoader action = GetClassLoader.fromContext();
ClassLoader loader = isSecured ? AccessController.doPrivileged( action ) : action.run();
- if (loader == null) {
- log.debug( "No default context class loader, fallbacking to Bean Validation's loader" );
- action = GetClassLoader.fromClass(ValidationXmlParser.class);
+ if ( loader == null ) {
+ log.debug( "No default context class loader, fall back to Bean Validation's loader" );
+ action = GetClassLoader.fromClass( ValidationXmlParser.class );
loader = isSecured ? AccessController.doPrivileged( action ) : action.run();
isContextCL = false;
}
@@ -262,7 +262,7 @@
// try the current class loader
if ( isContextCL && inputStream == null ) {
- action = GetClassLoader.fromClass(ValidationXmlParser.class);
+ action = GetClassLoader.fromClass( ValidationXmlParser.class );
loader = isSecured ? AccessController.doPrivileged( action ) : action.run();
inputStream = loader.getResourceAsStream( path );
}
Property changes on: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/Coordinate.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/PostCodeList.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/Suburb.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/constraints/ValidatorResolutionTest.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/xml/Customer.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/xml/Customer.java 2009-09-03 13:06:31 UTC (rev 17474)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/xml/Customer.java 2009-09-03 14:27:32 UTC (rev 17475)
@@ -1,4 +1,4 @@
-// $Id: Order.java 17421 2009-08-26 12:25:39Z hardy.ferentschik $
+// $Id$
/*
* JBoss, Home of Professional Open Source
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
Property changes on: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/xml/Customer.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/xml/Person.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/xml/Person.java 2009-09-03 13:06:31 UTC (rev 17474)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/xml/Person.java 2009-09-03 14:27:32 UTC (rev 17475)
@@ -1,4 +1,4 @@
-// $Id: Order.java 17421 2009-08-26 12:25:39Z hardy.ferentschik $
+// $Id$
/*
* JBoss, Home of Professional Open Source
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
Property changes on: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/xml/Person.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/xml/XmlMappingTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/xml/XmlMappingTest.java 2009-09-03 13:06:31 UTC (rev 17474)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/xml/XmlMappingTest.java 2009-09-03 14:27:32 UTC (rev 17475)
@@ -1,4 +1,4 @@
-// $Id: Order.java 17421 2009-08-26 12:25:39Z hardy.ferentschik $
+// $Id$
/*
* JBoss, Home of Professional Open Source
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
Property changes on: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validator/xml/XmlMappingTest.java
___________________________________________________________________
Name: svn:keywords
+ Id
16 years