Removed client-side validation from 2.3m1 branch. Client side validation is
not yet ready for general usage.
git-svn-id: https://google-web-toolkit.googlecode.com/svn/releases/2.3@9875 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/eclipse/samples/Validation/.checkstyle b/eclipse/samples/Validation/.checkstyle
deleted file mode 100644
index 0f1cbd9..0000000
--- a/eclipse/samples/Validation/.checkstyle
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<fileset-config file-format-version="1.2.0" simple-config="true">
- <fileset name="all" enabled="true" check-config-name="GWT Checks" local="false">
- <file-match-pattern match-pattern="." include-pattern="true"/>
- </fileset>
- <filter name="NonSrcDirs" enabled="true"/>
-</fileset-config>
diff --git a/eclipse/samples/Validation/.classpath b/eclipse/samples/Validation/.classpath
deleted file mode 100644
index f36f38b..0000000
--- a/eclipse/samples/Validation/.classpath
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="core/src"/>
- <classpathentry kind="src" output="war" path="core/war"/>
- <classpathentry kind="src" path="gwt-gen"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry combineaccessrules="false" kind="src" path="/gwt-user"/>
- <classpathentry kind="var" path="GWT_TOOLS/lib/apache/log4j/log4j-1.2.16.jar"/>
- <classpathentry kind="var" path="GWT_TOOLS/lib/hibernate/validator/hibernate-validator-4.1.0.Final.jar" sourcepath="/GWT_TOOLS/lib/hibernate/validator/hibernate-validator-4.1.0.Final-sources.jar"/>
- <classpathentry kind="var" path="GWT_TOOLS/lib/slf4j/slf4j-api/slf4j-api-1.6.1.jar"/>
- <classpathentry kind="var" path="GWT_TOOLS/lib/slf4j/slf4j-log4j12/slf4j-log4j12-1.6.1.jar"/>
- <classpathentry kind="var" path="GWT_TOOLS/lib/hibernate/validator/hibernate-validator-4.1.0.Final-sources.jar"/>
- <classpathentry kind="output" path="war/WEB-INF/classes"/>
-</classpath>
diff --git a/eclipse/samples/Validation/.project b/eclipse/samples/Validation/.project
deleted file mode 100644
index 93a5b2f..0000000
--- a/eclipse/samples/Validation/.project
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>Validation</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature>
- </natures>
- <linkedResources>
- <link>
- <name>core</name>
- <type>2</type>
- <locationURI>GWT_ROOT/samples/validation</locationURI>
- </link>
- </linkedResources>
-</projectDescription>
diff --git a/eclipse/samples/Validation/Validation-gwtc.launch b/eclipse/samples/Validation/Validation-gwtc.launch
deleted file mode 100644
index c48be56..0000000
--- a/eclipse/samples/Validation/Validation-gwtc.launch
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
-<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
-<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER" javaProject="Validation" path="1" type="4"/> "/>
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/Validation/core/src" path="3" type="2"/> "/>
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/gwt-user/core/src" path="3" type="2"/> "/>
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/gwt-user/core/super" path="3" type="2"/> "/>
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/gwt-dev/core/super" path="3" type="2"/> "/>
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="Validation"/> </runtimeClasspathEntry> "/>
-</listAttribute>
-<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.Compiler"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="com.google.gwt.sample.validation.Validation"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Validation"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea -Xmx256M -Dgwt.devjar=${gwt_devjar}"/>
-</launchConfiguration>
diff --git a/eclipse/samples/Validation/Validation.launch b/eclipse/samples/Validation/Validation.launch
deleted file mode 100644
index 1f1e3e2..0000000
--- a/eclipse/samples/Validation/Validation.launch
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
-<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
-<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER" javaProject="Validation" path="1" type="4"/> "/>
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/Validation/core/src" path="3" type="2"/> "/>
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/gwt-user/core/src" path="3" type="2"/> "/>
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/gwt-user/core/super" path="3" type="2"/> "/>
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/gwt-dev/core/super" path="3" type="2"/> "/>
-<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="Validation"/> </runtimeClasspathEntry> "/>
-</listAttribute>
-<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-startupUrl Validation.html com.google.gwt.sample.validation.Validation"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Validation"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea -Xmx256M -Dgwt.devjar=${gwt_devjar}"/>
-</launchConfiguration>
diff --git a/samples/build.xml b/samples/build.xml
index b5061e1..9db9033 100644
--- a/samples/build.xml
+++ b/samples/build.xml
@@ -38,14 +38,6 @@
<gwt.ant dir="showcase" />
</target>
- <target name="validation" description="Build validation">
- <gwt.ant dir="validation" />
- </target>
-
- <target name="validationtck" description="Build validation TCK">
- <gwt.ant dir="validationtck" />
- </target>
-
<target name="-do" description="Run all subprojects" >
<antcall target="dynatable" />
<antcall target="dynatablerf" />
@@ -55,8 +47,6 @@
<antcall target="logexample" />
<antcall target="mail" />
<antcall target="showcase" />
- <antcall target="validation" />
- <!-- don't include validationtck, it is not really a sample -->
</target>
<target name="build" description="Builds GWT">
diff --git a/samples/validation/build.xml b/samples/validation/build.xml
deleted file mode 100755
index 6c25136..0000000
--- a/samples/validation/build.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<project name="validation" default="build" basedir=".">
- <property name="sample.root" value="validation" />
- <property name="sample.module" value="Validation" />
- <property name="sample.path" value="src" />
- <import file="../common.ant.xml" />
-
- <!-- these are after the common.ant.xml so they have gwt.tools etc. -->
- <path id="sample.extraclasspath">
- <pathelement location="${gwt.tools.lib}/apache/log4j/log4j-1.2.16.jar" />
- <pathelement location="${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA.jar" />
- <pathelement location="${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA-sources.jar" />
- <pathelement location="${gwt.tools.lib}/hibernate/validator/hibernate-validator-4.1.0.Final.jar" />
- <pathelement location="${gwt.tools.lib}/hibernate/validator/hibernate-validator-4.1.0.Final-sources.jar" />
- <pathelement location="${gwt.tools.lib}/slf4j/slf4j-api/slf4j-api-1.6.1.jar" />
- <pathelement location="${gwt.tools.lib}/slf4j/slf4j-log4j12/slf4j-log4j12-1.6.1.jar" />
- <!-- Needed for JDK 1.5-->
- <pathelement location="${gwt.tools.lib}/javax/activation/activation-1.1.jar" />
- <pathelement location="${gwt.tools.lib}/javax/xml/bind/jaxb-api-2.1.jar" />
- <pathelement location="${gwt.tools.lib}/sun/jaxb/jaxb-impl-2.1.3.jar" />
- <pathelement location="${gwt.tools.lib}/javax/xml/stream/stax-api-1.0-2.jar" />
- </path>
- <fileset id="sample.server.libs" dir="${gwt.tools.lib}">
- <include name="javax/validation/validation-api-1.0.0.GA-sources.jar" />
- <include name="hibernate/validator/hibernate-validator-4.1.0.Final.jar" />
- <include name="hibernate/validator/hibernate-validator-4.1.0.Final-sources.jar" />
- <include name="apache/log4j/log4j-1.2.16.jar" />
- <include name="slf4j/slf4j-api/slf4j-api-1.6.1.jar" />
- <include name="slf4j/slf4j-log4j12/slf4j-log4j12-1.6.1.jar" />
- <!-- Needed for JDK 1.5-->
- <include name="javax/activation/activation-1.1.jar" />
- <include name="javax/xml/bind/jaxb-api-2.1.jar" />
- <include name="sun/jaxb/jaxb-impl-2.1.3.jar" />
- <include name="javax/xml/stream/stax-api-1.0-2.jar" />
- </fileset>
-</project>
diff --git a/samples/validation/src/com/google/gwt/sample/validation/COPYING b/samples/validation/src/com/google/gwt/sample/validation/COPYING
deleted file mode 100644
index d9a10c0..0000000
--- a/samples/validation/src/com/google/gwt/sample/validation/COPYING
+++ /dev/null
@@ -1,176 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
diff --git a/samples/validation/src/com/google/gwt/sample/validation/Validation.gwt.xml b/samples/validation/src/com/google/gwt/sample/validation/Validation.gwt.xml
deleted file mode 100644
index 23173e9..0000000
--- a/samples/validation/src/com/google/gwt/sample/validation/Validation.gwt.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright 2010 Google Inc. -->
-<!-- Licensed under the Apache License, Version 2.0 (the "License"); you -->
-<!-- may not use this file except in compliance with the License. You may -->
-<!-- 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. License for the specific language governing permissions and -->
-<!-- limitations under the License. -->
-
-<module rename-to='validation'>
- <inherits name='com.google.gwt.rpc.RPC' />
- <inherits name='com.google.gwt.user.User' />
- <inherits name='com.google.gwt.user.theme.standard.Standard' />
- <inherits name='org.hibernate.validator.HibernateValidator' />
-
- <entry-point class='com.google.gwt.sample.validation.client.Validation' />
-
- <source path='client' />
- <source path='shared' />
- <super-source path="super" />
-
- <!-- Specify the Validator for the Validation bootstrap to use. -->
- <replace-with
- class="com.google.gwt.sample.validation.client.SampleValidatorFactory">
- <when-type-is class="javax.validation.ValidatorFactory" />
- </replace-with>
-
- <!-- TODO(nchalko) figure out how to make this a attribute of the GwtValidation
- annotation -->
- <!-- specify the ValidationMessageResolver to use for your custom validation messages -->
- <replace-with
- class="com.google.gwt.sample.validation.client.CustomValidationMessagesResolver">
- <when-type-is
- class="com.google.gwt.validation.client.UserValidationMessagesResolver" />
- </replace-with>
-</module>
diff --git a/samples/validation/src/com/google/gwt/sample/validation/client/CustomValidationMessagesResolver.java b/samples/validation/src/com/google/gwt/sample/validation/client/CustomValidationMessagesResolver.java
deleted file mode 100644
index b81c63d..0000000
--- a/samples/validation/src/com/google/gwt/sample/validation/client/CustomValidationMessagesResolver.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.sample.validation.client;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.i18n.client.ConstantsWithLookup;
-import com.google.gwt.validation.client.AbstractValidationMessageResolver;
-import com.google.gwt.validation.client.UserValidationMessagesResolver;
-
-/**
- * {@link UserValidationMessageResolver} that uses the
- * {@link ValidationMessages}.
- */
-public class CustomValidationMessagesResolver extends AbstractValidationMessageResolver
- implements UserValidationMessagesResolver {
-
- // TODO(nchalko) implement this as part of the GWtValidation annotation
- // instead of a separate class.
- protected CustomValidationMessagesResolver() {
- super((ConstantsWithLookup) GWT.create(ValidationMessages.class));
- }
-}
\ No newline at end of file
diff --git a/samples/validation/src/com/google/gwt/sample/validation/client/GreetingService.java b/samples/validation/src/com/google/gwt/sample/validation/client/GreetingService.java
deleted file mode 100644
index 9ed0787..0000000
--- a/samples/validation/src/com/google/gwt/sample/validation/client/GreetingService.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.sample.validation.client;
-
-import com.google.gwt.rpc.client.RpcService;
-import com.google.gwt.safehtml.shared.SafeHtml;
-import com.google.gwt.sample.validation.shared.Person;
-import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
-
-import javax.validation.ConstraintViolationException;
-
-/**
- * The client side stub for the RPC service.
- */
-@RemoteServiceRelativePath("greet")
-public interface GreetingService extends RpcService {
- SafeHtml greetServer(Person name) throws IllegalArgumentException,
- ConstraintViolationException;
-}
diff --git a/samples/validation/src/com/google/gwt/sample/validation/client/GreetingServiceAsync.java b/samples/validation/src/com/google/gwt/sample/validation/client/GreetingServiceAsync.java
deleted file mode 100644
index 1309e56..0000000
--- a/samples/validation/src/com/google/gwt/sample/validation/client/GreetingServiceAsync.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.sample.validation.client;
-
-import com.google.gwt.safehtml.shared.SafeHtml;
-import com.google.gwt.sample.validation.shared.Person;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-
-import javax.validation.ConstraintViolationException;
-
-/**
- * The async counterpart of <code>GreetingService</code>.
- */
-public interface GreetingServiceAsync {
- void greetServer(Person person, AsyncCallback<SafeHtml> callback)
- throws IllegalArgumentException, ConstraintViolationException;
-}
diff --git a/samples/validation/src/com/google/gwt/sample/validation/client/SampleValidatorFactory.java b/samples/validation/src/com/google/gwt/sample/validation/client/SampleValidatorFactory.java
deleted file mode 100644
index fd5ae12..0000000
--- a/samples/validation/src/com/google/gwt/sample/validation/client/SampleValidatorFactory.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.sample.validation.client;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.sample.validation.shared.ClientGroup;
-import com.google.gwt.sample.validation.shared.Person;
-import com.google.gwt.validation.client.GwtValidation;
-import com.google.gwt.validation.client.AbstractGwtValidatorFactory;
-import com.google.gwt.validation.client.impl.AbstractGwtValidator;
-
-import javax.validation.Validator;
-import javax.validation.groups.Default;
-
-/**
- * {@link AbstractGwtValidatorFactory} that creates the specified {@link GwtValidator}.
- */
-public final class SampleValidatorFactory extends AbstractGwtValidatorFactory {
-
- /**
- * Validator marker for the Validation Sample project. Only the classes listed
- * in the {@link GwtValidation} annotation can be validated.
- */
- @GwtValidation(value = Person.class,
- groups = {Default.class, ClientGroup.class})
- public interface GwtValidator extends Validator {
- }
-
- @Override
- public AbstractGwtValidator createValidator() {
- return GWT.create(GwtValidator.class);
- }
-}
diff --git a/samples/validation/src/com/google/gwt/sample/validation/client/Validation.java b/samples/validation/src/com/google/gwt/sample/validation/client/Validation.java
deleted file mode 100644
index 86bb36e..0000000
--- a/samples/validation/src/com/google/gwt/sample/validation/client/Validation.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.sample.validation.client;
-
-import com.google.gwt.core.client.EntryPoint;
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.sample.validation.shared.Person;
-import com.google.gwt.user.client.ui.RootPanel;
-
-/**
- * Entry point classes define <code>onModuleLoad()</code>.
- */
-public class Validation implements EntryPoint {
-
- /**
- * Create a remote service proxy to talk to the server-side Greeting service.
- */
- private final GreetingServiceAsync greetingService = GWT.create(GreetingService.class);
-
- /**
- * This is the entry point method.
- */
- public void onModuleLoad() {
- Person person = new Person();
- ValidationView view = new ValidationView(person, greetingService);
- RootPanel.get("view").add(view);
- }
-}
diff --git a/samples/validation/src/com/google/gwt/sample/validation/client/ValidationMessages.java b/samples/validation/src/com/google/gwt/sample/validation/client/ValidationMessages.java
deleted file mode 100644
index ae526ff..0000000
--- a/samples/validation/src/com/google/gwt/sample/validation/client/ValidationMessages.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.sample.validation.client;
-
-/**
- * Custom validation messages. Interface to represent the constants contained in
- * resource bundle:
- * 'com/google/gwt/sample/validation/client/ValidationMessages.properties'
- * TODO(nchalko) move this to the root package so client and server can share
- * the same properties files.
- */
-public interface ValidationMessages extends
- com.google.gwt.i18n.client.ConstantsWithLookup {
-
- /**
- * Translated "Name must be at least {size} characters long.".
- *
- * @return translated "Name must be at least {min} characters long."
- */
- @DefaultStringValue("Name must be at least {min} characters long.")
- @Key("custom.name.size.message")
- String custom_name_size_message();
-}
diff --git a/samples/validation/src/com/google/gwt/sample/validation/client/ValidationMessages.properties b/samples/validation/src/com/google/gwt/sample/validation/client/ValidationMessages.properties
deleted file mode 100644
index a9ea8f1..0000000
--- a/samples/validation/src/com/google/gwt/sample/validation/client/ValidationMessages.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-# Put custom messages here.
-custom.name.size.message=Name must be at least {min} characters long.
diff --git a/samples/validation/src/com/google/gwt/sample/validation/client/ValidationView.java b/samples/validation/src/com/google/gwt/sample/validation/client/ValidationView.java
deleted file mode 100644
index e113e83..0000000
--- a/samples/validation/src/com/google/gwt/sample/validation/client/ValidationView.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.sample.validation.client;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.KeyCodes;
-import com.google.gwt.event.dom.client.KeyUpEvent;
-import com.google.gwt.resources.client.CssResource;
-import com.google.gwt.safehtml.shared.SafeHtml;
-import com.google.gwt.sample.validation.shared.ClientGroup;
-import com.google.gwt.sample.validation.shared.Person;
-import com.google.gwt.uibinder.client.UiBinder;
-import com.google.gwt.uibinder.client.UiField;
-import com.google.gwt.uibinder.client.UiHandler;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.DialogBox;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.TextBox;
-import com.google.gwt.user.client.ui.Widget;
-
-import java.util.Set;
-
-import javax.validation.ConstraintViolation;
-import javax.validation.ConstraintViolationException;
-import javax.validation.Validation;
-import javax.validation.Validator;
-import javax.validation.groups.Default;
-
-/**
- * Display the Validation sample.
- */
-public class ValidationView extends Composite {
- interface MyStyle extends CssResource {
- String error();
- }
-
- interface ValidationViewUiBinder extends UiBinder<Widget, ValidationView> {
- }
-
- /**
- * The message displayed to the user when the server cannot be reached or
- * returns an error.
- */
- private static final String SERVER_ERROR = "An error occurred while "
- + "attempting to contact the server. Please check your network "
- + "connection and try again.";
-
- private static ValidationViewUiBinder uiBinder = GWT.create(ValidationViewUiBinder.class);
-
- @UiField
- Button closeButton;
-
- @UiField
- DialogBox dialogBox;
-
- @UiField
- Label errorLabel;
-
- @UiField
- TextBox nameField;
-
- @UiField
- Button sendButton;
-
- @UiField
- HTML serverResponse;
-
- @UiField
- MyStyle style;
-
- @UiField
- Label textToServer;
-
- private final GreetingServiceAsync greetingService;
-
- private final Person person;
-
- public ValidationView(Person person, GreetingServiceAsync greetingService) {
-
- this.person = person;
-
- this.greetingService = greetingService;
- initWidget(uiBinder.createAndBindUi(this));
-
- nameField.setText(person.getName());
- }
-
- @UiHandler("closeButton")
- public void doClick(ClickEvent e) {
- dialogBox.hide();
- sendButton.setEnabled(true);
- sendButton.setFocus(true);
- }
-
- @UiHandler("sendButton")
- void onClick(ClickEvent e) {
- sendPersonToServer();
- }
-
- @UiHandler("sendButton")
- void onKeyPress(KeyUpEvent e) {
- if (e.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
- sendPersonToServer();
- }
- }
-
- /**
- * Send the person from the nameField to the server and wait for a response.
- */
- private void sendPersonToServer() {
- errorLabel.setText("");
- person.setName(nameField.getText());
-
- Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
- Set<ConstraintViolation<Person>> violations = validator.validate(person,
- Default.class, ClientGroup.class);
- if (!violations.isEmpty()) {
- StringBuffer errorMessage = new StringBuffer();
- for (ConstraintViolation<Person> constraintViolation : violations) {
- if (errorMessage.length() == 0) {
- errorMessage.append('\n');
- }
- errorMessage.append(constraintViolation.getMessage());
- }
- errorLabel.setText(errorMessage.toString());
- return;
- }
- sendButton.setEnabled(false);
- textToServer.setText(person.getName());
- serverResponse.setText("");
- greetingService.greetServer(person, new AsyncCallback<SafeHtml>() {
- public void onFailure(Throwable caught) {
- if (caught instanceof ConstraintViolationException) {
- ConstraintViolationException violationException = (ConstraintViolationException) caught;
- Set<ConstraintViolation<?>> violations = violationException.getConstraintViolations();
- StringBuffer sb = new StringBuffer();
- for (ConstraintViolation<?> constraintViolation : violations) {
- sb.append(constraintViolation.getPropertyPath().toString()) //
- .append(":") //
- .append(constraintViolation.getMessage()) //
- .append("\n");
- }
- errorLabel.setText(sb.toString());
- sendButton.setEnabled(true);
- sendButton.setFocus(true);
- return;
- }
-
- // Show the RPC error message to the user
- dialogBox.setText("Remote Procedure Call - Failure");
- serverResponse.addStyleName(style.error());
- serverResponse.setHTML(SERVER_ERROR);
- dialogBox.center();
- closeButton.setFocus(true);
- }
-
- public void onSuccess(SafeHtml result) {
- dialogBox.setText("Remote Procedure Call");
- serverResponse.removeStyleName(style.error());
- serverResponse.setHTML(result);
- dialogBox.center();
- closeButton.setFocus(true);
- }
- });
- }
-}
diff --git a/samples/validation/src/com/google/gwt/sample/validation/client/ValidationView.ui.xml b/samples/validation/src/com/google/gwt/sample/validation/client/ValidationView.ui.xml
deleted file mode 100644
index dc7c5a6..0000000
--- a/samples/validation/src/com/google/gwt/sample/validation/client/ValidationView.ui.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
-<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
- xmlns:g="urn:import:com.google.gwt.user.client.ui">
- <ui:style type ="com.google.gwt.sample.validation.client.ValidationView.MyStyle">
- @external .gwt-DialogBox;
- .gwt-DialogBox {
- width: 400px;
- }
- .panel {
- align: center;
- }
- .send {
- display: block;
- font-size: 16pt;
- }
- .error {
- color: red;
- }
- .dialogPanel {
- margin: 5px;
- }
- .close {
- margin: 15px 6px 6px;
- }
- </ui:style>
- <g:VerticalPanel styleName="{style.panel}">
- <g:FlowPanel>
- <g:Label>Please enter your name:</g:Label>
- <g:TextBox ui:field="nameField">GWT User</g:TextBox>
- </g:FlowPanel>
- <g:Button styleName="{style.send}" ui:field="sendButton">Send</g:Button>
- <g:Label styleName="{style.error}" ui:field="errorLabel" />
- <g:DialogBox ui:field="dialogBox"
- animationEnabled="true"
- text="Remote Procedure Call"
- visible="false"
- width="400">
- <g:VerticalPanel styleName="dialogPanel">
- <g:HTML>
- <b>Sending name to the server:</b>
- </g:HTML>
- <g:Label ui:field="textToServer" />
- <g:HTML>
- <br />
- <b>Server replies:</b>
- </g:HTML>
- <g:HTML ui:field="serverResponse" />
- <g:Button styleName="{style.close}" ui:field="closeButton">Close</g:Button>
- </g:VerticalPanel>
- </g:DialogBox>
- </g:VerticalPanel>
-</ui:UiBinder>
\ No newline at end of file
diff --git a/samples/validation/src/com/google/gwt/sample/validation/server/GreetingServiceImpl.java b/samples/validation/src/com/google/gwt/sample/validation/server/GreetingServiceImpl.java
deleted file mode 100644
index f8712c7..0000000
--- a/samples/validation/src/com/google/gwt/sample/validation/server/GreetingServiceImpl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.sample.validation.server;
-
-import com.google.gwt.rpc.server.RpcServlet;
-import com.google.gwt.safehtml.shared.SafeHtml;
-import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
-import com.google.gwt.sample.validation.client.GreetingService;
-import com.google.gwt.sample.validation.shared.Person;
-import com.google.gwt.sample.validation.shared.ServerGroup;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.validation.ConstraintViolation;
-import javax.validation.ConstraintViolationException;
-import javax.validation.Validation;
-import javax.validation.Validator;
-import javax.validation.groups.Default;
-
-/**
- * The server side implementation of the RPC service.
- */
-@SuppressWarnings("serial")
-public class GreetingServiceImpl extends RpcServlet implements
- GreetingService {
-
- private final Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
-
- public SafeHtml greetServer(Person person) throws IllegalArgumentException,
- ConstraintViolationException {
- // Verify that the input is valid.
- Set<ConstraintViolation<Person>> violations = validator.validate(person,
- Default.class, ServerGroup.class);
- if (!violations.isEmpty()) {
- Set<ConstraintViolation<?>> temp = new HashSet<ConstraintViolation<?>>(
- violations);
- throw new ConstraintViolationException(temp);
- }
-
- String serverInfo = getServletContext().getServerInfo();
- String userAgent = getThreadLocalRequest().getHeader("User-Agent");
-
- // Escape data from the client to avoid cross-site script vulnerabilities.
- SafeHtmlBuilder builder = new SafeHtmlBuilder();
-
- SafeHtml safeHtml = builder//
- .appendEscapedLines("Hello, " + person.getName() + "!")//
- .appendHtmlConstant("<br>")//
- .appendEscaped("I am running " + serverInfo + ".")//
- .appendHtmlConstant("<br><br>")//
- .appendEscaped("It looks like you are using: ")//
- .appendEscaped(userAgent)//
- .toSafeHtml();
- return safeHtml;
- }
-}
\ No newline at end of file
diff --git a/samples/validation/src/com/google/gwt/sample/validation/shared/Address.java b/samples/validation/src/com/google/gwt/sample/validation/shared/Address.java
deleted file mode 100644
index f340eab..0000000
--- a/samples/validation/src/com/google/gwt/sample/validation/shared/Address.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.sample.validation.shared;
-
-import com.google.gwt.user.client.rpc.IsSerializable;
-
-import javax.validation.constraints.NotNull;
-
-/**
- * Sample address for validation
- */
-public class Address implements IsSerializable {
-
- @NotNull
- public String street;
-
- @Zip
- public String zip;
-
-
-}
diff --git a/samples/validation/src/com/google/gwt/sample/validation/shared/ClientGroup.java b/samples/validation/src/com/google/gwt/sample/validation/shared/ClientGroup.java
deleted file mode 100644
index 0acd314..0000000
--- a/samples/validation/src/com/google/gwt/sample/validation/shared/ClientGroup.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.sample.validation.shared;
-
-/**
- * Client Validation Group
- */
-public interface ClientGroup {
-}
\ No newline at end of file
diff --git a/samples/validation/src/com/google/gwt/sample/validation/shared/NoOp.java b/samples/validation/src/com/google/gwt/sample/validation/shared/NoOp.java
deleted file mode 100644
index 1459303..0000000
--- a/samples/validation/src/com/google/gwt/sample/validation/shared/NoOp.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.sample.validation.shared;
-
-import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
-import static java.lang.annotation.ElementType.CONSTRUCTOR;
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.validation.Constraint;
-import javax.validation.Payload;
-
-/**
- * Test constraint that is always valid
- */
-@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE})
-@Retention(RUNTIME)
-@Documented
-@Constraint(validatedBy = {NoOpValidator.class})
-public @interface NoOp {
- String message() default "Hey, this can't fail!";
-
- Class<?>[] groups() default {};
-
- Class<? extends Payload>[] payload() default {};
-}
\ No newline at end of file
diff --git a/samples/validation/src/com/google/gwt/sample/validation/shared/NoOpValidator.java b/samples/validation/src/com/google/gwt/sample/validation/shared/NoOpValidator.java
deleted file mode 100644
index 348befe..0000000
--- a/samples/validation/src/com/google/gwt/sample/validation/shared/NoOpValidator.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.sample.validation.shared;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * This is always valid.
- */
-public class NoOpValidator implements ConstraintValidator<NoOp, Object> {
-
- public void initialize(NoOp constraintAnnotation) {
- }
-
- public boolean isValid(Object value, ConstraintValidatorContext context) {
- return true;
- }
-}
diff --git a/samples/validation/src/com/google/gwt/sample/validation/shared/Person.java b/samples/validation/src/com/google/gwt/sample/validation/shared/Person.java
deleted file mode 100644
index ee882b8..0000000
--- a/samples/validation/src/com/google/gwt/sample/validation/shared/Person.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.sample.validation.shared;
-
-import com.google.gwt.user.client.rpc.IsSerializable;
-
-import java.util.Map;
-
-import javax.validation.Valid;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Size;
-
-/**
- * A sample bean to show validation on.
- */
-@ServerConstraint(groups = ServerGroup.class)
-public class Person implements IsSerializable {
-
- @Valid
- private Address address;
-
- @Valid
- private Map<String, Address> otherAddresses;
-
- @NotNull
- @Size(min = 4, message = "{custom.name.size.message}")
- private String name;
-
- private long ssn;
-
- public Address getAddress() {
- return address;
- }
-
- public String getName() {
- return name;
- }
-
- public void setAddress(Address address) {
- this.address = address;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public void setSsn(long ssn) {
- this.ssn = ssn;
- }
-
- @Max(999999999)
- protected long getSsn() {
- return ssn;
- }
-}
diff --git a/samples/validation/src/com/google/gwt/sample/validation/shared/ServerConstraint.java b/samples/validation/src/com/google/gwt/sample/validation/shared/ServerConstraint.java
deleted file mode 100644
index 290062b..0000000
--- a/samples/validation/src/com/google/gwt/sample/validation/shared/ServerConstraint.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.sample.validation.shared;
-
-import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
-import static java.lang.annotation.ElementType.CONSTRUCTOR;
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.validation.Constraint;
-import javax.validation.Payload;
-
-/**
- * Sample constraint that is designed to only run on the server. It will fail if
- * the Persons name is "Fail"
- */
-@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE})
-@Retention(RUNTIME)
-@Documented
-@Constraint(validatedBy = {ServerValidator.class})
-public @interface ServerConstraint {
- String message() default "Not valid at the server";
-
- Class<?>[] groups() default {};
-
- Class<? extends Payload>[] payload() default {};
-}
\ No newline at end of file
diff --git a/samples/validation/src/com/google/gwt/sample/validation/shared/ServerGroup.java b/samples/validation/src/com/google/gwt/sample/validation/shared/ServerGroup.java
deleted file mode 100644
index dce02cf..0000000
--- a/samples/validation/src/com/google/gwt/sample/validation/shared/ServerGroup.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.sample.validation.shared;
-
-/**
- * Server Validation Group.
- */
-public interface ServerGroup {
-}
diff --git a/samples/validation/src/com/google/gwt/sample/validation/shared/ServerValidator.java b/samples/validation/src/com/google/gwt/sample/validation/shared/ServerValidator.java
deleted file mode 100644
index ead810a..0000000
--- a/samples/validation/src/com/google/gwt/sample/validation/shared/ServerValidator.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.sample.validation.shared;
-
-import java.lang.reflect.Method;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * Fails only on the server if the persons name is "Fail".
- */
-public class ServerValidator implements
- ConstraintValidator<ServerConstraint, Person> {
-
- public void initialize(ServerConstraint constraintAnnotation) {
- // Here I do something that will not compile on GWT
- Method[] methods = constraintAnnotation.getClass().getMethods();
- }
-
- public boolean isValid(Person person, ConstraintValidatorContext context) {
- if (person == null) {
- return true;
- }
- String name = person.getName();
- return name == null || !name.equals("Fail");
- }
-}
diff --git a/samples/validation/src/com/google/gwt/sample/validation/shared/Zip.java b/samples/validation/src/com/google/gwt/sample/validation/shared/Zip.java
deleted file mode 100644
index ffc8ec3..0000000
--- a/samples/validation/src/com/google/gwt/sample/validation/shared/Zip.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.sample.validation.shared;
-
-import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
-import static java.lang.annotation.ElementType.CONSTRUCTOR;
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.validation.Constraint;
-import javax.validation.Payload;
-import javax.validation.constraints.Pattern;
-import javax.validation.constraints.Size;
-
-/**
- * Example composite constraint.
- */
-@Pattern(regexp = "[0-9]*")
-@Size(min = 5, max = 5)
-@Constraint(validatedBy = {})
-@Documented
-@Target({ANNOTATION_TYPE, METHOD, FIELD, CONSTRUCTOR, PARAMETER})
-@Retention(RUNTIME)
-public @interface Zip {
- /**
- * Defines several @Zip annotations on the same element
- *
- * @see {@link Zip}
- */
- @Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER})
- @Retention(RUNTIME)
- @Documented
- @interface List {
- Zip[] value();
- }
-
- Class<?>[] groups() default {};
-
- String message() default "Wrong zipcode";
-
- Class<? extends Payload>[] payload() default {};
-}
\ No newline at end of file
diff --git a/samples/validation/src/com/google/gwt/sample/validation/super/com/google/gwt/sample/validation/shared/ServerValidator.java b/samples/validation/src/com/google/gwt/sample/validation/super/com/google/gwt/sample/validation/shared/ServerValidator.java
deleted file mode 100644
index c633d58..0000000
--- a/samples/validation/src/com/google/gwt/sample/validation/super/com/google/gwt/sample/validation/shared/ServerValidator.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.sample.validation.shared;
-
-import com.google.gwt.validation.client.constraints.NotGwtCompatibleValidator;
-
-/**
- * Always invalid.
- * <p>
- * Server validator is overriden so it compiles, but it is always invalid.
- */
-public class ServerValidator extends
- NotGwtCompatibleValidator<ServerConstraint, Person> {
-}
\ No newline at end of file
diff --git a/samples/validation/src/log4j.properties b/samples/validation/src/log4j.properties
deleted file mode 100644
index bf638d2..0000000
--- a/samples/validation/src/log4j.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-#log4j configuration, needed by hibernate validator.
-log4j.rootLogger=INFO, stdout
-
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
\ No newline at end of file
diff --git a/samples/validation/war/Validation.css b/samples/validation/war/Validation.css
deleted file mode 100644
index ebf683e..0000000
--- a/samples/validation/war/Validation.css
+++ /dev/null
@@ -1,15 +0,0 @@
-/** Add css rules here for your application. */
-
-
-/** Example rules used by the template application (remove for your app) */
-h1 {
- font-size: 2em;
- font-weight: bold;
- color: #777777;
- margin: 40px 0px 70px;
- text-align: center;
-}
-
-.serverResponseLabelError {
- color: red;
-}
diff --git a/samples/validation/war/Validation.html b/samples/validation/war/Validation.html
deleted file mode 100644
index 32654de..0000000
--- a/samples/validation/war/Validation.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<!-- -->
-<!-- Copyright 2010 Google Inc. -->
-<!-- Licensed under the Apache License, Version 2.0 (the "License"); you -->
-<!-- may not use this file except in compliance with the License. You may -->
-<!-- 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. License for the specific language governing permissions and -->
-<!-- limitations under the License. -->
-<html>
- <head>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8">
-
- <!-- -->
- <!-- Consider inlining CSS to reduce the number of requested files -->
- <!-- -->
- <link type="text/css" rel="stylesheet" href="Validation.css">
-
- <!-- -->
- <!-- Any title is fine -->
- <!-- -->
- <title>javax.validation Starter Project</title>
-
- <!-- -->
- <!-- This script loads your compiled module. -->
- <!-- If you add any GWT meta tags, they must -->
- <!-- be added before this line. -->
- <!-- -->
- <script type="text/javascript" language="javascript" src="validation/validation.nocache.js"></script>
- </head>
-
- <!-- -->
- <!-- The body can have arbitrary html, or -->
- <!-- you can leave the body empty if you want -->
- <!-- to create a completely dynamic UI. -->
- <!-- -->
- <body>
-
- <!-- OPTIONAL: include this if you want history support -->
- <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
-
- <!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
- <noscript>
- <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
- Your web browser must have JavaScript enabled
- in order for this application to display correctly.
- </div>
- </noscript>
-
- <h1>javax.validation Starter Project</h1>
- <div id="view" />
- </body>
-</html>
diff --git a/samples/validation/war/WEB-INF/classes/marker b/samples/validation/war/WEB-INF/classes/marker
deleted file mode 100644
index e69de29..0000000
--- a/samples/validation/war/WEB-INF/classes/marker
+++ /dev/null
diff --git a/samples/validation/war/WEB-INF/lib/gwt-servlet.jar b/samples/validation/war/WEB-INF/lib/gwt-servlet.jar
deleted file mode 100644
index bc41164..0000000
--- a/samples/validation/war/WEB-INF/lib/gwt-servlet.jar
+++ /dev/null
Binary files differ
diff --git a/samples/validation/war/WEB-INF/web.xml b/samples/validation/war/WEB-INF/web.xml
deleted file mode 100644
index 9f79f03..0000000
--- a/samples/validation/war/WEB-INF/web.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app>
-
- <!-- Servlets -->
- <servlet>
- <servlet-name>greetServlet</servlet-name>
- <servlet-class>com.google.gwt.sample.validation.server.GreetingServiceImpl</servlet-class>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>greetServlet</servlet-name>
- <url-pattern>/validation/greet</url-pattern>
- </servlet-mapping>
-
- <!-- Default page to serve -->
- <welcome-file-list>
- <welcome-file>Validation.html</welcome-file>
- </welcome-file-list>
-
-</web-app>
diff --git a/samples/validation/war/favicon.ico b/samples/validation/war/favicon.ico
deleted file mode 100644
index d7ccc73..0000000
--- a/samples/validation/war/favicon.ico
+++ /dev/null
Binary files differ
diff --git a/user/src/com/google/gwt/editor/Editor.gwt.xml b/user/src/com/google/gwt/editor/Editor.gwt.xml
index f5146c6..48f6b34 100644
--- a/user/src/com/google/gwt/editor/Editor.gwt.xml
+++ b/user/src/com/google/gwt/editor/Editor.gwt.xml
@@ -14,7 +14,7 @@
<!-- Editor framework support -->
<module>
<inherits name="com.google.gwt.core.Core" />
- <inherits name="com.google.gwt.validation.Validation" />
+ <inherits name="javax.validation.Validation" />
<source path="client"/>
<source path="shared"/>
diff --git a/user/src/com/google/gwt/validation/Validation.gwt.xml b/user/src/com/google/gwt/validation/Validation.gwt.xml
deleted file mode 100644
index 063a83e..0000000
--- a/user/src/com/google/gwt/validation/Validation.gwt.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN"
- "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd">
-<!--
- Copyright 2010 Google Inc.
-
- 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.
--->
-<module>
- <inherits name="com.google.gwt.user.User" />
- <inherits name="com.google.gwt.regexp.RegExp" />
- <inherits name="javax.validation.Validation" />
- <source path="client" />
- <super-source path="super" />
-
- <replace-with
- class="com.google.gwt.validation.client.GwtConstraintValidatorFactory">
- <when-type-is class="javax.validation.ConstraintValidatorFactory" />
- </replace-with>
- <replace-with
- class="com.google.gwt.validation.client.GwtMessageInterpolator">
- <when-type-is class="javax.validation.MessageInterpolator" />
- </replace-with>
- <replace-with
- class="com.google.gwt.validation.client.GwtTraversableResolver">
- <when-type-is class="javax.validation.TraversableResolver" />
- </replace-with>
-
- <replace-with
- class="com.google.gwt.validation.client.GwtValidationProviderResolver">
- <when-type-is class="javax.validation.ValidationProviderResolver" />
- </replace-with>
- <replace-with class="com.google.gwt.validation.client.GwtValidatorContext">
- <when-type-is class="javax.validation.ValidatorContext" />
- </replace-with>
- <replace-with class="com.google.gwt.validation.client.NullUserValidationMessageResolver">
- <!-- User can override this to have Custom messages -->
- <when-type-is class="com.google.gwt.validation.client.UserValidationMessagesResolver" />
- </replace-with>
- <replace-with
- class="com.google.gwt.validation.client.spi.GwtValidationProvider">
- <when-type-is class="javax.validation.spi.ValidationProvider" />
- </replace-with>
-
- <!-- Generators -->
- <generate-with class="com.google.gwt.validation.rebind.ValidatorGenerator">
- <when-type-assignable class="javax.validation.Validator" />
- </generate-with>
- <generate-with
- class="com.google.gwt.validation.rebind.GwtSpecificValidatorGenerator">
- <when-type-assignable
- class="com.google.gwt.validation.client.impl.GwtSpecificValidator" />
- </generate-with>
-</module>
diff --git a/user/src/com/google/gwt/validation/client/AbstractGwtValidatorFactory.java b/user/src/com/google/gwt/validation/client/AbstractGwtValidatorFactory.java
deleted file mode 100644
index c4fbaa0..0000000
--- a/user/src/com/google/gwt/validation/client/AbstractGwtValidatorFactory.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.validation.client.impl.AbstractGwtValidator;
-
-import javax.validation.ConstraintValidatorFactory;
-import javax.validation.MessageInterpolator;
-import javax.validation.TraversableResolver;
-import javax.validation.Validator;
-import javax.validation.ValidatorContext;
-import javax.validation.ValidatorFactory;
-
-/**
- * Abstract {@link ValidatorFactory} that delegates to a GWT generated
- * {@link Validator}.
- * <p>
- * Extend this class create and implement createValidator
- *
- * <pre>
- * public class MyValidatorFactory extends AbstractGwtValidatorFactory {
- * @GwtValidation(value = {Pojo.class,Other.class})
- * public static interface GwtValidator extends Validator {
- * }
- *
- * public AbstractGwtValidator createValidator (){
- * return GWT.create(GwtValidator.class));
- * }
- * }
- * </pre>
- * <p>
- * Then add a line like this to your Gwt Module config (gwt.xml) file.
- *
- * <pre>
- * <replace-with class="com.example.MyValidatorFactory">
- * <when-type-is class="javax.validation.ValidatorFactory"/>
- * </replace-with>
- * </pre>
- */
-public abstract class AbstractGwtValidatorFactory implements ValidatorFactory {
-
- /**
- * Implement this method to returns a {@link GWT#create}ed {@link Validator}
- * annotated with {@link GwtValidation}.
- *
- * @return newly created Validator
- */
- public abstract AbstractGwtValidator createValidator();
-
- public final ConstraintValidatorFactory getConstraintValidatorFactory() {
- return GWT.create(ConstraintValidatorFactory.class);
- }
-
- public final MessageInterpolator getMessageInterpolator() {
- return new GwtMessageInterpolator();
- }
-
- public final TraversableResolver getTraversableResolver() {
- return GWT.create(TraversableResolver.class);
- }
-
- public final Validator getValidator() {
- AbstractGwtValidator validator = createValidator();
- validator.init(getConstraintValidatorFactory(), getMessageInterpolator(),
- getTraversableResolver());
- return validator;
- }
-
- public final <T> T unwrap(Class<T> type) {
- // TODO(nchalko implement
- return null;
- }
-
- public final ValidatorContext usingContext() {
- return GWT.create(ValidatorContext.class);
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/AbstractValidationMessageResolver.java b/user/src/com/google/gwt/validation/client/AbstractValidationMessageResolver.java
deleted file mode 100644
index 6c7eaa0..0000000
--- a/user/src/com/google/gwt/validation/client/AbstractValidationMessageResolver.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client;
-
-import com.google.gwt.i18n.client.ConstantsWithLookup;
-
-import java.util.MissingResourceException;
-
-/**
- * ValidationMessageResolver using a {@link ConstantsWithLookup} source.
- */
-public abstract class AbstractValidationMessageResolver {
- private final ConstantsWithLookup messages;
-
- protected AbstractValidationMessageResolver(ConstantsWithLookup messages) {
- this.messages = messages;
- }
-
- public final String get(String key) {
- try {
- // Replace "." with "_" in the key to match what ConstantsImplCreator
- // does.
- return key == null ? null : messages.getString(key.replace(".", "_"));
- } catch (MissingResourceException e) {
- return null;
- }
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/BaseGwtConfiguration.java b/user/src/com/google/gwt/validation/client/BaseGwtConfiguration.java
deleted file mode 100644
index bdaa2f8..0000000
--- a/user/src/com/google/gwt/validation/client/BaseGwtConfiguration.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.validation.client.spi.GwtConfigurationState;
-import com.google.gwt.validation.client.spi.GwtValidationProvider;
-
-import javax.validation.Configuration;
-import javax.validation.ConstraintValidatorFactory;
-import javax.validation.MessageInterpolator;
-import javax.validation.TraversableResolver;
-import javax.validation.ValidatorFactory;
-import javax.validation.spi.BootstrapState;
-import javax.validation.spi.ConfigurationState;
-
-/**
- * Base GWT {@link Configuration}.
- */
-public abstract class BaseGwtConfiguration implements
- Configuration<BaseGwtConfiguration> {
-
- protected final GwtValidationProvider provider;
- protected final BootstrapState state;
-
- public BaseGwtConfiguration(GwtValidationProvider gwtValidationProvider,
- BootstrapState state) {
- provider = gwtValidationProvider;
- this.state = state;
- }
-
- public final BaseGwtConfiguration addProperty(String name, String value) {
- // TODO(nchalko) implement.
- return this;
- }
-
- public final ValidatorFactory buildValidatorFactory() {
- ConfigurationState configurationState = new GwtConfigurationState();
- return provider.buildValidatorFactory(configurationState);
- }
-
- public final BaseGwtConfiguration constraintValidatorFactory(
- ConstraintValidatorFactory constraintValidatorFactory) {
- // TODO(nchalko) implement.
- return this;
- }
-
- public final ConstraintValidatorFactory getDefaultConstraintValidatorFactory() {
- return GWT.create(ConstraintValidatorFactory.class);
- }
-
- public final MessageInterpolator getDefaultMessageInterpolator() {
- return GWT.create(MessageInterpolator.class);
- }
-
- public final TraversableResolver getDefaultTraversableResolver() {
- return GWT.create(TraversableResolver.class);
- }
-
- public final BaseGwtConfiguration ignoreXmlConfiguration() {
- // TODO(nchalko) implement.
- return this;
- }
-
- public final BaseGwtConfiguration messageInterpolator(
- MessageInterpolator interpolator) {
- // TODO(nchalko) implement.
- return this;
- }
-
- public final BaseGwtConfiguration traversableResolver(
- TraversableResolver resolver) {
- // TODO(nchalko) implement.
- return this;
- }
-
-}
\ No newline at end of file
diff --git a/user/src/com/google/gwt/validation/client/BaseMessageInterpolator.java b/user/src/com/google/gwt/validation/client/BaseMessageInterpolator.java
deleted file mode 100644
index 9feb57d..0000000
--- a/user/src/com/google/gwt/validation/client/BaseMessageInterpolator.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.i18n.shared.GwtLocale;
-import com.google.gwt.regexp.shared.MatchResult;
-import com.google.gwt.regexp.shared.RegExp;
-
-import java.util.Map;
-
-import javax.validation.MessageInterpolator;
-import javax.validation.metadata.ConstraintDescriptor;
-
-/**
- * Base GWT {@link MessageInterpolator}.
- */
-public abstract class BaseMessageInterpolator implements MessageInterpolator {
-
- /**
- * Implementation of {@link Context}.
- */
- public static class ContextImpl implements Context {
-
- private final ConstraintDescriptor<?> constraintDescriptor;
- private final Object value;
-
- public ContextImpl(ConstraintDescriptor<?> constraintDescriptor, Object value) {
- this.constraintDescriptor = constraintDescriptor;
- this.value = value;
- }
-
- public ConstraintDescriptor<?> getConstraintDescriptor() {
- return constraintDescriptor;
- }
-
- public Object getValidatedValue() {
- return value;
- }
- }
-
- // local version because guava is included.
- private static interface Function<F, T> {
- T apply(F from);
- }
-
- /**
- * Regular expression used to do message interpolation.
- */
- private static final RegExp MESSAGE_PARAMETER_PATTERN = RegExp.compile(
- "(\\{[^\\}]+?\\})", "g");
-
- // Visible for testing
- static Function<String, String> createAnnotationReplacer(
- final Map<String, Object> map) {
- return new Function<String, String>() {
-
- public String apply(String from) {
- Object object = map.get(from);
- return object == null ? null : object.toString();
- }
- };
- }
-
- private static Function<String, String> createReplacer(
- final ValidationMessageResolver messageResolver) {
- return new Function<String, String>() {
- public String apply(String from) {
- Object object = messageResolver.get(from);
- return object == null ? null : object.toString();
- }
- };
- }
-
- /**
- * Replaces keys using the Default Validation Provider properties.
- */
- private final Function<String, String> providerReplacer =
- createReplacer((ValidationMessageResolver)
- GWT.create(ProviderValidationMessageResolver.class));
-
- /**
- * Replaces keys using the Validation User custom properties.
- */
- private final Function<String, String> userReplacer =
- createReplacer((ValidationMessageResolver)
- GWT.create(UserValidationMessagesResolver.class));
-
- public String interpolate(String messageTemplate, Context context) {
- return gwtInterpolate(messageTemplate, context, null);
- }
-
- protected String gwtInterpolate(String message, Context context,
- GwtLocale locale) {
- // see Section 4.3.1.1
- String resolvedMessage = message;
- String step1message;
-
- // TODO(nchalko) Add a safety to make sure this does not loop forever.
- do {
- do {
- step1message = resolvedMessage;
-
- // Step 1 Replace message parameters using custom user messages
- // repeat
- resolvedMessage = replaceParameters(resolvedMessage, userReplacer);
- } while (!step1message.equals(resolvedMessage));
-
- // Step2 Replace message parameter using the default provider messages.
- resolvedMessage = replaceParameters(resolvedMessage, providerReplacer);
-
- // Step 3 repeat from step 1 if step 2 made changes.
- } while (!step1message.equals(resolvedMessage));
-
- // step 4 resolve annotation attributes
- resolvedMessage = replaceParameters(
- resolvedMessage,
- createAnnotationReplacer(context.getConstraintDescriptor().getAttributes()));
-
- // Remove escapes (4.3.1)
- resolvedMessage = resolvedMessage.replace("\\{", "{");
- resolvedMessage = resolvedMessage.replace("\\}", "}");
- resolvedMessage = resolvedMessage.replace("\\\\", "\\");
- return resolvedMessage;
- }
-
- protected String replaceParameters(String message,
- Function<String, String> replacer) {
- StringBuffer sb = new StringBuffer();
- int index = 0;
-
- MatchResult matcher;
- while ((matcher = MESSAGE_PARAMETER_PATTERN.exec(message)) != null) {
- String matched = matcher.getGroup(0);
- sb.append(message.substring(index, matcher.getIndex()));
- Object value = replacer.apply(removeCurlyBrace(matched));
- sb.append(value == null ? matched : value);
- index = MESSAGE_PARAMETER_PATTERN.getLastIndex();
- }
- if (index < message.length()) {
- sb.append(message.substring(index));
- }
- return sb.toString();
- }
-
- private String removeCurlyBrace(String parameter) {
- return parameter.substring(1, parameter.length() - 1);
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/GwtConfiguration.java b/user/src/com/google/gwt/validation/client/GwtConfiguration.java
deleted file mode 100644
index 4f81609..0000000
--- a/user/src/com/google/gwt/validation/client/GwtConfiguration.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client;
-
-import com.google.gwt.validation.client.spi.GwtValidationProvider;
-
-import java.io.InputStream;
-
-import javax.validation.spi.BootstrapState;
-
-/**
- * Extends {@link BaseGwtConfiguration} with just the parts that are not GWT
- * compatible.
- */
-public class GwtConfiguration extends BaseGwtConfiguration {
-
- public GwtConfiguration(GwtValidationProvider gwtValidationProvider,
- BootstrapState state) {
- super(gwtValidationProvider, state);
- }
-
- public GwtConfiguration addMapping(InputStream stream) {
- throw new UnsupportedOperationException("GWT does not support InputStreams");
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/GwtConstraintValidatorFactory.java b/user/src/com/google/gwt/validation/client/GwtConstraintValidatorFactory.java
deleted file mode 100644
index 5a567da..0000000
--- a/user/src/com/google/gwt/validation/client/GwtConstraintValidatorFactory.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorFactory;
-
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.
- */
-
-/**
- * GWT does not support {@link ConstraintValidatorFactory} use
- * {@link com.google.gwt.core.client.GWT;#create(Class)} instead. Using this
- * class throws a {@link UnsupportedOperationException}.
- */
-public class GwtConstraintValidatorFactory implements
- ConstraintValidatorFactory {
-
- /**
- * Always throws {@link UnsupportedOperationException}.
- *
- * @throws UnsupportedOperationException
- */
- public <T extends ConstraintValidator<?, ?>> T getInstance(Class<T> key) {
- throw new UnsupportedOperationException("GWT does not support "
- + ConstraintValidatorFactory.class.getName()
- + " use GWT.create instead");
- }
-
-}
diff --git a/user/src/com/google/gwt/validation/client/GwtMessageInterpolator.java b/user/src/com/google/gwt/validation/client/GwtMessageInterpolator.java
deleted file mode 100644
index 7d2578c..0000000
--- a/user/src/com/google/gwt/validation/client/GwtMessageInterpolator.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client;
-
-import java.util.Locale;
-
-/**
- * Simple GWT {@link javax.validation.MessageInterpolator}.
- */
-public class GwtMessageInterpolator extends BaseMessageInterpolator {
- // This class only has the parts the need to overridden for GWT
-
- public String interpolate(String messageTemplate, Context context,
- Locale locale) {
- return messageTemplate;
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/GwtTraversableResolver.java b/user/src/com/google/gwt/validation/client/GwtTraversableResolver.java
deleted file mode 100644
index 38d3880..0000000
--- a/user/src/com/google/gwt/validation/client/GwtTraversableResolver.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client;
-
-import java.lang.annotation.ElementType;
-
-import javax.validation.Path;
-import javax.validation.Path.Node;
-import javax.validation.TraversableResolver;
-
-/**
- * GWT {@link TraversableResolver}.
- */
-public class GwtTraversableResolver implements TraversableResolver {
-
- public boolean isCascadable(Object traversableObject,
- Node traversableProperty, Class<?> rootBeanType,
- Path pathToTraversableObject, ElementType elementType) {
- // TODO(nchalko) implement
- return false;
- }
-
- public boolean isReachable(Object traversableObject,
- Node traversableProperty, Class<?> rootBeanType,
- Path pathToTraversableObject, ElementType elementType) {
- // TODO(nchalko) implement
- return false;
- }
-
-}
diff --git a/user/src/com/google/gwt/validation/client/GwtValidation.java b/user/src/com/google/gwt/validation/client/GwtValidation.java
deleted file mode 100644
index 70f82c8..0000000
--- a/user/src/com/google/gwt/validation/client/GwtValidation.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client;
-
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Annotates a {@code javax.validation.Validator} explicitly listing the classes
- * that can be validated in GWT.
- * <p>
- * Define the Validator you want, explicitly listing the class you want to
- * validate.
- *
- * <pre>
- * @GwtValidation(MyBean.class, MyOther.class)
- * public interface MyValidator extends javax.validation.Validator {
- * }
- * </pre>
- * Create and use the validator.
- *
- * <pre>
- * MyValidator validator = GWT.create(MyValidator.class);
- * MyBean bean = new MyBean();
- * ...
- * Set<ConstraintViolation<MyBean>> violations = validator.validate(bean);
- * </pre>
- *
- * <p>
- * NOTE: Validation is done using only the Constraints found on the Classes
- * listed in the annotation. If you have
- *
- * <pre>
- * class MyBean {
- * @Null
- * String getName(){return name;}
- * }
- * class MySubBean extends MyBean {
- * @Size(min = 5)
- * String getName(){return super.getName();}
- * }
- * </pre>
- *
- * And then create your {@link javax.validation.ValidatorFactory
- * ValidatorFactory} using
- *
- * <pre>
- * @GwtValidation(MyBean.class, MyOther.class)}
- * </pre>
- *
- * but call validator with the subclass like
- *
- * <pre>
- * MySubBean bean = new MySubBean();
- * Set<ConstraintViolation<MyBean>> violations = validator.validate(bean);
- * </pre>
- *
- * The {@code Size} constraint will not be validated.
- *
- * Instead make sure you list the all BeanTypes that will be directly validated
- * in the {@link GwtValidation} annotation.
- *
- *
- */
-@Documented
-@Target(TYPE)
-@Retention(RUNTIME)
-public @interface GwtValidation {
-
- /**
- * The list of Groups which can be processed by the annotated
- * {@code Validator}, empty means all groups.
- */
- Class<?>[] groups() default {};
-
- /**
- * The list of Classes which can be validated by the annotated
- * {@code Validator}.
- */
- Class<?>[] value();
-}
diff --git a/user/src/com/google/gwt/validation/client/GwtValidationProviderResolver.java b/user/src/com/google/gwt/validation/client/GwtValidationProviderResolver.java
deleted file mode 100644
index 66ea36b..0000000
--- a/user/src/com/google/gwt/validation/client/GwtValidationProviderResolver.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client;
-
-import com.google.gwt.core.client.GWT;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import javax.validation.ValidationProviderResolver;
-import javax.validation.spi.ValidationProvider;
-
-/**
- * The default GWT {@link ValidationProviderResolver}. This always returns the
- * single default ValidationProvider using {@link GWT#create(Class)}.
- */
-public class GwtValidationProviderResolver implements
- ValidationProviderResolver {
-
- private static final List<ValidationProvider<?>> defaultList =
- Collections.unmodifiableList(createValidationProviderList());
-
- private static ArrayList<ValidationProvider<?>> createValidationProviderList() {
- ArrayList<ValidationProvider<?>> temp = new ArrayList<ValidationProvider<?>>();
- ValidationProvider<?> provider = GWT.create(ValidationProvider.class);
- temp.add(provider);
- return temp;
- }
-
- public List<ValidationProvider<?>> getValidationProviders() {
- return defaultList;
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/GwtValidatorContext.java b/user/src/com/google/gwt/validation/client/GwtValidatorContext.java
deleted file mode 100644
index 259b869..0000000
--- a/user/src/com/google/gwt/validation/client/GwtValidatorContext.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.validation.client.impl.AbstractGwtValidator;
-
-import javax.validation.ConstraintValidatorFactory;
-import javax.validation.MessageInterpolator;
-import javax.validation.TraversableResolver;
-import javax.validation.Validator;
-import javax.validation.ValidatorContext;
-import javax.validation.ValidatorFactory;
-
-/**
- * GWT {@link ValidatorContext}.
- */
-public class GwtValidatorContext implements ValidatorContext {
-
- private final AbstractGwtValidatorFactory validatorFactory = GWT.create(ValidatorFactory.class);
-
- private ConstraintValidatorFactory constraintValidatorfactory = validatorFactory.getConstraintValidatorFactory();
- private MessageInterpolator messageInterpolator = validatorFactory.getMessageInterpolator();
- private TraversableResolver traversableResolver = validatorFactory.getTraversableResolver();
-
- public ValidatorContext constraintValidatorFactory(
- ConstraintValidatorFactory factory) {
- if (factory == null) {
- this.constraintValidatorfactory = GWT.create(ConstraintValidatorFactory.class);
- } else {
- this.constraintValidatorfactory = factory;
- }
- return this;
- }
-
- public Validator getValidator() {
- AbstractGwtValidator validator = validatorFactory.createValidator();
- validator.init(constraintValidatorfactory, messageInterpolator,
- traversableResolver);
- return validator;
- }
-
- public ValidatorContext messageInterpolator(
- MessageInterpolator messageInterpolator) {
- if (messageInterpolator == null) {
- this.messageInterpolator = GWT.create(MessageInterpolator.class);
- } else {
- this.messageInterpolator = messageInterpolator;
- }
- return this;
- }
-
- public ValidatorContext traversableResolver(
- TraversableResolver traversableResolver) {
- if (traversableResolver == null) {
- this.traversableResolver = GWT.create(TraversableResolver.class);
- } else {
- this.traversableResolver = traversableResolver;
- }
- return this;
- }
-
-}
diff --git a/user/src/com/google/gwt/validation/client/NullUserValidationMessageResolver.java b/user/src/com/google/gwt/validation/client/NullUserValidationMessageResolver.java
deleted file mode 100644
index 0cc8a3f..0000000
--- a/user/src/com/google/gwt/validation/client/NullUserValidationMessageResolver.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client;
-
-/**
- * Always resolves message keys to null.
- */
-public class NullUserValidationMessageResolver implements
- UserValidationMessagesResolver {
-
- public String get(String key) {
- return null;
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/ProviderValidationMessageResolver.java b/user/src/com/google/gwt/validation/client/ProviderValidationMessageResolver.java
deleted file mode 100644
index 51a461c..0000000
--- a/user/src/com/google/gwt/validation/client/ProviderValidationMessageResolver.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client;
-
-/**
- * Validation Providers implement this to resolve Validation Messages.
- */
-public interface ProviderValidationMessageResolver extends ValidationMessageResolver {
-}
diff --git a/user/src/com/google/gwt/validation/client/UserValidationMessagesResolver.java b/user/src/com/google/gwt/validation/client/UserValidationMessagesResolver.java
deleted file mode 100644
index 41a0620..0000000
--- a/user/src/com/google/gwt/validation/client/UserValidationMessagesResolver.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client;
-
-/**
- * Validation Providers implement this to resolve Validation Messages. including
- * overriding the default {@link ProviderValidationMessageResolver}.
- */
-public interface UserValidationMessagesResolver extends ValidationMessageResolver {
-}
diff --git a/user/src/com/google/gwt/validation/client/Validation.java b/user/src/com/google/gwt/validation/client/Validation.java
deleted file mode 100644
index c111e1a..0000000
--- a/user/src/com/google/gwt/validation/client/Validation.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client;
-
-import com.google.gwt.core.client.GWT;
-
-import java.util.List;
-
-import javax.validation.Configuration;
-import javax.validation.ValidationException;
-import javax.validation.ValidationProviderResolver;
-import javax.validation.ValidatorFactory;
-import javax.validation.bootstrap.GenericBootstrap;
-import javax.validation.bootstrap.ProviderSpecificBootstrap;
-import javax.validation.spi.BootstrapState;
-import javax.validation.spi.ValidationProvider;
-
-/**
- * This class is the entry point for Bean Validation. There are three ways to
- * bootstrap it:
- * <ul>
- * <li>
- * The easiest approach is to build the default <code>ValidatorFactory</code>.
- *
- * <pre>{@code ValidatorFactory factory = Validation.buildDefaultValidatorFactory();}</pre>
- * In this case, the default validation provider resolver will be used to locate
- * available providers. The chosen provider is defined as followed:
- * <ul>
- * <li>Since GWT does not support XML configuration, the first provider returned
- * by the <code>ValidationProviderResolver</code> instance is used.</li>
- * </ul>
- * </li>
- * <li>
- * The second bootstrap approach allows to choose a custom
- * <code>ValidationProviderResolver</code>. The chosen
- * <code>ValidationProvider</code> is then determined in the same way as in the
- * default bootstrapping case (see above).
- *
- * <pre>{@code
- * Configuration<?> configuration = Validation
- * .byDefaultProvider()
- * .providerResolver( new MyResolverStrategy() )
- * .configure();
- * ValidatorFactory factory = configuration.buildValidatorFactory();}
- * </pre>
- * </li>
- * <li>
- * The third approach allows you to specify explicitly and in a type safe
- * fashion the expected provider.
- * <p/>
- * Optionally you can choose a custom <code>ValidationProviderResolver</code>.
- *
- * <pre>{@code
- * ACMEConfiguration configuration = Validation
- * .byProvider(ACMEProvider.class)
- * .providerResolver( new MyResolverStrategy() ) // optionally set the provider resolver
- * .configure();
- * ValidatorFactory factory = configuration.buildValidatorFactory();}
- * </pre>
- * </li>
- * </ul>
- * Note:<br/>
- * <ul>
- * <li>
- * The <code>ValidatorFactory</code> object built by the bootstrap process
- * should be cached and shared amongst <code>Validator</code> consumers.</li>
- * <li>
- * This class is thread-safe.</li>
- * </ul>
- *
- * This class was modified by Google from the original
- * javax.validation.Validation source to make it suitable for GWT.
- */
-public class Validation {
-
- // private class, not exposed
- private static class GenericBootstrapImpl implements GenericBootstrap,
- BootstrapState {
-
- private ValidationProviderResolver defaultResolver;
- private ValidationProviderResolver resolver;
-
- public Configuration<?> configure() {
- ValidationProviderResolver aResolver = this.resolver == null
- ? getDefaultValidationProviderResolver() : this.resolver;
-
- List<ValidationProvider<?>> resolvers;
- try {
- resolvers = aResolver.getValidationProviders();
- } catch (RuntimeException re) {
- throw new ValidationException(
- "Unable to get available provider resolvers.", re);
- }
-
- if (resolvers.size() == 0) {
- // FIXME looks like an assertion error almost
- throw new ValidationException("Unable to find a default provider");
- }
-
- Configuration<?> config;
- try {
- config = aResolver.getValidationProviders().get(0).createGenericConfiguration(
- this);
- } catch (RuntimeException re) {
- throw new ValidationException("Unable to instantiate Configuration.",
- re);
- }
-
- return config;
- }
-
- public ValidationProviderResolver getDefaultValidationProviderResolver() {
- if (defaultResolver == null) {
- defaultResolver = GWT.create(ValidationProviderResolver.class);
- }
- return defaultResolver;
- }
-
- public ValidationProviderResolver getValidationProviderResolver() {
- return resolver;
- }
-
- public GenericBootstrap providerResolver(ValidationProviderResolver resolver) {
- this.resolver = resolver;
- return this;
- }
- }
-
- // private class, not exposed
- private static class ProviderSpecificBootstrapImpl
- <T extends Configuration<T>, U extends ValidationProvider<T>>
- implements ProviderSpecificBootstrap<T> {
-
- private ValidationProviderResolver resolver;
- private final Class<U> validationProviderClass;
-
- public ProviderSpecificBootstrapImpl(Class<U> validationProviderClass) {
- this.validationProviderClass = validationProviderClass;
- }
-
- /**
- * Determine the provider implementation suitable for byProvider(Class) and
- * delegate the creation of this specific Configuration subclass to the
- * provider.
- *
- * @return a Configuration sub interface implementation
- */
- public T configure() {
- if (validationProviderClass == null) {
- throw new ValidationException(
- "builder is mandatory. Use Validation.byDefaultProvider() to use the generic provider discovery mechanism");
- }
- // used mostly as a BootstrapState
- GenericBootstrapImpl state = new GenericBootstrapImpl();
- if (resolver == null) {
- resolver = state.getDefaultValidationProviderResolver();
- } else {
- // stay null if no resolver is defined
- state.providerResolver(resolver);
- }
-
- List<ValidationProvider<?>> resolvers;
- try {
- resolvers = resolver.getValidationProviders();
- } catch (RuntimeException re) {
- throw new ValidationException(
- "Unable to get available provider resolvers.", re);
- }
-
- for (ValidationProvider<?> provider : resolvers) {
- // GWT validation only support exact matches.
- if (validationProviderClass.equals(provider.getClass())) {
- @SuppressWarnings("unchecked")
- ValidationProvider<T> specificProvider = (ValidationProvider<T>) provider;
- return specificProvider.createSpecializedConfiguration(state);
- }
- }
- throw new ValidationException("Unable to find provider: "
- + validationProviderClass);
- }
-
- /**
- * Optionally define the provider resolver implementation used. If not
- * defined, use the default ValidationProviderResolver
- *
- * @param resolver ValidationProviderResolver implementation used
- *
- * @return self
- */
- public ProviderSpecificBootstrap<T> providerResolver(
- ValidationProviderResolver resolver) {
- this.resolver = resolver;
- return this;
- }
- }
-
- /**
- * Build and return a <code>ValidatorFactory</code> instance based on the
- * default Bean Validation provider.
- * <p/>
- * The provider list is resolved using the default validation provider
- * resolver logic.
- * <p/>
- * The code is semantically equivalent to
- * <code>Validation.byDefaultProvider().configure().buildValidatorFactory()</code>
- *
- * @return <code>ValidatorFactory</code> instance.
- *
- * @throws ValidationException if the ValidatorFactory cannot be built
- */
- public static ValidatorFactory buildDefaultValidatorFactory() {
- return byDefaultProvider().configure().buildValidatorFactory();
- }
-
- /**
- * Build a <code>Configuration</code>. The provider list is resolved using the
- * strategy provided to the bootstrap state.
- *
- * <pre>
- * Configuration<?> configuration = Validation
- * .byDefaultProvider()
- * .providerResolver( new MyResolverStrategy() )
- * .configure();
- * ValidatorFactory factory = configuration.buildValidatorFactory();
- * </pre>
- *
- * The first available provider will be returned.
- *
- * @return instance building a generic <code>Configuration</code> complaint
- * with the bootstrap state provided.
- */
- public static GenericBootstrap byDefaultProvider() {
- return new GenericBootstrapImpl();
- }
-
- /**
- * Build a <code>Configuration</code> for a particular provider
- * implementation. Optionally overrides the provider resolution strategy used
- * to determine the provider.
- * <p/>
- * Used by applications targeting a specific provider programmatically.
- * <p/>
- *
- * <pre>
- * ACMEConfiguration configuration =
- * Validation.byProvider(ACMEProvider.class)
- * .providerResolver( new MyResolverStrategy() )
- * .configure();
- * </pre>
- * , where <code>ACMEConfiguration</code> is the <code>Configuration</code>
- * sub interface uniquely identifying the ACME Bean Validation provider. and
- * <code>ACMEProvider</code> is the <code>ValidationProvider</code>
- * implementation of the ACME provider.
- *
- * @param providerType the <code>ValidationProvider</code> implementation type
- *
- * @return instance building a provider specific <code>Configuration</code>
- * sub interface implementation.
- */
- public static <T extends Configuration<T>,U extends ValidationProvider<T>>
- ProviderSpecificBootstrap<T> byProvider(Class<U> providerType) {
- return new ProviderSpecificBootstrapImpl<T, U>(providerType);
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/ValidationMessageResolver.java b/user/src/com/google/gwt/validation/client/ValidationMessageResolver.java
deleted file mode 100644
index 5b96dd9..0000000
--- a/user/src/com/google/gwt/validation/client/ValidationMessageResolver.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client;
-
-/**
- * Users and Validation providers implement this to resolve ValidationMessages
- */
-public interface ValidationMessageResolver {
-
- /**
- * Lookup the value of the given key.
- *
- * @param key the key to find
- * @return the value of the key or {@code null} if not found.
- */
- String get(String key);
-}
\ No newline at end of file
diff --git a/user/src/com/google/gwt/validation/client/constraints/AbstractDecimalMaxValidator.java b/user/src/com/google/gwt/validation/client/constraints/AbstractDecimalMaxValidator.java
deleted file mode 100644
index 57fb0eb..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/AbstractDecimalMaxValidator.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import java.math.BigDecimal;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.constraints.DecimalMax;
-
-/**
- * Abstract {@link DecimalMax} constraint validator implementation for a
- * <code>T</code>.
- *
- * @param <T> the type of object to validate
- */
-public abstract class AbstractDecimalMaxValidator<T> implements
- ConstraintValidator<DecimalMax, T> {
-
- private BigDecimal max;
-
- public AbstractDecimalMaxValidator() {
- super();
- }
-
- public final void initialize(DecimalMax constraintAnnotation) {
- try {
- max = new BigDecimal(constraintAnnotation.value());
- } catch (NumberFormatException e) {
- throw new IllegalArgumentException(constraintAnnotation.value()
- + " does not represent a valid BigDecimal format", e);
- }
- }
-
- protected final boolean isValid(BigDecimal bigValue) {
- return max.compareTo(bigValue) >= 0;
- }
-}
\ No newline at end of file
diff --git a/user/src/com/google/gwt/validation/client/constraints/AbstractDecimalMinValidator.java b/user/src/com/google/gwt/validation/client/constraints/AbstractDecimalMinValidator.java
deleted file mode 100644
index c0c6748..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/AbstractDecimalMinValidator.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import java.math.BigDecimal;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.constraints.DecimalMin;
-
-/**
- * Abstract {@link DecimalMin} constraint validator implementation for a
- * <code>T</code>.
- *
- * @param <T> the type of object to validate
- */
-public abstract class AbstractDecimalMinValidator<T> implements
- ConstraintValidator<DecimalMin, T> {
-
- private BigDecimal min;
-
- public final void initialize(DecimalMin constraintAnnotation) {
- try {
- min = new BigDecimal(constraintAnnotation.value());
- } catch (NumberFormatException e) {
- throw new IllegalArgumentException(constraintAnnotation.value()
- + " does not represent a valid BigDecimal format", e);
- }
- }
-
- protected final boolean isValid(BigDecimal bigValue) {
- return min.compareTo(bigValue) <= 0;
- }
-}
\ No newline at end of file
diff --git a/user/src/com/google/gwt/validation/client/constraints/AbstractDigitsValidator.java b/user/src/com/google/gwt/validation/client/constraints/AbstractDigitsValidator.java
deleted file mode 100644
index 3b21514..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/AbstractDigitsValidator.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import java.math.BigDecimal;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.constraints.Digits;
-
-/**
- * Abstract {@link Digits} constraint validator implementation for a
- * <code>T</code>.
- *
- * @param <T> the type of object to validate
- */
-public abstract class AbstractDigitsValidator<T> implements
- ConstraintValidator<Digits, T> {
-
- private int fraction;
- private int integer;
-
- public final void initialize(Digits constraintAnnotation) {
- if (!(constraintAnnotation.fraction() >= 0)) {
- throw new IllegalArgumentException(
- "@Digits.fraction must be a nonnegative nubmer");
- }
- if (!(constraintAnnotation.integer() >= 0)) {
- throw new IllegalArgumentException(
- "@Digits.integer must be a nonnegative nubmer");
- }
- fraction = constraintAnnotation.fraction();
- integer = constraintAnnotation.integer();
- }
-
- protected final boolean isValid(BigDecimal bigValue) {
- int integerLength = bigValue.precision() - bigValue.scale();
- if (integerLength > integer) {
- return false;
- }
- int fractionalLength = bigValue.scale() < 0 ? 0 : bigValue.scale();
- return fractionalLength <= fraction;
- }
-}
\ No newline at end of file
diff --git a/user/src/com/google/gwt/validation/client/constraints/AbstractMaxValidator.java b/user/src/com/google/gwt/validation/client/constraints/AbstractMaxValidator.java
deleted file mode 100644
index 5465269..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/AbstractMaxValidator.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.constraints.Max;
-
-/**
- *
- * @param <T> the type of object to validate
- */
-public abstract class AbstractMaxValidator<T> implements
- ConstraintValidator<Max, T> {
-
- private long max;
-
- public final void initialize(Max constraintAnnotation) {
- max = constraintAnnotation.value();
- }
-
- protected final boolean isValid(Number value) {
- if (value instanceof BigDecimal) {
- return ((BigDecimal) value).compareTo(BigDecimal.valueOf(max)) <= 0;
- } else if (value instanceof BigInteger) {
- return ((BigInteger) value).compareTo(BigInteger.valueOf(max)) <= 0;
- } else {
- return value.longValue() <= max;
- }
- }
-}
\ No newline at end of file
diff --git a/user/src/com/google/gwt/validation/client/constraints/AbstractMinValidator.java b/user/src/com/google/gwt/validation/client/constraints/AbstractMinValidator.java
deleted file mode 100644
index 0fab154..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/AbstractMinValidator.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.constraints.Min;
-
-/**
- * Abstract {@link Min} constraint validator implementation for a <code>T</code>
- * .
- *
- * @param <T> the type of object to validate
- */
-public abstract class AbstractMinValidator<T> implements
- ConstraintValidator<Min, T> {
-
- private long min;
-
- public final void initialize(Min constraintAnnotation) {
- min = constraintAnnotation.value();
- }
-
- protected final boolean isValid(Number value) {
- if (value instanceof BigDecimal) {
- return ((BigDecimal) value).compareTo(BigDecimal.valueOf(min)) >= 0;
- } else if (value instanceof BigInteger) {
- return ((BigInteger) value).compareTo(BigInteger.valueOf(min)) >= 0;
- } else {
- return value.longValue() >= min;
- }
- }
-}
\ No newline at end of file
diff --git a/user/src/com/google/gwt/validation/client/constraints/AbstractSizeValidator.java b/user/src/com/google/gwt/validation/client/constraints/AbstractSizeValidator.java
deleted file mode 100644
index 43d38b5..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/AbstractSizeValidator.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.constraints.Size;
-
-/**
- * Abstract {@link Size} constraint validator implementation.
- *
- * @param <T>
- */
-public abstract class AbstractSizeValidator<T> implements
- ConstraintValidator<Size, T> {
-
- private int min;
- private int max;
-
- public AbstractSizeValidator() {
- super();
- }
-
- public final void initialize(Size annotation) {
- if (!(annotation.min() >= 0)) {
- throw new IllegalArgumentException(
- "@Size.min must be a nonnegative nubmer");
- }
- if (!(annotation.max() >= 0)) {
- throw new IllegalArgumentException(
- "@Size.max must be a nonnegative nubmer");
- }
- if (!(annotation.min() <= annotation.max())) {
- throw new IllegalArgumentException(
- "@Size.min must be less than or equal to @Size.max");
- }
- min = annotation.min();
- max = annotation.max();
- }
-
- protected final boolean isLengthValid(int length) {
- return min <= length && length <= max;
- }
-}
\ No newline at end of file
diff --git a/user/src/com/google/gwt/validation/client/constraints/AssertFalseValidator.java b/user/src/com/google/gwt/validation/client/constraints/AssertFalseValidator.java
deleted file mode 100644
index ee44197..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/AssertFalseValidator.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
-import javax.validation.constraints.AssertFalse;
-
-/**
- * {@link AssertFalse} constraint validator implementation.
- */
-public class AssertFalseValidator implements
- ConstraintValidator<AssertFalse, Boolean> {
-
- public void initialize(AssertFalse constraintAnnotation) {
- }
-
- public boolean isValid(Boolean value, ConstraintValidatorContext context) {
- return value == null || !value.booleanValue();
- }
-
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/AssertTrueValidator.java b/user/src/com/google/gwt/validation/client/constraints/AssertTrueValidator.java
deleted file mode 100644
index dfd5827..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/AssertTrueValidator.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
-import javax.validation.constraints.AssertTrue;
-
-/**
- * {@link AssertTrue} constraint validator implementation.
- */
-public class AssertTrueValidator implements
- ConstraintValidator<AssertTrue, Boolean> {
-
- public void initialize(AssertTrue constraintAnnotation) {
- }
-
- public boolean isValid(Boolean value, ConstraintValidatorContext context) {
- return value == null || value.booleanValue();
- }
-
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/DecimalMaxValidatorForNumber.java b/user/src/com/google/gwt/validation/client/constraints/DecimalMaxValidatorForNumber.java
deleted file mode 100644
index 668b3d5..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/DecimalMaxValidatorForNumber.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * {@link javax.validation.constraints.DecimalMax} constraint validator
- * implementation for a {@link Number}.
- */
-public class DecimalMaxValidatorForNumber extends
- AbstractDecimalMaxValidator<Number> {
-
- public boolean isValid(Number value, ConstraintValidatorContext context) {
- if (value == null) {
- return true;
- }
- if (value instanceof BigDecimal) {
- return isValid((BigDecimal) value);
- }
- if (value instanceof BigInteger) {
- return isValid(new BigDecimal((BigInteger) value));
- }
- return isValid(BigDecimal.valueOf(value.doubleValue()));
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/DecimalMaxValidatorForString.java b/user/src/com/google/gwt/validation/client/constraints/DecimalMaxValidatorForString.java
deleted file mode 100644
index 16e378f..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/DecimalMaxValidatorForString.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import java.math.BigDecimal;
-
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * {@link javax.validation.constraints.DecimalMax} constraint validator
- * implementation for a {@link String}.
- */
-public class DecimalMaxValidatorForString extends
- AbstractDecimalMaxValidator<String> {
-
- public boolean isValid(String value, ConstraintValidatorContext context) {
- if (value == null) {
- return true;
- }
- BigDecimal bigValue;
- try {
- bigValue = new BigDecimal(value);
- } catch (NumberFormatException e) {
- return false;
- }
- return isValid(bigValue);
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/DecimalMinValidatorForNumber.java b/user/src/com/google/gwt/validation/client/constraints/DecimalMinValidatorForNumber.java
deleted file mode 100644
index eaf5169..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/DecimalMinValidatorForNumber.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * {@link javax.validation.constraints.DecimalMin} constraint validator
- * implementation for a {@link Number}.
- */
-public class DecimalMinValidatorForNumber extends
- AbstractDecimalMinValidator<Number> {
-
- public boolean isValid(Number value, ConstraintValidatorContext context) {
- if (value == null) {
- return true;
- } else if (value instanceof BigDecimal) {
- BigDecimal bigValue = (BigDecimal) value;
- return isValid(bigValue);
- } else if (value instanceof BigInteger) {
- return isValid(new BigDecimal((BigInteger) value));
- } else {
- return isValid(BigDecimal.valueOf(value.doubleValue()));
- }
- }
-
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/DecimalMinValidatorForString.java b/user/src/com/google/gwt/validation/client/constraints/DecimalMinValidatorForString.java
deleted file mode 100644
index eca67de..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/DecimalMinValidatorForString.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import java.math.BigDecimal;
-
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * {@link javax.validation.constraints.DecimalMax} constraint validator
- * implementation for a {@link String}.
- */
-public class DecimalMinValidatorForString extends
- AbstractDecimalMinValidator<String> {
-
- public boolean isValid(String value, ConstraintValidatorContext context) {
- if (value == null) {
- return true;
- }
- BigDecimal bigValue;
- try {
- bigValue = new BigDecimal(value);
- } catch (NumberFormatException e) {
- return false;
- }
- return isValid(bigValue);
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/DigitsValidatorForNumber.java b/user/src/com/google/gwt/validation/client/constraints/DigitsValidatorForNumber.java
deleted file mode 100644
index 8e10b66..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/DigitsValidatorForNumber.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * {@link javax.validation.constraints.Digits} constraint validator
- * implementation for a {@link Number}.
- */
-public class DigitsValidatorForNumber extends AbstractDigitsValidator<Number> {
-
- public boolean isValid(Number value, ConstraintValidatorContext context) {
- if (value == null) {
- return true;
- } else if (value instanceof BigDecimal) {
- BigDecimal bigValue = (BigDecimal) value;
- return isValid(bigValue);
- } else if (value instanceof BigInteger) {
- return isValid(new BigDecimal((BigInteger) value));
- } else {
- return isValid(BigDecimal.valueOf(value.doubleValue()));
- }
- }
-
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/DigitsValidatorForString.java b/user/src/com/google/gwt/validation/client/constraints/DigitsValidatorForString.java
deleted file mode 100644
index 227453d..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/DigitsValidatorForString.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import java.math.BigDecimal;
-
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * {@link javax.validation.constraints.Digits} constraint validator
- * implementation for a {@link String}.
- */
-public class DigitsValidatorForString extends AbstractDigitsValidator<String> {
-
- public boolean isValid(String value, ConstraintValidatorContext context) {
- if (value == null) {
- return true;
- }
- BigDecimal bigValue;
- try {
- bigValue = new BigDecimal(value);
- } catch (NumberFormatException e) {
- return false;
- }
- return isValid(bigValue);
- }
-
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/FutureValidatorForDate.java b/user/src/com/google/gwt/validation/client/constraints/FutureValidatorForDate.java
deleted file mode 100644
index f007213..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/FutureValidatorForDate.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import java.util.Date;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
-import javax.validation.constraints.Future;
-
-/**
- * {@link Future} constraint validator implementation for a
- * {@link java.util.Date}.
- */
-public class FutureValidatorForDate implements
- ConstraintValidator<Future, Date> {
-
- public void initialize(Future constraintAnnotation) {
- }
-
- public boolean isValid(Date value, ConstraintValidatorContext context) {
- if (value == null) {
- return true;
- }
- return value.after(new Date());
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/MaxValidatorForNumber.java b/user/src/com/google/gwt/validation/client/constraints/MaxValidatorForNumber.java
deleted file mode 100644
index e5adf31..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/MaxValidatorForNumber.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * {@link javax.validation.constraints.Max} constraint validator implementation
- * for a {@link Number}.
- */
-public class MaxValidatorForNumber extends AbstractMaxValidator<Number> {
-
- public boolean isValid(Number value, ConstraintValidatorContext context) {
- if (value == null) {
- return true;
- }
- return isValid(value);
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/MaxValidatorForString.java b/user/src/com/google/gwt/validation/client/constraints/MaxValidatorForString.java
deleted file mode 100644
index e3fc8c0..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/MaxValidatorForString.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import java.math.BigDecimal;
-
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * {@link javax.validation.constraints.Max} constraint validator implementation
- * for a {@link String}.
- */
-public class MaxValidatorForString extends AbstractMaxValidator<String> {
-
- public boolean isValid(String value, ConstraintValidatorContext context) {
- if (value == null) {
- return true;
- }
- BigDecimal bigValue;
- try {
- bigValue = new BigDecimal(value);
- } catch (NumberFormatException e) {
- return false;
- }
- return isValid(bigValue);
- }
-
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/MinValidatorForNumber.java b/user/src/com/google/gwt/validation/client/constraints/MinValidatorForNumber.java
deleted file mode 100644
index 16865dd..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/MinValidatorForNumber.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * {@link javax.validation.constraints.Min} constraint validator implementation
- * for a {@link Number}.
- */
-public class MinValidatorForNumber extends AbstractMinValidator<Number> {
-
- public boolean isValid(Number value, ConstraintValidatorContext context) {
- if (value == null) {
- return true;
- }
- return isValid(value);
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/MinValidatorForString.java b/user/src/com/google/gwt/validation/client/constraints/MinValidatorForString.java
deleted file mode 100644
index 7c713af..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/MinValidatorForString.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import java.math.BigDecimal;
-
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * {@link javax.validation.constraints.Min} constraint validator implementation
- * for a {@link String}.
- */
-public class MinValidatorForString extends AbstractMinValidator<String> {
-
- public boolean isValid(String value, ConstraintValidatorContext context) {
- if (value == null) {
- return true;
- }
- BigDecimal bigValue;
- try {
- bigValue = new BigDecimal(value); // TODO(nchalko) deal with i18n
- } catch (NumberFormatException e) {
- return false;
- }
- return isValid(bigValue);
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/NotGwtCompatibleValidator.java b/user/src/com/google/gwt/validation/client/constraints/NotGwtCompatibleValidator.java
deleted file mode 100644
index c1a2949..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/NotGwtCompatibleValidator.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import java.lang.annotation.Annotation;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * Masks a {@link ConstraintValidator} that is not GWT compatible. This
- * validator always fails.
- * <p>
- * Extend this class and implement it as GWT super class. Use validation groups
- * to keep this constraint from being validated on the client.
- *
- * <p>
- * In a super source directory override your validator like this:
- *
- * <pre>
- * public class MyValidator extends
- * NotGwtCompatibleValidator <MyConstraint, MyType>{
- * }
- * </pre>
- *
- * @param <A> the constraint to validate
- * @param <T> the type to validate
- */
-public abstract class NotGwtCompatibleValidator<A extends Annotation, T>
- implements ConstraintValidator<A, T> {
-
- public final void initialize(A constraintAnnotation) {
- }
-
- /**
- * Always fails.
- */
- public final boolean isValid(T value, ConstraintValidatorContext context) {
- // TODO (nchalko) add a custom message
- return false;
- }
-
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/NotNullValidator.java b/user/src/com/google/gwt/validation/client/constraints/NotNullValidator.java
deleted file mode 100644
index 95aec12..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/NotNullValidator.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
-import javax.validation.constraints.NotNull;
-
-/**
- * {@link NotNull} constraint validator implementation.
- */
-public class NotNullValidator implements ConstraintValidator<NotNull, Object> {
-
- public void initialize(NotNull constraintAnnotation) {
- }
-
- public boolean isValid(Object value, ConstraintValidatorContext context) {
- return value != null;
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/NullValidator.java b/user/src/com/google/gwt/validation/client/constraints/NullValidator.java
deleted file mode 100644
index ed46cd6..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/NullValidator.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
-import javax.validation.constraints.Null;
-
-/**
- * {@link Null} constraint validator implementation.
- */
-public class NullValidator implements ConstraintValidator<Null, Object> {
-
- public void initialize(Null constraintAnnotation) {
- }
-
- public boolean isValid(Object value, ConstraintValidatorContext context) {
- return value == null;
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/PastValidatorForDate.java b/user/src/com/google/gwt/validation/client/constraints/PastValidatorForDate.java
deleted file mode 100644
index 4a7f0c8..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/PastValidatorForDate.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import java.util.Date;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
-import javax.validation.constraints.Past;
-
-/**
- * {@link Past} constraint validator implementation for a {@link java.util.Date}.
- */
-public class PastValidatorForDate implements ConstraintValidator<Past, Date> {
-
- public void initialize(Past constraintAnnotation) {
- }
-
- public boolean isValid(Date value, ConstraintValidatorContext context) {
- if (value == null) {
- return true;
- }
- return value.before(new Date());
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/PatternValidator.java b/user/src/com/google/gwt/validation/client/constraints/PatternValidator.java
deleted file mode 100644
index 068703f..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/PatternValidator.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import com.google.gwt.regexp.shared.MatchResult;
-import com.google.gwt.regexp.shared.RegExp;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
-import javax.validation.constraints.Pattern;
-import javax.validation.constraints.Pattern.Flag;
-
-/**
- * {@link Pattern} constraint validator implementation.
- * <p>
- * Note this implementation uses {@link RegExp} which differs from
- * {@link java.util.regex.Pattern}.
- */
-public class PatternValidator implements ConstraintValidator<Pattern, String> {
- private RegExp pattern;
-
- public void initialize(Pattern annotation) {
- Pattern.Flag flags[] = annotation.flags();
- String flagString = "";
- for (Pattern.Flag flag : flags) {
- flagString += toString(flag);
- }
- pattern = RegExp.compile(annotation.regexp(), flagString);
- }
-
- public boolean isValid(String value, ConstraintValidatorContext context) {
- if (value == null) {
- return true;
- }
- MatchResult match = pattern.exec(value);
- if (match == null) {
- return false;
- }
- // Must match the entire string
- return match.getGroup(0).length() == value.length();
- }
-
- private String toString(Flag flag) {
- String value;
- switch (flag) {
- case CASE_INSENSITIVE:
- case UNICODE_CASE:
- value = "i";
- break;
- case MULTILINE:
- value = "m";
- break;
- default:
- throw new IllegalArgumentException(flag
- + " is not a suppoted gwt Pattern (RegExp) flag");
- }
- return value;
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfBoolean.java b/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfBoolean.java
deleted file mode 100644
index 3c3b79d..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfBoolean.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * {@link javax.validation.constraints.Size} constraint validator implementation
- * for a array of {@code boolean}s.
- */
-public class SizeValidatorForArrayOfBoolean extends
- AbstractSizeValidator<boolean[]> {
-
- public boolean isValid(boolean[] value, ConstraintValidatorContext context) {
- if (value == null) {
- return true;
- }
- return isLengthValid(value.length);
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfByte.java b/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfByte.java
deleted file mode 100644
index 6312aee..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfByte.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * {@link javax.validation.constraints.Size} constraint validator implementation
- * for a array of {@code byte}s.
- */
-public class SizeValidatorForArrayOfByte extends AbstractSizeValidator<byte[]> {
-
- public boolean isValid(byte[] value, ConstraintValidatorContext context) {
- if (value == null) {
- return true;
- }
- return isLengthValid(value.length);
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfChar.java b/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfChar.java
deleted file mode 100644
index 407e36a..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfChar.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * {@link javax.validation.constraints.Size} constraint validator implementation
- * for a array of {@code char}s.
- */
-public class SizeValidatorForArrayOfChar extends AbstractSizeValidator<char[]> {
-
- public boolean isValid(char[] value, ConstraintValidatorContext context) {
- if (value == null) {
- return true;
- }
- return isLengthValid(value.length);
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfDouble.java b/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfDouble.java
deleted file mode 100644
index d3b1feb..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfDouble.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * {@link javax.validation.constraints.Size} constraint validator implementation
- * for a array of {@code double}s.
- */
-public class SizeValidatorForArrayOfDouble extends
- AbstractSizeValidator<double[]> {
-
- public boolean isValid(double[] value, ConstraintValidatorContext context) {
- if (value == null) {
- return true;
- }
- return isLengthValid(value.length);
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfFloat.java b/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfFloat.java
deleted file mode 100644
index 1202a90..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfFloat.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * {@link javax.validation.constraints.Size} constraint validator implementation
- * for a array of {@code float}s.
- */
-public class SizeValidatorForArrayOfFloat extends
- AbstractSizeValidator<float[]> {
-
- public boolean isValid(float[] value, ConstraintValidatorContext context) {
- if (value == null) {
- return true;
- }
- return isLengthValid(value.length);
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfInt.java b/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfInt.java
deleted file mode 100644
index 160f286..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfInt.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * {@link javax.validation.constraints.Size} constraint validator implementation
- * for a array of {@code int}s.
- */
-public class SizeValidatorForArrayOfInt extends AbstractSizeValidator<int[]> {
-
- public boolean isValid(int[] value, ConstraintValidatorContext context) {
- if (value == null) {
- return true;
- }
- return isLengthValid(value.length);
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfLong.java b/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfLong.java
deleted file mode 100644
index 552fcfd..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfLong.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * {@link javax.validation.constraints.Size} constraint validator implementation
- * for a array of {@code long}s.
- */
-public class SizeValidatorForArrayOfLong extends AbstractSizeValidator<long[]> {
-
- public boolean isValid(long[] value, ConstraintValidatorContext context) {
- if (value == null) {
- return true;
- }
- return isLengthValid(value.length);
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfObject.java b/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfObject.java
deleted file mode 100644
index 3264f43..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfObject.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * {@link javax.validation.constraints.Size} constraint validator implementation
- * for a array of {@link Object}s.
- */
-public class SizeValidatorForArrayOfObject extends
- AbstractSizeValidator<Object[]> {
-
- public boolean isValid(Object[] value, ConstraintValidatorContext context) {
- if (value == null) {
- return true;
- }
- return isLengthValid(value.length);
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfShort.java b/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfShort.java
deleted file mode 100644
index 683fb3a..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfShort.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * {@link javax.validation.constraints.Size} constraint validator implementation
- * for a array of {@code short}s.
- */
-public class SizeValidatorForArrayOfShort extends
- AbstractSizeValidator<short[]> {
-
- public boolean isValid(short[] value, ConstraintValidatorContext context) {
- if (value == null) {
- return true;
- }
- return isLengthValid(value.length);
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForCollection.java b/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForCollection.java
deleted file mode 100644
index 7f5b4ef..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForCollection.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import java.util.Collection;
-
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * {@link javax.validation.constraints.Size} constraint validator implementation
- * for a {@link Collection}.
- */
-public class SizeValidatorForCollection extends
- AbstractSizeValidator<Collection<?>> {
-
- public boolean isValid(Collection<?> value, ConstraintValidatorContext context) {
- if (value == null) {
- return true;
- }
- return isLengthValid(value.size());
- }
-
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForMap.java b/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForMap.java
deleted file mode 100644
index d820181..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForMap.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import java.util.Map;
-
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * {@link javax.validation.constraints.Size} constraint validator implementation
- * for a {@link Map}.
- */
-public class SizeValidatorForMap extends AbstractSizeValidator<Map<?, ?>> {
-
- public boolean isValid(Map<?, ?> value, ConstraintValidatorContext context) {
- if (value == null) {
- return true;
- }
- return isLengthValid(value.size());
- }
-
-}
diff --git a/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForString.java b/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForString.java
deleted file mode 100644
index c25fcac..0000000
--- a/user/src/com/google/gwt/validation/client/constraints/SizeValidatorForString.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * {@link javax.validation.constraints.Size} constraint validator implementation
- * for a {@link String}.
- */
-public class SizeValidatorForString extends AbstractSizeValidator<String> {
-
- public boolean isValid(String value, ConstraintValidatorContext context) {
- if (value == null) {
- return true;
- }
- return isLengthValid(value.length());
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/impl/AbstractGwtSpecificValidator.java b/user/src/com/google/gwt/validation/client/impl/AbstractGwtSpecificValidator.java
deleted file mode 100644
index 62b482d..0000000
--- a/user/src/com/google/gwt/validation/client/impl/AbstractGwtSpecificValidator.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.impl;
-
-import com.google.gwt.validation.client.BaseMessageInterpolator.ContextImpl;
-
-import java.lang.annotation.Annotation;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintViolation;
-import javax.validation.MessageInterpolator;
-import javax.validation.groups.Default;
-
-/**
- * Base methods for implementing a {@link GwtSpecificValidator}.
- * <p>
- * All methods that do not need to be generated go here.
- *
- * @param <G> the type object to validate
- */
-public abstract class AbstractGwtSpecificValidator<G> implements
- GwtSpecificValidator<G> {
-
- /**
- * Builds attributes one at a time.
- * <p>
- * Used to create a attribute map for annotations.
- */
- public static final class AttributeBuilder {
- private final HashMap<String, Object> tempMap = new HashMap<String, Object>();
-
- private AttributeBuilder() {
- }
-
- public Map<String, Object> build() {
- return Collections.unmodifiableMap(tempMap);
- }
-
- public AttributeBuilder put(String key, Object value) {
- tempMap.put(key, value);
- return this;
- }
- }
-
- public static AttributeBuilder attributeBuilder() {
- return new AttributeBuilder();
- }
-
- protected <A extends Annotation, T, V> void validate(
- GwtValidationContext<T> context, Set<ConstraintViolation<T>> violations,
- G object, V value, ConstraintValidator<A, ? super V> validator,
- ConstraintDescriptorImpl<A> constraintDescriptor, Class<?>[] groups) {
- validator.initialize(constraintDescriptor.getAnnotation());
- ConstraintValidatorContextImpl<A, V> constraintValidatorContext =
- context.createConstraintValidatorContext(constraintDescriptor);
-
- // TODO(nchalko) set empties to Default earlier.
- Set<Class<?>> constraintGroup = constraintDescriptor.getGroups();
- if (groups.length == 0) {
- groups = new Class<?>[]{Default.class};
- }
- if (constraintGroup.isEmpty()) {
- constraintGroup = new HashSet<Class<?>>();
- constraintGroup.add(Default.class);
- }
-
- // check group
- if (!containsAny(groups, constraintGroup)) {
- return;
- }
-
- if (!validator.isValid(value, constraintValidatorContext)) {
- addViolations(//
- context, //
- violations, //
- object, //
- value, //
- constraintDescriptor, //
- constraintValidatorContext);
- }
- }
-
- private <V, T, A extends Annotation> void addViolations(
- GwtValidationContext<T> context, Set<ConstraintViolation<T>> violations,
- G object, V value, ConstraintDescriptorImpl<A> constraintDescriptor,
- ConstraintValidatorContextImpl<A, V> constraintValidatorContext) {
- Set<MessageAndPath> mps = constraintValidatorContext.getMessageAndPaths();
- for (MessageAndPath messageAndPath : mps) {
- ConstraintViolation<T> violation = createConstraintViolation(//
- context, //
- object, //
- value, //
- constraintDescriptor, //
- messageAndPath);
- violations.add(violation);
- }
- }
-
- private <T> boolean containsAny(T[] left, Collection<T> right) {
- for (T t : left) {
- if (right.contains(t)) {
- return true;
- }
- }
- return false;
- }
-
- private <T, V, A extends Annotation> ConstraintViolation<T> createConstraintViolation(
- GwtValidationContext<T> context, G object, V value,
- ConstraintDescriptorImpl<A> constraintDescriptor,
- MessageAndPath messageAndPath) {
- MessageInterpolator messageInterpolator = context.getMessageInterpolator();
- ContextImpl messageContext = new ContextImpl(constraintDescriptor, value);
- String message = messageInterpolator.interpolate(
- messageAndPath.getMessage(), messageContext);
- ConstraintViolation<T> violation = ConstraintViolationImpl.<T> builder() //
- .setConstraintDescriptor(constraintDescriptor) //
- .setInvalidValue(value) //
- .setLeafBean(object) //
- .setMessage(message) //
- .setMessageTemplate(messageAndPath.getMessage()) //
- .setPropertyPath(messageAndPath.getPath()) //
- .setRootBean(context.getRootBean()) //
- .setRootBeanClass(context.getRootBeanClass()) //
- .build();
- return violation;
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/impl/AbstractGwtValidator.java b/user/src/com/google/gwt/validation/client/impl/AbstractGwtValidator.java
deleted file mode 100644
index 1f0ad4f..0000000
--- a/user/src/com/google/gwt/validation/client/impl/AbstractGwtValidator.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.impl;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.validation.ConstraintValidatorFactory;
-import javax.validation.ConstraintViolation;
-import javax.validation.MessageInterpolator;
-import javax.validation.TraversableResolver;
-import javax.validation.ValidationException;
-import javax.validation.Validator;
-
-/**
- * Base methods for implementing {@link Validator} in GWT.
- * <p>
- * All methods that do not need to be generated go here.
- */
-public abstract class AbstractGwtValidator implements Validator {
-
- private final Set<Class<?>> validGroups;
- private ConstraintValidatorFactory factory;
- private MessageInterpolator messageInterpolator;
- private TraversableResolver traversableResolver;
-
- /**
- *
- * @param groups list of valid groups. An empty list defaults to just the
- * {@link javax.validation.groups.Default} group.
- */
- public AbstractGwtValidator(Class<?>... groups) {
- validGroups = new HashSet<Class<?>>(Arrays.asList(groups));
- }
-
- public void init(ConstraintValidatorFactory factory,
- MessageInterpolator messageInterpolator,
- TraversableResolver traversableResolver) {
- this.factory = factory;
- this.messageInterpolator = messageInterpolator;
- this.traversableResolver = traversableResolver;
- }
-
- public <T> T unwrap(Class<T> type) {
- throw new ValidationException();
- }
-
- public abstract <T> Set<ConstraintViolation<T>> validate(
- GwtValidationContext<T> context, Object object, Class<?>... groups)
- throws ValidationException;
-
- protected void checkGroups(Class<?>... groups) {
- // an empty list of valid groups means all groups are valid.
- if (!validGroups.isEmpty()
- && !validGroups.containsAll(Arrays.asList(groups))) {
- throw new IllegalArgumentException(this.getClass()
- + " only processes the following groups " + validGroups);
- }
- }
-
- protected void checkNotNull(Object object, String name)
- throws IllegalArgumentException {
- if (object == null) {
- throw new IllegalArgumentException(name + " can not be null.");
- }
- }
-
- protected ConstraintValidatorFactory getFactory() {
- return factory;
- }
-
- protected MessageInterpolator getMessageInterpolator() {
- return messageInterpolator;
- }
-
- protected TraversableResolver getTraversableResolver() {
- return traversableResolver;
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/impl/ConstraintDescriptorImpl.java b/user/src/com/google/gwt/validation/client/impl/ConstraintDescriptorImpl.java
deleted file mode 100644
index 1feed92..0000000
--- a/user/src/com/google/gwt/validation/client/impl/ConstraintDescriptorImpl.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.impl;
-
-import java.lang.annotation.Annotation;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.Payload;
-import javax.validation.metadata.ConstraintDescriptor;
-
-/**
- * A immutable GWT implementation of {@link ConstraintDescriptor}.
- *
- * @param <T> the constraint annotation to describe.
- */
-public class ConstraintDescriptorImpl<T extends Annotation> implements
- ConstraintDescriptor<T> {
-
- /**
- * Builder for {@link ConstraintDescriptorImpl}.
- *
- * @param <T> the constraint annotation to describe.
- */
- public static class Builder<T extends Annotation> {
- private T annotation;
- private Set<Class<?>> groups;
- private Set<Class<? extends Payload>> payload;
- private List<Class<? extends ConstraintValidator<T, ?>>> constraintValidatorClasses;
- private Map<String, Object> attributes;
- private Set<ConstraintDescriptor<?>> composingConstraints =
- new HashSet<ConstraintDescriptor<?>>();
- private boolean reportAsSingleViolation;
-
- public Builder<T> addComposingConstraint(
- ConstraintDescriptor<?> composingConstraint) {
- this.composingConstraints.add(composingConstraint);
- return this;
- }
-
- public ConstraintDescriptorImpl<T> build() {
- return new ConstraintDescriptorImpl<T>(//
- annotation, //
- groups, //
- payload, //
- constraintValidatorClasses, //
- attributes, //
- composingConstraints, //
- reportAsSingleViolation);
- }
-
- public Builder<T> setAnnotation(T annotation) {
- this.annotation = annotation;
- return this;
- }
-
- public Builder<T> setAttributes(Map<String, Object> attributes) {
- this.attributes = attributes;
- return this;
- }
-
- public Builder<T> setConstraintValidatorClasses(
- Class<? extends ConstraintValidator<T, ?>>[] constraintValidatorClasses) {
- List<Class<? extends ConstraintValidator<T, ?>>> list = Arrays.asList(constraintValidatorClasses);
- setConstraintValidatorClasses(list);
- return this;
- }
-
- public Builder<T> setConstraintValidatorClasses(
- List<Class<? extends ConstraintValidator<T, ?>>> constraintValidatorClasses) {
- this.constraintValidatorClasses = constraintValidatorClasses;
- return this;
- }
-
- public Builder<T> setGroups(Class<?>[] classes) {
- setGroups(new HashSet<Class<?>>(Arrays.asList(classes)));
- return this;
- }
-
- public Builder<T> setGroups(Set<Class<?>> groups) {
- this.groups = groups;
- return this;
- }
-
- public Builder<T> setPayload(Class<? extends Payload>[] classes) {
- setPayload(new HashSet<Class<? extends Payload>>(Arrays.asList(classes)));
- return this;
- }
-
- public Builder<T> setPayload(Set<Class<? extends Payload>> payload) {
- this.payload = payload;
- return this;
- }
-
- public Builder<T> setReportAsSingleViolation(boolean reportAsSingleViolation) {
- this.reportAsSingleViolation = reportAsSingleViolation;
- return this;
- }
- }
-
- public static <T extends Annotation> Builder<T> builder() {
- return new Builder<T>();
- }
-
- private final T annotation;
- private final Set<Class<?>> groups;
- private final Set<Class<? extends Payload>> payload;
- private final List<Class<? extends ConstraintValidator<T, ?>>> constraintValidatorClasses;
- private final Map<String, Object> attributes;
- private final Set<ConstraintDescriptor<?>> composingConstraints;
- private final boolean reportAsSingleViolation;
-
- private ConstraintDescriptorImpl(
- T annotation,
- Set<Class<?>> groups,
- Set<Class<? extends Payload>> payload,
- List<Class<? extends ConstraintValidator<T, ?>>> constraintValidatorClasses,
- Map<String, Object> attributes,
- Set<ConstraintDescriptor<?>> composingConstraints,
- boolean reportAsSingleViolation) {
- super();
- this.annotation = annotation;
- this.groups = groups;
- this.payload = payload;
- this.constraintValidatorClasses = constraintValidatorClasses;
- this.attributes = attributes;
- this.composingConstraints = composingConstraints;
- this.reportAsSingleViolation = reportAsSingleViolation;
- }
-
- public T getAnnotation() {
- return annotation;
- }
-
- public Map<String, Object> getAttributes() {
- return attributes;
- }
-
- public Set<ConstraintDescriptor<?>> getComposingConstraints() {
- return composingConstraints;
- }
-
- public List<Class<? extends ConstraintValidator<T, ?>>> getConstraintValidatorClasses() {
- return constraintValidatorClasses;
- }
-
- public Set<Class<?>> getGroups() {
- return groups;
- }
-
- public Set<Class<? extends Payload>> getPayload() {
- return payload;
- }
-
- public boolean isReportAsSingleViolation() {
- return reportAsSingleViolation;
- }
-
- /**
- * For debugging only. Do not rely on the format. It can change at any time.
- */
- @Override
- public String toString() {
- return String.valueOf(annotation);
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/impl/ConstraintValidatorContextImpl.java b/user/src/com/google/gwt/validation/client/impl/ConstraintValidatorContextImpl.java
deleted file mode 100644
index 07bde24..0000000
--- a/user/src/com/google/gwt/validation/client/impl/ConstraintValidatorContextImpl.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.impl;
-
-import java.lang.annotation.Annotation;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.validation.ConstraintValidatorContext;
-import javax.validation.ConstraintValidatorContext.ConstraintViolationBuilder.NodeBuilderCustomizableContext;
-import javax.validation.ConstraintValidatorContext.ConstraintViolationBuilder.NodeBuilderDefinedContext;
-import javax.validation.ConstraintValidatorContext.ConstraintViolationBuilder.NodeContextBuilder;
-import javax.validation.ConstraintViolation;
-import javax.validation.metadata.ConstraintDescriptor;
-
-/**
- * GWT safe immutable implementation of {@link ConstraintValidatorContext}
- * <p>
- * These objects are very short lived.
- *
- * @param <A> the constraint being validated
- * @param <T> the type of object being validated
- */
-public class ConstraintValidatorContextImpl<A extends Annotation, T> implements
- ConstraintValidatorContext {
-
- /**
- * Builder for {@link ConstraintValidatorContextImpl}.
- */
- public final class ConstraintViolationBuilderImpl implements
- ConstraintViolationBuilder {
-
- private ConstraintValidatorContextImpl<A, T> context;
- private String messageTemplate;
-
- /**
- * @param constraintValidatorContextImpl
- * @param messageTemplate
- */
- public ConstraintViolationBuilderImpl(
- ConstraintValidatorContextImpl<A, T> constraintValidatorContextImpl,
- String messageTemplate) {
- this.context = constraintValidatorContextImpl;
- this.messageTemplate = messageTemplate;
- }
-
- public ConstraintValidatorContext addConstraintViolation() {
- messages.add(new MessageAndPath(context.basePath, messageTemplate));
- return context;
- }
-
- public NodeBuilderDefinedContext addNode(String name) {
- return new NodeBuilderDefinedContextImpl(this, messageTemplate,
- basePath.append(name));
- }
- }
-
- /**
- * Immutable GWT safe {@link NodeBuilderCustomizableContext}.
- */
- public final class NodeBuilderCustomizableContextImpl implements
- NodeBuilderCustomizableContext {
- private final String messageTemplate;
- private final ConstraintViolationBuilderImpl parent;
- private final PathImpl path;
-
- /**
- * @param parent
- * @param messageTemplate
- * @param append
- */
- public NodeBuilderCustomizableContextImpl(
- ConstraintViolationBuilderImpl parent, String messageTemplate,
- PathImpl path) {
- this.parent = parent;
- this.messageTemplate = messageTemplate;
- this.path = path;
- }
-
- public ConstraintValidatorContext addConstraintViolation() {
- return null;
- }
-
- public NodeBuilderCustomizableContext addNode(String name) {
- return this;
- }
-
- public NodeContextBuilder inIterable() {
- return new NodeContextBuilderImpl(path, messageTemplate, parent);
- }
- }
-
- /**
- * Immutable GWT safe {@link NodeBuilderDefinedContext}.
- */
- public final class NodeBuilderDefinedContextImpl implements
- NodeBuilderDefinedContext {
-
- private final String messageTemplate;
- private final ConstraintViolationBuilderImpl parent;
- private final PathImpl path;
-
- /**
- * @param constraintViolationBuilderImpl
- * @param messageTemplate
- * @param append
- */
- public NodeBuilderDefinedContextImpl(ConstraintViolationBuilderImpl parent,
- String messageTemplate, PathImpl path) {
- this.parent = parent;
- this.messageTemplate = messageTemplate;
- this.path = path;
- }
-
- public ConstraintValidatorContext addConstraintViolation() {
- ConstraintViolation<T> violation = ConstraintViolationImpl.<T> builder().setPropertyPath(
- path).setMessageTemplate(messageTemplate).build();
-
- parent.context.violations.add(violation);
- return parent.context;
- }
-
- public NodeBuilderCustomizableContext addNode(String name) {
- return new NodeBuilderCustomizableContextImpl(parent, messageTemplate,
- path.append(name));
- }
- }
-
- /**
- * Immutable GWT safe {@link NodeContextBuilder}.
- */
- public final class NodeContextBuilderImpl implements NodeContextBuilder {
-
- private final String messageTemplate;
-
- private final ConstraintViolationBuilderImpl parent;
- private final PathImpl path;
-
- public NodeContextBuilderImpl(PathImpl path, String messageTemplate,
- ConstraintViolationBuilderImpl parent) {
- super();
- this.path = path;
- this.messageTemplate = messageTemplate;
- this.parent = parent;
- }
-
- public ConstraintValidatorContext addConstraintViolation() {
- return null;
- }
-
- public NodeBuilderCustomizableContext addNode(String name) {
- return new NodeBuilderCustomizableContextImpl(parent, messageTemplate,
- path.append(name));
- }
-
- public NodeBuilderDefinedContext atIndex(Integer index) {
- return new NodeBuilderDefinedContextImpl(parent, messageTemplate,
- path.appendIndex(null, index.intValue()));
- }
-
- public NodeBuilderDefinedContext atKey(Object key) {
- return new NodeBuilderDefinedContextImpl(parent, messageTemplate,
- path.appendKey(null, key));
- }
- }
-
- private final PathImpl basePath;
- private final ConstraintDescriptor<A> descriptor;
-
- private boolean disableDefault;
- private final Set<ConstraintViolation<T>> violations = new HashSet<ConstraintViolation<T>>();
- private final HashSet<MessageAndPath> messages = new HashSet<MessageAndPath>();
-
- public ConstraintValidatorContextImpl(PathImpl path,
- ConstraintDescriptor<A> descriptor) {
- super();
- this.basePath = path;
- this.descriptor = descriptor;
- }
-
- public ConstraintViolationBuilder buildConstraintViolationWithTemplate(
- String messageTemplate) {
- ConstraintViolationBuilderImpl builder = new ConstraintViolationBuilderImpl(
- this, messageTemplate);
- return builder;
- }
-
- public void disableDefaultConstraintViolation() {
- disableDefault = true;
- }
-
- public String getDefaultConstraintMessageTemplate() {
- return (String) descriptor.getAttributes().get("message");
- }
-
- public Set<MessageAndPath> getMessageAndPaths() {
- if (!disableDefault) {
- messages.add(new MessageAndPath(this.basePath, this
- .getDefaultConstraintMessageTemplate()));
- }
- return messages;
- }
-
- public Set<ConstraintViolation<T>> getViolations() {
- return violations;
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/impl/ConstraintViolationImpl.java b/user/src/com/google/gwt/validation/client/impl/ConstraintViolationImpl.java
deleted file mode 100644
index 0acd234..0000000
--- a/user/src/com/google/gwt/validation/client/impl/ConstraintViolationImpl.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.impl;
-
-import java.io.Serializable;
-
-import javax.validation.ConstraintViolation;
-import javax.validation.Path;
-import javax.validation.metadata.ConstraintDescriptor;
-
-/**
- * An implementation of {@link ConstraintViolation}.
- *
- * @param <T> the type of bean validated.
- */
-public class ConstraintViolationImpl<T> implements ConstraintViolation<T>,
- Serializable {
-
- /**
- * Builder for ConstraintViolations.
- *
- * @param <T> the type of bean validated.
- */
- public static class Builder<T> {
- private String message;
- private String messageTemplate;
- private T rootBean;
- private Class<T> rootBeanClass;
- private Object leafBean;
- private Path propertyPath;
- private Object invalidValue;
- private ConstraintDescriptor<?> constraintDescriptor;
-
- public ConstraintViolationImpl<T> build() {
- return new ConstraintViolationImpl<T>(message, messageTemplate, rootBean,
- rootBeanClass, leafBean, propertyPath, invalidValue,
- constraintDescriptor);
- }
-
- public Builder<T> setConstraintDescriptor(
- ConstraintDescriptor<?> constraintDescriptor) {
- this.constraintDescriptor = constraintDescriptor;
- return this;
- }
-
- public Builder<T> setInvalidValue(Object invalidValue) {
- this.invalidValue = invalidValue;
- return this;
- }
-
- public Builder<T> setLeafBean(Object leafBean) {
- this.leafBean = leafBean;
- return this;
- }
-
- public Builder<T> setMessage(String message) {
- this.message = message;
- return this;
- }
-
- public Builder<T> setMessageTemplate(String messageTemplate) {
- this.messageTemplate = messageTemplate;
- return this;
- }
-
- public Builder<T> setPropertyPath(Path propertyPath) {
- this.propertyPath = propertyPath;
- return this;
- }
-
- public Builder<T> setRootBean(T rootBean) {
- this.rootBean = rootBean;
- return this;
- }
-
- public Builder<T> setRootBeanClass(Class<T> rootBeanClass) {
- this.rootBeanClass = rootBeanClass;
- return this;
- }
- }
-
- private static final long serialVersionUID = 1L;
-
- public static <T> Builder<T> builder() {
- return new Builder<T>();
- }
-
- private final String message;
- private final String messageTemplate;
- private final T rootBean;
- private final Class<T> rootBeanClass;
- private final Object leafBean;
- private final Path propertyPath;
- private final Object invalidValue;
- private final ConstraintDescriptor<?> constraintDescriptor;
-
- /**
- * @param message
- * @param messageTemplate
- * @param rootBean
- * @param rootBeanClass
- * @param leafBean
- * @param propertyPath
- * @param invalidValue
- * @param constraintDescriptor
- */
- private ConstraintViolationImpl(String message, String messageTemplate,
- T rootBean, Class<T> rootBeanClass, Object leafBean, Path propertyPath,
- Object invalidValue, ConstraintDescriptor<?> constraintDescriptor) {
- super();
- this.message = message;
- this.messageTemplate = messageTemplate;
- this.rootBean = rootBean;
- this.rootBeanClass = rootBeanClass;
- this.leafBean = leafBean;
- this.propertyPath = propertyPath;
- this.invalidValue = invalidValue;
- this.constraintDescriptor = constraintDescriptor;
- }
-
- public ConstraintDescriptor<?> getConstraintDescriptor() {
- return constraintDescriptor;
- }
-
- public Object getInvalidValue() {
- return invalidValue;
- }
-
- public Object getLeafBean() {
- return leafBean;
- }
-
- public String getMessage() {
- return message;
- }
-
- public String getMessageTemplate() {
- return messageTemplate;
- }
-
- public Path getPropertyPath() {
- return propertyPath;
- }
-
- public T getRootBean() {
- return rootBean;
- }
-
- public Class<T> getRootBeanClass() {
- return rootBeanClass;
- }
-
- /**
- * For debugging only. Do not rely on the format. It can change at any time.
- */
- @Override
- public String toString() {
- return "message= " + message //
- + ", path= " + propertyPath //
- + ", invalidValue=" + invalidValue //
- + ", desc=" + constraintDescriptor;
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/impl/GwtBeanDescriptor.java b/user/src/com/google/gwt/validation/client/impl/GwtBeanDescriptor.java
deleted file mode 100644
index 700cf7a..0000000
--- a/user/src/com/google/gwt/validation/client/impl/GwtBeanDescriptor.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.impl;
-
-import javax.validation.metadata.BeanDescriptor;
-
-/**
- * Marker interface used by GWT to generate a {@link BeanDescriptor} for a
- * specific class T.
- *
- * @param <T>
- */
-public interface GwtBeanDescriptor<T> extends BeanDescriptor {
-}
diff --git a/user/src/com/google/gwt/validation/client/impl/GwtBeanDescriptorImpl.java b/user/src/com/google/gwt/validation/client/impl/GwtBeanDescriptorImpl.java
deleted file mode 100644
index 2cac855..0000000
--- a/user/src/com/google/gwt/validation/client/impl/GwtBeanDescriptorImpl.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.impl;
-
-import java.lang.annotation.Annotation;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import javax.validation.metadata.ConstraintDescriptor;
-import javax.validation.metadata.PropertyDescriptor;
-
-/**
- * Abstract BeanDescriptor for use by generated {@link GwtBeanDescriptor}.
- * <p>
- * Subclasses are expected to call setDescriptorMap from the constructor.
- *
- * @param <T> the bean Type
- */
-public final class GwtBeanDescriptorImpl<T> implements GwtBeanDescriptor<T> {
-
- /**
- * Builder for {@link GwtBeanDescriptors}.
- *
- * @param <T> the bean Type
- */
- public static final class Builder<T> {
-
- private final Class<T> clazz;
- private final Map<String, PropertyDescriptor> descriptorMap =
- new HashMap<String, PropertyDescriptor>();
- private final Set<ConstraintDescriptor<? extends Annotation>> constraints =
- new HashSet<ConstraintDescriptor<? extends Annotation>>();
- private boolean isConstrained;
-
- private Builder(Class<T> clazz) {
- this.clazz = clazz;
- }
-
- public Builder<T> add(
- ConstraintDescriptor<? extends Annotation> constraintDescriptor) {
- constraints.add(constraintDescriptor);
- return this;
- }
-
- public GwtBeanDescriptorImpl<T> build() {
- return new GwtBeanDescriptorImpl<T>(clazz, isConstrained, descriptorMap,
- constraints);
- }
-
- public Builder<T> put(String key, PropertyDescriptor value) {
- descriptorMap.put(key, value);
- return this;
- }
-
- public Builder<T> setConstrained(boolean isConstrained) {
- this.isConstrained = isConstrained;
- return this;
- }
- }
-
- public static <T> Builder<T> builder(Class<T> clazz) {
- return new Builder<T>(clazz);
- }
-
- private final Class<T> clazz;
- private final Set<ConstraintDescriptor<?>> constraints = new HashSet<ConstraintDescriptor<?>>();
-
- private final Map<String, PropertyDescriptor> descriptorMap = new HashMap<String, PropertyDescriptor>();
- private final boolean isBeanConstrained;
-
- private GwtBeanDescriptorImpl(Class<T> clazz, boolean isConstrained,
- Map<String, PropertyDescriptor> descriptorMap,
- Set<ConstraintDescriptor<?>> constraints) {
- super();
- this.clazz = clazz;
- this.isBeanConstrained = isConstrained;
- this.descriptorMap.putAll(descriptorMap);
- this.constraints.addAll(constraints);
- }
-
- public ConstraintFinder findConstraints() {
- // TODO(nchalko) implement
- return null;
- }
-
- public Set<PropertyDescriptor> getConstrainedProperties() {
- return new HashSet<PropertyDescriptor>(descriptorMap.values());
- }
-
- public Set<ConstraintDescriptor<?>> getConstraintDescriptors() {
- // Copy for safety
- return new HashSet<ConstraintDescriptor<?>>(constraints);
- }
-
- public PropertyDescriptor getConstraintsForProperty(String propertyName) {
- return descriptorMap.get(propertyName);
- }
-
- public Class<?> getElementClass() {
- return clazz;
- }
-
- public boolean hasConstraints() {
- return !constraints.isEmpty();
- }
-
- public boolean isBeanConstrained() {
- return isBeanConstrained;
- }
-}
\ No newline at end of file
diff --git a/user/src/com/google/gwt/validation/client/impl/GwtSpecificValidator.java b/user/src/com/google/gwt/validation/client/impl/GwtSpecificValidator.java
deleted file mode 100644
index 2391c8f..0000000
--- a/user/src/com/google/gwt/validation/client/impl/GwtSpecificValidator.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.impl;
-
-import java.util.Set;
-
-import javax.validation.ConstraintViolation;
-import javax.validation.ValidationException;
-
-/**
- * Defines GWT version of {@link javax.validation.Validator}. This used by
- * generate a specific Validator for a given class G.
- *
- * @param <G> the type of bean for this validator
- */
-public interface GwtSpecificValidator<G> {
-
- /**
- * Return the descriptor object describing bean constraints. The returned
- * object (and associated objects including
- * <code>ConstraintDescriptor<code>s) are immutable.
- *
- *
- * @return the bean descriptor for the class associated with this validator.
- *
- * @throws IllegalArgumentException if clazz is null
- * @throws ValidationException if a non recoverable error happens during the
- * metadata discovery or if some constraints are invalid.
- */
- GwtBeanDescriptor<G> getConstraints() throws ValidationException;
-
- /**
- * Validates all constraints on <code>object</code>.
- *
- * @param<T> the type of the RootBean for this validation context
- * @param context The gwt validation context
- * @param object object to validate
- * @param groups group or list of groups targeted for validation (default to
- * {@link javax.validation.groups.Default})
- *
- * @return constraint violations or an empty Set if none
- *
- * @throws IllegalArgumentException if object is null or if null is passed to
- * the varargs groups
- * @throws ValidationException if a non recoverable error happens during the
- * validation process
- */
- <T> Set<ConstraintViolation<T>> validate(GwtValidationContext<T> context,
- G object, Class<?>... groups) throws ValidationException;
-
- /**
- * Validates all constraints placed on the property of <code>object</code>
- * named <code>propertyName</code>.
- *
- * @param<T> the type of the RootBean for this validation context
- * @param context The gwt validation context
- * @param object object to validate
- * @param propertyName property to validate (ie field and getter constraints)
- * @param groups group or list of groups targeted for validation (default to
- * {@link javax.validation.groups.Default})
- *
- * @return constraint violations or an empty Set if none
- *
- * @throws IllegalArgumentException if <code>object</code> is null, if
- * <code>propertyName</code> null, empty or not a valid object
- * property or if null is passed to the varargs groups
- * @throws ValidationException if a non recoverable error happens during the
- * validation process
- */
- <T> Set<ConstraintViolation<T>> validateProperty(
- GwtValidationContext<T> context, G object, String propertyName,
- Class<?>... groups) throws ValidationException;
-
- /**
- * Validates all constraints placed on the property named
- * <code>propertyName</code> of the class <code>beanType</code> where the
- * property value is <code>value</code>.
- * <p/>
- * <code>ConstraintViolation</code> objects return null for
- * {@link ConstraintViolation#getRootBean()} and
- * {@link ConstraintViolation#getLeafBean()}
- *
- * @param<T> the type of the RootBean for this validation context
- * @param context The gwt validation context
- * @param beanType the bean type
- * @param propertyName property to validate
- * @param value property value to validate
- * @param groups group or list of groups targeted for validation (default to
- * {@link javax.validation.groups.Default})
- *
- * @return constraint violations or an empty Set if none
- *
- * @throws IllegalArgumentException if <code>beanType</code> is null, if
- * <code>propertyName</code> null, empty or not a valid object
- * property or if null is passed to the varargs groups
- * @throws ValidationException if a non recoverable error happens during the
- * validation process
- */
- <T> Set<ConstraintViolation<T>> validateValue(
- GwtValidationContext<T> context, Class<G> beanType, String propertyName,
- Object value, Class<?>... groups) throws ValidationException;
-}
diff --git a/user/src/com/google/gwt/validation/client/impl/GwtValidationContext.java b/user/src/com/google/gwt/validation/client/impl/GwtValidationContext.java
deleted file mode 100644
index 3573ee9..0000000
--- a/user/src/com/google/gwt/validation/client/impl/GwtValidationContext.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.impl;
-
-import java.lang.annotation.Annotation;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.validation.MessageInterpolator;
-import javax.validation.metadata.BeanDescriptor;
-import javax.validation.metadata.ConstraintDescriptor;
-
-/**
- * Context for a {@link com.google.gwt.validation.client.GwtValidation}.
- *
- * <p>
- * NOTE: This class is not thread safe.
- *
- * @param <T> the type of the root bean.
- *
- */
-public class GwtValidationContext<T> {
-
- private final BeanDescriptor beanDescriptor;
- private PathImpl path = new PathImpl();
- private final T rootBean;
- private final MessageInterpolator messageInterpolator;
- private final AbstractGwtValidator validator;
-
- /**
- * The set of validated object.
- * <p>
- * This set is shared with and updated by children contexts created by
- * {@link #append(String)}, {@link #appendIndex(String, int)} and
- * {@link #appendKey(String, String)}.
- */
- private final Set<Object> validatedObjects;
-
- public GwtValidationContext(T rootBean, BeanDescriptor beanDescriptor,
- MessageInterpolator messageInterpolator, AbstractGwtValidator validator) {
- this(rootBean, beanDescriptor, messageInterpolator, validator,
- new HashSet<Object>());
- }
-
- private GwtValidationContext(T rootBean, BeanDescriptor beanDescriptor,
- MessageInterpolator messageInterpolator, AbstractGwtValidator validator,
- Set<Object> validatedObjects) {
- this.rootBean = rootBean;
- this.beanDescriptor = beanDescriptor;
- this.messageInterpolator = messageInterpolator;
- this.validator = validator;
- this.validatedObjects = validatedObjects;
- }
-
- public final void addValidatedObject(Object o) {
- validatedObjects.add(o);
- }
-
- public final boolean alreadyValidated(Object o) {
- return validatedObjects.contains(o);
- }
-
- /**
- * Append a node named name to the path..
- *
- * @return the new GwtValidationContext.
- */
- public GwtValidationContext<T> append(String name) {
- GwtValidationContext<T> temp = new GwtValidationContext<T>(rootBean,
- beanDescriptor, messageInterpolator, validator, validatedObjects);
- temp.path = path.append(name);
- return temp;
- }
-
- /**
- * Append an indexed node to the path.
- *
- * @return the new GwtValidationContext.
- */
- public GwtValidationContext<T> appendIndex(String name, int index) {
- GwtValidationContext<T> temp = new GwtValidationContext<T>(rootBean,
- beanDescriptor, messageInterpolator, validator, validatedObjects);
- temp.path = path.appendIndex(name, index);
- return temp;
- }
-
- /**
- * Append an iterable node to the path.
- *
- * @return the new GwtValidationContext.
- */
- public GwtValidationContext<T> appendIterable(String name) {
- GwtValidationContext<T> temp = new GwtValidationContext<T>(rootBean,
- beanDescriptor, messageInterpolator, validator, validatedObjects);
- temp.path = path.appendIterable(name);
- return temp;
- }
-
- /**
- * Append a keyed node to the path.
- *
- * @return the new GwtValidationContext.
- */
- public GwtValidationContext<T> appendKey(String name, Object key) {
- GwtValidationContext<T> temp = new GwtValidationContext<T>(rootBean,
- beanDescriptor, messageInterpolator, validator, validatedObjects);
- temp.path = path.appendKey(name, key);
- return temp;
- }
-
- public <A extends Annotation, V> ConstraintValidatorContextImpl<A, V> createConstraintValidatorContext(
- ConstraintDescriptor<A> descriptor) {
- return new ConstraintValidatorContextImpl<A, V>(path, descriptor);
- }
-
- public MessageInterpolator getMessageInterpolator() {
- return messageInterpolator;
- }
-
- public T getRootBean() {
- return rootBean;
- }
-
- @SuppressWarnings("unchecked")
- public Class<T> getRootBeanClass() {
- return (Class<T>) rootBean.getClass();
- }
-
- public AbstractGwtValidator getValidator() {
- return validator;
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/impl/MessageAndPath.java b/user/src/com/google/gwt/validation/client/impl/MessageAndPath.java
deleted file mode 100644
index f40cc15..0000000
--- a/user/src/com/google/gwt/validation/client/impl/MessageAndPath.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.impl;
-
-import javax.validation.Path;
-
-/**
- * Holds as Message and a Path.
- * <p>
- * Used to build a {@link javax.validation.ConstraintViolation}
- */
-public class MessageAndPath {
-
- private final String message;
- private final Path path;
-
- public MessageAndPath(Path path, String message) {
- super();
- this.path = path;
- this.message = message;
- }
-
- public String getMessage() {
- return message;
- }
-
- public Path getPath() {
- return path;
- }
-
- /**
- * For debugging use only.
- */
- @Override
- public String toString() {
- return path + "=" + message;
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/impl/NodeImpl.java b/user/src/com/google/gwt/validation/client/impl/NodeImpl.java
deleted file mode 100644
index 910585c..0000000
--- a/user/src/com/google/gwt/validation/client/impl/NodeImpl.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.impl;
-
-import java.io.Serializable;
-
-import javax.validation.Path.Node;
-
-/**
- * An immutable GWT safe implementation of {@link Node}.
- */
-class NodeImpl implements Node, Serializable {
-
- private static final long serialVersionUID = 1L;
- public static final Node ROOT_NODE = new NodeImpl(null, null, null, false);
-
- static Node createIndexedNode(String name, Integer index) {
- return new NodeImpl(name, null, index, true);
- }
-
- static Node createIterableNode(String name) {
- return new NodeImpl(name, null, null, true);
- }
-
- static Node createKeyedNode(String name, Object key) {
- return new NodeImpl(name, key, null, true);
- }
-
- static Node createNode(String name) {
- return new NodeImpl(name, null, null, false);
- }
-
- private final boolean isInIterable;
- private final String name;
- private final Integer index;
-
- private final Object key;
-
-
- private NodeImpl(String name, Object key, Integer index, boolean iterable) {
- this.name = name;
- this.key = key;
- this.index = index;
- this.isInIterable = iterable;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (!(obj instanceof NodeImpl)) {
- return false;
- }
- NodeImpl that = (NodeImpl) obj;
- return (this.name == null ? that.name == null : this.name.equals(that.name))
- && (this.index == null ? that.index == null : this.index
- .equals(that.index))
- && (this.key == null ? that.key == null : this.key.equals(that.key))
- && this.isInIterable == that.isInIterable;
- }
-
- public Integer getIndex() {
- return index;
- }
-
- public Object getKey() {
- return key;
- }
-
- public String getName() {
- return name;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((index == null) ? 0 : index.hashCode());
- result = prime * result + ((key == null) ? 0 : key.hashCode());
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- result = prime * result + (isInIterable ? 0 : 1);
- return result;
- }
-
- public boolean isInIterable() {
- return isInIterable;
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- if (name != null) {
- sb.append(name);
- }
- if (isInIterable()) {
- sb.append('[');
- if (key != null) {
- sb.append(key);
- } else if (index != null) {
- sb.append(index);
- }
- sb.append(']');
- }
- return sb.toString();
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/impl/PathImpl.java b/user/src/com/google/gwt/validation/client/impl/PathImpl.java
deleted file mode 100644
index 6b20e3a..0000000
--- a/user/src/com/google/gwt/validation/client/impl/PathImpl.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.impl;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.validation.Path;
-
-/**
- * An immutable GWT safe implementation of {@link Path}.
- */
-public class PathImpl implements Path, Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private final List<Node> nodes = new ArrayList<Node>();
-
- /**
- * Creates a new path containing only the root (<code>null</code>)
- * {@link Node}.
- */
- public PathImpl() {
- nodes.add(NodeImpl.ROOT_NODE);
- }
-
- private PathImpl(PathImpl originalPath, Node node) {
- if (!originalPath.isRoot()) {
- nodes.addAll(originalPath.nodes);
- }
- nodes.add(node);
- }
-
- /**
- * Create a new path with a node named <code>name</code> appended to the
- * existing path.
- *
- * @param name
- * @return The new path with appended node.
- */
- public PathImpl append(String name) {
- return new PathImpl(this, NodeImpl.createNode(name));
- }
-
- /**
- * Create a new path with an indexed node named <code>name</code> appended to
- * the existing path.
- *
- * @param name
- * @param key
- * @return The new path with appended node.
- */
- public PathImpl appendIndex(String name, int index) {
- return new PathImpl(this, NodeImpl.createIndexedNode(name, index));
- }
-
- /**
- * Create a new path with an iterable node named <code>name</code> appended to
- * the existing path.
- *
- * @param name
- * @return The new path with appended node.
- */
- public PathImpl appendIterable(String name) {
- return new PathImpl(this, NodeImpl.createIterableNode(name));
- }
-
- /**
- * Create a new path with a keyed node named <code>name</code> appended to the
- * existing path.
- *
- * @param name
- * @param key
- * @return The new path with appended node.
- */
- public PathImpl appendKey(String name, Object key) {
- return new PathImpl(this, NodeImpl.createKeyedNode(name, key));
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (!(obj instanceof PathImpl)) {
- return false;
- }
- PathImpl that = (PathImpl) obj;
- return this.nodes.equals(that.nodes);
- }
-
- @Override
- public int hashCode() {
- return nodes.hashCode();
- }
-
- public Iterator<Node> iterator() {
- return nodes.iterator();
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- for (Node n : nodes) {
- if (sb.length() > 0) {
- sb.append('.');
- }
- sb.append(n);
- }
- return sb.toString();
- }
-
- private boolean isRoot() {
- return nodes.size() == 1 && nodes.get(0) == NodeImpl.ROOT_NODE;
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/impl/PropertyDescriptorImpl.java b/user/src/com/google/gwt/validation/client/impl/PropertyDescriptorImpl.java
deleted file mode 100644
index 67c95b4..0000000
--- a/user/src/com/google/gwt/validation/client/impl/PropertyDescriptorImpl.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.impl;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.validation.metadata.ConstraintDescriptor;
-import javax.validation.metadata.PropertyDescriptor;
-
-/**
- *
- */
-public class PropertyDescriptorImpl implements PropertyDescriptor {
-
- private boolean cascaded;
- private Set<ConstraintDescriptor<?>> descriptors = new HashSet<ConstraintDescriptor<?>>();
- private Class<?> elementClass;
- private String name;
-
- /**
- * @param name
- * @param elementClass
- * @param cascaded
- * @param descriptors
- */
- public PropertyDescriptorImpl(String name, Class<?> elementClass,
- boolean cascaded, ConstraintDescriptor<?>... descriptors) {
- super();
-
- this.elementClass = elementClass;
- this.cascaded = cascaded;
- this.name = name;
- this.descriptors = new HashSet<ConstraintDescriptor<?>>(
- Arrays.asList(descriptors));
- }
-
- public ConstraintFinder findConstraints() {
- return null;
- }
-
- public Set<ConstraintDescriptor<?>> getConstraintDescriptors() {
- return Collections.unmodifiableSet(descriptors);
- }
-
- public Class<?> getElementClass() {
- return elementClass;
- }
-
- public String getPropertyName() {
- return name;
- }
-
- public boolean hasConstraints() {
- return !descriptors.isEmpty();
- }
-
- public boolean isCascaded() {
- return cascaded;
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/spi/BaseConfigurationState.java b/user/src/com/google/gwt/validation/client/spi/BaseConfigurationState.java
deleted file mode 100644
index 732cf1d..0000000
--- a/user/src/com/google/gwt/validation/client/spi/BaseConfigurationState.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.spi;
-
-import java.util.Map;
-
-import javax.validation.ConstraintValidatorFactory;
-import javax.validation.MessageInterpolator;
-import javax.validation.TraversableResolver;
-import javax.validation.spi.ConfigurationState;
-
-/**
- * Base GWT implementation of {@link ConfigurationState}.
- */
-public abstract class BaseConfigurationState implements ConfigurationState {
-
- public ConstraintValidatorFactory getConstraintValidatorFactory() {
- // TODO(nchalko) implement.
- return null;
- }
-
- public MessageInterpolator getMessageInterpolator() {
- // TODO(nchalko) implement.
- return null;
- }
-
- public Map<String, String> getProperties() {
- // TODO(nchalko) implement.
- return null;
- }
-
- public TraversableResolver getTraversableResolver() {
- // TODO(nchalko) implement.
- return null;
- }
-
- public boolean isIgnoreXmlConfiguration() {
- // Always ignore XML
- return false;
- }
-
-}
\ No newline at end of file
diff --git a/user/src/com/google/gwt/validation/client/spi/GwtBootStrapState.java b/user/src/com/google/gwt/validation/client/spi/GwtBootStrapState.java
deleted file mode 100644
index 859251f..0000000
--- a/user/src/com/google/gwt/validation/client/spi/GwtBootStrapState.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.spi;
-
-import com.google.gwt.core.client.GWT;
-
-import javax.validation.ValidationProviderResolver;
-import javax.validation.spi.BootstrapState;
-
-/**
- * GWT {@link BootstrapState}.
- */
-public class GwtBootStrapState implements BootstrapState {
-
- public ValidationProviderResolver getDefaultValidationProviderResolver() {
- return GWT.create(ValidationProviderResolver.class);
- }
-
- public ValidationProviderResolver getValidationProviderResolver() {
- return null;
- }
-}
diff --git a/user/src/com/google/gwt/validation/client/spi/GwtConfigurationState.java b/user/src/com/google/gwt/validation/client/spi/GwtConfigurationState.java
deleted file mode 100644
index 69ce2a0..0000000
--- a/user/src/com/google/gwt/validation/client/spi/GwtConfigurationState.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.spi;
-
-import java.io.InputStream;
-import java.util.Set;
-
-/**
- * Only the GWT incompatible parts.
- */
-public class GwtConfigurationState extends BaseConfigurationState {
-
- public Set<InputStream> getMappingStreams() {
- throw new UnsupportedOperationException(
- "GWT Validation does not support getMappingStreams");
- }
-
-}
diff --git a/user/src/com/google/gwt/validation/client/spi/GwtValidationProvider.java b/user/src/com/google/gwt/validation/client/spi/GwtValidationProvider.java
deleted file mode 100644
index 52cab9d..0000000
--- a/user/src/com/google/gwt/validation/client/spi/GwtValidationProvider.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.spi;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.validation.client.BaseGwtConfiguration;
-import com.google.gwt.validation.client.GwtConfiguration;
-
-import javax.validation.Configuration;
-import javax.validation.ValidatorFactory;
-import javax.validation.spi.BootstrapState;
-import javax.validation.spi.ConfigurationState;
-import javax.validation.spi.ValidationProvider;
-
-/**
- * GWT {@link ValidationProvider}.
- */
-public class GwtValidationProvider implements
- ValidationProvider<BaseGwtConfiguration> {
-
- public ValidatorFactory buildValidatorFactory(
- ConfigurationState configurationState) {
- return GWT.create(ValidatorFactory.class);
- }
-
- public Configuration<?> createGenericConfiguration(BootstrapState state) {
- return new GwtConfiguration(this, state);
- }
-
- public GwtConfiguration createSpecializedConfiguration(BootstrapState state) {
- return new GwtConfiguration(this, state);
- }
-}
diff --git a/user/src/com/google/gwt/validation/rebind/AbstractCreator.java b/user/src/com/google/gwt/validation/rebind/AbstractCreator.java
deleted file mode 100644
index 4e79099..0000000
--- a/user/src/com/google/gwt/validation/rebind/AbstractCreator.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.rebind;
-
-import com.google.gwt.core.ext.GeneratorContext;
-import com.google.gwt.core.ext.TreeLogger;
-import com.google.gwt.core.ext.UnableToCompleteException;
-import com.google.gwt.core.ext.typeinfo.JClassType;
-import com.google.gwt.core.ext.typeinfo.JPackage;
-import com.google.gwt.user.rebind.AbstractSourceCreator;
-import com.google.gwt.user.rebind.ClassSourceFileComposerFactory;
-import com.google.gwt.user.rebind.SourceWriter;
-
-import java.io.PrintWriter;
-
-/**
- * Abstract Class for Creating source files.
- * <p>
- * This class is not thread safe.
- */
-public abstract class AbstractCreator extends AbstractSourceCreator {
-
- protected final GeneratorContext context;
-
- protected final TreeLogger logger;
-
- protected final JClassType validatorType;
-
- public AbstractCreator(GeneratorContext context, TreeLogger logger,
- JClassType validatorType) {
- super();
- this.context = context;
- this.logger = branch(logger, "Creating " + validatorType);
- this.validatorType = validatorType;
- }
-
- public final String create() throws UnableToCompleteException {
- SourceWriter sourceWriter = getSourceWriter(logger, context);
- if (sourceWriter != null) {
- writeClassBody(sourceWriter);
- sourceWriter.commit(logger);
- }
- return getQualifiedName();
- }
-
- protected void addImports(ClassSourceFileComposerFactory composerFactory, Class<?>... imports) {
- for (Class<?> imp : imports) {
- composerFactory.addImport(imp.getCanonicalName());
- }
- }
-
- protected abstract void compose(ClassSourceFileComposerFactory composerFactory);
-
- protected BeanHelper createBeanHelper(Class<?> clazz)
- throws UnableToCompleteException {
- return BeanHelper.createBeanHelper(clazz, logger, context);
- }
-
- protected BeanHelper createBeanHelper(JClassType jType)
- throws UnableToCompleteException {
- return BeanHelper.createBeanHelper(jType, logger, context);
- }
-
- protected final String getPackage() {
- JPackage serviceIntfPkg = validatorType.getPackage();
- String packageName = serviceIntfPkg == null ? "" : serviceIntfPkg.getName();
- return packageName;
- }
-
- protected abstract void writeClassBody(SourceWriter sourceWriter)
- throws UnableToCompleteException;
-
- protected void writeValidatorInstance(SourceWriter sw, BeanHelper bean) {
- BeanHelper.writeInterface(context, logger, bean);
- // private final MyBeanValidator myBeanValidator =
- sw.print("private final " + bean.getFullyQualifiedValidatorName() + " ");
- sw.print(bean.getValidatorInstanceName());
- sw.println(" = ");
- sw.indent();
- sw.indent();
-
- // MyBeanValidator.INSTANCE;
- sw.print(bean.getFullyQualifiedValidatorName());
- sw.println(".INSTANCE;");
- sw.outdent();
- sw.outdent();
- }
-
- private String getQualifiedName() {
- String packageName = getPackage();
- return (packageName == "" ? "" : packageName + ".") + getSimpleName();
- }
-
- private String getSimpleName() {
- return validatorType.getSimpleSourceName() + "Impl";
- }
-
- private SourceWriter getSourceWriter(TreeLogger logger,
- GeneratorContext ctx) {
- String packageName = getPackage();
- String simpleName = getSimpleName();
- PrintWriter printWriter = ctx.tryCreate(logger, packageName, simpleName);
- if (printWriter == null) {
- return null;
- }
-
- ClassSourceFileComposerFactory composerFactory = new ClassSourceFileComposerFactory(
- packageName, simpleName);
- compose(composerFactory);
- SourceWriter sourceWriter = composerFactory.createSourceWriter(ctx,
- printWriter);
- return sourceWriter;
- }
-}
\ No newline at end of file
diff --git a/user/src/com/google/gwt/validation/rebind/BeanHelper.java b/user/src/com/google/gwt/validation/rebind/BeanHelper.java
deleted file mode 100644
index af494e6..0000000
--- a/user/src/com/google/gwt/validation/rebind/BeanHelper.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.rebind;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.core.ext.GeneratorContext;
-import com.google.gwt.core.ext.TreeLogger;
-import com.google.gwt.core.ext.TreeLogger.Type;
-import com.google.gwt.core.ext.UnableToCompleteException;
-import com.google.gwt.core.ext.typeinfo.JArrayType;
-import com.google.gwt.core.ext.typeinfo.JClassType;
-import com.google.gwt.core.ext.typeinfo.JField;
-import com.google.gwt.core.ext.typeinfo.JParameterizedType;
-import com.google.gwt.core.ext.typeinfo.JRawType;
-import com.google.gwt.core.ext.typeinfo.JType;
-import com.google.gwt.core.ext.typeinfo.NotFoundException;
-import com.google.gwt.thirdparty.guava.common.base.Function;
-import com.google.gwt.user.rebind.ClassSourceFileComposerFactory;
-import com.google.gwt.user.rebind.SourceWriter;
-import com.google.gwt.validation.client.impl.GwtSpecificValidator;
-
-import java.io.PrintWriter;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.validation.Validation;
-import javax.validation.ValidationException;
-import javax.validation.Validator;
-import javax.validation.metadata.BeanDescriptor;
-import javax.validation.metadata.PropertyDescriptor;
-
-/**
- * A simple struct for the various values associated with a Bean that can be
- * validated.
- */
-public final class BeanHelper {
-
- public static final Function<BeanHelper, Class<?>> TO_CLAZZ =
- new Function<BeanHelper, Class<?>>() {
- public Class<?> apply(BeanHelper helper) {
- return helper.getClazz();
- }
- };
-
- private static final Validator serverSideValidator =
- Validation.buildDefaultValidatorFactory().getValidator();
-
- // stash the map in a ThreadLocal, since each GWT module lives in its own
- // thread in DevMode
- private static final ThreadLocal<Map<JClassType, BeanHelper>> threadLocalHelperMap =
- new ThreadLocal<Map<JClassType, BeanHelper>>() {
- @Override
- protected synchronized Map<JClassType, BeanHelper> initialValue() {
- return new HashMap<JClassType, BeanHelper>();
- }
- };
-
- /**
- * Visible for testing
- */
- public static void clearBeanHelpersForTests() {
- threadLocalHelperMap.get().clear();
- }
-
- public static BeanHelper createBeanHelper(Class<?> clazz, TreeLogger logger,
- GeneratorContext context) throws UnableToCompleteException {
- JClassType beanType = context.getTypeOracle().findType(
- clazz.getCanonicalName());
- return createBeanHelper(clazz, beanType, logger, context);
- }
-
- public static Map<JClassType, BeanHelper> getBeanHelpers() {
- return Collections.unmodifiableMap(threadLocalHelperMap.get());
- }
-
- protected static BeanHelper createBeanHelper(JClassType jType,
- TreeLogger logger, GeneratorContext context)
- throws UnableToCompleteException {
- JClassType erasedType = jType.getErasedType();
- try {
- Class<?> clazz = Class.forName(erasedType.getQualifiedBinaryName());
- return createBeanHelper(clazz, erasedType, logger, context);
- } catch (ClassNotFoundException e) {
- logger.log(TreeLogger.ERROR, "Unable to create BeanHelper for "
- + erasedType, e);
- throw new UnableToCompleteException();
- }
- }
-
- protected static boolean isClassConstrained(Class<?> clazz) {
- return serverSideValidator.getConstraintsForClass(clazz).isBeanConstrained();
- }
-
- static BeanHelper getBeanHelper(JClassType beanType) {
- return getBeanHelpers().get(beanType.getErasedType());
- }
-
- /**
- * Write an Empty Interface implementing {@link GwtSpecificValidator} with
- * Generic parameter of the bean type.
- */
- static void writeInterface(GeneratorContext context, TreeLogger logger,
- BeanHelper bean) {
- PrintWriter pw = context.tryCreate(logger, bean.getPackage(),
- bean.getValidatorName());
- if (pw != null) {
- TreeLogger interfaceLogger = logger.branch(TreeLogger.TRACE,
- "Creating the interface for " + bean.getFullyQualifiedValidatorName());
-
- ClassSourceFileComposerFactory factory = new ClassSourceFileComposerFactory(
- bean.getPackage(), bean.getValidatorName());
- factory.addImplementedInterface(GwtSpecificValidator.class.getCanonicalName()
- + " <" + bean.getTypeCanonicalName() + ">");
- factory.addImport(GWT.class.getCanonicalName());
- factory.makeInterface();
- SourceWriter sw = factory.createSourceWriter(context, pw);
-
- // static MyValidator INSTANCE = GWT.create(MyValidator.class);
- sw.print("static ");
- sw.print(bean.getValidatorName());
- sw.print(" INSTANCE = GWT.create(");
- sw.print(bean.getValidatorName());
- sw.println(".class);");
-
- sw.commit(interfaceLogger);
- pw.close();
- }
- }
-
- private static synchronized void addBeanHelper(BeanHelper helper) {
- threadLocalHelperMap.get().put(helper.getJClass(), helper);
- }
-
- private static BeanHelper createBeanHelper(Class<?> clazz,
- JClassType beanType, TreeLogger logger, GeneratorContext context)
- throws UnableToCompleteException {
- BeanHelper helper = getBeanHelper(beanType);
- if (helper == null) {
- BeanDescriptor bean;
- try {
- bean = serverSideValidator.getConstraintsForClass(clazz);
- } catch (ValidationException e) {
- logger.log(Type.ERROR,
- "Unable to create a validator for " + clazz.getCanonicalName()
- + " because " + e.getMessage(), e);
- throw new UnableToCompleteException();
- }
- helper = new BeanHelper(beanType, clazz, bean);
- addBeanHelper(helper);
- writeInterface(context, logger, helper);
-
- // now recurse on all Cascaded elements
- for (PropertyDescriptor p : bean.getConstrainedProperties()) {
- if (p.isCascaded()) {
- createBeanHelper(p, helper, logger, context);
- }
- }
- }
- return helper;
- }
-
- private static void createBeanHelper(PropertyDescriptor p, BeanHelper parent,
- TreeLogger logger, GeneratorContext context)
- throws UnableToCompleteException {
- Class<?> elementClass = p.getElementClass();
- if (GwtSpecificValidatorCreator.isIterableOrMap(elementClass)) {
- if (parent.hasField(p)) {
- JClassType type = parent.getAssociationType(p, true);
-
- createBeanHelper(type.getErasedType(), logger, context);
- }
- if (parent.hasGetter(p)) {
- JClassType type = parent.getAssociationType(p, false);
-
- createBeanHelper(type.getErasedType(), logger, context);
- }
- } else {
- if (serverSideValidator.getConstraintsForClass(elementClass).isBeanConstrained()) {
- createBeanHelper(elementClass, logger, context);
- }
- }
- }
-
- private final BeanDescriptor beanDescriptor;
-
- private final JClassType jClass;
-
- private Class<?> clazz;
-
- private BeanHelper(JClassType jClass, Class<?> clazz,
- BeanDescriptor beanDescriptor) {
- super();
- this.beanDescriptor = beanDescriptor;
- this.jClass = jClass;
- this.clazz = clazz;
- }
-
- public JClassType getAssociationType(PropertyDescriptor p, boolean useField) {
- JType type = this.getElementType(p, useField);
- JArrayType jArray = type.isArray();
- if (jArray != null) {
- return jArray.getComponentType().isClassOrInterface();
- }
- JParameterizedType pType = type.isParameterized();
- JClassType[] typeArgs;
- if (pType == null) {
- JRawType rType = type.isRawType();
- typeArgs = rType.getGenericType().getTypeParameters();
- } else {
- typeArgs = pType.getTypeArgs();
- }
- // it is either a Iterable or a Map use the last type arg.
- return typeArgs[typeArgs.length - 1].isClassOrInterface();
- }
-
- public BeanDescriptor getBeanDescriptor() {
- return beanDescriptor;
- }
-
- /*
- * The server side validator needs an actual class.
- */
- public Class<?> getClazz() {
- return clazz;
- }
-
- public String getDescriptorName() {
-
- return jClass.getName() + "Descriptor";
- }
-
- public String getFullyQualifiedValidatorName() {
- return getPackage() + "." + getValidatorName();
- }
-
- public JClassType getJClass() {
- return jClass;
- }
-
- public String getPackage() {
- return jClass.getPackage().getName();
- }
-
- public String getTypeCanonicalName() {
- return jClass.getQualifiedSourceName();
- }
-
- public String getValidatorInstanceName() {
- return getFullyQualifiedValidatorName() + ".INSTANCE";
- }
-
- public String getValidatorName() {
- return makeJavaSafe("_" + jClass.getName() + "Validator");
- }
-
- @Override
- public String toString() {
- return getTypeCanonicalName();
- }
-
- JType getElementType(PropertyDescriptor p, boolean useField) {
- if (useField) {
- return jClass.findField(p.getPropertyName()).getType();
- } else {
- return jClass.findMethod(GwtSpecificValidatorCreator.asGetter(p),
- GwtSpecificValidatorCreator.NO_ARGS).getReturnType();
- }
- }
-
- boolean hasField(PropertyDescriptor p) {
- JField field = jClass.findField(p.getPropertyName());
- return field != null;
- }
-
- boolean hasGetter(PropertyDescriptor p) {
- JType[] paramTypes = new JType[]{};
- try {
- jClass.getMethod(GwtSpecificValidatorCreator.asGetter(p), paramTypes);
- return true;
- } catch (NotFoundException e) {
- return false;
- }
- }
-
- private String makeJavaSafe(String in) {
- return in.replaceAll("\\.", "_");
- }
-
-}
diff --git a/user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorCreator.java b/user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorCreator.java
deleted file mode 100644
index ea587d6..0000000
--- a/user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorCreator.java
+++ /dev/null
@@ -1,1536 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.rebind;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.core.client.UnsafeNativeLong;
-import com.google.gwt.core.ext.Generator;
-import com.google.gwt.core.ext.GeneratorContext;
-import com.google.gwt.core.ext.TreeLogger;
-import com.google.gwt.core.ext.TreeLogger.Type;
-import com.google.gwt.core.ext.UnableToCompleteException;
-import com.google.gwt.core.ext.typeinfo.JClassType;
-import com.google.gwt.core.ext.typeinfo.JField;
-import com.google.gwt.core.ext.typeinfo.JMethod;
-import com.google.gwt.core.ext.typeinfo.JPrimitiveType;
-import com.google.gwt.core.ext.typeinfo.JType;
-import com.google.gwt.core.ext.typeinfo.TypeOracle;
-import com.google.gwt.dev.jjs.ast.JProgram;
-import com.google.gwt.thirdparty.guava.common.base.Function;
-import com.google.gwt.thirdparty.guava.common.base.Functions;
-import com.google.gwt.thirdparty.guava.common.base.Joiner;
-import com.google.gwt.thirdparty.guava.common.base.Predicate;
-import com.google.gwt.thirdparty.guava.common.collect.ImmutableList;
-import com.google.gwt.thirdparty.guava.common.collect.ImmutableSet;
-import com.google.gwt.thirdparty.guava.common.collect.Iterables;
-import com.google.gwt.thirdparty.guava.common.collect.Maps;
-import com.google.gwt.thirdparty.guava.common.collect.Ordering;
-import com.google.gwt.thirdparty.guava.common.collect.Sets;
-import com.google.gwt.thirdparty.guava.common.primitives.Primitives;
-import com.google.gwt.user.rebind.ClassSourceFileComposerFactory;
-import com.google.gwt.user.rebind.SourceWriter;
-import com.google.gwt.validation.client.impl.AbstractGwtSpecificValidator;
-import com.google.gwt.validation.client.impl.ConstraintDescriptorImpl;
-import com.google.gwt.validation.client.impl.GwtBeanDescriptor;
-import com.google.gwt.validation.client.impl.GwtBeanDescriptorImpl;
-import com.google.gwt.validation.client.impl.GwtValidationContext;
-import com.google.gwt.validation.client.impl.PropertyDescriptorImpl;
-
-import java.beans.BeanInfo;
-import java.beans.IntrospectionException;
-import java.beans.Introspector;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
-import javax.validation.Constraint;
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintViolation;
-import javax.validation.Payload;
-import javax.validation.UnexpectedTypeException;
-import javax.validation.Valid;
-import javax.validation.ValidationException;
-import javax.validation.metadata.BeanDescriptor;
-import javax.validation.metadata.ConstraintDescriptor;
-import javax.validation.metadata.PropertyDescriptor;
-
-/**
- * Creates a {@link com.google.gwt.validation.client.GwtSpecificValidator}.
- * <p>
- * This class is not thread safe.
- */
-public class GwtSpecificValidatorCreator extends AbstractCreator {
-
- private static enum Stage {
- OBJECT, PROPERTY, VALUE
- }
-
- private static final Annotation[] NO_ANNOTATIONS = new Annotation[]{};
-
- static final JType[] NO_ARGS = new JType[]{};
-
- private static Function<java.beans.PropertyDescriptor, String>
- PROPERTY_DESCRIPTOR_TO_NAME =
- new Function<java.beans.PropertyDescriptor, String>() {
- public String apply(java.beans.PropertyDescriptor pd) {
- return pd.getName();
- }
- };
-
- private static Function<Object, String> TO_LITERAL = new Function<Object, String>() {
-
- public String apply(Object input) {
- return asLiteral(input);
- }
- };
-
- public static String asGetter(PropertyDescriptor p) {
- return "get" + capitalizeFirstLetter(p.getPropertyName());
- }
-
- /**
- * Returns the literal value of an object that is suitable for inclusion in
- * Java Source code.
- *
- * <p>
- * Supports all types that {@link Annotation) value can have.
- *
- *
- * @throws IllegalArgumentException if the type of the object does not have a java literal form.
- */
- public static String asLiteral(Object value) throws IllegalArgumentException {
- Class<?> clazz = value.getClass();
- JProgram jProgram = new JProgram();
-
- if (clazz.isArray()) {
- StringBuilder sb = new StringBuilder();
- Object[] array = (Object[]) value;
-
- sb.append("new " + clazz.getComponentType().getCanonicalName() + "[] ");
- sb.append("{");
- boolean first = true;
- for (Object object : array) {
- if (first) {
- first = false;
- } else {
- sb.append(",");
- }
- sb.append(asLiteral(object));
- }
- sb.append("}");
- return sb.toString();
- }
-
- if (value instanceof Class) {
- return ((Class<?>) ((Class<?>) value)).getCanonicalName() + ".class";
- }
- if (value instanceof Double) {
- return jProgram.getLiteralDouble(((Double) value).doubleValue()).toSource();
- }
- if (value instanceof Integer) {
- return jProgram.getLiteralInt(((Integer) value).intValue()).toSource();
- }
- if (value instanceof Long) {
- return jProgram.getLiteralLong(((Long) value).intValue()).toSource();
- }
- if (value instanceof String) {
- return '"' + Generator.escape((String) value) + '"';
- }
- // TODO(nchalko) handle the rest of the literal types
- throw new IllegalArgumentException(value.getClass()
- + " is can not be represented as a Java Literal.");
- }
-
- public static String capitalizeFirstLetter(String propertyName) {
- if (propertyName == null) {
- return null;
- }
- if (propertyName.length() == 0) {
- return "";
- }
- String cap = propertyName.substring(0, 1).toUpperCase();
- if (propertyName.length() > 1) {
- cap += propertyName.substring(1);
- }
- return cap;
- }
-
- public static boolean isIterableOrMap(Class<?> elementClass) {
- // TODO(nchalko) handle iterables everywhere this is called.
- return elementClass.isArray()
- || Iterable.class.isAssignableFrom(elementClass)
- || Map.class.isAssignableFrom(elementClass);
- }
- static <T extends Annotation> Class<?> getTypeOfConstraintValidator(
- Class<? extends ConstraintValidator<T, ?>> constraintClass) {
-
- for (Method method : constraintClass.getMethods()) {
- if (method.getName().equals("isValid")
- && method.getParameterTypes().length == 2
- && method.getReturnType().isAssignableFrom(Boolean.TYPE)) {
- return method.getParameterTypes()[0];
- }
- }
- throw new IllegalStateException(
- "ConstraintValidators must have a isValid method");
- }
- // Visible for testing
- static <A extends Annotation> ImmutableSet<Class<? extends ConstraintValidator<A, ?>>> getValidatorForType(
- Class<?> type,
- List<Class<? extends ConstraintValidator<A, ?>>> constraintValidatorClasses) {
- type = Primitives.wrap(type);
- Map<Class<?>, Class<? extends ConstraintValidator<A, ?>>> map = Maps.newHashMap();
- for (Class<? extends ConstraintValidator<A, ?>> constraintClass : constraintValidatorClasses) {
- Class<?> aType = Primitives.wrap(getTypeOfConstraintValidator(constraintClass));
- if (aType.isAssignableFrom(type)) {
- map.put(aType, constraintClass);
- }
- }
- // TODO(nchalko) implement per spec
- // Handle Arrays and Generics
-
- final Set<Class<?>> best = Util.findBestMatches(type, map.keySet());
-
- Predicate<Class<?>> inBest = new Predicate<Class<?>>() {
-
- public boolean apply(Class<?> key) {
- return best.contains(key);
- }
- };
- return ImmutableSet.copyOf(Maps.filterKeys(map, inBest).values());
- }
-
- /**
- * Gets the best {@link ConstraintValidator}.
- *
- * <p>
- * The ConstraintValidator chosen to validate a declared type
- * {@code targetType} is the one where the type supported by the
- * ConstraintValidator is a supertype of {@code targetType} and where there is
- * no other ConstraintValidator whose supported type is a supertype of
- * {@code type} and not a supertype of the chosen ConstraintValidator
- * supported type.
- *
- * @param constraint the constraint to find ConstraintValidators for.
- * @param targetType The type to find a ConstraintValidator for.
- * @return ConstraintValidator
- *
- * @throws UnexpectedTypeException if there is not exactly one maximally
- * specific constraint validator for targetType.
- */
- private static <A extends Annotation> Class<? extends ConstraintValidator<A, ?>> getValidatorForType(
- ConstraintDescriptor<A> constraint, Class<?> targetType)
- throws UnexpectedTypeException {
- List<Class<? extends ConstraintValidator<A, ?>>> constraintValidatorClasses
- = constraint.getConstraintValidatorClasses();
- if (constraintValidatorClasses.isEmpty()) {
- throw new UnexpectedTypeException("No ConstraintValidator found for "
- + constraint.getAnnotation());
- }
- ImmutableSet<Class<? extends ConstraintValidator<A, ?>>> best = getValidatorForType(
- targetType, constraintValidatorClasses);
- if (best.isEmpty()) {
- throw new UnexpectedTypeException("No " + constraint.getAnnotation()
- + " ConstraintValidator for type " + targetType);
- }
- if (best.size() > 1) {
- throw new UnexpectedTypeException("More than one maximally specific "
- + constraint.getAnnotation() + " ConstraintValidator for type "
- + targetType + ", found " + Ordering.usingToString().sortedCopy(best));
- }
- return Iterables.get(best, 0);
- }
-
- private final BeanHelper beanHelper;
-
- private final Set<BeanHelper> beansToValidate = Sets.newHashSet();
-
- private final JClassType beanType;
-
- private final Set<JField> fieldsToWrap = Sets.newHashSet();
-
- private Set<JMethod> gettersToWrap = Sets.newHashSet();
-
- private final TypeOracle oracle;
-
- public GwtSpecificValidatorCreator(JClassType validatorType,
- JClassType beanType, BeanHelper beanHelper, TreeLogger logger,
- GeneratorContext context) {
- super(context, logger, validatorType);
- this.oracle = context.getTypeOracle();
- this.beanType = beanType;
- this.beanHelper = beanHelper;
- }
-
- @Override
- protected void compose(ClassSourceFileComposerFactory composerFactory) {
- addImports(composerFactory, Annotation.class, ConstraintViolation.class,
- GWT.class, GwtBeanDescriptor.class, GwtValidationContext.class,
- HashSet.class, IllegalArgumentException.class, Set.class,
- ValidationException.class);
- composerFactory.setSuperclass(AbstractGwtSpecificValidator.class.getCanonicalName()
- + "<" + beanType.getQualifiedSourceName() + ">");
- composerFactory.addImplementedInterface(validatorType.getName());
- }
-
- @Override
- protected void writeClassBody(SourceWriter sw)
- throws UnableToCompleteException {
- writeFields(sw);
- sw.println();
- writeValidate(sw);
- sw.println();
- writeValidateProperty(sw);
- sw.println();
- writeValidateValue(sw);
- sw.println();
- writeGetDescriptor(sw);
- sw.println();
- writePropertyValidators(sw);
- sw.println();
-
- // Write the wrappers after we know which are needed
- writeWrappers(sw);
- sw.println();
- }
-
- protected void writeUnsafeNativeLongIfNeeded(SourceWriter sw, JType jType) {
- if (JPrimitiveType.LONG.equals(jType)) {
- // @com.google.gwt.core.client.UnsafeNativeLong
- sw.print("@");
- sw.println(UnsafeNativeLong.class.getCanonicalName());
- }
- }
-
- private <T> T[] asArray(Collection<?> collection, T[] array) {
- if (collection == null) {
- return null;
- }
- return collection.toArray(array);
- }
-
- private String constraintDescriptorVar(String name, int count) {
- String s = name + "_c" + count;
- return s;
- }
-
- private Annotation getAnnotation(PropertyDescriptor p, boolean useField,
- Class<? extends Annotation> expectedAnnotationClass) {
- Annotation annotation = null;
- if (useField) {
- JField field = beanType.findField(p.getPropertyName());
- if (field.getEnclosingType().equals(beanType)) {
- annotation = field.getAnnotation(expectedAnnotationClass);
- }
- } else {
- JMethod method = beanType.findMethod(asGetter(p), NO_ARGS);
- if (method.getEnclosingType().equals(beanType)) {
- annotation = method.getAnnotation(expectedAnnotationClass);
- }
- }
- return annotation;
- }
-
- private Annotation[] getAnnotations(PropertyDescriptor p,
- boolean useField) {
- Class<?> clazz = beanHelper.getClazz();
- if (useField) {
- try {
- Field field = clazz.getDeclaredField(p.getPropertyName());
- return field.getAnnotations();
- } catch (NoSuchFieldException ignore) {
- // Expected Case
- }
- } else {
- try {
- Method method = clazz.getMethod(asGetter(p));
- return method.getAnnotations();
- } catch (NoSuchMethodException ignore) {
- // Expected Case
- }
- }
- return NO_ANNOTATIONS;
- }
-
- private String getQualifiedSourceNonPrimitiveType(JType elementType) {
- JPrimitiveType primitive = elementType.isPrimitive();
- return primitive == null ? elementType.getQualifiedSourceName()
- : primitive.getQualifiedBoxedSourceName();
- }
-
- private boolean hasMatchingAnnotation(Annotation expectedAnnotation,
- Annotation[] annotations) throws UnableToCompleteException {
- // See spec section 2.2. Applying multiple constraints of the same type
- for (Annotation annotation : annotations) {
- // annotations not annotated by @Constraint
- if (annotation.annotationType().getAnnotation(Constraint.class) == null) {
- try {
- // value element has a return type of an array of constraint
- // annotations
- Method valueMethod = annotation.annotationType().getMethod("value");
- Class<?> valueType = valueMethod.getReturnType();
- if (valueType.isArray()
- && Annotation.class.isAssignableFrom(valueType.getComponentType())) {
- Annotation[] valueAnnotions = (Annotation[]) valueMethod.invoke(annotation);
- for (Annotation annotation2 : valueAnnotions) {
- if (expectedAnnotation.equals(annotation2)) {
- return true;
- }
- }
- }
- } catch (NoSuchMethodException ignore) {
- // Expected Case.
- } catch (Exception e) {
- throw error(logger, e);
- }
- }
- }
- return false;
- }
-
- private boolean hasMatchingAnnotation(ConstraintDescriptor<?> constraint)
- throws UnableToCompleteException {
- Annotation expectedAnnotation = constraint.getAnnotation();
- Class<? extends Annotation> expectedAnnotationClass = expectedAnnotation.annotationType();
- if (expectedAnnotation.equals(beanHelper.getClazz().getAnnotation(
- expectedAnnotationClass))) {
- return true;
- }
-
- // See spec section 2.2. Applying multiple constraints of the same type
- Annotation[] annotations = beanHelper.getClazz().getAnnotations();
- return hasMatchingAnnotation(expectedAnnotation, annotations);
- }
-
- private boolean hasMatchingAnnotation(PropertyDescriptor p, boolean useField,
- ConstraintDescriptor<?> constraint) throws UnableToCompleteException {
- Annotation expectedAnnotation = constraint.getAnnotation();
- Class<? extends Annotation> expectedAnnotationClass =
- expectedAnnotation.annotationType();
- if (expectedAnnotation.equals(getAnnotation(p, useField,
- expectedAnnotationClass))) {
- return true;
- }
- return hasMatchingAnnotation(expectedAnnotation,
- getAnnotations(p, useField));
- }
-
- private boolean hasValid(PropertyDescriptor p, boolean useField) {
- return getAnnotation(p, useField, Valid.class) != null;
- }
-
- private boolean isPropertyConstrained(BeanHelper helper, PropertyDescriptor p) {
- Set<PropertyDescriptor> propertyDescriptors =
- helper.getBeanDescriptor().getConstrainedProperties();
- Predicate<PropertyDescriptor> nameMatches = newPropertyNameMatches(p);
- return Iterables.any(propertyDescriptors, nameMatches);
- }
-
- private Predicate<PropertyDescriptor> newPropertyNameMatches(
- final PropertyDescriptor p) {
- return new Predicate<PropertyDescriptor>() {
- public boolean apply(PropertyDescriptor input) {
- return input.getPropertyName().equals(p.getPropertyName());
- }
- };
- }
-
- private String toWrapperName(JField field) {
- return "_" + field.getName();
- }
-
- /**
- * @param method
- * @return
- */
- private String toWrapperName(JMethod method) {
- return "_" + method.getName();
- }
-
- private String validateMethodFieldName(PropertyDescriptor p) {
- return "validateProperty_" + p.getPropertyName();
- }
-
- private String validateMethodGetterName(PropertyDescriptor p) {
- return "validateProperty_get" + p.getPropertyName();
- }
-
- private void writeBeanDescriptor(SourceWriter sw) {
- BeanDescriptor beanDescriptor = beanHelper.getBeanDescriptor();
-
- // private final GwtBeanDescriptor <MyBean> beanDescriptor =
- sw.print("private final ");
- sw.print(GwtBeanDescriptor.class.getCanonicalName());
- sw.print("<" + beanHelper.getTypeCanonicalName() + ">");
- sw.println(" beanDescriptor = ");
- sw.indent();
- sw.indent();
-
- // GwtBeanDescriptorImpl.builder(Order.class)
- sw.print(GwtBeanDescriptorImpl.class.getCanonicalName());
- sw.println(".builder(" + beanHelper.getTypeCanonicalName() + ".class)");
- sw.indent();
- sw.indent();
-
- // .setConstrained(true)
- sw.println(".setConstrained(" + beanDescriptor.isBeanConstrained() + ")");
-
- for (int count = 0; count < beanDescriptor.getConstraintDescriptors().size(); count++) {
- // .add(c0)
- sw.println(".add(" + constraintDescriptorVar("this", count) + ")");
- }
-
- // .put("myProperty", myProperty_pd)
- for (PropertyDescriptor p : beanDescriptor.getConstrainedProperties()) {
- sw.print(".put(\"");
- sw.print(p.getPropertyName());
- sw.print("\", ");
- sw.print(p.getPropertyName());
- sw.println("_pd)");
- }
-
- // .build();
- sw.println(".build();");
- sw.outdent();
- sw.outdent();
- sw.outdent();
- sw.outdent();
- }
-
- private void writeCatchUnexpectedException(SourceWriter sw, String message) {
- // } catch (IllegalArgumentException e) {
- sw.outdent();
- sw.println("} catch (IllegalArgumentException e) {");
- sw.indent();
-
- // throw e;
- sw.println("throw e;");
-
- // } catch (ValidationException e) {
- sw.outdent();
- sw.println("} catch (ValidationException e) {");
- sw.indent();
-
- // throw e;
- sw.println("throw e;");
-
- // } catch (Exception e) {
- sw.outdent();
- sw.println("} catch (Exception e) {");
- sw.indent();
-
- // throw new ValidationException("my message", e);
- sw.println("throw new ValidationException(" + message + ", e);");
-
- // }
- sw.outdent();
- sw.println("}");
- }
-
- private void writeConstraintDescriptor(SourceWriter sw,
- ConstraintDescriptor<? extends Annotation> constraint,
- String constraintDescripotorVar) throws UnableToCompleteException {
- Class<? extends Annotation> annotationType =
- constraint.getAnnotation().annotationType();
-
- // First list all composing constraints
- int count = 0;
- for (ConstraintDescriptor<?> composingConstraint :
- constraint.getComposingConstraints()) {
- writeConstraintDescriptor(sw, composingConstraint,
- constraintDescripotorVar + "_" + count++);
- }
-
- // private final ConstraintDescriptorImpl<MyAnnotation> constraintDescriptor = ;
- sw.print("private final ");
- sw.print(ConstraintDescriptorImpl.class.getCanonicalName());
- sw.print("<");
-
- sw.print(annotationType.getCanonicalName());
- sw.print(">");
-
- sw.println(" " + constraintDescripotorVar + " = ");
- sw.indent();
- sw.indent();
-
- // ConstraintDescriptorImpl.<MyConstraint> builder()
- sw.print(ConstraintDescriptorImpl.class.getCanonicalName());
- sw.print(".<");
-
- sw.print(annotationType.getCanonicalName());
- sw.println("> builder()");
- sw.indent();
- sw.indent();
-
- // .setAnnotation(new MyAnnotation )
- sw.println(".setAnnotation( ");
- sw.indent();
- sw.indent();
- writeNewAnnotation(sw, constraint);
- sw.println(")");
- sw.outdent();
- sw.outdent();
-
- // .setAttributes(builder()
- sw.println(".setAttributes(attributeBuilder()");
- sw.indent();
-
- for (Map.Entry<String, Object> entry :
- constraint.getAttributes().entrySet()) {
- // .put(key, value)
- sw.print(".put(");
- sw.print(asLiteral(entry.getKey()));
- sw.print(", ");
- sw.print(asLiteral(entry.getValue()));
- sw.println(")");
- }
-
- // .build())
- sw.println(".build())");
- sw.outdent();
-
- // .setConstraintValidatorClasses(classes )
- sw.print(".setConstraintValidatorClasses(");
- sw.print(asLiteral(asArray(constraint.getConstraintValidatorClasses(),
- new Class[0])));
- sw.println(")");
-
- int ccCount = constraint.getComposingConstraints().size();
- for (int i = 0; i < ccCount; i++) {
- // .addComposingConstraint(cX_X)
- sw.print(".addComposingConstraint(");
- sw.print(constraintDescripotorVar + "_" + i);
- sw.println(")");
- }
-
- // .getGroups(groups)
- sw.print(".setGroups(");
- Set<Class<?>> groups = constraint.getGroups();
- sw.print(asLiteral(asArray(groups, new Class<?>[0])));
- sw.println(")");
-
- // .setPayload(payload)
- sw.print(".setPayload(");
- Set<Class<? extends Payload>> payload = constraint.getPayload();
- sw.print(asLiteral(asArray(payload, new Class[0])));
- sw.println(")");
-
- // .setReportAsSingleViolation(boolean )
- sw.print(".setReportAsSingleViolation(");
- sw.print(Boolean.valueOf(constraint.isReportAsSingleViolation())
- .toString());
- sw.println(")");
-
- // .build();
- sw.println(".build();");
- sw.outdent();
- sw.outdent();
-
- sw.outdent();
- sw.outdent();
- sw.println();
- }
-
- private void writeFields(SourceWriter sw) throws UnableToCompleteException {
-
- // Create a static array of all valid property names.
- BeanInfo beanInfo;
- try {
- beanInfo = Introspector.getBeanInfo(beanHelper.getClazz());
- } catch (IntrospectionException e) {
- throw error(logger, e);
- }
-
- // private static final java.util.List<String> ALL_PROPERTY_NAMES =
- sw.println("private static final java.util.List<String> ALL_PROPERTY_NAMES = ");
- sw.indent();
- sw.indent();
-
- // Collections.<String>unmodifiableList(
- sw.println("java.util.Collections.<String>unmodifiableList(");
- sw.indent();
- sw.indent();
-
- // java.util.Arrays.<String>asList(
- sw.print("java.util.Arrays.<String>asList(");
-
- // "foo","bar" );
- sw.print(Joiner.on(",").join(
- Iterables.transform(
- ImmutableList.copyOf(beanInfo.getPropertyDescriptors()),
- Functions.compose(TO_LITERAL, PROPERTY_DESCRIPTOR_TO_NAME))));
- sw.println("));");
- sw.outdent();
- sw.outdent();
- sw.outdent();
- sw.outdent();
-
- // Create a variable for each constraint of each property
- for (PropertyDescriptor p :
- beanHelper.getBeanDescriptor().getConstrainedProperties()) {
- int count = 0;
- for (ConstraintDescriptor<?> constraint : p.getConstraintDescriptors()) {
- writeConstraintDescriptor(sw, constraint,
- constraintDescriptorVar(p.getPropertyName(), count++));
- }
- writePropertyDescriptor(sw, p);
- if (p.isCascaded()) {
- beansToValidate.add(isIterableOrMap(p.getElementClass())
- ? createBeanHelper(beanHelper.getAssociationType(p, true))
- : createBeanHelper(p.getElementClass()));
- }
- }
-
- // Create a variable for each constraint of this class.
- int count = 0;
- for (ConstraintDescriptor<?> constraint :
- beanHelper.getBeanDescriptor().getConstraintDescriptors()) {
- writeConstraintDescriptor(sw, constraint,
- constraintDescriptorVar("this", count++));
- }
-
- // Now write the BeanDescriptor after we already have the
- // PropertyDescriptors and class constraints
- writeBeanDescriptor(sw);
- sw.println();
- }
-
- private void writeFieldWrapperMethod(SourceWriter sw, JField field) {
- writeUnsafeNativeLongIfNeeded(sw, field.getType());
-
- // private native fieldType _fieldName(Bean object) /*-{
- sw.print("private native ");
-
- sw.print(field.getType().getQualifiedSourceName());
- sw.print(" ");
- sw.print(toWrapperName(field));
- sw.print("(");
- sw.print(beanType.getName());
- sw.println(" object) /*-{");
- sw.indent();
-
- // return object.@com.examples.Bean::myMethod();
- sw.print("return object.@");
- sw.print(field.getEnclosingType().getQualifiedSourceName());
- sw.print("::" + field.getName());
- sw.println(";");
-
- // }-*/;
- sw.outdent();
- sw.println("}-*/;");
- }
-
- private void writeGetDescriptor(SourceWriter sw) {
- // public GwtBeanDescriptor<beanType> getConstraints() {
- sw.print("public ");
- sw.print("GwtBeanDescriptor<" + beanHelper.getTypeCanonicalName() + "> ");
- sw.println("getConstraints() {");
- sw.indent();
-
- // return beanDescriptor;
- sw.println("return beanDescriptor;");
-
- sw.outdent();
- sw.println("}");
- }
-
- private void writeGetterWrapperMethod(SourceWriter sw, JMethod method) {
- writeUnsafeNativeLongIfNeeded(sw, method.getReturnType());
-
- // private native fieldType _getter(Bean object) /*={
- sw.print("private native ");
- sw.print(method.getReturnType().getQualifiedSourceName());
- sw.print(" ");
- sw.print(toWrapperName(method));
- sw.print("(");
- sw.print(beanType.getName());
- sw.println(" object) /*-{");
- sw.indent();
-
- // return object.@com.examples.Bean::myMethod()();
- sw.print("return object.");
- sw.print(method.getJsniSignature());
- sw.println("();");
-
- // }-*/;
- sw.outdent();
- sw.println("}-*/;");
- }
-
- private void writeIfPropertyNameNotFound(SourceWriter sw) {
- // if (!ALL_PROPERTY_NAMES.contains(propertyName)) {
- sw.println(" if (!ALL_PROPERTY_NAMES.contains(propertyName)) {");
- sw.indent();
-
- // throw new IllegalArgumentException(propertyName
- // +"is not a valid property of myClass");
- sw.print("throw new ");
- sw.print(IllegalArgumentException.class.getCanonicalName());
- sw.print("( propertyName +\" is not a valid property of ");
- sw.print(beanType.getQualifiedSourceName());
- sw.println("\");");
-
- // }
- sw.outdent();
- sw.println("}");
- }
-
- private void writeNewAnnotation(SourceWriter sw,
- ConstraintDescriptor<? extends Annotation> constraint)
- throws UnableToCompleteException {
- Annotation annotation = constraint.getAnnotation();
- Class<? extends Annotation> annotationType = annotation.annotationType();
-
- // new MyAnnotation () {
- sw.print("new ");
- sw.print(annotationType.getCanonicalName());
- sw.println("(){");
- sw.indent();
- sw.indent();
-
- // public Class<? extends Annotation> annotationType() { return
- // MyAnnotation.class; }
- sw.print("public Class<? extends Annotation> annotationType() { return ");
- sw.print(annotationType.getCanonicalName());
- sw.println(".class; }");
-
- for (Method method : annotationType.getMethods()) {
- // method.isAbstract would be better
- if (method.getDeclaringClass().equals(annotation.annotationType())) {
- // public returnType method() { return value ;}
- sw.print("public ");
- sw.print(method.getReturnType().getCanonicalName()); // TODO handle
- // generics
- sw.print(" ");
- sw.print(method.getName());
- sw.print("() { return ");
-
- try {
- Object value = method.invoke(annotation);
- sw.print(asLiteral(value));
- } catch (IllegalArgumentException e) {
- throw error(logger, e);
- } catch (IllegalAccessException e) {
- throw error(logger, e);
- } catch (InvocationTargetException e) {
- throw error(logger, e);
- }
- sw.println(";}");
- }
- }
-
- sw.outdent();
- sw.outdent();
- sw.println("}");
- }
-
- private void writeNewViolations(SourceWriter sw) {
- // Set<ConstraintViolation<T>> violations =
- // new HashSet<ConstraintViolation<T>>();
- sw.println("Set<ConstraintViolation<T>> violations = ");
- sw.indent();
- sw.indent();
-
- sw.println("new HashSet<ConstraintViolation<T>>();");
- sw.outdent();
- sw.outdent();
- }
-
- /**
- * @param sw
- * @param p
- */
- private void writePropertyDescriptor(SourceWriter sw, PropertyDescriptor p) {
- // private final PropertyDescriptor myProperty_pd =
- sw.print("private final ");
- sw.print(PropertyDescriptor.class.getCanonicalName());
- sw.print(" ");
- sw.print(p.getPropertyName());
- sw.println("_pd =");
- sw.indent();
- sw.indent();
-
- // new PropertyDescriptorImpl(
- sw.println("new " + PropertyDescriptorImpl.class.getCanonicalName() + "(");
- sw.indent();
- sw.indent();
-
- // "myProperty",
- sw.println("\"" + p.getPropertyName() + "\",");
-
- // MyType.class,
- sw.println(p.getElementClass().getCanonicalName() + ".class,");
-
- // isCascaded,
- sw.print(Boolean.toString(p.isCascaded()));
-
- // myProperty_c0,
- // myProperty_c1 );
- int size = p.getConstraintDescriptors().size();
- for (int i = 0; i < size; i++) {
- sw.println(","); // Print the , for the previous line
- sw.print(constraintDescriptorVar(p.getPropertyName(), i));
- }
- sw.println(");");
-
- sw.outdent();
- sw.outdent();
- sw.outdent();
- sw.outdent();
- }
-
- private void writePropertyValidators(SourceWriter sw)
- throws UnableToCompleteException {
- for (PropertyDescriptor p :
- beanHelper.getBeanDescriptor().getConstrainedProperties()) {
- if (beanHelper.hasField(p)) {
- writeValidatePropertyMethod(sw, p, true);
- sw.println();
- }
- if (beanHelper.hasGetter(p)) {
- writeValidatePropertyMethod(sw, p, false);
- sw.println();
- }
- }
- }
-
- private void writeValidate(SourceWriter sw) throws UnableToCompleteException {
- // public <T> Set<ConstraintViolation<T>> validate(
- sw.println("public <T> Set<ConstraintViolation<T>> validate(");
-
- // GwtValidationContext<T> context, BeanType object, Class<?>... groups) {
- sw.indent();
- sw.indent();
- sw.println("GwtValidationContext<T> context,");
- sw.println(beanHelper.getTypeCanonicalName() + " object,");
- sw.println("Class<?>... groups) {");
- sw.outdent();
-
- // try {
- sw.println("try {");
- sw.indent();
-
- writeNewViolations(sw);
-
- // context.addValidatedObject(object);
- sw.println("context.addValidatedObject(object);");
-
- // /// For each group
-
- // TODO(nchalko) handle the sequence in the AbstractValidator
-
- // See JSR 303 section 3.5
- // all reachable fields
- // all reachable getters (both) at once
- // including all reachable and cascadable associations
-
- Set<PropertyDescriptor> properties = beanHelper.getBeanDescriptor().getConstrainedProperties();
-
- for (PropertyDescriptor p : properties) {
- writeValidatePropertyCall(sw, p, false);
- }
-
- // all class level constraints
- int count = 0;
- Class<?> clazz = beanHelper.getClazz();
- for (ConstraintDescriptor<?> constraint : beanHelper.getBeanDescriptor().getConstraintDescriptors()) {
- if (hasMatchingAnnotation(constraint)) {
-
- if (!constraint.getConstraintValidatorClasses().isEmpty()) {
- Class<? extends ConstraintValidator<? extends Annotation, ?>> validatorClass = getValidatorForType(
- constraint, clazz);
-
- // validate(context, violations, null, object,
- sw.print("validate(context, violations, null, object, ");
-
- // new MyValidtor();
- sw.print("new ");
- sw.print(validatorClass.getCanonicalName());
- sw.print("(), "); // TODO(nchalko) use ConstraintValidatorFactory
-
- // this.aConstraintDescriptor, groups);;
- sw.print(constraintDescriptorVar("this", count));
- sw.println(", groups);");
- } else if (constraint.getComposingConstraints().isEmpty()) {
- // TODO(nchalko) What does the spec say to do here.
- logger.log(Type.WARN, "No ConstraintValidator of " + constraint
- + " for type " + clazz);
- }
- // TODO(nchalko) handle constraint.isReportAsSingleViolation() and
- // hasComposingConstraints
- }
- count++;
- }
-
- // validate super classes and super interfaces
- writeValidateInheritance(sw, clazz, Stage.OBJECT, null);
-
- // return violations;
- sw.println("return violations;");
-
- writeCatchUnexpectedException(sw,
- "\"Error validating " + beanHelper.getTypeCanonicalName() + "\"");
-
- // }
- sw.outdent();
- sw.println("}");
- }
-
- private void writeValidateConstraint(SourceWriter sw, PropertyDescriptor p,
- Class<?> elementClass, ConstraintDescriptor<?> constraint,
- String constraintDescriptorVar) throws UnableToCompleteException {
- if (!constraint.getConstraintValidatorClasses().isEmpty()) {
-
- Class<? extends ConstraintValidator<? extends Annotation, ?>> validatorClass;
- try {
- validatorClass = getValidatorForType(constraint, elementClass);
- } catch (UnexpectedTypeException e) {
- throw error(logger, e);
- }
-
- // validate(myContext, violations, object, value, new MyValidator(),
- // constraintDescriptor, groups);
- sw.print("validate(myContext, violations, object, value, ");
- sw.print("new "); // TODO(nchalko) use ConstraintValidatorFactory
- sw.print(validatorClass.getCanonicalName());
- sw.print("(), ");
- sw.print(constraintDescriptorVar);
- sw.println(", groups);");
- } else if (constraint.getComposingConstraints().isEmpty()) {
- // TODO(nchalko) What does the spec say to do here.
- logger.log(Type.WARN, "No ConstraintValidator of " + constraint
- + " for " + p.getPropertyName() + " of type " + elementClass);
- }
- // TODO(nchalko) handle constraint.isReportAsSingleViolation()
- int count = 0;
- for (ConstraintDescriptor<?> compositeConstraint : constraint.getComposingConstraints()) {
- String compositeVar = constraintDescriptorVar + "_" + count++;
- writeValidateConstraint(sw, p, elementClass, compositeConstraint,
- compositeVar);
- }
- }
-
- private void writeValidateFieldCall(SourceWriter sw, PropertyDescriptor p,
- boolean useValue) {
- String propertyName = p.getPropertyName();
-
- // validateProperty_<<field>>(context,
- sw.print(validateMethodFieldName(p));
- sw.print("(context, ");
- sw.print("violations, ");
-
- // null, (MyType) value,
- // or
- // object, object.getLastName(),
- if (useValue) {
- sw.print("null, ");
- sw.print("(");
- sw.print(getQualifiedSourceNonPrimitiveType(beanHelper.getElementType(p,
- true)));
- sw.print(") value");
- } else {
- sw.print("object, ");
- JField field = beanType.getField(propertyName);
- if (field.isPublic()) {
- sw.print("object.");
- sw.print(propertyName);
- } else {
- fieldsToWrap.add(field);
- sw.print(toWrapperName(field) + "(object)");
- }
- }
- sw.print(", ");
-
- // groups));
- sw.println("groups);");
- }
-
- private void writeValidateGetterCall(SourceWriter sw, PropertyDescriptor p,
- boolean useValue) {
- // validateProperty_get<<field>>(context, violations,
- sw.print(validateMethodGetterName(p));
- sw.print("(context, ");
- sw.print("violations, ");
-
- // object, object.getMyProp(),
- // or
- // null, (MyType) value,
- if (useValue) {
- sw.print("null, ");
- sw.print("(");
- sw.print(getQualifiedSourceNonPrimitiveType(beanHelper.getElementType(p,
- false)));
- sw.print(") value");
- } else {
- sw.print("object, ");
- JMethod method = beanType.findMethod(asGetter(p), NO_ARGS);
- if (method.isPublic()) {
- sw.print("object.");
- sw.print(asGetter(p));
- sw.print("()");
- } else {
- gettersToWrap.add(method);
- sw.print(toWrapperName(method) + "(object)");
- }
- }
- sw.print(", ");
-
- // groups);
- sw.println("groups);");
- }
-
- private void writeValidateInheritance(SourceWriter sw, Class<?> clazz,
- Stage stage, PropertyDescriptor property)
- throws UnableToCompleteException {
- writeValidateInterfaces(sw, clazz, stage, property);
- Class<?> superClass = clazz.getSuperclass();
- if (superClass != null) {
- writeValidatorCall(sw, superClass, stage, property);
- }
- }
-
- private void writeValidateInterfaces(SourceWriter sw, Class<?> clazz,
- Stage stage, PropertyDescriptor p) throws UnableToCompleteException {
- for (Class<?> type : clazz.getInterfaces()) {
- writeValidatorCall(sw, type, stage, p);
- writeValidateInterfaces(sw, type, stage, p);
- }
- }
-
- private void writeValidateIterable(SourceWriter sw, PropertyDescriptor p) {
- // int i = 0;
- sw.println("int i = 0;");
-
- // for (Object instance : value) {
- sw.println("for(Object instance : value) {");
- sw.indent();
-
- // if(instance != null && !context.alreadyValidated(instance)) {
- sw.println(" if(instance != null && !context.alreadyValidated(instance)) {");
- sw.indent();
-
- // violations.addAll(
- sw.println("violations.addAll(");
- sw.indent();
- sw.indent();
-
- // context.getValidator().validate(
- sw.println("context.getValidator().validate(");
- sw.indent();
- sw.indent();
-
- Class<?> elementClass = p.getElementClass();
- if (elementClass.isArray() || List.class.isAssignableFrom(elementClass)) {
- // context.appendIndex("myProperty",i++),
- sw.print("context.appendIndex(\"");
- sw.print(p.getPropertyName());
- sw.println("\",i),");
- } else {
- // context.appendIterable("myProperty"),
- sw.print("context.appendIterable(\"");
- sw.print(p.getPropertyName());
- sw.println("\"),");
- }
-
- // instance, groups));
- sw.println("instance, groups));");
- sw.outdent();
- sw.outdent();
- sw.outdent();
- sw.outdent();
-
- // }
- sw.outdent();
- sw.println("}");
-
- // i++;
- sw.println("i++;");
-
- // }
- sw.outdent();
- sw.println("}");
- }
-
- private void writeValidateMap(SourceWriter sw, PropertyDescriptor p) {
- // for (Entry<?, Type> entry : value.entrySet()) {
- sw.print("for(");
- sw.print(Entry.class.getCanonicalName());
- sw.println("<?, ?> entry : value.entrySet()) {");
- sw.indent();
-
- // if(entry.getValue() != null &&
- // !context.alreadyValidated(entry.getValue())) {
- sw.println(" if(entry.getValue() != null && !context.alreadyValidated(entry.getValue())) {");
- sw.indent();
-
- // violations.addAll(
- sw.println("violations.addAll(");
- sw.indent();
- sw.indent();
-
- // context.getValidator().validate(
- sw.println("context.getValidator().validate(");
- sw.indent();
- sw.indent();
-
- // context.appendKey("myProperty",entry.getKey()),
- sw.print("context.appendKey(\"");
- sw.print(p.getPropertyName());
- sw.println("\",entry.getKey()),");
-
- // entry.getValue(), groups));
- sw.println("entry.getValue(), groups));");
- sw.outdent();
- sw.outdent();
- sw.outdent();
- sw.outdent();
-
- // }
- sw.outdent();
- sw.println("}");
-
- // }
- sw.outdent();
- sw.println("}");
- }
-
- private void writeValidateProperty(SourceWriter sw)
- throws UnableToCompleteException {
- // public <T> Set<ConstraintViolation<T>> validate(
- sw.println("public <T> Set<ConstraintViolation<T>> validateProperty(");
-
- // GwtValidationContext<T> context, BeanType object, String propertyName,
- // Class<?>... groups) throws ValidationException {
- sw.indent();
- sw.indent();
- sw.println("GwtValidationContext<T> context,");
- sw.println(beanHelper.getTypeCanonicalName() + " object,");
- sw.println("String propertyName,");
- sw.println("Class<?>... groups) throws ValidationException {");
- sw.outdent();
-
- // try {
- sw.println("try {");
- sw.indent();
-
- writeNewViolations(sw);
-
- for (PropertyDescriptor property : beanHelper.getBeanDescriptor().getConstrainedProperties()) {
- // if (propertyName.equals(myPropety)) {
- sw.print("if (propertyName.equals(\"");
- sw.print(property.getPropertyName());
- sw.println("\")) {");
- sw.indent();
-
- writeValidatePropertyCall(sw, property, false);
-
- // validate all super classes and interfaces
- writeValidateInheritance(sw, beanHelper.getClazz(), Stage.PROPERTY,
- property);
-
- // }
- sw.outdent();
- sw.print("} else ");
- }
-
- writeIfPropertyNameNotFound(sw);
-
- // return violations;
- sw.println("return violations;");
-
- writeCatchUnexpectedException(
- sw,
- "\"Error validating \" + propertyName + \" of "
- + beanHelper.getTypeCanonicalName() + "\"");
-
- // }
- sw.outdent();
- sw.println("}");
- }
-
- private void writeValidatePropertyCall(SourceWriter sw,
- PropertyDescriptor property, boolean useValue) {
- if (beanHelper.hasGetter(property)) {
- if (useValue) {
- // if ( value == null || value instanceof propertyType) {
- sw.print("if ( value == null || value instanceof ");
- sw.print(getQualifiedSourceNonPrimitiveType(beanHelper.getElementType(
- property, false)));
- sw.println(") {");
- sw.indent();
- }
- // validate_getMyProperty
- writeValidateGetterCall(sw, property, useValue);
- if (useValue) {
- // } else
- sw.outdent();
- sw.print("} else ");
- }
- }
-
- if (beanHelper.hasField(property)) {
- if (useValue) {
- // if ( value == null || value instanceof propertyType) {
- sw.print("if ( value == null || value instanceof ");
- sw.print(getQualifiedSourceNonPrimitiveType(beanHelper.getElementType(
- property, true)));
- sw.println(") {");
- sw.indent();
- }
- // validate_myProperty
- writeValidateFieldCall(sw, property, useValue);
- if (useValue) {
- // } else
- sw.outdent();
- sw.print("} else ");
- }
- }
-
- if (useValue & (beanHelper.hasGetter(property) || beanHelper.hasField(property))) {
- // {
- sw.println(" {");
- sw.indent();
-
- // throw new ValidationException(value.getClass +
- // " is not a valid type for " + propertyName);
- sw.print("throw new ValidationException");
- sw.println("(value.getClass() +\" is not a valid type for \"+ propertyName);");
-
- // }
- sw.outdent();
- sw.println("}");
- }
- }
-
- private void writeValidatePropertyMethod(SourceWriter sw,
- PropertyDescriptor p, boolean useField) throws UnableToCompleteException {
- Class<?> elementClass = p.getElementClass();
- JType elementType = beanHelper.getElementType(p, useField);
-
- // private final <T> void validateProperty_{get}<p>(
- sw.print("private final <T> void ");
- if (useField) {
- sw.print(validateMethodFieldName(p));
- } else {
- sw.print(validateMethodGetterName(p));
- }
- sw.println("(");
- sw.indent();
- sw.indent();
-
- // final GwtValidationContext<T> context,
- sw.println("final GwtValidationContext<T> context,");
-
- // final Set<ConstraintViolation<T>> violations,
- sw.println("final Set<ConstraintViolation<T>> violations,");
-
- // final BeanType object, <Type> value,
- sw.println(beanHelper.getTypeCanonicalName() + " object,");
-
- // Class<?>... groups) {
- sw.print("final ");
- sw.print(elementType.getParameterizedQualifiedSourceName());
- sw.println(" value,");
- sw.println("Class<?>... groups) {");
- sw.outdent();
-
- // context = context.append("myProperty");
- sw.print("final GwtValidationContext<T> myContext = context.append(\"");
- sw.print(p.getPropertyName());
- sw.println("\");");
-
- // TODO(nchalko) move this out of here to the Validate method
- if (p.isCascaded()) {
-
- // if(value != null) {
- sw.println("if(value != null) {");
- sw.indent();
-
- if (isIterableOrMap(elementClass)) {
- if (hasValid(p, useField)) {
- JClassType associationType = beanHelper.getAssociationType(p,
- useField);
- createBeanHelper(associationType);
- if (Map.class.isAssignableFrom(elementClass)) {
- writeValidateMap(sw, p);
- } else {
- writeValidateIterable(sw, p);
- }
- }
- } else {
- createBeanHelper(elementClass);
-
- // if (!context.alreadyValidated(value)) {
- sw.println(" if (!context.alreadyValidated(value)) {");
- sw.indent();
-
- // violations.addAll(myContext.getValidator().validate(context, value,
- // groups));
- sw.print("violations.addAll(");
- sw.println("myContext.getValidator().validate(myContext, value, groups));");
-
- // }
- sw.outdent();
- sw.println("}");
- }
-
- // }
- sw.outdent();
- sw.println("}");
- }
-
- // It is possible for an annotation with the exact same values to be set on
- // both the field and the getter.
- // Keep track of the ones we have used to make sure we don't duplicate.
- // It doesn't matter which one we use because they have exactly the same
- // values.
- Set<Object> includedAnnotations = Sets.newHashSet();
- int count = 0;
- for (ConstraintDescriptor<?> constraint : p.getConstraintDescriptors()) {
- Object annotation = constraint.getAnnotation();
- if (!includedAnnotations.contains(annotation)
- && hasMatchingAnnotation(p, useField, constraint)) {
- includedAnnotations.add(annotation);
- String constraintDescriptorVar = constraintDescriptorVar(
- p.getPropertyName(), count);
-
- writeValidateConstraint(sw, p, elementClass, constraint,
- constraintDescriptorVar);
- }
- count++;
- }
- sw.outdent();
- sw.println("}");
- }
-
- private void writeValidateValue(SourceWriter sw)
- throws UnableToCompleteException {
- // public <T> Set<ConstraintViolation<T>> validate(
- sw.println("public <T> Set<ConstraintViolation<T>> validateValue(");
-
- // GwtValidationContext<T> context, Class<Author> beanType,
- // String propertyName, Object value, Class<?>... groups) {
- sw.indent();
- sw.indent();
- sw.println("GwtValidationContext<T> context,");
- sw.println("Class<" + beanHelper.getTypeCanonicalName() + "> beanType,");
- sw.println("String propertyName,");
- sw.println("Object value,");
- sw.println("Class<?>... groups) {");
- sw.outdent();
-
- // try {
- sw.println("try {");
- sw.indent();
-
- writeNewViolations(sw);
-
- for (PropertyDescriptor property :
- beanHelper.getBeanDescriptor().getConstrainedProperties()) {
- // if (propertyName.equals(myPropety)) {
- sw.print("if (propertyName.equals(\"");
- sw.print(property.getPropertyName());
- sw.println("\")) {");
- sw.indent();
-
- if (!isIterableOrMap(property.getElementClass())) {
- writeValidatePropertyCall(sw, property, true);
- }
-
- // validate all super classes and interfaces
- writeValidateInheritance(sw, beanHelper.getClazz(),
- Stage.VALUE, property);
-
- // }
- sw.outdent();
- sw.print("} else ");
- }
-
- writeIfPropertyNameNotFound(sw);
-
- // return violations;
- sw.println("return violations;");
-
- writeCatchUnexpectedException(
- sw,
- "\"Error validating \" + propertyName + \" of "
- + beanHelper.getTypeCanonicalName() + "\"");
-
- sw.outdent();
- sw.println("}");
- }
-
- private void writeValidatorCall(SourceWriter sw, Class<?> type, Stage stage,
- PropertyDescriptor p) throws UnableToCompleteException {
- if (BeanHelper.isClassConstrained(type) && !isIterableOrMap(type)) {
- BeanHelper helper = createBeanHelper(type);
- beansToValidate.add(helper);
- switch (stage) {
- case OBJECT:
- // voilations.addAll(myValidator.validate(context,object,groups));
- sw.print("violations.addAll(");
- sw.print(helper.getValidatorInstanceName());
- sw.println(".validate(context, object, groups));");
- break;
- case PROPERTY:
- if (isPropertyConstrained(helper, p)) {
- // voilations.addAll(myValidator.validateProperty(context,object
- // ,propertyName, groups));
- sw.print("violations.addAll(");
- sw.print(helper.getValidatorInstanceName());
- sw.print(".validateProperty(context, object,");
- sw.println(" propertyName, groups));");
- }
- break;
- case VALUE:
- if (isPropertyConstrained(helper, p)) {
- // voilations.addAll(myValidator.validateProperty(context,beanType
- // ,propertyName, value, groups));
- sw.print("violations.addAll(");
- sw.print(helper.getValidatorInstanceName());
- sw.print(".validateValue(context, ");
- // TODO(nchalko) this seems like an unneeded param
- sw.print(helper.getTypeCanonicalName());
- sw.println(".class, propertyName, value, groups));");
- }
- break;
- default:
- throw new IllegalStateException();
- }
- }
- }
-
-
- private void writeWrappers(SourceWriter sw) {
- sw.println("// Write the wrappers after we know which are needed");
- for (JField field : fieldsToWrap) {
- writeFieldWrapperMethod(sw, field);
- sw.println();
- }
-
- for (JMethod method : gettersToWrap) {
- writeGetterWrapperMethod(sw, method);
- sw.println();
- }
- }
-}
diff --git a/user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorGenerator.java b/user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorGenerator.java
deleted file mode 100644
index 10c0448..0000000
--- a/user/src/com/google/gwt/validation/rebind/GwtSpecificValidatorGenerator.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.rebind;
-
-import com.google.gwt.core.ext.Generator;
-import com.google.gwt.core.ext.GeneratorContext;
-import com.google.gwt.core.ext.TreeLogger;
-import com.google.gwt.core.ext.UnableToCompleteException;
-import com.google.gwt.core.ext.typeinfo.JClassType;
-import com.google.gwt.core.ext.typeinfo.JParameterizedType;
-import com.google.gwt.core.ext.typeinfo.TypeOracle;
-import com.google.gwt.validation.client.impl.GwtSpecificValidator;
-
-/**
- * Generates a {@link com.google.gwt.validation.client.GwtSpecificValidator}.
- * <p>
- * This class is thread safe.
- */
-public class GwtSpecificValidatorGenerator extends Generator {
-
-
- @Override
- public String generate(TreeLogger logger, GeneratorContext context,
- String typeName) throws UnableToCompleteException {
- JClassType validatorType = context.getTypeOracle().findType(typeName);
- TypeOracle typeOracle = context.getTypeOracle();
- assert (typeOracle != null);
-
- JClassType validator = typeOracle.findType(typeName);
- if (validator == null) {
- logger.log(TreeLogger.ERROR, "Unable to find metadata for type '"
- + typeName + "'", null);
- throw new UnableToCompleteException();
- }
-
- JClassType gwtSpecificInterface = getGwtSpecificValidator(logger, validator);
- JClassType beanType = getBeanType(logger, validator, gwtSpecificInterface);
-
- BeanHelper beanHelper = BeanHelper.createBeanHelper(beanType,logger,context);
-
- if (beanHelper == null) {
- logger.log(TreeLogger.ERROR, "Unable to create BeanHelper for " + beanType
- + " " + GwtSpecificValidator.class.getSimpleName()
- + ".", null);
- throw new UnableToCompleteException();
- }
-
- AbstractCreator creator = new GwtSpecificValidatorCreator(validatorType,
- beanType, beanHelper, logger, context);
- return creator.create();
- }
-
- private JClassType getBeanType(TreeLogger logger, JClassType validator,
- JClassType gwtSpecificInterface) throws UnableToCompleteException {
- if (gwtSpecificInterface instanceof JParameterizedType) {
- JParameterizedType paramType = (JParameterizedType) gwtSpecificInterface;
- return paramType.getTypeArgs()[0];
- }
- logger.log(TreeLogger.ERROR, validator.getQualifiedSourceName()
- + " must implement " + GwtSpecificValidator.class.getCanonicalName()
- + " with a one generic parameter.", null);
- throw new UnableToCompleteException();
- }
-
- private JClassType getGwtSpecificValidator(TreeLogger logger,
- JClassType validator) throws UnableToCompleteException {
- for (JClassType interfaceType : validator.getImplementedInterfaces()) {
- if (interfaceType.getQualifiedSourceName().endsWith(
- GwtSpecificValidator.class.getCanonicalName())) {
- return interfaceType;
- }
- }
- logger.log(TreeLogger.ERROR, validator.getQualifiedSourceName()
- + " must implement " + GwtSpecificValidator.class.getCanonicalName(),
- null);
- throw new UnableToCompleteException();
- }
-}
diff --git a/user/src/com/google/gwt/validation/rebind/Util.java b/user/src/com/google/gwt/validation/rebind/Util.java
deleted file mode 100644
index 0d140fc..0000000
--- a/user/src/com/google/gwt/validation/rebind/Util.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.rebind;
-
-import com.google.gwt.thirdparty.guava.common.base.Function;
-import com.google.gwt.thirdparty.guava.common.base.Functions;
-import com.google.gwt.thirdparty.guava.common.base.Predicate;
-import com.google.gwt.thirdparty.guava.common.collect.ImmutableList;
-import com.google.gwt.thirdparty.guava.common.collect.ImmutableSet;
-import com.google.gwt.thirdparty.guava.common.collect.Iterables;
-import com.google.gwt.thirdparty.guava.common.collect.Lists;
-import com.google.gwt.thirdparty.guava.common.collect.Sets;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-/**
- * Static utilities for the validation rebind package.
- */
-class Util {
-
- /**
- * Creates a Predicate that returns false if source contains an associated
- * class that is a super type of the class associated with the tested T.
- *
- * @param <T> the type to test
- * @param source the set of <T> to look for class matches.
- * @param toClass Function from T to Class
- * @return newly create predicate.
- */
- static <T> Predicate<T> createMostSpecificMatchPredicate(
- final Iterable<T> source, final Function<T, Class<?>> toClass) {
- return new Predicate<T>() {
-
- public boolean apply(T input) {
- Class<?> inputClass = toClass.apply(input);
- for (Class<?> match : Iterables.transform(source, toClass)) {
- if (!inputClass.equals(match) && inputClass.isAssignableFrom(match)) {
- return false;
- }
- }
- return true;
- }
- };
- }
-
- /**
- * Selects first only the classes that are assignable from the target, and
- * then returns the most specific matching classes.
- *
- * @param target the Class to match
- * @param availableClasses classes to search
- * @return Set of only the most specific classes that match the target.
- */
- static Set<Class<?>> findBestMatches(Class<?> target,
- Set<Class<?>> availableClasses) {
- Set<Class<?>> matches = new HashSet<Class<?>>();
- if (availableClasses.contains(target)) {
- return ImmutableSet.<Class<?>> of(target);
- } else {
- for (Class<?> clazz : availableClasses) {
- if (clazz.isAssignableFrom(target)) {
- matches.add(clazz);
- }
- }
- }
- Predicate<Class<?>> moreSpecificClassPredicate = createMostSpecificMatchPredicate(
- matches, Functions.<Class<?>> identity());
- return Sets.filter(matches, moreSpecificClassPredicate);
- }
-
- /**
- * Returns a Immutable List sorted with the most specific associated class
- * first. Each element is guaranteed to not be assignable to any element that
- * appears before it in the list.
- */
- static <T> ImmutableList<T> sortMostSpecificFirst(Iterable<T> classes,
- Function<T, Class<?>> toClass) {
- List<T> working = Lists.newArrayList();
- // strip duplicates
- for (T t : classes) {
- if (!working.contains(t)) {
- working.add(t);
- }
- }
- List<T> sorted = Lists.newArrayList();
- Predicate<T> mostSpecific = createMostSpecificMatchPredicate(working,
- toClass);
- boolean changed = false;
- do {
- changed = false;
- for (Iterator<T> iterator = working.iterator(); iterator.hasNext();) {
- T t = iterator.next();
- if (mostSpecific.apply(t)) {
- sorted.add(t);
- iterator.remove();
- changed = true;
- }
- }
- } while (changed);
- if (!working.isEmpty()) {
- throw new IllegalStateException(
- "Unable to find a element that does not have a more specific element in the set "
- + working);
- }
- return ImmutableList.copyOf(sorted);
- }
-
- private Util() {
- }
-}
diff --git a/user/src/com/google/gwt/validation/rebind/ValidatorCreator.java b/user/src/com/google/gwt/validation/rebind/ValidatorCreator.java
deleted file mode 100644
index ff00dee..0000000
--- a/user/src/com/google/gwt/validation/rebind/ValidatorCreator.java
+++ /dev/null
@@ -1,391 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.rebind;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.core.ext.GeneratorContext;
-import com.google.gwt.core.ext.TreeLogger;
-import com.google.gwt.core.ext.UnableToCompleteException;
-import com.google.gwt.core.ext.typeinfo.JClassType;
-import com.google.gwt.thirdparty.guava.common.collect.ImmutableList;
-import com.google.gwt.thirdparty.guava.common.collect.Lists;
-import com.google.gwt.user.rebind.ClassSourceFileComposerFactory;
-import com.google.gwt.user.rebind.SourceWriter;
-import com.google.gwt.validation.client.GwtValidation;
-import com.google.gwt.validation.client.impl.AbstractGwtValidator;
-import com.google.gwt.validation.client.impl.GwtBeanDescriptor;
-import com.google.gwt.validation.client.impl.GwtSpecificValidator;
-import com.google.gwt.validation.client.impl.GwtValidationContext;
-
-import java.util.List;
-import java.util.Set;
-
-import javax.validation.ConstraintViolation;
-import javax.validation.metadata.BeanDescriptor;
-
-/**
- * Class that creates the validator for the given input class.
- */
-public class ValidatorCreator extends AbstractCreator {
-
- /**
- * The beans to validate in source declaration order.
- */
- private final ImmutableList<BeanHelper> beansToValidate;
- private final GwtValidation gwtValidation;
-
- public ValidatorCreator(JClassType validatorType, //
- GwtValidation gwtValidation, //
- TreeLogger logger, //
- GeneratorContext context) throws UnableToCompleteException {
- super(context, logger, validatorType);
- this.gwtValidation = gwtValidation;
-
- List<BeanHelper> temp = Lists.newArrayList();
- for (Class<?> clazz : gwtValidation.value()) {
- BeanHelper helper = createBeanHelper(clazz);
- temp.add(helper);
- }
- beansToValidate = Util.sortMostSpecificFirst(temp, BeanHelper.TO_CLAZZ);
- }
-
- @Override
- protected void compose(ClassSourceFileComposerFactory composerFactory) {
- addImports(composerFactory,
- GWT.class,
- GwtBeanDescriptor.class,
- GwtSpecificValidator.class,
- GwtValidationContext.class,
- Set.class,
- ConstraintViolation.class,
- BeanDescriptor.class);
- composerFactory.setSuperclass(AbstractGwtValidator.class.getCanonicalName());
- composerFactory.addImplementedInterface(this.validatorType.getQualifiedSourceName());
- }
-
- @Override
- protected void writeClassBody(SourceWriter sourceWriter) {
- writeConstructor(sourceWriter);
- sourceWriter.println();
- writeValidate(sourceWriter);
- sourceWriter.println();
- writeValidateProperty(sourceWriter);
- sourceWriter.println();
- writeValidateValue(sourceWriter);
- sourceWriter.println();
- writeGetConstraintsForClass(sourceWriter);
- sourceWriter.println();
- writeGwtValidate(sourceWriter);
- }
-
- private String getSimpleName() {
- return validatorType.getSimpleSourceName() + "Impl";
- }
-
- private void writeConstructor(SourceWriter sw) {
- // public MyValidator() {
- sw.println("public " + getSimpleName() + "() {");
- sw.indent();
-
- // super( <<groups>>);
- sw.print("super(");
- boolean first = true;
- for (Class<?> group : gwtValidation.groups()) {
- if (!first) {
- sw.print(", ");
- } else {
- first = false;
- }
- sw.print(group.getCanonicalName() + ".class");
- }
- sw.println(");");
-
- sw.outdent();
- sw.println("}");
- }
-
-
- private void writeContext(SourceWriter sw, BeanHelper bean, String objectName) {
- // GwtValidationContext<T> context = new GwtValidationContext<T>(
- sw.print(GwtValidationContext.class.getSimpleName());
- sw.print("<T> context =");
- sw.print(" new " + GwtValidationContext.class.getSimpleName());
- sw.println("<T>" + "(");
- sw.indent();
- sw.indent();
-
- // object,
- sw.println(objectName + ", ");
-
- // MyBeanValidator.INSTANCE.getConstraints(),
- sw.print(bean.getFullyQualifiedValidatorName());
- sw.println(".INSTANCE.getConstraints(), ");
-
- // getMessageInterpolator(),
- sw.println("getMessageInterpolator(), ");
-
- // this);
- sw.println("this);");
- sw.outdent();
- sw.outdent();
- }
-
- private void writeGetConstraintsForClass(SourceWriter sw) {
- // public BeanDescriptor getConstraintsForClass(Class<?> clazz {
- sw.println("public BeanDescriptor getConstraintsForClass(Class<?> clazz) {");
- sw.indent();
-
- // checkNotNull(clazz, "clazz");
- sw.println("checkNotNull(clazz, \"clazz\");");
-
- for (BeanHelper bean : beansToValidate) {
- writeGetConstraintsForClass(sw, bean);
- }
-
- writeThrowIllegalArgumnet(sw, "clazz.getName()");
-
- // }
- sw.outdent();
- sw.println("}");
- }
-
- private void writeGetConstraintsForClass(SourceWriter sw,
- BeanHelper bean) {
- // if (clazz.eqals(MyBean.class)) {
- sw.println("if (clazz.equals(" + bean.getTypeCanonicalName() + ".class)) {");
- sw.indent();
-
- // return MyBeanValidator.INSTANCE.getConstraints();
- sw.print("return ");
- sw.print(bean.getFullyQualifiedValidatorName());
- sw.println(".INSTANCE.getConstraints();");
-
- // }
- sw.outdent();
- sw.println("}");
- }
-
- private void writeGwtValidate(SourceWriter sw) {
- // public <T> Set<ConstraintViolation<T>> validate(GwtValidationContext<T>
- // context,
- sw.print("public <T> Set<ConstraintViolation<T>> ");
- sw.println("validate(GwtValidationContext<T> context,");
- sw.indent();
- sw.indent();
-
- // Object object, Class<?>... groups) {
- sw.println("Object object, Class<?>... groups) {");
- sw.outdent();
-
- sw.println("checkNotNull(context, \"context\");");
- sw.println("checkNotNull(object, \"object\");");
- sw.println("checkNotNull(groups, \"groups\");");
- sw.println("checkGroups(groups);");
-
- for (BeanHelper bean : Util.sortMostSpecificFirst(
- BeanHelper.getBeanHelpers().values(), BeanHelper.TO_CLAZZ)) {
- writeGwtValidate(sw, bean);
- }
-
- // TODO(nchalko) log warning instead.
- writeThrowIllegalArgumnet(sw, "object.getClass().getName()");
-
- sw.outdent();
- sw.println("}");
- }
-
- private void writeGwtValidate(SourceWriter sw, BeanHelper bean) {
- writeIfInstanceofBeanType(sw, bean);
- sw.indent();
-
- // return PersonValidator.INSTANCE
-
- sw.print("return ");
- sw.println(bean.getFullyQualifiedValidatorName() + ".INSTANCE");
- sw.indent();
- sw.indent();
- // .validate(context, (<<MyBean>>) object, groups);
- sw.print(".validate(context, ");
- sw.print("(" + bean.getTypeCanonicalName() + ") object, ");
- sw.println("groups);");
- sw.outdent();
- sw.outdent();
-
- // }
- sw.outdent();
- sw.println("}");
- }
-
- private void writeIfInstanceofBeanType(SourceWriter sourceWriter, BeanHelper bean) {
- // if (object instanceof MyBean) {
- sourceWriter.print("if (object instanceof ");
- sourceWriter.print(bean.getTypeCanonicalName());
- sourceWriter.println(") {");
- }
-
- private void writeThrowIllegalArgumnet(SourceWriter sourceWriter,
- String getClassName) {
- // throw new IllegalArgumentException("MyValidator can not validate ",
- sourceWriter.print("throw new IllegalArgumentException(\"");
- sourceWriter.print(this.validatorType.getName() + " can not validate \"");
- sourceWriter.indent();
- sourceWriter.indent();
-
- // + object.getClass().getName() +". "
- sourceWriter.print("+ ");
- sourceWriter.print(getClassName);
- sourceWriter.println("+ \". \"");
-
- // + "Valid values are {Foo.clas, Bar.class}
- sourceWriter.print("+ \"Valid types are ");
- sourceWriter.print(beansToValidate.toString());
- sourceWriter.println("\");");
- sourceWriter.outdent();
- sourceWriter.outdent();
- }
-
-
- private void writeValidate(SourceWriter sw) {
- // public <T> Set<ConstraintViolation<T>> validate(T object, Class<?>...
- // groups) {
- sw.println("public <T> Set<ConstraintViolation<T>> validate(T object, Class<?>... groups) {");
- sw.indent();
-
- sw.println("checkNotNull(object, \"object\");");
- sw.println("checkNotNull(groups, \"groups\");");
- sw.println("checkGroups(groups);");
-
- for (BeanHelper bean : beansToValidate) {
- writeValidate(sw, bean);
- }
-
- writeThrowIllegalArgumnet(sw, "object.getClass().getName()");
-
- sw.outdent();
- sw.println("}");
- }
-
- private void writeValidate(SourceWriter sw, BeanHelper bean) {
- writeIfInstanceofBeanType(sw, bean);
- sw.indent();
-
- writeContext(sw, bean, "object");
-
- // return PersonValidator.INSTANCE
- sw.print("return ");
- sw.println(bean.getFullyQualifiedValidatorName() + ".INSTANCE");
- sw.indent();
- sw.indent();
-
- // .validate(context, (<<MyBean>>) object, groups);
- sw.print(".validate(context, ");
- sw.print("(" + bean.getTypeCanonicalName() + ") object, ");
- sw.println("groups);");
- sw.outdent();
- sw.outdent();
-
- // }
- sw.outdent();
- sw.println("}");
- }
-
- private void writeValidateProperty(SourceWriter sw) {
- sw.println("public <T> Set<ConstraintViolation<T>> validateProperty(T object,String propertyName, Class<?>... groups) {");
- sw.indent();
-
- sw.println("checkNotNull(object, \"object\");");
- sw.println("checkNotNull(propertyName, \"propertyName\");");
- sw.println("checkNotNull(groups, \"groups\");");
- sw.println("checkGroups(groups);");
-
- for (BeanHelper bean : beansToValidate) {
- writeValidateProperty(sw, bean);
- }
-
- writeThrowIllegalArgumnet(sw, "object.getClass().getName()");
-
- sw.outdent();
- sw.println("}");
- }
-
- private void writeValidateProperty(SourceWriter sw, BeanHelper bean) {
- writeIfInstanceofBeanType(sw, bean);
- sw.indent();
- writeContext(sw, bean, "object");
-
- // return PersonValidator.INSTANCE
- sw.print("return ");
- sw.println(bean.getFullyQualifiedValidatorName() + ".INSTANCE");
- sw.indent();
- sw.indent();
-
- // .validateProperty(context, (MyBean) object, propertyName, groups);
- sw.print(".validateProperty(context, (");
- sw.print(bean.getTypeCanonicalName());
- sw.print(") object, propertyName, ");
- sw.println("groups);");
- sw.outdent();
- sw.outdent();
-
- // }
- sw.outdent();
- sw.println("}");
- }
-
- private void writeValidateValue(SourceWriter sw) {
- sw.println("public <T> Set<ConstraintViolation<T>> validateValue(Class<T> beanType, String propertyName, Object value, Class<?>... groups) {");
- sw.indent();
-
- sw.println("checkNotNull(beanType, \"beanType\");");
- sw.println("checkNotNull(propertyName, \"propertyName\");");
- sw.println("checkNotNull(groups, \"groups\");");
- sw.println("checkGroups(groups);");
-
- for (BeanHelper bean : beansToValidate) {
- writeValidateValue(sw, bean);
- }
-
- writeThrowIllegalArgumnet(sw, "beanType.getName()");
-
- sw.outdent();
- sw.println("}");
- }
-
- private void writeValidateValue(SourceWriter sw, BeanHelper bean) {
- sw.println("if (beanType.equals(" + bean.getTypeCanonicalName()
- + ".class)) {");
- sw.indent();
- writeContext(sw, bean, "null");
-
- // return PersonValidator.INSTANCE
- sw.print("return ");
- sw.println(bean.getFullyQualifiedValidatorName() + ".INSTANCE");
- sw.indent();
- sw.indent();
-
- // .validateValue(context, (Class<MyBean> beanType, propertyName, value,
- // groups);
- sw.print(".validateValue(context, (Class<");
- sw.print(bean.getTypeCanonicalName());
- sw.println(">)beanType, propertyName, value, groups);");
- sw.outdent();
- sw.outdent();
-
- // }
- sw.outdent();
- sw.println("}");
- }
-}
diff --git a/user/src/com/google/gwt/validation/rebind/ValidatorGenerator.java b/user/src/com/google/gwt/validation/rebind/ValidatorGenerator.java
deleted file mode 100644
index 83ffd12..0000000
--- a/user/src/com/google/gwt/validation/rebind/ValidatorGenerator.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.rebind;
-
-import com.google.gwt.core.ext.Generator;
-import com.google.gwt.core.ext.GeneratorContext;
-import com.google.gwt.core.ext.TreeLogger;
-import com.google.gwt.core.ext.UnableToCompleteException;
-import com.google.gwt.core.ext.typeinfo.JClassType;
-import com.google.gwt.core.ext.typeinfo.TypeOracle;
-import com.google.gwt.validation.client.GwtValidation;
-
-/**
- * Generates the generic {@link javax.validation.Validator}. The generic
- * validator only handles the classes listed in the
- * {@link com.google.gwt.validation.client.GwtValidation} annotation. See
- * {@link com.google.gwt.validation.client.GwtValidation} for usage.
- */
-public class ValidatorGenerator extends Generator {
-
- @Override
- public String generate(TreeLogger logger, GeneratorContext context,
- String typeName) throws UnableToCompleteException {
- TypeOracle typeOracle = context.getTypeOracle();
- assert (typeOracle != null);
-
- JClassType validatorType = typeOracle.findType(typeName);
- if (validatorType == null) {
- logger.log(TreeLogger.ERROR, "Unable to find metadata for type '"
- + typeName + "'", null);
- throw new UnableToCompleteException();
- }
-
- GwtValidation gwtValidation = validatorType.findAnnotationInTypeHierarchy(GwtValidation.class);
-
- if (gwtValidation == null) {
- logger.log(TreeLogger.ERROR, typeName + " must be anntotated with "
- + GwtValidation.class.getCanonicalName(), null);
- throw new UnableToCompleteException();
- }
-
- if (gwtValidation.value().length == 0) {
- logger.log(TreeLogger.ERROR,
- "The @" + GwtValidation.class.getSimpleName() + " of " + typeName
- + "must specify at least one bean type to validate.", null);
- throw new UnableToCompleteException();
- }
-
- TreeLogger validatorLogger = logger.branch(TreeLogger.DEBUG,
- "Generating Validator for '" + validatorType.getQualifiedSourceName()
- + "'", null);
- AbstractCreator creator = new ValidatorCreator(validatorType,
- gwtValidation,
- validatorLogger,
- context);
- return creator.create();
- }
-}
diff --git a/user/src/com/google/gwt/validation/super/com/google/gwt/validation/client/GwtConfiguration.java b/user/src/com/google/gwt/validation/super/com/google/gwt/validation/client/GwtConfiguration.java
deleted file mode 100644
index c70d11b..0000000
--- a/user/src/com/google/gwt/validation/super/com/google/gwt/validation/client/GwtConfiguration.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client;
-
-import com.google.gwt.validation.client.spi.GwtValidationProvider;
-
-import javax.validation.spi.BootstrapState;
-
-/**
- * Extends {@link BaseGwtConfiguration} with just the parts that are not GWT
- * compatible.
- */
-public class GwtConfiguration extends BaseGwtConfiguration {
-
- public GwtConfiguration(GwtValidationProvider gwtValidationProvider,
- BootstrapState state) {
- super(gwtValidationProvider, state);
- }
-
- public BaseGwtConfiguration addMapping(String stream) {
- throw new UnsupportedOperationException("GWT does not support InputStreams");
- }
-}
diff --git a/user/src/com/google/gwt/validation/super/com/google/gwt/validation/client/GwtMessageInterpolator.java b/user/src/com/google/gwt/validation/super/com/google/gwt/validation/client/GwtMessageInterpolator.java
deleted file mode 100644
index f180b17..0000000
--- a/user/src/com/google/gwt/validation/super/com/google/gwt/validation/client/GwtMessageInterpolator.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client;
-
-import com.google.gwt.i18n.shared.GwtLocale;
-
-import javax.validation.MessageInterpolator.Context;
-
-/**
- * Simple GWT {@link javax.validation.MessageInterpolator}.
- */
-public class GwtMessageInterpolator extends BaseMessageInterpolator {
- // This class only has the parts the need to overridden for GWT
-
- public String interpolate(String messageTemplate, Context context,
- GwtLocale locale) {
- return gwtInterpolate(messageTemplate,context,locale);
- }
-}
diff --git a/user/src/com/google/gwt/validation/super/com/google/gwt/validation/client/spi/GwtConfigurationState.java b/user/src/com/google/gwt/validation/super/com/google/gwt/validation/client/spi/GwtConfigurationState.java
deleted file mode 100644
index 6cabb78..0000000
--- a/user/src/com/google/gwt/validation/super/com/google/gwt/validation/client/spi/GwtConfigurationState.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.spi;
-
-import java.util.Set;
-
-/**
- * Only the GWT incompatible parts.
- */
-public class GwtConfigurationState extends BaseConfigurationState {
-
- public Set<String> getMappingStreams() {
- throw new UnsupportedOperationException(
- "GWT Validation does not support getMappingStreams");
- }
-
-}
diff --git a/user/src/javax/validation/super/javax/validation/Validation.java b/user/src/javax/validation/super/javax/validation/Validation.java
index 45a4540..738cef5 100644
--- a/user/src/javax/validation/super/javax/validation/Validation.java
+++ b/user/src/javax/validation/super/javax/validation/Validation.java
@@ -16,7 +16,7 @@
package javax.validation;
/**
- * Pass through to GWT version {@link com.google.gwt.validation.client.Validation}.
+ * Empty version to prevent compilation errors.
*/
-public class Validation extends com.google.gwt.validation.client.Validation {
+public class Validation {
}
diff --git a/user/src/org/hibernate/validator/HibernateValidationMessageResolver.java b/user/src/org/hibernate/validator/HibernateValidationMessageResolver.java
deleted file mode 100644
index 824c017..0000000
--- a/user/src/org/hibernate/validator/HibernateValidationMessageResolver.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.i18n.client.ConstantsWithLookup;
-import com.google.gwt.validation.client.AbstractValidationMessageResolver;
-import com.google.gwt.validation.client.ProviderValidationMessageResolver;
-
-/**
- * Hibernate default {@link ProviderValidationMessageResolver}.
- */
-public class HibernateValidationMessageResolver extends
- AbstractValidationMessageResolver implements
- ProviderValidationMessageResolver {
-
- private final ValidationMessages messages = GWT.create(ValidationMessages.class);
-
- public HibernateValidationMessageResolver() {
- super((ConstantsWithLookup) GWT.create(ValidationMessages.class));
- }
-}
diff --git a/user/src/org/hibernate/validator/HibernateValidator.gwt.xml b/user/src/org/hibernate/validator/HibernateValidator.gwt.xml
deleted file mode 100644
index 8100d63..0000000
--- a/user/src/org/hibernate/validator/HibernateValidator.gwt.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module>
-<!--
-Import this module to use Hibernate Validator during the compilation of validation classes for
-gwt clients.
- -->
- <inherits name='com.google.gwt.validation.Validation' />
- <source path="constraints">
- <exclude name="impl/scriptassert/" />
- <exclude name="super/" />
- </source>
- <source path="engine">
- <include name="ConstraintViolationImpl.java"/>
- <include name="NodeImpl.java"/>
- <include name="PathImpl.java"/>
- </source>
- <source path="">
- <include name="ValidationMessages.java"/>
- <include name="HibernateValidationMessageResolver.java"/>
- </source>
- <super-source path="super" />
- <replace-with
- class="org.hibernate.validator.HibernateValidationMessageResolver">
- <when-type-is class="com.google.gwt.validation.client.ProviderValidationMessageResolver" />
- </replace-with>
-</module>
diff --git a/user/src/org/hibernate/validator/README.txt b/user/src/org/hibernate/validator/README.txt
deleted file mode 100644
index 008bc33..0000000
--- a/user/src/org/hibernate/validator/README.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-The Hibernate Validator module is used to:
-
-1) generate client side validators.
-2) super source hibernate specific constraints
-3) super source hibernate classes needed to return ConstraintViolations from the server to the client.
-
-
-Maintenance Notes.
-Test using samples/validation and samples/validationtck
-
-
-NOTE
-(nchalko) all of should be pushed back to hibernate.
\ No newline at end of file
diff --git a/user/src/org/hibernate/validator/ValidationMessages.java b/user/src/org/hibernate/validator/ValidationMessages.java
deleted file mode 100644
index a1fbaec..0000000
--- a/user/src/org/hibernate/validator/ValidationMessages.java
+++ /dev/null
@@ -1,197 +0,0 @@
-package org.hibernate.validator;
-
-/**
- * Interface to represent the constants contained in resource bundle:
- * 'validation/ValidationMessages.properties'.
- */
-public interface ValidationMessages extends com.google.gwt.i18n.client.ConstantsWithLookup {
-
- /**
- * Translated "must be false".
- *
- * @return translated "must be false"
- */
- @DefaultStringValue("must be false")
- @Key("javax.validation.constraints.AssertFalse.message")
- String javax_validation_constraints_AssertFalse_message();
-
- /**
- * Translated "must be true".
- *
- * @return translated "must be true"
- */
- @DefaultStringValue("must be true")
- @Key("javax.validation.constraints.AssertTrue.message")
- String javax_validation_constraints_AssertTrue_message();
-
- /**
- * Translated "must be less than or equal to {value}".
- *
- * @return translated "must be less than or equal to {value}"
- */
- @DefaultStringValue("must be less than or equal to {value}")
- @Key("javax.validation.constraints.DecimalMax.message")
- String javax_validation_constraints_DecimalMax_message();
-
- /**
- * Translated "must be greater than or equal to {value}".
- *
- * @return translated "must be greater than or equal to {value}"
- */
- @DefaultStringValue("must be greater than or equal to {value}")
- @Key("javax.validation.constraints.DecimalMin.message")
- String javax_validation_constraints_DecimalMin_message();
-
- /**
- * Translated "numeric value out of bounds (<{integer} digits>.<{fraction} digits> expected)".
- *
- * @return translated "numeric value out of bounds (<{integer} digits>.<{fraction} digits> expected)"
- */
- @DefaultStringValue("numeric value out of bounds (<{integer} digits>.<{fraction} digits> expected)")
- @Key("javax.validation.constraints.Digits.message")
- String javax_validation_constraints_Digits_message();
-
- /**
- * Translated "must be in the future".
- *
- * @return translated "must be in the future"
- */
- @DefaultStringValue("must be in the future")
- @Key("javax.validation.constraints.Future.message")
- String javax_validation_constraints_Future_message();
-
- /**
- * Translated "must be less than or equal to {value}".
- *
- * @return translated "must be less than or equal to {value}"
- */
- @DefaultStringValue("must be less than or equal to {value}")
- @Key("javax.validation.constraints.Max.message")
- String javax_validation_constraints_Max_message();
-
- /**
- * Translated "must be greater than or equal to {value}".
- *
- * @return translated "must be greater than or equal to {value}"
- */
- @DefaultStringValue("must be greater than or equal to {value}")
- @Key("javax.validation.constraints.Min.message")
- String javax_validation_constraints_Min_message();
-
- /**
- * Translated "may not be null".
- *
- * @return translated "may not be null"
- */
- @DefaultStringValue("may not be null")
- @Key("javax.validation.constraints.NotNull.message")
- String javax_validation_constraints_NotNull_message();
-
- /**
- * Translated "must be null".
- *
- * @return translated "must be null"
- */
- @DefaultStringValue("must be null")
- @Key("javax.validation.constraints.Null.message")
- String javax_validation_constraints_Null_message();
-
- /**
- * Translated "must be in the past".
- *
- * @return translated "must be in the past"
- */
- @DefaultStringValue("must be in the past")
- @Key("javax.validation.constraints.Past.message")
- String javax_validation_constraints_Past_message();
-
- /**
- * Translated "must match \"{regexp}\"".
- *
- * @return translated "must match \"{regexp}\""
- */
- @DefaultStringValue("must match \"{regexp}\"")
- @Key("javax.validation.constraints.Pattern.message")
- String javax_validation_constraints_Pattern_message();
-
- /**
- * Translated "size must be between {min} and {max}".
- *
- * @return translated "size must be between {min} and {max}"
- */
- @DefaultStringValue("size must be between {min} and {max}")
- @Key("javax.validation.constraints.Size.message")
- String javax_validation_constraints_Size_message();
-
- /**
- * Translated "invalid credit card number".
- *
- * @return translated "invalid credit card number"
- */
- @DefaultStringValue("invalid credit card number")
- @Key("org.hibernate.validator.constraints.CreditCardNumber.message")
- String org_hibernate_validator_constraints_CreditCardNumber_message();
-
- /**
- * Translated "not a well-formed email address".
- *
- * @return translated "not a well-formed email address"
- */
- @DefaultStringValue("not a well-formed email address")
- @Key("org.hibernate.validator.constraints.Email.message")
- String org_hibernate_validator_constraints_Email_message();
-
- /**
- * Translated "length must be between {min} and {max}".
- *
- * @return translated "length must be between {min} and {max}"
- */
- @DefaultStringValue("length must be between {min} and {max}")
- @Key("org.hibernate.validator.constraints.Length.message")
- String org_hibernate_validator_constraints_Length_message();
-
- /**
- * Translated "may not be empty".
- *
- * @return translated "may not be empty"
- */
- @DefaultStringValue("may not be empty")
- @Key("org.hibernate.validator.constraints.NotBlank.message")
- String org_hibernate_validator_constraints_NotBlank_message();
-
- /**
- * Translated "may not be empty".
- *
- * @return translated "may not be empty"
- */
- @DefaultStringValue("may not be empty")
- @Key("org.hibernate.validator.constraints.NotEmpty.message")
- String org_hibernate_validator_constraints_NotEmpty_message();
-
- /**
- * Translated "must be between {min} and {max}".
- *
- * @return translated "must be between {min} and {max}"
- */
- @DefaultStringValue("must be between {min} and {max}")
- @Key("org.hibernate.validator.constraints.Range.message")
- String org_hibernate_validator_constraints_Range_message();
-
- /**
- * Translated "script expression \"{script}\" didn't evaluate to true".
- *
- * @return translated "script expression \"{script}\" didn't evaluate to true"
- */
- @DefaultStringValue("script expression \"{script}\" didn't evaluate to true")
- @Key("org.hibernate.validator.constraints.ScriptAssert.message")
- String org_hibernate_validator_constraints_ScriptAssert_message();
-
- /**
- * Translated "must be a valid URL".
- *
- * @return translated "must be a valid URL"
- */
- @DefaultStringValue("must be a valid URL")
- @Key("org.hibernate.validator.constraints.URL.message")
- String org_hibernate_validator_constraints_URL_message();
-}
diff --git a/user/src/org/hibernate/validator/ValidationMessages.properties b/user/src/org/hibernate/validator/ValidationMessages.properties
deleted file mode 100644
index 0e92c8f..0000000
--- a/user/src/org/hibernate/validator/ValidationMessages.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-
-# $Id: ValidationMessages.properties 19251 2010-04-20 15:28:18Z hardy.ferentschik $
-javax.validation.constraints.AssertFalse.message=must be false
-javax.validation.constraints.AssertTrue.message=must be true
-javax.validation.constraints.DecimalMax.message=must be less than or equal to {value}
-javax.validation.constraints.DecimalMin.message=must be greater than or equal to {value}
-javax.validation.constraints.Digits.message=numeric value out of bounds (<{integer} digits>.<{fraction} digits> expected)
-javax.validation.constraints.Future.message=must be in the future
-javax.validation.constraints.Max.message=must be less than or equal to {value}
-javax.validation.constraints.Min.message=must be greater than or equal to {value}
-javax.validation.constraints.NotNull.message=may not be null
-javax.validation.constraints.Null.message=must be null
-javax.validation.constraints.Past.message=must be in the past
-javax.validation.constraints.Pattern.message=must match "{regexp}"
-javax.validation.constraints.Size.message=size must be between {min} and {max}
-org.hibernate.validator.constraints.Email.message=not a well-formed email address
-org.hibernate.validator.constraints.Length.message=length must be between {min} and {max}
-org.hibernate.validator.constraints.NotBlank.message=may not be empty
-org.hibernate.validator.constraints.NotEmpty.message=may not be empty
-org.hibernate.validator.constraints.Range.message=must be between {min} and {max}
-org.hibernate.validator.constraints.URL.message=must be a valid URL
-org.hibernate.validator.constraints.CreditCardNumber.message=invalid credit card number
-org.hibernate.validator.constraints.ScriptAssert.message=script expression "{script}" didn't evaluate to true
diff --git a/user/src/org/hibernate/validator/ValidationMessages_de.properties b/user/src/org/hibernate/validator/ValidationMessages_de.properties
deleted file mode 100644
index 194b15d..0000000
--- a/user/src/org/hibernate/validator/ValidationMessages_de.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-# $Id: ValidationMessages_de.properties 19251 2010-04-20 15:28:18Z hardy.ferentschik $
-javax.validation.constraints.NotNull.message=kann nicht null sein
-javax.validation.constraints.Size.message=muss zwischen {min} und {max} liegen
-javax.validation.constraints.Pattern.message=muss auf Ausdruck "{regexp}" passen
-javax.validation.constraints.Min.message=muss gr\u00F6ssergleich {value} sein
-javax.validation.constraints.Max.message=muss kleinergleich {value} sein
-javax.validation.constraints.Null.message=muss null sein
-javax.validation.constraints.Past.message=muss in der Vergangenheit liegen
-javax.validation.constraints.Future.message=muss in der Zukunft liegen
-javax.validation.constraints.AssertTrue.message=muss wahr sein
-javax.validation.constraints.AssertFalse.message=muss falsch sein
-javax.validation.constraints.Digits.message=numerischer Wert au\u00DFerhalb erlaubten Wertebereichs (<{integer} Ziffern>.<{fraction} Ziffern> erwartet)
-javax.validation.constraints.DecimalMin.message=muss gr\u00F6ssergleich {value} sein
-javax.validation.constraints.DecimalMax.message=muss kleinergleich {value} sein
-org.hibernate.validator.constraints.Email.message=keine g\u00FCltige E-Mail-Adresse
-org.hibernate.validator.constraints.Length.message=muss zwischen {min} und {max} liegen
-org.hibernate.validator.constraints.NotBlank.message=kann nicht leer sein
-org.hibernate.validator.constraints.NotEmpty.message=kann nicht leer sein
-org.hibernate.validator.constraints.Range.message=muss zwischen {min} und {max} liegen
-org.hibernate.validator.constraints.URL.message=muss eine g\u00FCltige URL sein
-org.hibernate.validator.constraints.CreditCardNumber.message=ung\u00FCltige Kreditkartennummer
-org.hibernate.validator.constraints.ScriptAssert.message=Skriptausdruck "{script}" muss true zur\u00FCckliefern
diff --git a/user/src/org/hibernate/validator/ValidationMessages_en.properties b/user/src/org/hibernate/validator/ValidationMessages_en.properties
deleted file mode 100644
index cea61f0..0000000
--- a/user/src/org/hibernate/validator/ValidationMessages_en.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-# $Id: ValidationMessages_en.properties 19090 2010-03-23 15:22:59Z hardy.ferentschik $
-# This file is intentionally left empty. All calls to this bundle will
-# be delegated to the parent bundle ValidationMessages (which contains
-# English messages).
-#
-# Not providing this bundle would cause the bundle for the default
-# locale to take precedence over the base bundle. If the default locale
-# is not English but one, for which a resource bundle exists (e.g. German),
-# the English texts would never be returned.
diff --git a/user/src/org/hibernate/validator/ValidationMessages_fr.properties b/user/src/org/hibernate/validator/ValidationMessages_fr.properties
deleted file mode 100644
index 44713b5..0000000
--- a/user/src/org/hibernate/validator/ValidationMessages_fr.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-# $Id: ValidationMessages_fr.properties 19252 2010-04-20 15:29:43Z hardy.ferentschik $
-javax.validation.constraints.NotNull.message=ne peut pas \u00EAtre nul
-javax.validation.constraints.Size.message=la taille doit \u00EAtre entre {min} et {max}
-javax.validation.constraints.Pattern.message=doit suivre "{regexp}"
-javax.validation.constraints.Min.message=doit \u00EAtre plus grand que {value}
-javax.validation.constraints.Max.message=doit \u00EAtre plus petit que {value}
-javax.validation.constraints.Null.message=doit \u00EAtre nul
-javax.validation.constraints.Past.message=doit \u00EAtre dans le pass\u00E9
-javax.validation.constraints.Future.message=doit \u00EAtre dans le futur
-javax.validation.constraints.AssertTrue.message=doit \u00EAtre vrai
-javax.validation.constraints.AssertFalse.message=doit \u00EAtre faux
-javax.validation.constraints.Digits.message=Valeur num\u00E9rique hors limite (<{integer} chiffres>.<{fraction} chiffres> attendus)
-javax.validation.constraints.DecimalMin.message=doit \u00EAtre plus grand que {value}
-javax.validation.constraints.DecimalMax.message=doit \u00EAtre plus petit que {value}
-org.hibernate.validator.constraints.Email.message=Addresse email mal form\u00E9e
-org.hibernate.validator.constraints.Length.message=la taille doit \u00EAtre entre {min} et {max}
-org.hibernate.validator.constraints.NotBlank.message=ne peut pas \u00EAtre vide
-org.hibernate.validator.constraints.NotEmpty.message=ne peut pas \u00EAtre vide
-org.hibernate.validator.constraints.Range.message=doit \u00EAtre entre {min} et {max}
-org.hibernate.validator.constraints.URL.message=URL mal form\u00E9e
-org.hibernate.validator.constraints.CreditCardNumber.message=Num\u00E9ro de carte de cr\u00E9dit invalide
\ No newline at end of file
diff --git a/user/src/org/hibernate/validator/ValidationMessages_mn_MN.properties b/user/src/org/hibernate/validator/ValidationMessages_mn_MN.properties
deleted file mode 100644
index f11da6f..0000000
--- a/user/src/org/hibernate/validator/ValidationMessages_mn_MN.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-javax.validation.constraints.AssertFalse.message=\u0425\u0443\u0434\u0430\u043B \u0431\u0430\u0439\u0445 \u0451\u0441\u0442\u043E\u0439
-javax.validation.constraints.AssertTrue.message=\u04AE\u043D\u044D\u043D \u0431\u0430\u0439\u0445 \u0451\u0441\u0442\u043E\u0439
-javax.validation.constraints.DecimalMax.message={value}-\u0430\u0430\u0441 \u0431\u0430\u0433\u0430 \u0431\u0443\u044E\u0443 \u0442\u044D\u043D\u0446\u04AF\u04AF \u0431\u0430\u0439\u0445 \u0451\u0441\u0442\u043E\u0439
-javax.validation.constraints.DecimalMin.message={value}-\u0430\u0430\u0441 \u0438\u0445 \u0431\u0443\u044E\u0443 \u0442\u044D\u043D\u0446\u04AF\u04AF \u0431\u0430\u0439\u0445 \u0451\u0441\u0442\u043E\u0439
-javax.validation.constraints.Digits.message=\u0422\u043E\u043E\u043D \u0445\u044F\u0437\u0433\u0430\u0430\u0440\u0430\u0430\u0441 \u0445\u044D\u0442\u044D\u0440\u0441\u044D\u043D \u0431\u0430\u0439\u043D\u0430 (<{integerDigits} digits>.<{fractionalDigits} digits> \u0445\u043E\u043E\u0440\u043E\u043D\u0434 \u0431\u0430\u0439\u043D\u0430)
-javax.validation.constraints.Future.message=\u0418\u0440\u044D\u044D\u0434\u04AF\u0439\u0434 \u0431\u0430\u0439\u0445 \u0451\u0441\u0442\u043E\u0439
-javax.validation.constraints.Max.message={value}-\u0430\u0430\u0441 \u0431\u0430\u0433\u0430 \u0431\u0443\u044E\u0443 \u0442\u044D\u043D\u0446\u04AF\u04AF \u0431\u0430\u0439\u0445 \u0451\u0441\u0442\u043E\u0439
-javax.validation.constraints.Min.message={value}-\u0430\u0430\u0441 \u0438\u0445 \u0431\u0443\u044E\u0443 \u0442\u044D\u043D\u0446\u04AF\u04AF \u0431\u0430\u0439\u0445 \u0451\u0441\u0442\u043E\u0439
-javax.validation.constraints.NotNull.message=null \u0431\u0430\u0439\u0436 \u0431\u043E\u043B\u043E\u0445\u0433\u04AF\u0439
-javax.validation.constraints.Null.message=null \u0431\u0430\u0439\u0445 \u0451\u0441\u0442\u043E\u0439
-javax.validation.constraints.Past.message=\u04E8\u043D\u0433\u04E9\u0440\u0441\u04E9\u043D\u0434 \u0431\u0430\u0439\u0445 \u0451\u0441\u0442\u043E\u0439
-javax.validation.constraints.Pattern.message=\"{regexp}\"-\u0434 \u0442\u0430\u0430\u0440\u0430\u0445 \u0451\u0441\u0442\u043E\u0439
-javax.validation.constraints.Size.message=\u0425\u044D\u043C\u0436\u044D\u044D {min}-\u0441 {max} \u0445\u043E\u043E\u0440\u043E\u043D\u0434 \u0431\u0430\u0439\u043D\u0430
-org.hibernate.validator.constraints.Email.message=\u0411\u0443\u0440\u0443\u0443 \u0438-\u043C\u044D\u0439\u043B \u0445\u0430\u044F\u0433 \u0431\u0430\u0439\u043D\u0430
-org.hibernate.validator.constraints.Length.message=\u0422\u044D\u043C\u0434\u044D\u0433\u0442\u0438\u0439\u043D \u0443\u0440\u0442 {min}-\u0441 {max} \u0445\u043E\u043E\u0440\u043E\u043D\u0434 \u0431\u0430\u0439\u043D\u0430
-org.hibernate.validator.constraints.NotBlank.message=\u0425\u043E\u043E\u0441\u043E\u043D \u0431\u0430\u0439\u0436 \u0431\u043E\u043B\u043E\u0445\u0433\u04AF\u0439
-org.hibernate.validator.constraints.NotEmpty.message=\u0425\u043E\u043E\u0441\u043E\u043D \u0431\u0430\u0439\u0436 \u0431\u043E\u043B\u043E\u0445\u0433\u04AF\u0439
-org.hibernate.validator.constraints.Range.message=\u0423\u0442\u0433\u0430 {min}-\u0441 {max} \u0445\u043E\u043E\u0440\u043E\u043D\u0434 \u0431\u0430\u0439\u043D\u0430
\ No newline at end of file
diff --git a/user/src/org/hibernate/validator/ValidationMessages_tr.properties b/user/src/org/hibernate/validator/ValidationMessages_tr.properties
deleted file mode 100644
index 01acd7f..0000000
--- a/user/src/org/hibernate/validator/ValidationMessages_tr.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-javax.validation.constraints.AssertFalse.message=teyit ba\u015far\u0131s\u0131z
-javax.validation.constraints.AssertTrue.message=teyit ba\u015far\u0131s\u0131z
-javax.validation.constraints.DecimalMax.message='{value}' de\u011ferinden k\u00fc\u00e7\u00fck yada e\u015fit olmal\u0131
-javax.validation.constraints.DecimalMin.message='{value}' de\u011ferinden b\u00fcy\u00fck yada e\u015fit olmal\u0131
-javax.validation.constraints.Digits.message=s\u0131n\u0131rlar\u0131n d\u0131\u015f\u0131nda say\u0131sal de\u011fer (beklenen <{integerDigits} basamak>.<{fractionalDigits} basamak>)
-javax.validation.constraints.Future.message=ileri bir tarih olmal\u0131
-javax.validation.constraints.Max.message='{value}' de\u011ferinden k\u00fc\u00e7\u00fck yada e\u015fit olmal\u0131
-javax.validation.constraints.Min.message='{value}' de\u011ferinden b\u00fcy\u00fck yada e\u015fit olmal\u0131
-javax.validation.constraints.NotNull.message=bo\u015f de\u011fer olamaz
-javax.validation.constraints.Null.message=bo\u015f de\u011fer olmal\u0131
-javax.validation.constraints.Past.message=ge\u00e7mi\u015f bir tarih olmal\u0131
-javax.validation.constraints.Pattern.message='{regexp}' ile e\u015fle\u015fmeli
-javax.validation.constraints.Size.message=boyut '{min}' ile '{max}' aras\u0131nda olmal\u0131
-org.hibernate.validator.constraints.Length.message=uzunluk '{min}' ile '{max}' aras\u0131nda olmal\u0131
-org.hibernate.validator.constraints.NotBlank.message=bo\u015f de\u011fer olamaz
-org.hibernate.validator.constraints.NotEmpty.message=bo\u015f de\u011fer olamaz
-org.hibernate.validator.constraints.Email.message=d\u00fczg\u00fcn bi\u00e7imli bir e-posta adresi de\u011fil!
-org.hibernate.validator.constraints.Range.message={min} ve {max} aras\u0131nda olmal\u0131d\u0131r!
diff --git a/user/src/org/hibernate/validator/engine/ConstraintViolationImpl_CustomFieldSerializer.java b/user/src/org/hibernate/validator/engine/ConstraintViolationImpl_CustomFieldSerializer.java
deleted file mode 100644
index 97883fa..0000000
--- a/user/src/org/hibernate/validator/engine/ConstraintViolationImpl_CustomFieldSerializer.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.engine;
-
-import com.google.gwt.user.client.rpc.SerializationException;
-import com.google.gwt.user.client.rpc.SerializationStreamReader;
-import com.google.gwt.user.client.rpc.SerializationStreamWriter;
-
-import java.lang.annotation.ElementType;
-
-import javax.validation.Path;
-import javax.validation.metadata.ConstraintDescriptor;
-
-/**
- * Custom Serializer for {@link ConstraintViolationImpl}.
- */
-public class ConstraintViolationImpl_CustomFieldSerializer {
-
- public static void deserialize(SerializationStreamReader streamReader,
- ConstraintViolationImpl instance) throws SerializationException {
- // no fields
- }
-
- public static ConstraintViolationImpl<Object> instantiate(
- SerializationStreamReader streamReader) throws SerializationException {
-
- String messageTemplate = null;
- String interpolatedMessage = streamReader.readString();
- Class<Object> rootBeanClass = null;
- Object rootBean = null;
- Object leafBeanInstance = null;
- Object value = null;
- Path propertyPath = (Path) streamReader.readObject();
- ConstraintDescriptor<?> constraintDescriptor = null;
- ElementType elementType = null;
- return new ConstraintViolationImpl<Object>(messageTemplate,
- interpolatedMessage, rootBeanClass, rootBean, leafBeanInstance, value,
- propertyPath, constraintDescriptor, elementType);
- }
-
- /**
- * Only a subset of fields are actually serialized.
- * <p/>
- * There is no guarantee that the root bean is GWT-serializable or that it's
- * appropriate for it to be exposed on the client. Even if the root bean could
- * be sent back, the lack of reflection on the client makes it troublesome to
- * interpret the path as a sequence of property accesses.
- * <p/>
- * The current implementation is the simplest-to-implement properties.
- * <ol>
- * <li>Message</li>
- * <li>Property Path</li>
- * </ol>
- */
- public static void serialize(SerializationStreamWriter streamWriter,
- ConstraintViolationImpl instance) throws SerializationException {
-
- // streamWriter.writeString(instance.getMessageTemplate());
- streamWriter.writeString(instance.getMessage());
- // streamWriter.writeObject(instance.getRootBeanClass());
- // streamWriter.writeObject(instance.getRootBean());
- // streamWriter.writeObject(instance.getLeafBean());
- // streamWriter.writeObject(instance.getInvalidValue());
- streamWriter.writeObject(instance.getPropertyPath());
- // streamWriter.writeObject(instance.getConstraintDescriptor());
- // ElementType
- }
-}
diff --git a/user/src/org/hibernate/validator/engine/PathImpl_CustomFieldSerializer.java b/user/src/org/hibernate/validator/engine/PathImpl_CustomFieldSerializer.java
deleted file mode 100644
index 67c6c59..0000000
--- a/user/src/org/hibernate/validator/engine/PathImpl_CustomFieldSerializer.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.engine;
-
-import com.google.gwt.user.client.rpc.SerializationException;
-import com.google.gwt.user.client.rpc.SerializationStreamReader;
-import com.google.gwt.user.client.rpc.SerializationStreamWriter;
-
-/**
- * Custom Serializer for {@link PathImpl}.
- */
-public class PathImpl_CustomFieldSerializer {
-
- public static void deserialize(SerializationStreamReader streamReader,
- PathImpl instance) throws SerializationException {
- // no fields
- }
-
- public static PathImpl instantiate(SerializationStreamReader streamReader)
- throws SerializationException {
- String propertyPath = streamReader.readString();
-
- return PathImpl.createPathFromString(propertyPath);
- }
-
- public static void serialize(SerializationStreamWriter streamWriter,
- PathImpl instance) throws SerializationException {
- streamWriter.writeString(instance.toString());
- }
-}
diff --git a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/ScriptAssert.java b/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/ScriptAssert.java
deleted file mode 100644
index 260a80e..0000000
--- a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/ScriptAssert.java
+++ /dev/null
@@ -1,136 +0,0 @@
-// $Id: ScriptAssert.java 19327 2010-04-30 08:11:15Z hardy.ferentschik $
-/*
- * JBoss, Home of Professional Open Source Copyright 2010, Red Hat, Inc. and/or
- * its affiliates, 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.
- */
-// MODIFIED BY GOOGLE
-package org.hibernate.validator.constraints;
-
-import org.hibernate.validator.constraints.impl.ScriptAssertValidator;
-
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.validation.Constraint;
-import javax.validation.ConstraintDeclarationException;
-import javax.validation.Payload;
-
-/**
- * <p>
- * A class-level constraint, that evaluates a script expression against the
- * annotated element. This constraint can be used to implement validation
- * routines, that depend on multiple attributes of the annotated element.
- * </p>
- * <p>
- * For evaluation of expressions the Java Scripting API as defined by <a
- * href="http://jcp.org/en/jsr/detail?id=223">JSR 223</a>
- * ("Scripting for the Java<sup>TM</sup> Platform") is used. Therefore an
- * implementation of that API must part of the class path. This is automatically
- * the case when running on Java 6. For older Java versions, the JSR 223 RI can
- * be added manually to the class path.
- * </p>
- * The expressions to be evaluated can be written in any scripting or expression
- * language, for which a JSR 223 compatible engine can be found in the class
- * path. The following listing shows an example using the JavaScript engine,
- * which comes with Java 6: </p>
- * <p/>
- *
- * <pre>
- * @ScriptAssert(lang = "javascript", script = "_this.startDate.before(_this.endDate)")
- * public class CalendarEvent {
- * <p/>
- * private Date startDate;
- * <p/>
- * private Date endDate;
- * <p/>
- * //...
- * <p/>
- * }
- * </pre>
- * <p>
- * Using a real expression language in conjunction with a shorter object alias
- * allows for very compact expressions:
- * </p>
- *
- * <pre>
- * @ScriptAssert(lang = "jexl", script = "_.startDate < _.endDate", alias = "_")
- * public class CalendarEvent {
- * <p/>
- * private Date startDate;
- * <p/>
- * private Date endDate;
- * <p/>
- * //...
- * <p/>
- * }
- * </pre>
- * <p>
- * Accepts any type.
- * </p>
- *
- * @author Gunnar Morling
- */
-@Target({TYPE})
-@Retention(RUNTIME)
-@Constraint(validatedBy = ScriptAssertValidator.class)
-@Documented
-public @interface ScriptAssert {
-
- String message() default "{org.hibernate.validator.constraints.ScriptAssert.message}";
-
- Class<?>[] groups() default {};
-
- Class<? extends Payload>[] payload() default {};
-
- /**
- * @return The name of the script language used by this constraint as expected
- * by the JSR 223 {@link javax.script.ScriptEngineManager}. A
- * {@link ConstraintDeclarationException} will be thrown upon script
- * evaluation, if no engine for the given language could be found.
- */
- String lang();
-
- /**
- * @return The script to be executed. The script must return
- * <code>Boolean.TRUE</code>, if the annotated element could
- * successfully be validated, otherwise <code>Boolean.FALSE</code>.
- * Returning null or any type other than Boolean will cause a
- * {@link ConstraintDeclarationException} upon validation. Any
- * exception occurring during script evaluation will be wrapped into a
- * ConstraintDeclarationException, too. Within the script, the
- * validated object can be accessed from the
- * {@link javax.script.ScriptContext script context} using the name
- * specified in the <code>alias</code> attribute.
- */
- String script();
-
- /**
- * @return The name, under which the annotated element shall be registered
- * within the script context. Defaults to "_this".
- */
- String alias() default "_this";
-
- /**
- * Defines several {@code @ScriptAssert} annotations on the same element.
- */
- @Target({TYPE})
- @Retention(RUNTIME)
- @Documented
- public @interface List {
- ScriptAssert[] value();
- }
-}
diff --git a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/EmailValidator.java b/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/EmailValidator.java
deleted file mode 100644
index 46ed562..0000000
--- a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/EmailValidator.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.constraints.impl;
-
-import com.google.gwt.validation.client.constraints.NotGwtCompatibleValidator;
-
-import org.hibernate.validator.constraints.Email;
-
-/**
- * This Validator is not GWT complatible.
- */
-public class EmailValidator extends NotGwtCompatibleValidator<Email, String> {
- // TODO(nchalko) make compatible
-}
diff --git a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/FutureValidatorForCalendar.java b/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/FutureValidatorForCalendar.java
deleted file mode 100644
index 7cbf05e..0000000
--- a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/FutureValidatorForCalendar.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.constraints.impl;
-
-import com.google.gwt.validation.client.constraints.NotGwtCompatibleValidator;
-
-import javax.validation.constraints.Future;
-
-/**
- * This Validator is not GWT complatible.
- */
-public class FutureValidatorForCalendar extends
- NotGwtCompatibleValidator<Future, Object> {
-}
diff --git a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/PastValidatorForCalendar.java b/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/PastValidatorForCalendar.java
deleted file mode 100644
index 1dba9e2..0000000
--- a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/PastValidatorForCalendar.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.constraints.impl;
-
-import com.google.gwt.validation.client.constraints.NotGwtCompatibleValidator;
-
-import javax.validation.constraints.Past;
-
-/**
- * This Validator is not GWT complatible.
- */
-public class PastValidatorForCalendar extends
- NotGwtCompatibleValidator<Past, Object> {
-}
diff --git a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/PatternValidator.java b/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/PatternValidator.java
deleted file mode 100644
index aaf3e92..0000000
--- a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/PatternValidator.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.constraints.impl;
-
-/**
- * Override the Hibernate implementation with the GWT version.
- */
-public class PatternValidator extends
- com.google.gwt.validation.client.constraints.PatternValidator {
-}
diff --git a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/ScriptAssertValidator.java b/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/ScriptAssertValidator.java
deleted file mode 100644
index 48bdc3a..0000000
--- a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/ScriptAssertValidator.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.constraints.impl;
-
-import com.google.gwt.validation.client.constraints.NotGwtCompatibleValidator;
-
-import org.hibernate.validator.constraints.Email;
-
-/**
- * This Validator is not GWT complatible.
- */
-public class ScriptAssertValidator extends
- NotGwtCompatibleValidator<Email, String> {
-}
diff --git a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArray.java b/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArray.java
deleted file mode 100644
index 5ed12e4..0000000
--- a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArray.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.constraints.impl;
-
-/**
- * Override the Hibernate implementation with the GWT version.
- */
-public class SizeValidatorForArray extends
- com.google.gwt.validation.client.constraints.SizeValidatorForArrayOfObject {
-}
diff --git a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfBoolean.java b/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfBoolean.java
deleted file mode 100644
index a26c805..0000000
--- a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfBoolean.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.constraints.impl;
-
-/**
- * Override the Hibernate implementation with the GWT version.
- */
-public class SizeValidatorForArraysOfBoolean extends
- com.google.gwt.validation.client.constraints.SizeValidatorForArrayOfBoolean {
-}
diff --git a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfByte.java b/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfByte.java
deleted file mode 100644
index 228fdd9..0000000
--- a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfByte.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.constraints.impl;
-
-/**
- * Override the Hibernate implementation with the GWT version.
- */
-public class SizeValidatorForArraysOfByte extends
- com.google.gwt.validation.client.constraints.SizeValidatorForArrayOfByte {
-}
diff --git a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfChar.java b/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfChar.java
deleted file mode 100644
index 8a1f3c2..0000000
--- a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfChar.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.constraints.impl;
-
-/**
- * Override the Hibernate implementation with the GWT version.
- */
-public class SizeValidatorForArraysOfChar extends
- com.google.gwt.validation.client.constraints.SizeValidatorForArrayOfChar {
-}
diff --git a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfDouble.java b/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfDouble.java
deleted file mode 100644
index 4e4beb8..0000000
--- a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfDouble.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.constraints.impl;
-
-/**
- * Override the Hibernate implementation with the GWT version.
- */
-public class SizeValidatorForArraysOfDouble extends
- com.google.gwt.validation.client.constraints.SizeValidatorForArrayOfDouble {
-}
diff --git a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfFloat.java b/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfFloat.java
deleted file mode 100644
index 8d87589..0000000
--- a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfFloat.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.constraints.impl;
-
-/**
- * Override the Hibernate implementation with the GWT version.
- */
-public class SizeValidatorForArraysOfFloat extends
- com.google.gwt.validation.client.constraints.SizeValidatorForArrayOfFloat {
-}
diff --git a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfInt.java b/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfInt.java
deleted file mode 100644
index d875240..0000000
--- a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfInt.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.constraints.impl;
-
-/**
- * Override the Hibernate implementation with the GWT version.
- */
-public class SizeValidatorForArraysOfInt extends
- com.google.gwt.validation.client.constraints.SizeValidatorForArrayOfInt {
-}
diff --git a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfLong.java b/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfLong.java
deleted file mode 100644
index 55bf45d..0000000
--- a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfLong.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.constraints.impl;
-
-/**
- * Override the Hibernate implementation with the GWT version.
- */
-public class SizeValidatorForArraysOfLong extends
- com.google.gwt.validation.client.constraints.SizeValidatorForArrayOfLong {
-}
diff --git a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfShort.java b/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfShort.java
deleted file mode 100644
index bd50c7d..0000000
--- a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/SizeValidatorForArraysOfShort.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.constraints.impl;
-
-/**
- * Override the Hibernate implementation with the GWT version.
- */
-public class SizeValidatorForArraysOfShort extends
- com.google.gwt.validation.client.constraints.SizeValidatorForArrayOfShort {
-}
diff --git a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/URLValidator.java b/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/URLValidator.java
deleted file mode 100644
index bf01353..0000000
--- a/user/src/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/URLValidator.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.constraints.impl;
-
-import com.google.gwt.validation.client.constraints.NotGwtCompatibleValidator;
-
-import org.hibernate.validator.constraints.URL;
-
-/**
- * This Validator is not GWT complatible.
- */
-public class URLValidator extends
- NotGwtCompatibleValidator<URL, Object> {
-}
diff --git a/user/src/org/hibernate/validator/super/org/hibernate/validator/engine/PathImpl.java b/user/src/org/hibernate/validator/super/org/hibernate/validator/engine/PathImpl.java
deleted file mode 100644
index 91bd2c3..0000000
--- a/user/src/org/hibernate/validator/super/org/hibernate/validator/engine/PathImpl.java
+++ /dev/null
@@ -1,225 +0,0 @@
-// $Id: PathImpl.java 17744 2009-10-14 14:38:57Z hardy.ferentschik $
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2009, Red Hat, Inc. and/or its affiliates, 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.
-*/
-// Modified by Google: Replace java.util.Pattern with gwt RegExp
-package org.hibernate.validator.engine;
-
-import com.google.gwt.regexp.shared.MatchResult;
-import com.google.gwt.regexp.shared.RegExp;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.validation.Path;
-
-/**
- * @author Hardy Ferentschik
- */
-public class PathImpl implements Path, Serializable {
-
- private static final long serialVersionUID = 7564511574909882392L;
-
- /**
- * Regular expression used to split a string path into its elements.
- *
- * @see <a href="http://www.regexplanet.com/simple/index.jsp">Regular expression tester</a>
- */
- private static final RegExp pathPattern = RegExp.compile("(\\w+)(\\[(\\w*)\\])?(\\.(.*))*");
-
- private static final String PROPERTY_PATH_SEPERATOR = ".";
-
- private final List<Node> nodeList;
-
- /**
- * Returns a {@code Path} instance representing the path described by the given string. To create a root node the empty string should be passed.
- *
- * @param propertyPath the path as string representation.
- *
- * @return a {@code Path} instance representing the path described by the given string.
- *
- * @throws IllegalArgumentException in case {@code property == null} or {@code property} cannot be parsed.
- */
- public static PathImpl createPathFromString(String propertyPath) {
- if ( propertyPath == null ) {
- throw new IllegalArgumentException( "null is not allowed as property path." );
- }
-
- if ( propertyPath.length() == 0 ) {
- return createNewPath( null );
- }
-
- return parseProperty( propertyPath );
- }
-
- public static PathImpl createNewPath(String name) {
- PathImpl path = new PathImpl();
- NodeImpl node = new NodeImpl( name );
- path.addNode( node );
- return path;
- }
-
- public static PathImpl createShallowCopy(Path path) {
- return path == null ? null : new PathImpl( path );
- }
-
- private PathImpl(Path path) {
- this.nodeList = new ArrayList<Node>();
- for ( Object aPath : path ) {
- nodeList.add( new NodeImpl( ( Node ) aPath ) );
- }
- }
-
- private PathImpl() {
- nodeList = new ArrayList<Node>();
- }
-
- private PathImpl(List<Node> nodeList) {
- this.nodeList = new ArrayList<Node>();
- for ( Node node : nodeList ) {
- this.nodeList.add( new NodeImpl( node ) );
- }
- }
-
- public boolean isRootPath() {
- return nodeList.size() == 1 && nodeList.get( 0 ).getName() == null;
- }
-
- public PathImpl getPathWithoutLeafNode() {
- List<Node> nodes = new ArrayList<Node>( nodeList );
- PathImpl path = null;
- if ( nodes.size() > 1 ) {
- nodes.remove( nodes.size() - 1 );
- path = new PathImpl( nodes );
- }
- return path;
- }
-
- public void addNode(Node node) {
- nodeList.add( node );
- }
-
- public Node removeLeafNode() {
- if ( nodeList.size() == 0 ) {
- throw new IllegalStateException( "No nodes in path!" );
- }
- if ( nodeList.size() == 1 ) {
- throw new IllegalStateException( "Root node cannot be removed!" );
- }
- return nodeList.remove( nodeList.size() - 1 );
- }
-
- public NodeImpl getLeafNode() {
- if ( nodeList.size() == 0 ) {
- throw new IllegalStateException( "No nodes in path!" );
- }
- return ( NodeImpl ) nodeList.get( nodeList.size() - 1 );
- }
-
- public Iterator<Path.Node> iterator() {
- return nodeList.iterator();
- }
-
- public boolean isSubPathOf(Path path) {
- Iterator<Node> pathIter = path.iterator();
- Iterator<Node> thisIter = iterator();
- while ( pathIter.hasNext() ) {
- Node pathNode = pathIter.next();
- if ( !thisIter.hasNext() ) {
- return false;
- }
- Node thisNode = thisIter.next();
- if ( !thisNode.equals( pathNode ) ) {
- return false;
- }
- }
- return true;
- }
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- Iterator<Path.Node> iter = iterator();
- while ( iter.hasNext() ) {
- Node node = iter.next();
- builder.append( node.toString() );
- if ( iter.hasNext() ) {
- builder.append( PROPERTY_PATH_SEPERATOR );
- }
- }
- return builder.toString();
- }
-
- @Override
- public boolean equals(Object o) {
- if ( this == o ) {
- return true;
- }
- if ( o == null || getClass() != o.getClass() ) {
- return false;
- }
-
- PathImpl path = ( PathImpl ) o;
- if ( nodeList != null && !nodeList.equals( path.nodeList ) ) {
- return false;
- }
- if ( nodeList == null && path.nodeList != null ) {
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return nodeList != null ? nodeList.hashCode() : 0;
- }
-
- private static PathImpl parseProperty(String property) {
- PathImpl path = new PathImpl();
- String tmp = property;
- do {
- MatchResult matcher = pathPattern.exec(tmp);
- if (matcher != null) {
- String value = matcher.getGroup(1);
- String indexed = matcher.getGroup(2);
- String index = matcher.getGroup(3);
- NodeImpl node = new NodeImpl( value );
- if ( indexed != null ) {
- node.setInIterable( true );
- }
- if ( index != null && index.length() > 0 ) {
- try {
- Integer i = Integer.parseInt( index );
- node.setIndex( i );
- }
- catch ( NumberFormatException e ) {
- node.setKey( index );
- }
- }
- path.addNode( node );
- tmp = matcher.getGroup(5);
- }
- else {
- throw new IllegalArgumentException( "Unable to parse property path " + property );
- }
- } while ( tmp != null );
- return path;
- }
-
-}
diff --git a/user/test-super/org/hibernate/jsr303/tck/super/org/hibernate/jsr303/tck/common/TCKValidationProvider.java b/user/test-super/org/hibernate/jsr303/tck/super/org/hibernate/jsr303/tck/common/TCKValidationProvider.java
deleted file mode 100644
index cfd70d5..0000000
--- a/user/test-super/org/hibernate/jsr303/tck/super/org/hibernate/jsr303/tck/common/TCKValidationProvider.java
+++ /dev/null
@@ -1,79 +0,0 @@
-// $Id: TCKValidationProvider.java 17620 2009-10-04 19:19:28Z hardy.ferentschik $
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2009, Red Hat, Inc. and/or its affiliates, 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.jsr303.tck.common;
-
-import javax.validation.Configuration;
-import javax.validation.MessageInterpolator;
-import javax.validation.Validator;
-import javax.validation.ValidatorContext;
-import javax.validation.ValidatorFactory;
-import javax.validation.TraversableResolver;
-import javax.validation.ConstraintValidatorFactory;
-import javax.validation.spi.BootstrapState;
-import javax.validation.spi.ConfigurationState;
-import javax.validation.spi.ValidationProvider;
-
-/**
- *
- * Modified by Google:
- * <ul>
- * <li>Replaced cast with a simple new.</li>
- * </ul>
- * @author Hardy Ferentschik
- */
-public class TCKValidationProvider implements ValidationProvider<TCKValidatorConfiguration> {
-
- public TCKValidatorConfiguration createSpecializedConfiguration(BootstrapState state) {
- return new TCKValidatorConfiguration( this );
- }
-
- public Configuration<?> createGenericConfiguration(BootstrapState state) {
- return new TCKValidatorConfiguration( this );
- }
-
- public ValidatorFactory buildValidatorFactory(ConfigurationState configurationState) {
- return new DummyValidatorFactory();
- }
-
- public static class DummyValidatorFactory implements ValidatorFactory {
-
- public Validator getValidator() {
- throw new UnsupportedOperationException();
- }
-
- public ValidatorContext usingContext() {
- throw new UnsupportedOperationException();
- }
-
- public MessageInterpolator getMessageInterpolator() {
- throw new UnsupportedOperationException();
- }
-
- public TraversableResolver getTraversableResolver() {
- throw new UnsupportedOperationException();
- }
-
- public ConstraintValidatorFactory getConstraintValidatorFactory() {
- throw new UnsupportedOperationException();
- }
-
- public <T> T unwrap(Class<T> type) {
- throw new UnsupportedOperationException();
- }
- }
-}
diff --git a/user/test-super/org/hibernate/jsr303/tck/super/org/hibernate/jsr303/tck/common/TCKValidatorConfiguration.java b/user/test-super/org/hibernate/jsr303/tck/super/org/hibernate/jsr303/tck/common/TCKValidatorConfiguration.java
deleted file mode 100644
index d308384..0000000
--- a/user/test-super/org/hibernate/jsr303/tck/super/org/hibernate/jsr303/tck/common/TCKValidatorConfiguration.java
+++ /dev/null
@@ -1,85 +0,0 @@
-// $Id: TCKValidatorConfiguration.java 17620 2009-10-04 19:19:28Z hardy.ferentschik $
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2009, Red Hat, Inc. and/or its affiliates, 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.jsr303.tck.common;
-
-import javax.validation.Configuration;
-import javax.validation.ConstraintValidatorFactory;
-import javax.validation.MessageInterpolator;
-import javax.validation.TraversableResolver;
-import javax.validation.ValidatorFactory;
-import javax.validation.spi.ValidationProvider;
-
-/**
- * Modified by Google:
- * <ul>
- * <li>Changed InputStream to String</li>
- * </ul>
- * @author Hardy Ferentschik
- */
-public class TCKValidatorConfiguration implements Configuration<TCKValidatorConfiguration> {
- private final ValidationProvider provider;
-
- public TCKValidatorConfiguration() {
- provider = null;
- }
-
- public TCKValidatorConfiguration(ValidationProvider provider) {
- this.provider = provider;
- }
-
- public TCKValidatorConfiguration ignoreXmlConfiguration() {
- throw new UnsupportedOperationException();
- }
-
- public TCKValidatorConfiguration messageInterpolator(MessageInterpolator interpolator) {
- throw new UnsupportedOperationException();
- }
-
- public TCKValidatorConfiguration traversableResolver(TraversableResolver resolver) {
- throw new UnsupportedOperationException();
- }
-
- public TCKValidatorConfiguration constraintValidatorFactory(ConstraintValidatorFactory constraintValidatorFactory) {
- throw new UnsupportedOperationException();
- }
-
- public TCKValidatorConfiguration addMapping(String stream) {
- throw new UnsupportedOperationException();
- }
-
- public TCKValidatorConfiguration addProperty(String name, String value) {
- throw new UnsupportedOperationException();
- }
-
- public MessageInterpolator getDefaultMessageInterpolator() {
- throw new UnsupportedOperationException();
- }
-
- public TraversableResolver getDefaultTraversableResolver() {
- throw new UnsupportedOperationException();
- }
-
- public ConstraintValidatorFactory getDefaultConstraintValidatorFactory() {
- throw new UnsupportedOperationException();
- }
-
- public ValidatorFactory buildValidatorFactory() {
- return provider.buildValidatorFactory( null );
- }
-
-}
diff --git a/user/test-super/org/hibernate/jsr303/tck/super/org/hibernate/jsr303/tck/tests/messageinterpolation/MessageInterpolationTest.java b/user/test-super/org/hibernate/jsr303/tck/super/org/hibernate/jsr303/tck/tests/messageinterpolation/MessageInterpolationTest.java
deleted file mode 100644
index 2f753d6..0000000
--- a/user/test-super/org/hibernate/jsr303/tck/super/org/hibernate/jsr303/tck/tests/messageinterpolation/MessageInterpolationTest.java
+++ /dev/null
@@ -1,299 +0,0 @@
-// $Id: MessageInterpolationTest.java 17620 2009-10-04 19:19:28Z hardy.ferentschik $
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2009, Red Hat, Inc. and/or its affiliates, 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.jsr303.tck.tests.messageinterpolation;
-
-import java.util.Date;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.i18n.shared.GwtLocale;
-import com.google.gwt.i18n.shared.GwtLocaleFactory;
-
-import java.util.Set;
-import javax.validation.ConstraintViolation;
-import javax.validation.MessageInterpolator;
-import javax.validation.Validator;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Past;
-import javax.validation.constraints.Size;
-import javax.validation.metadata.ConstraintDescriptor;
-
-import org.jboss.test.audit.annotations.SpecAssertion;
-import org.jboss.test.audit.annotations.SpecAssertions;
-import org.jboss.testharness.AbstractTest;
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.testharness.impl.packaging.ArtifactType;
-import org.jboss.testharness.impl.packaging.Classes;
-import org.jboss.testharness.impl.packaging.IntegrationTest;
-import org.jboss.testharness.impl.packaging.Resource;
-import org.jboss.testharness.impl.packaging.Resources;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNotNull;
-import org.testng.annotations.Test;
-
-import org.hibernate.jsr303.tck.util.TestUtil;
-import static org.hibernate.jsr303.tck.util.TestUtil.assertCorrectConstraintViolationMessages;
-import static org.hibernate.jsr303.tck.util.TestUtil.assertCorrectNumberOfViolations;
-import static org.hibernate.jsr303.tck.util.TestUtil.getDefaultMessageInterpolator;
-import static org.hibernate.jsr303.tck.util.TestUtil.getValidatorUnderTest;
-
-/**
- * Modified by Google:
- * <ul>
- * <li>Changed Local to GwtLocale</li>
- * </ul>
- * @author Hardy Ferentschik
- */
-@Artifact(artifactType = ArtifactType.JSR303)
-@Classes({ TestUtil.class, TestUtil.PathImpl.class, TestUtil.NodeImpl.class })
-@Resources({
- @Resource(source = "ValidationMessages.properties",
- destination = "WEB-INF/classes/ValidationMessages.properties"),
- @Resource(source = "ValidationMessages_de.properties",
- destination = "WEB-INF/classes/ValidationMessages_de.properties")
-})
-@IntegrationTest
-public class MessageInterpolationTest extends AbstractTest {
-
- @Test
- @SpecAssertion(section = "4.3.1", id = "a")
- public void testDefaultMessageInterpolatorIsNotNull() {
- MessageInterpolator interpolator = getDefaultMessageInterpolator();
- assertNotNull( interpolator, "Each bean validation provider must provide a default message interpolator." );
- }
-
- @Test
- @SpecAssertions({
- @SpecAssertion(section = "4.3.1", id = "e"),
- @SpecAssertion(section = "4.3.1.1", id = "a")
- })
- public void testSuccessfulInterpolationOfValidationMessagesValue() {
-
- MessageInterpolator interpolator = getDefaultMessageInterpolator();
- ConstraintDescriptor<?> descriptor = getDescriptorFor( DummyEntity.class, "foo" );
- MessageInterpolator.Context context = new TestContext( descriptor );
-
- String expected = "replacement worked";
- String actual = interpolator.interpolate( "{foo}", context );
- assertEquals( actual, expected, "Wrong substitution" );
-
- expected = "replacement worked replacement worked";
- actual = interpolator.interpolate( "{foo} {foo}", context );
- assertEquals( actual, expected, "Wrong substitution" );
-
- expected = "This replacement worked just fine";
- actual = interpolator.interpolate( "This {foo} just fine", context );
- assertEquals( actual, expected, "Wrong substitution" );
-
- expected = "{} replacement worked {unknown}";
- actual = interpolator.interpolate( "{} {foo} {unknown}", context );
- assertEquals( actual, expected, "Wrong substitution" );
- }
-
- @Test
- @SpecAssertion(section = "4.3.1.1", id = "b")
- public void testRecursiveMessageInterpolation() {
- MessageInterpolator interpolator = getDefaultMessageInterpolator();
- ConstraintDescriptor<?> descriptor = getDescriptorFor( DummyEntity.class, "fubar" );
- MessageInterpolator.Context context = new TestContext( descriptor );
-
- String expected = "recursion worked";
- String actual = interpolator.interpolate( ( String ) descriptor.getAttributes().get( "message" ), context );
- assertEquals(
- expected, actual, "Expansion should be recursive"
- );
- }
-
- @Test
- @SpecAssertion(section = "4.3.1", id = "d")
- public void testMessagesCanBeOverriddenAtConstraintLevel() {
- Validator validator = TestUtil.getValidatorUnderTest();
- Set<ConstraintViolation<DummyEntity>> constraintViolations = validator.validateProperty(
- new DummyEntity(), "snafu"
- );
- assertCorrectNumberOfViolations( constraintViolations, 1 );
- assertCorrectConstraintViolationMessages(
- constraintViolations, "messages can also be overridden at constraint declaration."
- );
- }
-
-
- @Test
- @SpecAssertions({
- @SpecAssertion(section = "4.3.1", id = "f"),
- @SpecAssertion(section = "4.3.1", id = "g"),
- @SpecAssertion(section = "4.3.1", id = "h")
- })
- public void testLiteralCurlyBraces() {
-
- MessageInterpolator interpolator = getDefaultMessageInterpolator();
- ConstraintDescriptor<?> descriptor = getDescriptorFor( DummyEntity.class, "foo" );
- MessageInterpolator.Context context = new TestContext( descriptor );
-
- String expected = "{";
- String actual = interpolator.interpolate( "\\{", context );
- assertEquals( actual, expected, "Wrong substitution" );
-
- expected = "}";
- actual = interpolator.interpolate( "\\}", context );
- assertEquals( actual, expected, "Wrong substitution" );
-
- expected = "\\";
- actual = interpolator.interpolate( "\\", context );
- assertEquals( actual, expected, "Wrong substitution" );
- }
-
- @Test
- @SpecAssertion(section = "4.3.1.1", id = "a")
- public void testUnSuccessfulInterpolation() {
- MessageInterpolator interpolator = getDefaultMessageInterpolator();
- ConstraintDescriptor<?> descriptor = getDescriptorFor( DummyEntity.class, "foo" );
- MessageInterpolator.Context context = new TestContext( descriptor );
-
- String expected = "foo"; // missing {}
- String actual = interpolator.interpolate( "foo", context );
- assertEquals( actual, expected, "Wrong substitution" );
-
- expected = "#{foo {}";
- actual = interpolator.interpolate( "#{foo {}", context );
- assertEquals( actual, expected, "Wrong substitution" );
- }
-
- @Test
- @SpecAssertion(section = "4.3.1.1", id = "a")
- public void testUnknownTokenInterpolation() {
- MessageInterpolator interpolator = getDefaultMessageInterpolator();
- ConstraintDescriptor<?> descriptor = getDescriptorFor( DummyEntity.class, "foo" );
- MessageInterpolator.Context context = new TestContext( descriptor );
-
- String expected = "{bar}"; // unknown token {}
- String actual = interpolator.interpolate( "{bar}", context );
- assertEquals( actual, expected, "Wrong substitution" );
- }
-
- @Test
- @SpecAssertion(section = "4.3.1.1", id = "c")
- public void testParametersAreExtractedFromBeanValidationProviderBundle() {
- MessageInterpolator interpolator = getDefaultMessageInterpolator();
- ConstraintDescriptor<?> descriptor = getDescriptorFor( Person.class, "birthday" );
- MessageInterpolator.Context context = new TestContext( descriptor );
-
- String key = "{javax.validation.constraints.Past.message}"; // Past is a built-in constraint so the provider must provide a default message
- String actual = interpolator.interpolate( key, context );
- assertFalse(
- key.equals( actual ),
- "There should have been a message interpolation from the bean validator provider bundle."
- );
- }
-
- @Test
- @SpecAssertion(section = "4.3.1.1", id = "g")
- public void testConstraintAttributeValuesAreInterpolated() {
- MessageInterpolator interpolator = getDefaultMessageInterpolator();
- ConstraintDescriptor<?> descriptor = getDescriptorFor( DummyEntity.class, "bar" );
- MessageInterpolator.Context context = new TestContext( descriptor );
-
- String expected = "size must be between 5 and 10";
- String actual = interpolator.interpolate( ( String ) descriptor.getAttributes().get( "message" ), context );
- assertEquals( actual, expected, "Wrong substitution" );
- }
-
- @Test
- @SpecAssertion(section = "4.3.1.1", id = "h")
- public void testMessageInterpolationWithLocale() {
- MessageInterpolator interpolator = getDefaultMessageInterpolator();
- ConstraintDescriptor<?> descriptor = getDescriptorFor( DummyEntity.class, "foo" );
- MessageInterpolator.Context context = new TestContext( descriptor );
-
- String expected = "kann nicht null sein";
- // TODO(nchalko) i18n
- //GwtLocaleFactory localeFactory = GWT.create(GwtLocaleFactory.class);
- GwtLocale german = null; //localeFactory.fromComponents("de","","","");
- String actual = interpolator.interpolate(
- ( String ) descriptor.getAttributes().get( "message" ), context, german
- );
- assertEquals( actual, expected, "Wrong substitution" );
- }
-
- @Test
- @SpecAssertion(section = "4.3.1.1", id = "i")
- public void testIfNoLocaleIsSpecifiedTheDefaultLocaleIsAssumed() {
- MessageInterpolator interpolator = getDefaultMessageInterpolator();
- ConstraintDescriptor<?> descriptor = getDescriptorFor( DummyEntity.class, "foo" );
- String messageTemplate = ( String ) descriptor.getAttributes().get( "message" );
- MessageInterpolator.Context context = new TestContext( descriptor );
-
- String messageInterpolatedWithNoLocale = interpolator.interpolate( messageTemplate, context );
- // TODO(nchalko) i18n
- //GwtLocaleFactory localeFactory = GWT.create(GwtLocaleFactory.class);
- GwtLocale defaultLocale = null; // localeFactory.getDefault();
- String messageInterpolatedWithDefaultLocale = interpolator.interpolate(
- messageTemplate, context,defaultLocale
- );
-
- assertEquals( messageInterpolatedWithNoLocale, messageInterpolatedWithDefaultLocale, "Wrong substitution" );
- }
-
- private ConstraintDescriptor<?> getDescriptorFor(Class<?> clazz, String propertyName) {
- Validator validator = getValidatorUnderTest();
- return validator.getConstraintsForClass( clazz )
- .getConstraintsForProperty( propertyName )
- .getConstraintDescriptors()
- .iterator()
- .next();
- }
-
- public class TestContext implements MessageInterpolator.Context {
- ConstraintDescriptor<?> descriptor;
-
- TestContext(ConstraintDescriptor<?> descriptor) {
- this.descriptor = descriptor;
- }
-
- public ConstraintDescriptor<?> getConstraintDescriptor() {
- return descriptor;
- }
-
- public Object getValidatedValue() {
- return null;
- }
- }
-
- public class DummyEntity {
- @NotNull
- String foo;
-
- @Size(min = 5, max = 10, message = "size must be between {min} and {max}")
- String bar;
-
- @Max(value = 10, message = "{replace.in.user.bundle1}")
- String fubar;
-
- @NotNull(message = "messages can also be overridden at constraint declaration.")
- String snafu;
- }
-
- public class Person {
-
- String name;
-
- @Past
- Date birthday;
- }
-}
diff --git a/user/test-super/org/hibernate/jsr303/tck/super/org/hibernate/jsr303/tck/tests/validation/ValidationTest.java b/user/test-super/org/hibernate/jsr303/tck/super/org/hibernate/jsr303/tck/tests/validation/ValidationTest.java
deleted file mode 100644
index 74bb26d..0000000
--- a/user/test-super/org/hibernate/jsr303/tck/super/org/hibernate/jsr303/tck/tests/validation/ValidationTest.java
+++ /dev/null
@@ -1,118 +0,0 @@
-// $Id: ValidationTest.java 17620 2009-10-04 19:19:28Z hardy.ferentschik $
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2009, Red Hat, Inc. and/or its affiliates, 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.jsr303.tck.tests.validation;
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.validation.Configuration;
-import javax.validation.Validation;
-import javax.validation.ValidationProviderResolver;
-import javax.validation.ValidatorFactory;
-import javax.validation.bootstrap.GenericBootstrap;
-import javax.validation.bootstrap.ProviderSpecificBootstrap;
-import javax.validation.spi.ValidationProvider;
-
-import org.jboss.test.audit.annotations.SpecAssertion;
-import org.jboss.test.audit.annotations.SpecAssertions;
-import org.jboss.testharness.AbstractTest;
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.testharness.impl.packaging.ArtifactType;
-import org.jboss.testharness.impl.packaging.Classes;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-import static org.testng.Assert.fail;
-import org.testng.annotations.Test;
-
-import org.hibernate.jsr303.tck.common.TCKValidationProvider;
-import org.hibernate.jsr303.tck.common.TCKValidatorConfiguration;
-import org.hibernate.jsr303.tck.util.TestUtil;
-
-/**
- * Tests for the implementation of <code>Validation</code>.
- *
- *Modified by google.
- *<ul>
- *<li>Removed testVerifyMethodsOfValidationObjects
- *</ul
- *
- * @author Hardy Ferentschik
- */
-@Artifact(artifactType = ArtifactType.JSR303)
-@Classes({
- TestUtil.class, TestUtil.PathImpl.class, TestUtil.NodeImpl.class, TCKValidationProvider.class,
- TCKValidationProvider.DummyValidatorFactory.class, TCKValidatorConfiguration.class
-})
-public class ValidationTest extends AbstractTest {
-
- @Test
- @SpecAssertion(section = "4.4.5", id = "a")
- public void testBuildDefaultValidatorFactory() {
- ValidatorFactory defaultFactory = Validation.buildDefaultValidatorFactory();
- assertNotNull( defaultFactory, "We should be able to get a factory." );
-
- ValidatorFactory defaultProviderFactory = Validation.byDefaultProvider().configure().buildValidatorFactory();
- assertNotNull( defaultProviderFactory, "We should be able to get a factory." );
-
- assertEquals( defaultFactory.getClass(), defaultFactory.getClass(), "The factories have to be identical." );
- }
-
- @Test
- @SpecAssertions({
- @SpecAssertion(section = "4.4.5", id = "b"),
- @SpecAssertion(section = "4.4.5", id = "e")
- })
- public void testCustomValidationProviderResolution() {
- ValidationProviderResolver resolver = new ValidationProviderResolver() {
-
- public List<ValidationProvider<?>> getValidationProviders() {
- List<ValidationProvider<?>> list = new ArrayList<ValidationProvider<?>>();
- list.add( new TCKValidationProvider() );
- return list;
- }
- };
-
- GenericBootstrap bootstrap = Validation.byDefaultProvider();
- Configuration<?> config = bootstrap.providerResolver( resolver ).configure();
-
- ValidatorFactory factory = config.buildValidatorFactory();
- assertTrue( factory instanceof TCKValidationProvider.DummyValidatorFactory );
- }
-
- @Test
- @SpecAssertions({
- @SpecAssertion(section = "4.4.5", id = "c"),
- @SpecAssertion(section = "4.4.5", id = "e")
- })
- public void testSpecificValidationProvider() {
- ValidationProviderResolver resolver = new ValidationProviderResolver() {
-
- public List<ValidationProvider<?>> getValidationProviders() {
- List<ValidationProvider<?>> list = new ArrayList<ValidationProvider<?>>();
- list.add( new TCKValidationProvider() );
- return list;
- }
- };
-
- // with resolver
- ProviderSpecificBootstrap<TCKValidatorConfiguration> bootstrap = Validation.byProvider( TCKValidationProvider.class );
- Configuration<?> config = bootstrap.providerResolver( resolver ).configure();
- ValidatorFactory factory = config.buildValidatorFactory();
- assertTrue( factory instanceof TCKValidationProvider.DummyValidatorFactory );
- }
-}
diff --git a/user/test-super/org/hibernate/jsr303/tck/super/org/hibernate/jsr303/tck/util/TestUtil.java b/user/test-super/org/hibernate/jsr303/tck/super/org/hibernate/jsr303/tck/util/TestUtil.java
deleted file mode 100644
index 0be399c..0000000
--- a/user/test-super/org/hibernate/jsr303/tck/super/org/hibernate/jsr303/tck/util/TestUtil.java
+++ /dev/null
@@ -1,407 +0,0 @@
-// $Id: TestUtil.java 17620 2009-10-04 19:19:28Z hardy.ferentschik $
-/*
- * JBoss, Home of Professional Open Source Copyright 2009, Red Hat, Inc. and/or
- * its affiliates, 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.jsr303.tck.util;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.regexp.shared.MatchResult;
-import com.google.gwt.regexp.shared.RegExp;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertTrue;
-import static org.testng.Assert.fail;
-
-import java.lang.annotation.Annotation;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import javax.validation.Configuration;
-import javax.validation.ConstraintViolation;
-import javax.validation.MessageInterpolator;
-import javax.validation.Path;
-import javax.validation.Validator;
-import javax.validation.ValidatorFactory;
-import javax.validation.Validation;
-import javax.validation.bootstrap.ProviderSpecificBootstrap;
-import javax.validation.metadata.ConstraintDescriptor;
-import javax.validation.metadata.ElementDescriptor;
-import javax.validation.metadata.PropertyDescriptor;
-import javax.validation.spi.ValidationProvider;
-
-/**
- * Modified by Google.
- * <ul>
- * <li>Use RegExp instead of Pattern</li>
- * </ul>
- * @author Hardy Ferentschik
- */
-public final class TestUtil {
-
- private static String VALIDATION_PROVIDER_TEST_CLASS = "validation.provider";
-
- private static ValidationProvider<?> validationProviderUnderTest;
-
- private TestUtil() {
- }
-
- public static Validator getValidatorUnderTest() {
- return getValidatorFactoryUnderTest().getValidator();
- }
-
- public static ValidationProvider<?> getValidationProviderUnderTest() {
- if (validationProviderUnderTest == null) {
- instantiateValidationProviderUnderTest();
- }
- return validationProviderUnderTest;
- }
-
- public static ValidatorFactory getValidatorFactoryUnderTest() {
- Configuration<?> config = getConfigurationUnderTest();
- return config.buildValidatorFactory();
- }
-
- public static Configuration<?> getConfigurationUnderTest() {
- if (validationProviderUnderTest == null) {
- instantiateValidationProviderUnderTest();
- }
-
- ProviderSpecificBootstrap<?> bootstrap =
- Validation.byProvider(validationProviderUnderTest.getClass());
- return bootstrap.configure();
- }
-
- public static MessageInterpolator getDefaultMessageInterpolator() {
- Configuration<?> config = getConfigurationUnderTest();
- return config.getDefaultMessageInterpolator();
- }
-
- public static <T> void assertCorrectNumberOfViolations(
- Set<ConstraintViolation<T>> violations, int expectedViolations) {
- assertEquals(violations.size(), expectedViolations,
- "Wrong number of constraint violations. Expected: "
- + expectedViolations + " Actual: " + violations.size());
- }
-
- public static <T> void assertCorrectConstraintViolationMessages(
- Set<ConstraintViolation<T>> violations, String... messages) {
- List<String> actualMessages = new ArrayList<String>();
- for (ConstraintViolation<?> violation : violations) {
- actualMessages.add(violation.getMessage());
- }
-
- assertTrue(actualMessages.size() == messages.length,
- "Wrong number or error messages. Expected: " + messages.length
- + " Actual: " + actualMessages.size());
-
- for (String expectedMessage : messages) {
- assertTrue(actualMessages.contains(expectedMessage), "The message '"
- + expectedMessage
- + "' should have been in the list of actual messages: "
- + actualMessages);
- actualMessages.remove(expectedMessage);
- }
- assertTrue(actualMessages.isEmpty(),
- "Actual messages contained more messages as specified expected messages");
- }
-
- public static <T> void assertCorrectConstraintTypes(
- Set<ConstraintViolation<T>> violations,
- Class<?>... expectedConsraintTypes) {
- List<String> actualConstraintTypes = new ArrayList<String>();
- for (ConstraintViolation<?> violation : violations) {
- actualConstraintTypes.add(((Annotation) violation.getConstraintDescriptor().getAnnotation()).annotationType().getName());
- }
-
- assertEquals(expectedConsraintTypes.length, actualConstraintTypes.size(),
- "Wrong number of constraint types.");
-
- for (Class<?> expectedConstraintType : expectedConsraintTypes) {
- assertTrue(
- actualConstraintTypes.contains(expectedConstraintType.getName()),
- "The constraint type " + expectedConstraintType.getName()
- + " is not in the list of actual violated constraint types: "
- + actualConstraintTypes);
- }
- }
-
- public static <T> void assertCorrectPropertyPaths(
- Set<ConstraintViolation<T>> violations, String... propertyPaths) {
- List<Path> propertyPathsOfViolations = new ArrayList<Path>();
- for (ConstraintViolation<?> violation : violations) {
- propertyPathsOfViolations.add(violation.getPropertyPath());
- }
-
- assertEquals(propertyPaths.length, propertyPathsOfViolations.size(),
- "Wrong number of property paths. Expected: " + propertyPaths.length
- + " Actual: " + propertyPathsOfViolations.size());
-
- for (String propertyPath : propertyPaths) {
- Path expectedPath = PathImpl.createPathFromString(propertyPath);
- boolean containsPath = false;
- for (Path actualPath : propertyPathsOfViolations) {
- if (assertEqualPaths(expectedPath, actualPath)) {
- containsPath = true;
- break;
- }
- }
- if (!containsPath) {
- fail(expectedPath
- + " is not in the list of path instances contained in the actual constraint violations: "
- + propertyPathsOfViolations);
- }
- }
- }
-
- public static <T> void assertConstraintViolation(
- ConstraintViolation<T> violation, Class<?> rootBean, Object invalidValue,
- String propertyPath) {
- Path expectedPath = PathImpl.createPathFromString(propertyPath);
- if (!assertEqualPaths(violation.getPropertyPath(), expectedPath)) {
- fail("Property paths differ. Actual: " + violation.getPropertyPath()
- + " Expected: " + expectedPath);
- }
-
- assertEquals(violation.getRootBeanClass(), rootBean, "Wrong root bean.");
- assertEquals(violation.getInvalidValue(), invalidValue,
- "Wrong invalid value.");
- }
-
- public static boolean assertEqualPaths(Path p1, Path p2) {
- Iterator<Path.Node> p1Iterator = p1.iterator();
- Iterator<Path.Node> p2Iterator = p2.iterator();
- while (p1Iterator.hasNext()) {
- Path.Node p1Node = p1Iterator.next();
- if (!p2Iterator.hasNext()) {
- return false;
- }
- Path.Node p2Node = p2Iterator.next();
-
- // do the comparison on the node values
- if (p2Node.getName() == null) {
- if (p1Node.getName() != null) {
- return false;
- }
- } else if (!p2Node.getName().equals(p1Node.getName())) {
- return false;
- }
-
- if (p2Node.isInIterable() != p1Node.isInIterable()) {
- return false;
- }
-
- if (p2Node.getIndex() == null) {
- if (p1Node.getIndex() != null) {
- return false;
- }
- } else if (!p2Node.getIndex().equals(p1Node.getIndex())) {
- return false;
- }
-
- if (p2Node.getKey() == null) {
- if (p1Node.getKey() != null) {
- return false;
- }
- } else if (!p2Node.getKey().equals(p1Node.getKey())) {
- return false;
- }
- }
-
- return !p2Iterator.hasNext();
- }
-
- public static PropertyDescriptor getPropertyDescriptor(Class<?> clazz,
- String property) {
- Validator validator = getValidatorUnderTest();
- return validator.getConstraintsForClass(clazz).getConstraintsForProperty(
- property);
- }
-
- public static Set<ConstraintDescriptor<?>> getConstraintDescriptorsFor(
- Class<?> clazz, String property) {
- ElementDescriptor elementDescriptor = getPropertyDescriptor(clazz, property);
- return elementDescriptor.getConstraintDescriptors();
- }
-
- public static Object getInputStreamForPath(String path) {
-
- return null;
- }
-
- private static <U extends ValidationProvider<?>> void instantiateValidationProviderUnderTest() {
- validationProviderUnderTest = GWT.create(ValidationProvider.class);
- }
-
- public static class PathImpl implements Path {
-
- /**
- * Regular expression used to split a string path into its elements.
- *
- * @see <a href="http://www.regexplanet.com/simple/index.jsp">Regular
- * expression tester</a>
- */
- private static final RegExp pathPattern = RegExp.compile("(\\w+)(\\[(\\w*)\\])?(\\.(.*))*");
-
- private static final String PROPERTY_PATH_SEPARATOR = ".";
-
- private final List<Node> nodeList;
-
- public static PathImpl createPathFromString(String propertyPath) {
- if (propertyPath == null) {
- throw new IllegalArgumentException(
- "null is not allowed as property path.");
- }
-
- if (propertyPath.length() == 0) {
- return createNewPath(null);
- }
-
- return parseProperty(propertyPath);
- }
-
- public static PathImpl createNewPath(String name) {
- PathImpl path = new PathImpl();
- NodeImpl node = new NodeImpl(name);
- path.addNode(node);
- return path;
- }
-
- private PathImpl() {
- nodeList = new ArrayList<Node>();
- }
-
- public void addNode(Node node) {
- nodeList.add(node);
- }
-
- public Iterator<Path.Node> iterator() {
- return nodeList.iterator();
- }
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- Iterator<Path.Node> iter = iterator();
- while (iter.hasNext()) {
- Node node = iter.next();
- builder.append(node.toString());
- if (iter.hasNext()) {
- builder.append(PROPERTY_PATH_SEPARATOR);
- }
- }
- return builder.toString();
- }
-
- private static PathImpl parseProperty(String property) {
- PathImpl path = new PathImpl();
- String tmp = property;
- do {
- MatchResult matcher = pathPattern.exec(tmp);
- if (matcher != null) {
- String value = matcher.getGroup(1);
- String indexed = matcher.getGroup(2);
- String index = matcher.getGroup(3);
- NodeImpl node = new NodeImpl(value);
-
- if (indexed != null && indexed.length() > 0) {
- node.setInIterable(true);
- }
- if (index != null && index.length() > 0) {
- try {
- Integer i = Integer.parseInt(index);
- node.setIndex(i);
- } catch (NumberFormatException e) {
- node.setKey(index);
- }
- }
- path.addNode(node);
- tmp = matcher.getGroup(5);
- } else {
- throw new IllegalArgumentException("Unable to parse property path "
- + property);
- }
- } while (tmp != null && tmp.length() > 0);
- return path;
- }
- }
-
- public static class NodeImpl implements Path.Node {
-
- private static final String INDEX_OPEN = "[";
- private static final String INDEX_CLOSE = "]";
-
- private final String name;
- private boolean isInIterable;
- private Integer index;
- private Object key;
-
- public NodeImpl(String name) {
- this.name = name;
- }
-
- NodeImpl(Path.Node node) {
- this.name = node.getName();
- this.isInIterable = node.isInIterable();
- this.index = node.getIndex();
- this.key = node.getKey();
- }
-
- public String getName() {
- return name;
- }
-
- public boolean isInIterable() {
- return isInIterable;
- }
-
- public void setInIterable(boolean inIterable) {
- isInIterable = inIterable;
- }
-
- public Integer getIndex() {
- return index;
- }
-
- public void setIndex(Integer index) {
- isInIterable = true;
- this.index = index;
- }
-
- public Object getKey() {
- return key;
- }
-
- public void setKey(Object key) {
- isInIterable = true;
- this.key = key;
- }
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder(name == null ? "" : name);
- if (isInIterable) {
- builder.append(INDEX_OPEN);
- if (getIndex() != null) {
- builder.append(getIndex());
- } else if (getKey() != null) {
- builder.append(getKey());
- }
- builder.append(INDEX_CLOSE);
- }
- return builder.toString();
- }
- }
-}
diff --git a/user/test-super/org/jboss/testharness/super/org/jboss/testharness/AbstractTest.java b/user/test-super/org/jboss/testharness/super/org/jboss/testharness/AbstractTest.java
deleted file mode 100644
index 8773ba6..0000000
--- a/user/test-super/org/jboss/testharness/super/org/jboss/testharness/AbstractTest.java
+++ /dev/null
@@ -1,200 +0,0 @@
-//Modified by Google.
-package org.jboss.testharness;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import java.util.logging.Logger;
-import org.jboss.testharness.api.Configuration;
-import org.jboss.testharness.api.DeploymentException;
-//import org.jboss.testharness.api.TestResult;
-//import org.jboss.testharness.api.TestResult.Status;
-//import org.jboss.testharness.impl.ConfigurationImpl;
-//import org.jboss.testharness.impl.packaging.ArtifactGenerator;
-import org.jboss.testharness.impl.packaging.TCKArtifact;
-import org.testng.IHookCallBack;
-import org.testng.IHookable;
-//import org.testng.ITestContext;
-import org.testng.ITestResult;
-//import org.testng.annotations.AfterClass;
-//import org.testng.annotations.AfterSuite;
-//import org.testng.annotations.BeforeClass;
-//import org.testng.annotations.BeforeSuite;
-
-/**
- * Abstract Test
- * <p>
- * Modified by Google to only include the minimum needed to run the JSR-303 tck.
- */
-public abstract class AbstractTest implements IHookable
-{
-
- private static Logger log = Logger.getLogger(AbstractTest.class.getName());
-
- private static boolean inContainer = false;
-
- public static boolean isInContainer()
- {
- return inContainer;
- }
-
- public static void setInContainer(boolean inContainer)
- {
- AbstractTest.inContainer = inContainer;
- }
-
- private TCKArtifact artifact;
- private DeploymentException deploymentException;
- private boolean skipTest = false;
-
- private boolean isSuiteDeployingTestsToContainer()
- {
- return !isInContainer() && (!getCurrentConfiguration().isStandalone() || getCurrentConfiguration().isRunIntegrationTests());
- }
-
- private void generateArtifact()
- {
-
- }
-
- protected TCKArtifact postCreate(TCKArtifact artifact)
- {
- return artifact;
- }
-
- private boolean isDeployToContainerNeeded()
- {
- /*
- * If this isn't running inside the container AND there is an artifact to
- * deploy AND EITHER we are in standalone mode and it isn't a unit test OR
- * we aren't in standalone mode THEN we need to deploy
- */
- return !isInContainer() && artifact != null && ((getCurrentConfiguration().isStandalone() && !artifact.isUnit() && getCurrentConfiguration().isRunIntegrationTests()) || !getCurrentConfiguration().isStandalone());
- }
-
- private void deployArtifact()
- {
-
- }
-
- protected DeploymentException handleDeploymentFailure(DeploymentException deploymentException)
- {
- return deploymentException;
- }
-
-
- private void undeployArtifact() throws Exception
- {
- if (isDeployToContainerNeeded())
- {
- getCurrentConfiguration().getContainers().undeploy(artifact.getDefaultName());
- }
- if (getCurrentConfiguration().isStandalone() && artifact != null && artifact.isUnit())
- {
- getCurrentConfiguration().getStandaloneContainers().undeploy();
- }
- }
-
- private void checkAssertionsEnabled()
- {
- boolean assertionsEnabled = false;
- try
- {
- assert false;
- }
- catch (AssertionError error)
- {
- assertionsEnabled = true;
- }
- if (!assertionsEnabled)
- {
- throw new IllegalStateException("Assertions must be enabled!");
- }
- }
-
- //@BeforeSuite(alwaysRun = true, groups = "scaffold")
-// public void beforeSuite(ITestContext context) throws Exception
-// {
-// if (isSuiteDeployingTestsToContainer())
-// {
-// getCurrentConfiguration().getContainers().setup();
-// }
-// if (getCurrentConfiguration().isStandalone())
-// {
-// getCurrentConfiguration().getStandaloneContainers().setup();
-// }
-// checkAssertionsEnabled();
-// }
-
- //@AfterSuite(alwaysRun = true, groups = "scaffold")
- public void afterSuite() throws Exception
- {
- if (isSuiteDeployingTestsToContainer())
- {
- getCurrentConfiguration().getContainers().cleanup();
- }
- if (getCurrentConfiguration().isStandalone())
- {
- getCurrentConfiguration().getStandaloneContainers().cleanup();
- }
- }
-
- //@BeforeClass(alwaysRun = true, groups = "scaffold")
- public void beforeClass() throws Throwable
- {
- generateArtifact();
- deployArtifact();
-
- }
-
- //@AfterClass(alwaysRun = true, groups = "scaffold")
- public void afterClass() throws Exception
- {
- undeployArtifact();
- this.artifact = null;
- this.deploymentException = null;
- skipTest = false;
- }
-
- public void beforeMethod()
- {
-
- }
-
- public void afterMethod()
- {
-
- }
-
- public final void run(IHookCallBack callback, ITestResult testResult)
- {
- }
-
- protected Configuration getCurrentConfiguration()
- {
- return null; //ConfigurationImpl.get();
- }
-
- protected String getContextPath()
- {
- return "http://" + getCurrentConfiguration().getHost() + "/" + this.getClass().getName() + "/";
- }
-
- protected boolean isThrowablePresent(Class<? extends Throwable> throwableType, Throwable throwable)
- {
- if (throwable == null)
- {
- return false;
- }
-// else if (throwableType.isAssignableFrom(throwable.getClass()))
-// {
-// return true;
-// }
-// else
-// {
-// return isThrowablePresent(throwableType, throwable.getCause());
-// }
- return true;
- }
-}
\ No newline at end of file
diff --git a/user/test-super/org/jboss/testharness/super/org/jboss/testharness/api/Configuration.java b/user/test-super/org/jboss/testharness/super/org/jboss/testharness/api/Configuration.java
deleted file mode 100644
index cf7c5a0..0000000
--- a/user/test-super/org/jboss/testharness/super/org/jboss/testharness/api/Configuration.java
+++ /dev/null
@@ -1,138 +0,0 @@
-package org.jboss.testharness.api;
-
-import java.util.List;
-
-import org.jboss.testharness.spi.Containers;
-import org.jboss.testharness.spi.StandaloneContainers;
-
-/**
- * The configuration of the TCK.
- *
- * The TCK may be configured using system properties or placed in a properties
- * file called META-INF/web-beans-tck.properties.
- *
- * Porting package property names are the FQCN of the SPI class. Other property
- * names (one for each non-porting package SPI configuration option) are
- * specified here. The defaults are also listed here.
- *
- * The TCK may also be configured programatically through this interface
- *
- * <p>
- * Modified by Google.
- * <ul>
- * <li>Removed references to TestLauncher</li>
- * <li>Removed revernces to the output dir.</li>
- * <ul>
- *
- * @author Pete Muir
- *
- */
-public interface Configuration
-{
-
- public static final String OUTPUT_DIRECTORY_PROPERTY_NAME = "org.jboss.testharness.outputDirectory";
- public static final String STANDALONE_PROPERTY_NAME = "org.jboss.testharness.standalone";
- public static final String RUN_INTEGRATION_TESTS_PROPERTY_NAME = "org.jboss.testharness.runIntegrationTests";
- public static final String CONNECT_TIMEOUT_PROPERTY_NAME = "org.jboss.testharness.connectTimeout";
- public static final String LIBRARY_DIRECTORY_PROPERTY_NAME = "org.jboss.testharness.libraryDirectory";
- public static final String HOST_PROPERTY_NAME = "org.jboss.testharness.host";
- public static final String TEST_PACKAGE_PROPERTY_NAME = "org.jboss.testharness.testPackage";
-
- public static final boolean DEFAULT_STANDALONE = true;
- public static final boolean DEFAULT_RUN_INTEGRATION_TESTS = false;
- public static final int DEFAULT_CONNECT_DELAY = 5000;
- public static final boolean DEFAULT_WRITE_DEPLOYED_ARCHIVES_TO_DISK = false;
- public static final String DEFAULT_LIBRARY_DIRECTORY = null;
- public static final String DEFAULT_HOST = "localhost:8080";
-
- /**
- * The output directory to put TCK specific output. The TestNG output
- * directory is configured via TestNG.
- *
- * By default set to ${tmp}/jsr-299-tck
- */
- public String getOutputDirectory();
-
- /**
- * Whether the TCK is in standalone mode or not.
- *
- * By default true
- */
- public boolean isStandalone();
-
- /**
- * When the TCK is running in container tests it will attempt to connect to
- * the server every 200ms until the timeout is reached.
- *
- * By default 5000ms
- */
- public int getConnectTimeout();
-
- /**
- * The TCK allows additional libraries to be put in the deployed test
- * artifacts (for example the porting package for the implementation). Any
- * jars in this directory will be added to the deployed artifact.
- *
- * By default no directory is used.
- */
- public String getLibraryDirectory();
-
- /**
- * The TCK test launcher
- *
- * @see TestLauncher
- *
- */
- public Object getInContainerTestLauncher();
-
- /**
- * The implementation of {@link Containers} in use.
- */
- public Containers getContainers();
-
- /**
- * Whether to run integration tests, by default false.
- */
- public boolean isRunIntegrationTests();
-
- public void setOutputDirectory(String outputDirectory);
-
- public void setStandalone(boolean standalone);
-
- public void setConnectTimeout(int connectTimeout);
-
- public void setLibraryDirectory(String libraryDir);
-
- public void setInContainerTestLauncher(Object testLauncher);
-
- public void setContainers(Containers containers);
-
- /**
- * The implementation of {@link StandaloneContainers} in use.
- */
- public StandaloneContainers getStandaloneContainers();
-
- public void setStandaloneContainers(StandaloneContainers standaloneContainers);
-
- public void setRunIntegrationTests(boolean runIntegrationTests);
-
- /**
- * The TCK will use this as the remote host to connect to run in container
- * tests. By default localhost:8080
- *
- */
- public String getHost();
-
- public void setHost(String host);
-
- public List<String> getExtraPackages();
-
- public List<ResourceDescriptor> getExtraResources();
-
- public List<String> getExtraDeploymentProperties();
-
- public String getTestPackage();
-
- public void setTestPackage(String packageName);
-
-}
\ No newline at end of file
diff --git a/user/test-super/org/jboss/testharness/super/org/jboss/testharness/api/ResourceDescriptor.java b/user/test-super/org/jboss/testharness/super/org/jboss/testharness/api/ResourceDescriptor.java
deleted file mode 100644
index 772f06b..0000000
--- a/user/test-super/org/jboss/testharness/super/org/jboss/testharness/api/ResourceDescriptor.java
+++ /dev/null
@@ -1,14 +0,0 @@
-//Modified by Google:
-//Removed URL
-package org.jboss.testharness.api;
-
-
-public interface ResourceDescriptor
-{
-
- public String getName();
-
- //public URL getSource();
- public Object getSource();
-
-}
\ No newline at end of file
diff --git a/user/test-super/org/jboss/testharness/super/org/jboss/testharness/impl/packaging/TCKArtifact.java b/user/test-super/org/jboss/testharness/super/org/jboss/testharness/impl/packaging/TCKArtifact.java
deleted file mode 100644
index 49f70c1..0000000
--- a/user/test-super/org/jboss/testharness/super/org/jboss/testharness/impl/packaging/TCKArtifact.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package org.jboss.testharness.impl.packaging;
-
-import java.util.Set;
-
-import org.jboss.testharness.api.ResourceDescriptor;
-
-/**
- * @author Hardy Ferentschik
- */
-public interface TCKArtifact {
- TCKArtifact initialize();
-
- Object getJarAsStream();
-
- Object getJar();
-
- Object getExplodedJar();
-
- void create();
-
- void writeArtifactToDisk(String outputDirectory);
-
- void writeArtifactToDisk(String outputDirectory, String ObjectName);
-
- String getDefaultName();
-
- Set<Class<?>> getClasses();
-
- Set<ResourceDescriptor> getResources();
-
- void addPackage(Object pkg);
-
- void addPackage(String packageName, boolean addRecursively);
-
- Object getClassesRoot(Object archiveRoot);
-
- String getClassesRoot();
-
- void setClassesRoot(String classesRoot);
-
- Class<?> getDeclaringClass();
-
- String getExtension();
-
- void setExtension(String extension);
-
- Set<ResourceDescriptor> getLibraries();
-
- Object getLibraryRoot(Object archiveRoot);
-
- void setLibrariesRoot(String libraryRoot);
-
- boolean isLibrariesSupported();
-
- void setLibrariesSupported(boolean librariesSupported);
-
- boolean isUnit();
-
- void setUnit(boolean unit);
-
- Class<? extends Throwable> getExpectedDeploymentException();
-
- void setExpectedDeploymentException(Class<? extends Throwable> expectedDeploymentException);
-
- boolean isRunLocally();
-
- void setRunLocally(boolean runLocally);
-
- String getXmlConfigDestination();
-
- void setXmlConfigDestination(String xmlConfigDest);
-
- ResourceDescriptor getXmlConfig();
-
- void skipIncludeXmlConfig(boolean skip);
-}
-
diff --git a/user/test-super/org/jboss/testharness/super/org/jboss/testharness/spi/Containers.java b/user/test-super/org/jboss/testharness/super/org/jboss/testharness/spi/Containers.java
deleted file mode 100644
index 9456642..0000000
--- a/user/test-super/org/jboss/testharness/super/org/jboss/testharness/spi/Containers.java
+++ /dev/null
@@ -1,85 +0,0 @@
-//Modified by Google
-package org.jboss.testharness.spi;
-
-//import java.io.IOException;
-//import java.io.InputStream;
-
-import org.jboss.testharness.api.DeploymentException;
-
-/**
- * Incontainer mode deployment related operations
- *
- * The TCK porting package must provide an implementation of this interface
- * which is suitable for the target implementation and application server
- *
- * <p>
- * Modified by Google.
- * <ul>
- * <li>Removed refrences to java.io.</li>
- * <ul>
- *
- * @author Pete Muir
- *
- */
-public interface Containers
-{
-
- public static final String PROPERTY_NAME = Containers.class.getName();
-
- /**
- * The war/ear to deploy to the container, it should be read using a
- * JarInputStream. Any deployment exceptions can be found through
- * {@link #getDeploymentException()}.
- *
- * For a successful deployment, a symmetric {@link #undeploy(String)} will be
- * called.
- *
- * @see #undeploy(String)
- *
- * @param archive the archive
- * @param name the name the TCK uses to refer to this archive, unique within
- * this tck run
- * @return true if the deployment suceeded, otherwise false
- * @throws IOException if any communication problems with the server occur
- * during deployment. These will cause the test suite to fail.
- */
- public boolean deploy(Object archive, String name);
-
- public DeploymentException getDeploymentException();
-
- /**
- * Undeploy the war/ear from the container.
- *
- * @see #deploy(InputStream, String)
- *
- * @param name the name the TCK uses to refer to this archive, unique within
- * this tck run
- * @throws IOException if any communication problems with the server occur
- * during deployment. These will cause the test suite to fail.
- */
- public void undeploy(String name);
-
- /**
- * Called before the TCK starts executing the testsuite, but after the suite
- * has been configured.
- *
- * A TCK suite lifecycle callback, useful for setting up the container. This
- * method may be a no-op if no setup is required.
- *
- * @throws IOException if any communication problems with the server occur
- * during setup. These will cause the test suite to fail.
- */
- public void setup();
-
- /**
- * Called after the TCK finishes executing the testsuite.
- *
- * A TCK suite lifecycle callback, useful for cleaning up and shutting down
- * the container. This method may be a no-op if no setup is required.
- *
- * @throws IOException if any communication problems with the server occur
- * during cleanup. These will cause the test suite to fail.
- */
- public void cleanup() ;
-
-}
\ No newline at end of file
diff --git a/user/test-super/org/jboss/testharness/super/org/jboss/testharness/spi/StandaloneContainers.java b/user/test-super/org/jboss/testharness/super/org/jboss/testharness/spi/StandaloneContainers.java
deleted file mode 100644
index 354fb13..0000000
--- a/user/test-super/org/jboss/testharness/super/org/jboss/testharness/spi/StandaloneContainers.java
+++ /dev/null
@@ -1,102 +0,0 @@
-//Modified by Google
-package org.jboss.testharness.spi;
-
-import java.util.Collection;
-
-import org.jboss.testharness.api.DeploymentException;
-
-/**
- * Standalone mode deployment related operations. If the TCK is placed in
- * standalone mode, unit tests will be deployed via this interface.
- *
- * You must implement this as part of the porting package if you intend to run
- * the TCK in standalone mode
- *
- * @author Pete Muir
- *
- */
-public interface StandaloneContainers
-{
-
- public static final String PROPERTY_NAME = StandaloneContainers.class.getName();
-
- /**
- * <p>Bootstrap the container by registering Beans and Observers, raising
- * @Initialized event, validating the deployment, and raising the
- * @Deployed event.</p>
- *
- * <p>Any classes passed in should be fully deployed. This includes:</p>
- *
- * <ul>
- * <li>Simple beans</li>
- * <li>Session beans</li>
- * <li>Producer methods and producer fields</li>
- * <li>Observer methods</li>
- * <li>support for Event and Instance injection points</li>
- * </ul>
- *
- * The container should be in an fully initialized state when the
- * method returns
- *
- * @param classes the classes to deploy
- */
- public void deploy(Collection<Class<?>> classes) throws DeploymentException;
-
- /**
- * <p>Bootstrap the container for a test by registering Beans and Observers,
- * raising @Initialized event, validating the deployment, and raising the
- * @Deployed event.</p>
- *
- * <p>Any classes passed in should be fully deployed. This includes:</p>
- *
- * <ul>
- * <li>Simple beans</li>
- * <li>Session beans</li>
- * <li>Producer methods and producer fields</li>
- * <li>Observer methods</li>
- * <li>support for Event and Instance injection points</li>
- * </ul>
- *
- * The container should be in an fully initialized state when the
- * method returns
- *
- * @param classes the classes to deploy
- * @param beansXmls the beans.xml files to deploy
- *
- * @return true if the deployment suceeded, otherwise false
- */
- public boolean deploy(Collection<Class<?>> classes, Collection<Object> beansXmls);
-
- /**
- * Any deployment exception, or null if the deployment suceeded
- *
- * @return
- */
- public DeploymentException getDeploymentException();
-
- /**
- * Cleanup the container after this test
- *
- */
- public void undeploy();
-
- /**
- * Called before the TCK starts executing the testsuite, but after the suite
- * has been configured.
- *
- * A TCK suite lifecycle callback, useful for setting up the container. This
- * method may be a no-op if no setup is required.
- *
- */
- public void setup();
-
- /**
- * Called after the TCK finishes executing the testsuite.
- *
- * A TCK suite lifecycle callback, useful for cleaning up and shutting down
- * the container. This method may be a no-op if no setup is required.
- *
- */
- public void cleanup();
-
-}
diff --git a/user/test-super/org/testng/super/org/testng/Assert.java b/user/test-super/org/testng/super/org/testng/Assert.java
deleted file mode 100644
index 7326ef0..0000000
--- a/user/test-super/org/testng/super/org/testng/Assert.java
+++ /dev/null
@@ -1,700 +0,0 @@
-package org.testng;
-
-import org.testng.collections.Lists;
-
-//import java.lang.reflect.Array;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-
-/**
- * Assertion tool class. Presents assertion methods with a more natural parameter order.
- * The order is always <B>actualValue</B>, <B>expectedValue</B> [, message].
- *
- * <p>
- * Modified by Google
- * <ul>
- * <li>Removed java.lang.reflect</li>
- * <li>Delegate fail messages to junit</li>
- * </ul>
- *
- * @author <a href='mailto:the_mindstorm@evolva.ro'>Alexandru Popescu</a>
- */
-public class Assert {
-
- /**
- * Protect constructor since it is a static only class
- */
- protected Assert() {
- // hide constructor
- }
-
- /**
- * Asserts that a condition is true. If it isn't,
- * an AssertionError, with the given message, is thrown.
- * @param condition the condition to evaluate
- * @param message the assertion error message
- */
- static public void assertTrue(boolean condition, String message) {
- if(!condition) {
- failNotEquals( Boolean.valueOf(condition), Boolean.TRUE, message);
- }
- }
-
- /**
- * Asserts that a condition is true. If it isn't,
- * an AssertionError is thrown.
- * @param condition the condition to evaluate
- */
- static public void assertTrue(boolean condition) {
- assertTrue(condition, null);
- }
-
- /**
- * Asserts that a condition is false. If it isn't,
- * an AssertionError, with the given message, is thrown.
- * @param condition the condition to evaluate
- * @param message the assertion error message
- */
- static public void assertFalse(boolean condition, String message) {
- if(condition) {
- failNotEquals( Boolean.valueOf(condition), Boolean.FALSE, message); // TESTNG-81
- }
- }
-
- /**
- * Asserts that a condition is false. If it isn't,
- * an AssertionError is thrown.
- * @param condition the condition to evaluate
- */
- static public void assertFalse(boolean condition) {
- assertFalse(condition, null);
- }
-
- /**
- * Fails a test with the given message and wrapping the original exception.
- *
- * @param message the assertion error message
- * @param realCause the original exception
- */
- static public void fail(String message, Throwable realCause) {
- if(message == null){
- if (realCause != null){
- message = realCause.getMessage();
- }
- } else {
- message = message + ": " + realCause.getMessage();
- }
- junit.framework.Assert.fail(message);
- }
-
- /**
- * Fails a test with the given message.
- * @param message the assertion error message
- */
- static public void fail(String message) {
- junit.framework.Assert.fail(message);
- }
-
- /**
- * Fails a test with no message.
- */
- static public void fail() {
- fail(null);
- }
-
- /**
- * Asserts that two objects are equal. If they are not,
- * an AssertionError, with the given message, is thrown.
- * @param actual the actual value
- * @param expected the expected value
- * @param message the assertion error message
- */
- static public void assertEquals(Object actual, Object expected, String message) {
- if((expected == null) && (actual == null)) {
- return;
- }
- if(expected != null) {
- if (expected.getClass().isArray()) {
- assertArrayEquals(actual, expected, message);
- return;
- } else if (expected.equals(actual)) {
- return;
- }
- }
- failNotEquals(actual, expected, message);
- }
-
- /**
- * Asserts that two objects are equal. It they are not, an AssertionError,
- * with given message, is thrown.
- * @param actual the actual value
- * @param expected the expected value (should be an non-null array value)
- * @param message the assertion error message
- */
- private static void assertArrayEquals(Object actual, Object expected, String message) {
- //is called only when expected is an array
-// if (actual.getClass().isArray()) {
-// int expectedLength = Array.getLength(expected);
-// if (expectedLength == Array.getLength(actual)) {
-// for (int i = 0 ; i < expectedLength ; i++) {
-// Object _actual = Array.get(actual, i);
-// Object _expected = Array.get(expected, i);
-// try {
-// assertEquals(_actual, _expected);
-// } catch (AssertionError ae) {
-// failNotEquals(actual, expected, message == null ? "" : message
-// + " (values as index " + i + " are not the same)");
-// }
-// }
-// //array values matched
-// return;
-// } else {
-// failNotEquals(Array.getLength(actual), expectedLength, message == null ? "" : message
-// + " (Array lengths are not the same)");
-// }
-// }
-// failNotEquals(actual, expected, message);
- fail("assertArrayEquals not implemented");
- }
-
-/**
- * Asserts that two objects are equal. If they are not,
- * an AssertionError is thrown.
- * @param actual the actual value
- * @param expected the expected value
- */
- static public void assertEquals(Object actual, Object expected) {
- assertEquals(actual, expected, null);
- }
-
- /**
- * Asserts that two Strings are equal. If they are not,
- * an AssertionError, with the given message, is thrown.
- * @param actual the actual value
- * @param expected the expected value
- * @param message the assertion error message
- */
- static public void assertEquals(String actual, String expected, String message) {
- assertEquals((Object) actual, (Object) expected, message);
- }
-
- /**
- * Asserts that two Strings are equal. If they are not,
- * an AssertionError is thrown.
- * @param actual the actual value
- * @param expected the expected value
- */
- static public void assertEquals(String actual, String expected) {
- assertEquals(actual, expected, null);
- }
-
- /**
- * Asserts that two doubles are equal concerning a delta. If they are not,
- * an AssertionError, with the given message, is thrown. If the expected
- * value is infinity then the delta value is ignored.
- * @param actual the actual value
- * @param expected the expected value
- * @param delta the absolute tolerate value value between the actual and expected value
- * @param message the assertion error message
- */
- static public void assertEquals(double actual, double expected, double delta, String message) {
- // handle infinity specially since subtracting to infinite values gives NaN and the
- // the following test fails
- if(Double.isInfinite(expected)) {
- if(!(expected == actual)) {
- failNotEquals(new Double(actual), new Double(expected), message);
- }
- }
- else if(!(Math.abs(expected - actual) <= delta)) { // Because comparison with NaN always returns false
- failNotEquals(new Double(actual), new Double(expected), message);
- }
- }
-
- /**
- * Asserts that two doubles are equal concerning a delta. If they are not,
- * an AssertionError is thrown. If the expected value is infinity then the
- * delta value is ignored.
- * @param actual the actual value
- * @param expected the expected value
- * @param delta the absolute tolerate value value between the actual and expected value
- */
- static public void assertEquals(double actual, double expected, double delta) {
- assertEquals(actual, expected, delta, null);
- }
-
- /**
- * Asserts that two floats are equal concerning a delta. If they are not,
- * an AssertionError, with the given message, is thrown. If the expected
- * value is infinity then the delta value is ignored.
- * @param actual the actual value
- * @param expected the expected value
- * @param delta the absolute tolerate value value between the actual and expected value
- * @param message the assertion error message
- */
- static public void assertEquals(float actual, float expected, float delta, String message) {
- // handle infinity specially since subtracting to infinite values gives NaN and the
- // the following test fails
- if(Float.isInfinite(expected)) {
- if(!(expected == actual)) {
- failNotEquals(new Float(actual), new Float(expected), message);
- }
- }
- else if(!(Math.abs(expected - actual) <= delta)) {
- failNotEquals(new Float(actual), new Float(expected), message);
- }
- }
-
- /**
- * Asserts that two floats are equal concerning a delta. If they are not,
- * an AssertionError is thrown. If the expected
- * value is infinity then the delta value is ignored.
- * @param actual the actual value
- * @param expected the expected value
- * @param delta the absolute tolerate value value between the actual and expected value
- */
- static public void assertEquals(float actual, float expected, float delta) {
- assertEquals(actual, expected, delta, null);
- }
-
- /**
- * Asserts that two longs are equal. If they are not,
- * an AssertionError, with the given message, is thrown.
- * @param actual the actual value
- * @param expected the expected value
- * @param message the assertion error message
- */
- static public void assertEquals(long actual, long expected, String message) {
- assertEquals(Long.valueOf(actual), Long.valueOf(expected), message);
- }
-
- /**
- * Asserts that two longs are equal. If they are not,
- * an AssertionError is thrown.
- * @param actual the actual value
- * @param expected the expected value
- */
- static public void assertEquals(long actual, long expected) {
- assertEquals(actual, expected, null);
- }
-
- /**
- * Asserts that two booleans are equal. If they are not,
- * an AssertionError, with the given message, is thrown.
- * @param actual the actual value
- * @param expected the expected value
- * @param message the assertion error message
- */
- static public void assertEquals(boolean actual, boolean expected, String message) {
- assertEquals( Boolean.valueOf(actual), Boolean.valueOf(expected), message);
- }
-
- /**
- * Asserts that two booleans are equal. If they are not,
- * an AssertionError is thrown.
- * @param actual the actual value
- * @param expected the expected value
- */
- static public void assertEquals(boolean actual, boolean expected) {
- assertEquals(actual, expected, null);
- }
-
- /**
- * Asserts that two bytes are equal. If they are not,
- * an AssertionError, with the given message, is thrown.
- * @param actual the actual value
- * @param expected the expected value
- * @param message the assertion error message
- */
- static public void assertEquals(byte actual, byte expected, String message) {
- assertEquals(Byte.valueOf(actual), Byte.valueOf(expected), message);
- }
-
- /**
- * Asserts that two bytes are equal. If they are not,
- * an AssertionError is thrown.
- * @param actual the actual value
- * @param expected the expected value
- */
- static public void assertEquals(byte actual, byte expected) {
- assertEquals(actual, expected, null);
- }
-
- /**
- * Asserts that two chars are equal. If they are not,
- * an AssertionFailedError, with the given message, is thrown.
- * @param actual the actual value
- * @param expected the expected value
- * @param message the assertion error message
- */
- static public void assertEquals(char actual, char expected, String message) {
- assertEquals(Character.valueOf(actual), Character.valueOf(expected), message);
- }
-
- /**
- * Asserts that two chars are equal. If they are not,
- * an AssertionError is thrown.
- * @param actual the actual value
- * @param expected the expected value
- */
- static public void assertEquals(char actual, char expected) {
- assertEquals(actual, expected, null);
- }
-
- /**
- * Asserts that two shorts are equal. If they are not,
- * an AssertionFailedError, with the given message, is thrown.
- * @param actual the actual value
- * @param expected the expected value
- * @param message the assertion error message
- */
- static public void assertEquals(short actual, short expected, String message) {
- assertEquals(Short.valueOf(actual), Short.valueOf(expected), message);
- }
-
- /**
- * Asserts that two shorts are equal. If they are not,
- * an AssertionError is thrown.
- * @param actual the actual value
- * @param expected the expected value
- */
- static public void assertEquals(short actual, short expected) {
- assertEquals(actual, expected, null);
- }
-
- /**
- * Asserts that two ints are equal. If they are not,
- * an AssertionFailedError, with the given message, is thrown.
- * @param actual the actual value
- * @param expected the expected value
- * @param message the assertion error message
- */
- static public void assertEquals(int actual, int expected, String message) {
- assertEquals(Integer.valueOf(actual), Integer.valueOf(expected), message);
- }
-
- /**
- * Asserts that two ints are equal. If they are not,
- * an AssertionError is thrown.
- * @param actual the actual value
- * @param expected the expected value
- */
- static public void assertEquals(int actual, int expected) {
- assertEquals(actual, expected, null);
- }
-
- /**
- * Asserts that an object isn't null. If it is,
- * an AssertionError is thrown.
- * @param object the assertion object
- */
- static public void assertNotNull(Object object) {
- assertNotNull(object, null);
- }
-
- /**
- * Asserts that an object isn't null. If it is,
- * an AssertionFailedError, with the given message, is thrown.
- * @param object the assertion object
- * @param message the assertion error message
- */
- static public void assertNotNull(Object object, String message) {
- assertTrue(object != null, message);
- }
-
- /**
- * Asserts that an object is null. If it is not,
- * an AssertionError, with the given message, is thrown.
- * @param object the assertion object
- */
- static public void assertNull(Object object) {
- assertNull(object, null);
- }
-
- /**
- * Asserts that an object is null. If it is not,
- * an AssertionFailedError, with the given message, is thrown.
- * @param object the assertion object
- * @param message the assertion error message
- */
- static public void assertNull(Object object, String message) {
- assertTrue(object == null, message);
- }
-
- /**
- * Asserts that two objects refer to the same object. If they do not,
- * an AssertionFailedError, with the given message, is thrown.
- * @param actual the actual value
- * @param expected the expected value
- * @param message the assertion error message
- */
- static public void assertSame(Object actual, Object expected, String message) {
- if(expected == actual) {
- return;
- }
- failNotSame(actual, expected, message);
- }
-
- /**
- * Asserts that two objects refer to the same object. If they do not,
- * an AssertionError is thrown.
- * @param actual the actual value
- * @param expected the expected value
- */
- static public void assertSame(Object actual, Object expected) {
- assertSame(actual, expected, null);
- }
-
- /**
- * Asserts that two objects do not refer to the same objects. If they do,
- * an AssertionError, with the given message, is thrown.
- * @param actual the actual value
- * @param expected the expected value
- * @param message the assertion error message
- */
- static public void assertNotSame(Object actual, Object expected, String message) {
- if(expected == actual) {
- failSame(actual, expected, message);
- }
- }
-
- /**
- * Asserts that two objects do not refer to the same object. If they do,
- * an AssertionError is thrown.
- * @param actual the actual value
- * @param expected the expected value
- */
- static public void assertNotSame(Object actual, Object expected) {
- assertNotSame(actual, expected, null);
- }
-
- static private void failSame(Object actual, Object expected, String message) {
- String formatted = "";
- if(message != null) {
- formatted = message + " ";
- }
- fail(formatted + "expected not same with:<" + expected +"> but was same:<" + actual + ">");
- }
-
- static private void failNotSame(Object actual, Object expected, String message) {
- String formatted = "";
- if(message != null) {
- formatted = message + " ";
- }
- fail(formatted + "expected same with:<" + expected + "> but was:<" + actual + ">");
- }
-
- static private void failNotEquals(Object actual , Object expected, String message ) {
- fail(format(actual, expected, message));
- }
-
- static String format(Object actual, Object expected, String message) {
- String formatted = "";
- if (null != message) {
- formatted = message + " ";
- }
-
- return formatted + "expected:<" + expected + "> but was:<" + actual + ">";
- }
-
- /**
- * Asserts that two collections contain the same elements in the same order. If they do not,
- * an AssertionError is thrown.
- *
- * @param actual the actual value
- * @param expected the expected value
- */
- static public void assertEquals(Collection actual, Collection expected) {
- assertEquals(actual, expected, null);
- }
-
- /**
- * Asserts that two collections contain the same elements in the same order. If they do not,
- * an AssertionError, with the given message, is thrown.
- * @param actual the actual value
- * @param expected the expected value
- * @param message the assertion error message
- */
- static public void assertEquals(Collection actual, Collection expected, String message) {
- if(actual == expected) return;
-
- if (actual == null || expected == null) {
- if (message != null) fail(message);
- else fail("Collections not equal: expected: " + expected + " and actual: " + actual);
- }
-
- assertEquals(actual.size(), expected.size(), message + ": lists don't have the same size");
-
- Iterator actIt = actual.iterator();
- Iterator expIt = expected.iterator();
- int i = -1;
- while(actIt.hasNext() && expIt.hasNext()) {
- i++;
- Object e = expIt.next();
- Object a = actIt.next();
- String errorMessage = message == null
- ? "Lists differ at element [" + i + "]: " + e + " != " + a
- : message + ": Lists differ at element [" + i + "]: " + e + " != " + a;
-
- assertEquals(a, e, errorMessage);
- }
- }
-
- /**
- * Asserts that two arrays contain the same elements in the same order. If they do not,
- * an AssertionError, with the given message, is thrown.
- * @param actual the actual value
- * @param expected the expected value
- * @param message the assertion error message
- */
- static public void assertEquals(Object[] actual, Object[] expected, String message) {
- if(actual == expected) return;
-
- if ((actual == null && expected != null) || (actual != null && expected == null)) {
- if (message != null) fail(message);
- else fail("Arrays not equal: " + Arrays.toString(expected) + " and " + Arrays.toString(actual));
- }
- assertEquals(Arrays.asList(actual), Arrays.asList(expected), message);
- }
-
- /**
- * Asserts that two arrays contain the same elements in no particular order. If they do not,
- * an AssertionError, with the given message, is thrown.
- * @param actual the actual value
- * @param expected the expected value
- * @param message the assertion error message
- */
- static public void assertEqualsNoOrder(Object[] actual, Object[] expected, String message) {
- if(actual == expected) return;
-
- if ((actual == null && expected != null) || (actual != null && expected == null)) {
- failAssertNoEqual(actual, expected,
- "Arrays not equal: " + Arrays.toString(expected) + " and " + Arrays.toString(actual),
- message);
- }
-
- if (actual.length != expected.length) {
- failAssertNoEqual(actual, expected,
- "Arrays do not have the same size:" + actual.length + " != " + expected.length,
- message);
- }
-
- List actualCollection = Lists.newArrayList();
- for (Object a : actual) {
- actualCollection.add(a);
- }
- for (Object o : expected) {
- actualCollection.remove(o);
- }
- if (actualCollection.size() != 0) {
- failAssertNoEqual(actual, expected,
- "Arrays not equal: " + Arrays.toString(expected) + " and " + Arrays.toString(actual),
- message);
- }
- }
-
- private static void failAssertNoEqual(Object[] actual, Object[] expected,
- String message, String defaultMessage)
- {
- if (message != null) fail(message);
- else fail(defaultMessage);
- }
-
- /**
- * Asserts that two arrays contain the same elements in the same order. If they do not,
- * an AssertionError is thrown.
- *
- * @param actual the actual value
- * @param expected the expected value
- */
- static public void assertEquals(Object[] actual, Object[] expected) {
- assertEquals(actual, expected, null);
- }
-
- /**
- * Asserts that two arrays contain the same elements in no particular order. If they do not,
- * an AssertionError is thrown.
- * @param actual the actual value
- * @param expected the expected value
- */
- static public void assertEqualsNoOrder(Object[] actual, Object[] expected) {
- assertEqualsNoOrder(actual, expected, null);
- }
-
- /**
- * Asserts that two arrays contain the same elements in the same order. If they do not,
- * an AssertionError is thrown.
- *
- * @param actual the actual value
- * @param expected the expected value
- */
- static public void assertEquals(final byte[] actual, final byte[] expected) {
- assertEquals(actual, expected, "");
- }
-
- /**
- * Asserts that two arrays contain the same elements in the same order. If they do not,
- * an AssertionError, with the given message, is thrown.
- *
- * @param actual the actual value
- * @param expected the expected value
- * @param message the assertion error message
- */
- static public void assertEquals(final byte[] actual, final byte[] expected, final String message) {
- if(expected == actual) {
- return;
- }
- if(null == expected) {
- fail("expected a null array, but not null found. " + message);
- }
- if(null == actual) {
- fail("expected not null array, but null found. " + message);
- }
-
- assertEquals(actual.length, expected.length, "arrays don't have the same size. " + message);
-
- for(int i= 0; i < expected.length; i++) {
- if(expected[i] != actual[i]) {
- fail("arrays differ firstly at element [" + i +"]; "
- + "expected value is <" + expected[i] +"> but was <"
- + actual[i] + ">. "
- + message);
- }
- }
- }
-
- /**
- * Asserts that two sets are equal.
- */
- static public void assertEquals(Set actual, Set expected) {
- if(actual == expected) return;
-
- if (actual == null || expected == null) {
- fail("Sets not equal: expected: " + expected + " and actual: " + actual);
- }
-
- if (!actual.equals(expected)) {
- fail("Sets differ: expected " + expected + " but got " + actual);
- }
- }
-
- /**
- * Asserts that two maps are equal.
- */
- static public void assertEquals(Map actual, Map expected) {
- if(actual == expected) return;
-
- if (actual == null || expected == null) {
- fail("Maps not equal: expected: " + expected + " and actual: " + actual);
- }
-
- if (!actual.equals(expected)) {
- fail("Maps differ: expected " + expected + " but got " + actual);
- }
- }
-
-}
diff --git a/user/test-super/org/testng/super/org/testng/IClass.java b/user/test-super/org/testng/super/org/testng/IClass.java
deleted file mode 100644
index d957929..0000000
--- a/user/test-super/org/testng/super/org/testng/IClass.java
+++ /dev/null
@@ -1,53 +0,0 @@
-// Modified by Google
-// Removed xml classes
-package org.testng;
-
-import java.io.Serializable;
-
-
-/**
- * <code>IClass</code> represents a test class and a collection of its instances.
- *
- * <p>
- * Modified by Google
- * <ul><li>Removed xml classes</li>
- * </ul>
- *
- * @author <a href = "mailto:cedric@beust.com">Cedric Beust</a>
- */
-public interface IClass extends Serializable {
-
- /**
- * @return this test class name. This is the name of the
- * corresponding Java class.
- */
- String getName();
-
- /**
- * @return the <test> tag this class was found in.
- */
- Object getXmlTest();
-
- /**
- * @return the *lt;class> tag this class was found in.
- */
- Object getXmlClass();
-
- /**
- * If this class implements ITest, returns its test name, otherwise returns null.
- */
- String getTestName();
-
- /**
- * @return the Java class corresponding to this IClass.
- */
- Class getRealClass();
-
- Object[] getInstances(boolean create);
-
- int getInstanceCount();
-
- long[] getInstanceHashCodes();
-
- void addInstance(Object instance);
-}
diff --git a/user/test-super/org/testng/super/org/testng/ITestNGMethod.java b/user/test-super/org/testng/super/org/testng/ITestNGMethod.java
deleted file mode 100644
index df2683b..0000000
--- a/user/test-super/org/testng/super/org/testng/ITestNGMethod.java
+++ /dev/null
@@ -1,238 +0,0 @@
-package org.testng;
-
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * Describes a TestNG annotated method and the instance on which it will be invoked.
- *
- * This interface is not meant to be implemented by users.
- *
- * <p>
- * Modified by Google
- * <ul>
- * <li>removed java.reflect.Method</li>
- * </ul>
- *
- * @author Cedric Beust, May 3, 2004
- */
-public interface ITestNGMethod extends Comparable, Serializable, Cloneable {
-
- /**
- * @return The real class on which this method was declared
- * (can be different from getMethod().getDeclaringClass() if
- * the test method was defined in a superclass).
- */
- Class getRealClass();
-
- ITestClass getTestClass();
-
- /**
- * Sets the test class having this method. This is not necessarily the declaring class.
- *
- * @param cls The test class having this method.
- */
- void setTestClass(ITestClass cls);
-
- /**
- * Returns the corresponding Java test method.
- * @return the corresponding Java test method.
- */
- Object getMethod();
-
- /**
- * Returns the method name. This is needed for serialization because
- * methods are not Serializable.
- * @return the method name.
- */
- String getMethodName();
-
- /**
- * @return All the instances the methods will be invoked upon.
- * This will typically be an array of one object in the absence
- * of an @Factory annotation.
- */
- Object[] getInstances();
-
- /**
- * Needed for serialization.
- */
- long[] getInstanceHashCodes();
-
- /**
- * @return The groups this method belongs to, possibly added to the groups
- * declared on the class.
- */
- String[] getGroups();
-
- /**
- * @return The groups this method depends on, possibly added to the groups
- * declared on the class.
- */
- String[] getGroupsDependedUpon();
-
- /**
- * If a group was not found.
- */
- String getMissingGroup();
- public void setMissingGroup(String group);
-
- /**
- * Before and After groups
- */
- public String[] getBeforeGroups();
- public String[] getAfterGroups();
-
- /**
- * @return The methods this method depends on, possibly added to the methods
- * declared on the class.
- */
- String[] getMethodsDependedUpon();
- void addMethodDependedUpon(String methodName);
-
- /**
- * @return true if this method was annotated with @Test
- */
- boolean isTest();
-
- /**
- * @return true if this method was annotated with @Configuration
- * and beforeTestMethod = true
- */
- boolean isBeforeMethodConfiguration();
-
- /**
- * @return true if this method was annotated with @Configuration
- * and beforeTestMethod = false
- */
- boolean isAfterMethodConfiguration();
-
- /**
- * @return true if this method was annotated with @Configuration
- * and beforeClassMethod = true
- */
- boolean isBeforeClassConfiguration();
-
- /**
- * @return true if this method was annotated with @Configuration
- * and beforeClassMethod = false
- */
- boolean isAfterClassConfiguration();
-
- /**
- * @return true if this method was annotated with @Configuration
- * and beforeSuite = true
- */
- boolean isBeforeSuiteConfiguration();
-
- /**
- * @return true if this method was annotated with @Configuration
- * and afterSuite = true
- */
- boolean isAfterSuiteConfiguration();
-
- /**
- * @return <tt>true</tt> if this method is a @BeforeTest (@Configuration beforeTest=true)
- */
- boolean isBeforeTestConfiguration();
-
- /**
- * @return <tt>true</tt> if this method is an @AfterTest (@Configuration afterTest=true)
- */
- boolean isAfterTestConfiguration();
-
- boolean isBeforeGroupsConfiguration();
-
- boolean isAfterGroupsConfiguration();
-
- /**
- * @return The timeout in milliseconds.
- */
- long getTimeOut();
- void setTimeOut(long timeOut);
-
- /**
- * @return the number of times this method needs to be invoked.
- */
- int getInvocationCount();
- void setInvocationCount(int count);
-
- /**
- * @return the success percentage for this method (between 0 and 100).
- */
- int getSuccessPercentage();
-
- /**
- * @return The id of the thread this method was run in.
- */
- String getId();
-
- void setId(String id);
-
- long getDate();
-
- void setDate(long date);
-
- /**
- * Returns if this ITestNGMethod can be invoked from within IClass.
- */
- boolean canRunFromClass(IClass testClass);
-
- /**
- * @return true if this method is alwaysRun=true
- */
- boolean isAlwaysRun();
-
- /**
- * @return the number of threads to be used when invoking the method on parallel
- */
- int getThreadPoolSize();
-
- void setThreadPoolSize(int threadPoolSize);
-
- public String getDescription();
-
- public void incrementCurrentInvocationCount();
- public int getCurrentInvocationCount();
- public void setParameterInvocationCount(int n);
- public int getParameterInvocationCount();
-
- public ITestNGMethod clone();
-
- public IRetryAnalyzer getRetryAnalyzer();
- public void setRetryAnalyzer(IRetryAnalyzer retryAnalyzer);
-
- public boolean skipFailedInvocations();
- public void setSkipFailedInvocations(boolean skip);
-
- /**
- * The time under which all invocationCount methods need to complete by.
- */
- public long getInvocationTimeOut();
-
- public boolean ignoreMissingDependencies();
- public void setIgnoreMissingDependencies(boolean ignore);
-
- /**
- * Which invocation numbers of this method should be used (only applicable
- * if it uses a data provider). If this value is an empty list, use all the values
- * returned from the data provider. These values are read from the XML file in
- * the <include invocationNumbers="..."> tag.
- */
- public List<Integer> getInvocationNumbers();
- public void setInvocationNumbers(List<Integer> numbers);
-
- /**
- * The list of invocation numbers that failed, which is only applicable for
- * methods that have a data provider.
- */
- public void addFailedInvocationNumber(int number);
- public List<Integer> getFailedInvocationNumbers();
-
- /**
- * The scheduling priority. Lower priorities get scheduled first.
- */
- public int getPriority();
- public void setPriority(int priority);
-}
diff --git a/user/test-super/org/testng/super/org/testng/collections/Maps.java b/user/test-super/org/testng/super/org/testng/collections/Maps.java
deleted file mode 100644
index 778f637..0000000
--- a/user/test-super/org/testng/super/org/testng/collections/Maps.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.testng.collections;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class Maps {
-
- public static <K, V> Map<K,V> newHashMap() {
- return new HashMap<K, V>();
- }
-
- public static <K, V> Map<K,V> newHashtable() {
- throw new RuntimeException("Hashtable are not supported in GWT");
- }
-}
diff --git a/user/test/com/google/gwt/validation/ConstraintsGwtSuite.java b/user/test/com/google/gwt/validation/ConstraintsGwtSuite.java
deleted file mode 100644
index 2930f06..0000000
--- a/user/test/com/google/gwt/validation/ConstraintsGwtSuite.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation;
-
-import com.google.gwt.junit.tools.GWTTestSuite;
-import com.google.gwt.validation.client.constraints.GwtCompileTest;
-
-import junit.framework.Test;
-
-/**
- * All Constraints tests that GWTTestCase.
- */
-public class ConstraintsGwtSuite {
- public static Test suite() {
- GWTTestSuite suite = new GWTTestSuite(
- "Validation Constraint tests that require GWT");
- suite.addTestSuite(GwtCompileTest.class);
- return suite;
- }
-
-}
diff --git a/user/test/com/google/gwt/validation/ConstraintsJreSuite.java b/user/test/com/google/gwt/validation/ConstraintsJreSuite.java
deleted file mode 100644
index 4578f5a..0000000
--- a/user/test/com/google/gwt/validation/ConstraintsJreSuite.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation;
-
-import com.google.gwt.validation.testing.constraints.AssertFalseValidatorTest;
-import com.google.gwt.validation.testing.constraints.AssertTrueValidatorTest;
-import com.google.gwt.validation.testing.constraints.DecimalMaxValidatorForNumberTest;
-import com.google.gwt.validation.testing.constraints.DecimalMaxValidatorForStringTest;
-import com.google.gwt.validation.testing.constraints.DecimalMinValidatorForNumberTest;
-import com.google.gwt.validation.testing.constraints.DecimalMinValidatorForStringTest;
-import com.google.gwt.validation.testing.constraints.DigitsValidatorForNumberTest;
-import com.google.gwt.validation.testing.constraints.DigitsValidatorForStringTest;
-import com.google.gwt.validation.testing.constraints.FutureValidatorForDateTest;
-import com.google.gwt.validation.testing.constraints.MaxValidatorForNumberTest;
-import com.google.gwt.validation.testing.constraints.MaxValidatorForStringTest;
-import com.google.gwt.validation.testing.constraints.MinValidatorForNumberTest;
-import com.google.gwt.validation.testing.constraints.MinValidatorForStringTest;
-import com.google.gwt.validation.testing.constraints.NotNullValidatorTest;
-import com.google.gwt.validation.testing.constraints.NullValidatorTest;
-import com.google.gwt.validation.testing.constraints.PastValidatorForDateTest;
-import com.google.gwt.validation.testing.constraints.PatternValidatorTest;
-import com.google.gwt.validation.testing.constraints.SizeValidatorForArrayOfBooleanTest;
-import com.google.gwt.validation.testing.constraints.SizeValidatorForArrayOfByteTest;
-import com.google.gwt.validation.testing.constraints.SizeValidatorForArrayOfCharTest;
-import com.google.gwt.validation.testing.constraints.SizeValidatorForArrayOfDoubleTest;
-import com.google.gwt.validation.testing.constraints.SizeValidatorForArrayOfFloatTest;
-import com.google.gwt.validation.testing.constraints.SizeValidatorForArrayOfIntTest;
-import com.google.gwt.validation.testing.constraints.SizeValidatorForArrayOfLongTest;
-import com.google.gwt.validation.testing.constraints.SizeValidatorForArrayOfObjectTest;
-import com.google.gwt.validation.testing.constraints.SizeValidatorForArrayOfShortTest;
-import com.google.gwt.validation.testing.constraints.SizeValidatorForCollectionTest;
-import com.google.gwt.validation.testing.constraints.SizeValidatorForMapTest;
-import com.google.gwt.validation.testing.constraints.SizeValidatorForStringTest;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * All Constraints tests that don't need GWTTestCase.
- */
-public class ConstraintsJreSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite(
- "Validation Constraint tests that require the JRE");
- suite.addTestSuite(AssertFalseValidatorTest.class);
- suite.addTestSuite(AssertTrueValidatorTest.class);
- suite.addTestSuite(DecimalMaxValidatorForNumberTest.class);
- suite.addTestSuite(DecimalMaxValidatorForStringTest.class);
- suite.addTestSuite(DecimalMinValidatorForNumberTest.class);
- suite.addTestSuite(DecimalMinValidatorForStringTest.class);
- suite.addTestSuite(DigitsValidatorForNumberTest.class);
- suite.addTestSuite(DigitsValidatorForStringTest.class);
- suite.addTestSuite(FutureValidatorForDateTest.class);
- suite.addTestSuite(MaxValidatorForNumberTest.class);
- suite.addTestSuite(MaxValidatorForStringTest.class);
- suite.addTestSuite(MinValidatorForNumberTest.class);
- suite.addTestSuite(MinValidatorForStringTest.class);
- suite.addTestSuite(NotNullValidatorTest.class);
- suite.addTestSuite(NullValidatorTest.class);
- suite.addTestSuite(PastValidatorForDateTest.class);
- suite.addTestSuite(PatternValidatorTest.class);
- suite.addTestSuite(SizeValidatorForArrayOfBooleanTest.class);
- suite.addTestSuite(SizeValidatorForArrayOfByteTest.class);
- suite.addTestSuite(SizeValidatorForArrayOfCharTest.class);
- suite.addTestSuite(SizeValidatorForArrayOfDoubleTest.class);
- suite.addTestSuite(SizeValidatorForArrayOfFloatTest.class);
- suite.addTestSuite(SizeValidatorForArrayOfIntTest.class);
- suite.addTestSuite(SizeValidatorForArrayOfLongTest.class);
- suite.addTestSuite(SizeValidatorForArrayOfObjectTest.class);
- suite.addTestSuite(SizeValidatorForArrayOfShortTest.class);
- suite.addTestSuite(SizeValidatorForCollectionTest.class);
- suite.addTestSuite(SizeValidatorForMapTest.class);
- suite.addTestSuite(SizeValidatorForCollectionTest.class);
- suite.addTestSuite(SizeValidatorForMapTest.class);
- suite.addTestSuite(SizeValidatorForStringTest.class);
- return suite;
- }
-}
diff --git a/user/test/com/google/gwt/validation/RebindJreSuite.java b/user/test/com/google/gwt/validation/RebindJreSuite.java
deleted file mode 100644
index 0929b60..0000000
--- a/user/test/com/google/gwt/validation/RebindJreSuite.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation;
-
-import com.google.gwt.validation.rebind.GwtSpecificValidatorCreatorTest;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * All validation client non GWT tests.
- */
-public class RebindJreSuite {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(
- "Test suite for validation rebind code that does not require GWT.");
- suite.addTestSuite(GwtSpecificValidatorCreatorTest.class);
- return suite;
- }
-}
diff --git a/user/test/com/google/gwt/validation/ValidationClientGwtSuite.java b/user/test/com/google/gwt/validation/ValidationClientGwtSuite.java
deleted file mode 100644
index a40bd79..0000000
--- a/user/test/com/google/gwt/validation/ValidationClientGwtSuite.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation;
-
-import com.google.gwt.junit.tools.GWTTestSuite;
-import com.google.gwt.validation.client.BaseMessageInterpolatorTest;
-import com.google.gwt.validation.client.SimpleSampleTest;
-
-import junit.framework.Test;
-
-/**
- * All validation client GWT tests.
- */
-public class ValidationClientGwtSuite {
-
- public static Test suite() {
- GWTTestSuite suite = new GWTTestSuite(
- "Test suite for all validation code.");
- suite.addTestSuite(BaseMessageInterpolatorTest.class);
- suite.addTestSuite(SimpleSampleTest.class);
- return suite;
- }
-}
diff --git a/user/test/com/google/gwt/validation/ValidationClientJreSuite.java b/user/test/com/google/gwt/validation/ValidationClientJreSuite.java
deleted file mode 100644
index bc794e7..0000000
--- a/user/test/com/google/gwt/validation/ValidationClientJreSuite.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation;
-
-import com.google.gwt.validation.client.impl.NodeImplTest;
-import com.google.gwt.validation.client.impl.PathImplTest;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * All validation client non GWT tests.
- */
-public class ValidationClientJreSuite {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(
- "Test suite for validation client code that does not require GWT.");
- suite.addTestSuite(PathImplTest.class);
- suite.addTestSuite(NodeImplTest.class);
- return suite;
- }
-}
diff --git a/user/test/com/google/gwt/validation/ValidationTest.gwt.xml b/user/test/com/google/gwt/validation/ValidationTest.gwt.xml
deleted file mode 100644
index d088c8f..0000000
--- a/user/test/com/google/gwt/validation/ValidationTest.gwt.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd">
-<!--
- Copyright 2010 Google Inc.
-
- 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.
--->
-<module>
- <inherits name="com.google.gwt.user.User" />
- <inherits name="org.hibernate.validator.HibernateValidator" />
- <source path="client">
- </source>
-</module>
\ No newline at end of file
diff --git a/user/test/com/google/gwt/validation/client/BaseMessageInterpolatorTest.java b/user/test/com/google/gwt/validation/client/BaseMessageInterpolatorTest.java
deleted file mode 100644
index 5b8a2f3..0000000
--- a/user/test/com/google/gwt/validation/client/BaseMessageInterpolatorTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Test for {@link BaseMessageInterpolator}. Full tests are in the TCK.
- */
-public class BaseMessageInterpolatorTest extends ValidationClientGwtTestCase {
- BaseMessageInterpolator interpolator;
- Map<String, Object> defaultMap = new HashMap<String, Object>();
-
- public void testReplace_foo() {
- assertAttributesReplaced("bar", "{foo}", defaultMap);
- }
-
- public void testReplace_fooFoo() {
- assertAttributesReplaced("bar and bar", "{foo} and {foo}", defaultMap);
- }
-
- public void testReplace_integer() {
- assertAttributesReplaced("integer=1", "integer={integer}", defaultMap);
- }
-
- public void testReplace_none() {
- assertAttributesReplaced("none", "none", defaultMap);
- }
-
- protected void assertAttributesReplaced(String expected, String message,
- Map<String, Object> map) {
- String result = interpolator.replaceParameters(message,
- BaseMessageInterpolator.createAnnotationReplacer(map));
- assertEquals(expected, result);
- }
-
- @Override
- protected void gwtSetUp() throws Exception {
- super.gwtSetUp();
- interpolator = new GwtMessageInterpolator();
- defaultMap.clear();
- defaultMap.put("foo", "bar");
- defaultMap.put("integer", Integer.valueOf(1));
- }
-}
diff --git a/user/test/com/google/gwt/validation/client/SimpleSample.java b/user/test/com/google/gwt/validation/client/SimpleSample.java
deleted file mode 100644
index 86083d8..0000000
--- a/user/test/com/google/gwt/validation/client/SimpleSample.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client;
-
-import javax.validation.constraints.NotNull;
-
-/**
- * A simple sample class to test javax.validation.
- */
-public class SimpleSample {
- @NotNull
- private String name;
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-}
diff --git a/user/test/com/google/gwt/validation/client/SimpleSampleTest.java b/user/test/com/google/gwt/validation/client/SimpleSampleTest.java
deleted file mode 100644
index 72c6860..0000000
--- a/user/test/com/google/gwt/validation/client/SimpleSampleTest.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client;
-
-import com.google.gwt.validation.client.impl.ConstraintViolationImpl;
-
-import javax.validation.ConstraintViolation;
-import javax.validation.constraints.NotNull;
-
-/**
- * Tests for {@link SimpleSample}.
- */
-public class SimpleSampleTest extends ValidationClientGwtTestCase {
- SimpleSample sample;
-
- public void testAnnotatedClassCompiles() throws Exception {
- // Only tests that validation annotated class compile
- assertEquals(null, sample.getName());
- }
-
- public void testConstraintViolation_compiles() throws Exception {
- // Only tests that Violation Compiles which will also compile Path, Node
- // and ConstraintDescriptor
- ConstraintViolation<NotNull> violation = ConstraintViolationImpl.<NotNull> builder().
- setLeafBean(sample).
- build();
- assertEquals(sample, violation.getLeafBean());
- }
-
- @Override
- protected void gwtSetUp() {
- sample = new SimpleSample();
- }
-}
diff --git a/user/test/com/google/gwt/validation/client/ValidationClientGwtTestCase.java b/user/test/com/google/gwt/validation/client/ValidationClientGwtTestCase.java
deleted file mode 100644
index eb2d781..0000000
--- a/user/test/com/google/gwt/validation/client/ValidationClientGwtTestCase.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client;
-
-import com.google.gwt.junit.client.GWTTestCase;
-
-/**
- * Base {@link GWTTestCase} for Validation Client tests.
- */
-public abstract class ValidationClientGwtTestCase extends GWTTestCase {
-
- @Override
- public final String getModuleName() {
- return "com.google.gwt.validation.ValidationTest";
- }
-}
\ No newline at end of file
diff --git a/user/test/com/google/gwt/validation/client/constraints/GwtCompileTest.java b/user/test/com/google/gwt/validation/client/constraints/GwtCompileTest.java
deleted file mode 100644
index 29d193e..0000000
--- a/user/test/com/google/gwt/validation/client/constraints/GwtCompileTest.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.constraints;
-
-import com.google.gwt.validation.client.ValidationClientGwtTestCase;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * A GWT test to force the compilation of all default standard
- * {@link javax.validation.ConstraintValidator}s.
- */
-public class GwtCompileTest extends ValidationClientGwtTestCase {
-
- public void testDefaultConstraints() {
- List<Class<?>> temp = new ArrayList<Class<?>>();
- temp.add(AssertFalseValidator.class);
- temp.add(AssertTrueValidator.class);
- temp.add(DecimalMaxValidatorForNumber.class);
- temp.add(DecimalMaxValidatorForString.class);
- temp.add(DecimalMinValidatorForNumber.class);
- temp.add(DecimalMinValidatorForString.class);
- temp.add(DigitsValidatorForNumber.class);
- temp.add(DigitsValidatorForString.class);
- // FutureValidatorForCalendar GWT does not support java.util.Calendar
- temp.add(FutureValidatorForDate.class);
- temp.add(MaxValidatorForNumber.class);
- temp.add(MaxValidatorForString.class);
- temp.add(MinValidatorForNumber.class);
- temp.add(MinValidatorForString.class);
- temp.add(NotNullValidator.class);
- temp.add(NullValidator.class);
- // PastValidatorForCalendar GWT does not support java.util.Calendar
- temp.add(PastValidatorForDate.class);
- temp.add(PatternValidator.class);
- temp.add(SizeValidatorForArrayOfBoolean.class);
- temp.add(SizeValidatorForArrayOfByte.class);
- temp.add(SizeValidatorForArrayOfChar.class);
- temp.add(SizeValidatorForArrayOfDouble.class);
- temp.add(SizeValidatorForArrayOfFloat.class);
- temp.add(SizeValidatorForArrayOfInt.class);
- temp.add(SizeValidatorForArrayOfLong.class);
- temp.add(SizeValidatorForArrayOfObject.class);
- temp.add(SizeValidatorForArrayOfShort.class);
- temp.add(SizeValidatorForCollection.class);
- temp.add(SizeValidatorForMap.class);
- temp.add(SizeValidatorForString.class);
-
- assertEquals(29, temp.size());
- }
-}
diff --git a/user/test/com/google/gwt/validation/client/impl/NodeImplTest.java b/user/test/com/google/gwt/validation/client/impl/NodeImplTest.java
deleted file mode 100644
index 38e4b12..0000000
--- a/user/test/com/google/gwt/validation/client/impl/NodeImplTest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.impl;
-
-import junit.framework.TestCase;
-
-import javax.validation.Path.Node;
-
-/**
- * Tests for {@link NodeImpl}.
- */
-public class NodeImplTest extends TestCase {
-
- public void testFoo() throws Exception {
- assertNode(NodeImpl.createNode("foo"), "foo", false, null, null);
- }
-
- public void testFoo_iterable() throws Exception {
- assertNode(NodeImpl.createIterableNode("foo"), "foo", true, null, null);
- }
-
- public void testFoo1() throws Exception {
- assertNode(NodeImpl.createIndexedNode("foo", 1), "foo", true, null,
- Integer.valueOf(1));
- }
-
- public void testFooBar() throws Exception {
- assertNode(NodeImpl.createKeyedNode("foo", "bar"), "foo", true, "bar", null);
- }
-
- public void testRoot() throws Exception {
- assertNode(NodeImpl.ROOT_NODE, null, false, null, null);
- }
-
- protected void assertNode(Node node, String expectedName,
- boolean expectedInIterator, Object expectedKey, Integer expectedIndex) {
- assertEquals(node + " name", expectedName, node.getName());
- assertEquals(node + " isInIterator", expectedInIterator,
- node.isInIterable());
- assertEquals(node + " key", expectedKey, node.getKey());
- assertEquals(node + " index", expectedIndex, node.getIndex());
- }
-}
diff --git a/user/test/com/google/gwt/validation/client/impl/PathImplTest.java b/user/test/com/google/gwt/validation/client/impl/PathImplTest.java
deleted file mode 100644
index e8a1fd7..0000000
--- a/user/test/com/google/gwt/validation/client/impl/PathImplTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.client.impl;
-
-import junit.framework.TestCase;
-
-/**
- * Tests for {@link PathImpl}.
- */
-public class PathImplTest extends TestCase {
-
- public void testEquals_root() {
- PathImpl root = new PathImpl();
- PathImpl rootCopy = new PathImpl();
- assertEqualsAndHash(root, rootCopy);
- }
-
- public void testEquals_foo() {
- PathImpl foo = new PathImpl().append("foo");
- PathImpl fooCopy = new PathImpl().append("foo");
- assertEqualsAndHash(foo, fooCopy);
- }
-
- public void testEqual_fooBarKey() {
- PathImpl fooBarKey = new PathImpl().append("foo").appendKey("bar", "key");
- PathImpl fooBarKeyCopy = new PathImpl().append("foo").appendKey("bar",
- "key");
- assertEqualsAndHash(fooBarKey, fooBarKeyCopy);
- }
-
- public void testEquals_fooBar1() {
- PathImpl fooBar1 = new PathImpl().append("foo").appendIndex("bar", 1);
- PathImpl fooBar1Copy = new PathImpl().append("foo").appendIndex("bar", 1);
- assertEqualsAndHash(fooBar1, fooBar1Copy);
- }
-
- public void testEquals_not() {
- PathImpl root = new PathImpl();
- PathImpl foo = new PathImpl().append("foo");
- assertNotEqual(root, foo);
-
- PathImpl fooBarKey = new PathImpl().append("foo").appendKey("bar", "key");
- PathImpl fooBarNote = new PathImpl().append("foo").appendKey("bar", "note");
- assertNotEqual(root, fooBarKey);
- assertNotEqual(foo, fooBarKey);
- assertNotEqual(fooBarNote, fooBarKey);
-
- PathImpl fooBar1 = new PathImpl().append("foo").appendIndex("bar", 1);
- PathImpl fooBar2 = new PathImpl().append("foo").appendIndex("bar", 2);
- assertNotEqual(root, fooBar1);
- assertNotEqual(foo, fooBar1);
- assertNotEqual(fooBarKey, fooBar1);
- assertNotEqual(fooBar2, fooBar1);
- }
-
- protected void assertNotEqual(Object lhs, Object rhs) {
- assertFalse(lhs + "should not equal " + rhs, lhs.equals(rhs));
- }
-
- protected void assertEqualsAndHash(Object lhs, Object rhs) {
- assertEquals(lhs, rhs);
- assertEquals("hashCode", lhs.hashCode(), rhs.hashCode());
- }
-}
diff --git a/user/test/com/google/gwt/validation/example/ExampleValidationClientGwtSuite.java b/user/test/com/google/gwt/validation/example/ExampleValidationClientGwtSuite.java
deleted file mode 100644
index c13ee78..0000000
--- a/user/test/com/google/gwt/validation/example/ExampleValidationClientGwtSuite.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.example;
-
-import com.google.gwt.junit.tools.GWTTestSuite;
-import com.google.gwt.validation.example.client.AuthorTest;
-
-import junit.framework.Test;
-
-/**
- * All Constraints tests that GWTTestCase.
- */
-public class ExampleValidationClientGwtSuite {
- public static Test suite() {
- GWTTestSuite suite = new GWTTestSuite(
- "Validation Example tests that require GWT");
- suite.addTestSuite(AuthorTest.class);
- return suite;
- }
-
-}
diff --git a/user/test/com/google/gwt/validation/example/ValidationExample.gwt.xml b/user/test/com/google/gwt/validation/example/ValidationExample.gwt.xml
deleted file mode 100644
index a719210..0000000
--- a/user/test/com/google/gwt/validation/example/ValidationExample.gwt.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd">
-<!--
- Copyright 2010 Google Inc.
-
- 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.
--->
-<module>
- <inherits name="com.google.gwt.user.User" />
- <inherits name="org.hibernate.validator.HibernateValidator" />
- <source path="client">
- </source>
- <replace-with
- class="com.google.gwt.validation.example.client.ExampleValidatorFactory">
- <when-type-is class="javax.validation.ValidatorFactory" />
-</replace-with>
-</module>
\ No newline at end of file
diff --git a/user/test/com/google/gwt/validation/example/client/Author.java b/user/test/com/google/gwt/validation/example/client/Author.java
deleted file mode 100644
index fc84f893f..0000000
--- a/user/test/com/google/gwt/validation/example/client/Author.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.example.client;
-
-import javax.validation.constraints.Size;
-
-/**
- * From the jsr spec.
- */
-public class Author {
-
- private String firstName;
-
- @NotEmpty(message = "lastname must not be null")
- private String lastName;
-
- @Size(max = 30)
- private String company;
-
- public String getFirstName() {
- return firstName;
- }
-
- public void setFirstName(String firstName) {
- this.firstName = firstName;
- }
-
- public String getLastName() {
- return lastName;
- }
-
- public String getCompany() {
- return company;
- }
-
- public void setCompany(String company) {
- this.company = company;
- }
-
- public void setLastName(String lastName) {
- this.lastName = lastName;
- }
-}
diff --git a/user/test/com/google/gwt/validation/example/client/AuthorTest.java b/user/test/com/google/gwt/validation/example/client/AuthorTest.java
deleted file mode 100644
index 374399d..0000000
--- a/user/test/com/google/gwt/validation/example/client/AuthorTest.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.example.client;
-
-import com.google.gwt.junit.client.GWTTestCase;
-import com.google.gwt.validation.example.client.ExampleValidatorFactory.ClientGroup;
-import com.google.gwt.validation.example.client.ExampleValidatorFactory.ServerGroup;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-
-import javax.validation.ConstraintViolation;
-import javax.validation.Validation;
-import javax.validation.Validator;
-import javax.validation.groups.Default;
-
-/**
- * Tests for {@link Author}.
- */
-public class AuthorTest extends GWTTestCase {
-
- private Author author;
-
- private Validator validator;
-
- @Override
- public String getModuleName() {
- return "com.google.gwt.validation.example.ValidationExample";
- }
-
- public void testGroup_clientGroup() throws Exception {
- initValidAuthor();
- Set<ConstraintViolation<Author>> violations = validator.validate(author,
- ClientGroup.class);
- assertContentsAnyOrder("valid author", violations);
- }
-
- public void testGroup_default() throws Exception {
- initValidAuthor();
- Set<ConstraintViolation<Author>> violations = validator.validate(author,
- Default.class);
- assertContentsAnyOrder("valid author", violations);
- }
-
- public void testGroup_empty() throws Exception {
- initValidAuthor();
- Set<ConstraintViolation<Author>> violations = validator.validate(author);
- assertContentsAnyOrder("valid author", violations);
- }
-
- public void testGroup_serverGroup() throws Exception {
- initValidAuthor();
- try {
- validator.validate(author, ServerGroup.class);
- fail("Expected a " + IllegalArgumentException.class);
- } catch (IllegalArgumentException e) {
- // expected
- }
- }
-
- public void testValidate_companySize31() {
- initValidAuthor();
- author.setCompany("1234567890123456789012345678901");
- Set<ConstraintViolation<Author>> violations = validator.validate(author);
- assertContentsAnyOrder("company size 31", toMessage(violations),
- "size must be between 0 and 30"
- );
- }
-
- public void testValidate_string() {
- try {
- validator.validate("some string");
- fail("Expected a " + IllegalArgumentException.class);
- } catch (IllegalArgumentException expected) {
- }
- }
-
- public void testValidate_valid() {
- initValidAuthor();
- Set<ConstraintViolation<Author>> violations = validator.validate(author);
- assertContentsAnyOrder("valid author", violations);
- }
-
- public void testValidateProperty_object() {
- try {
- validator.validateProperty(new Object(), "foo");
- fail("Expected a " + IllegalArgumentException.class);
- } catch (IllegalArgumentException expected) {
- }
- }
-
- public void testValidateValue_string() {
- try {
- validator.validateValue(String.class, "notValid", "value");
- fail("Expected a " + IllegalArgumentException.class);
- } catch (IllegalArgumentException expected) {
- }
- }
-
- @Override
- protected final void gwtSetUp() throws Exception {
- super.gwtSetUp();
- author = new Author();
- validator = Validation.buildDefaultValidatorFactory().getValidator();
- }
-
- protected void initValidAuthor() {
- author.setFirstName("John");
- author.setLastName("Smith");
- author.setCompany("Google");
- }
-
- private <T> void assertContentsAnyOrder(String message,
- Iterable<T> actual, T... expected) {
-
- List<T> expectedList = new ArrayList<T>(Arrays.asList(expected));
- message += "Expected to find " + expectedList + " but found " + actual;
- for (T a : actual) {
- if (expectedList.contains(a)) {
- expectedList.remove(a);
- } else {
- fail(message);
- }
- }
- if (!expectedList.isEmpty()) {
- fail(message);
- }
- }
-
- private <T> List<String> toMessage(Set<ConstraintViolation<T>> violations) {
- List<String> messages = new ArrayList<String>();
- for (ConstraintViolation<T> violation : violations) {
- messages.add(violation.getMessage());
- }
- return messages;
- }
-}
diff --git a/user/test/com/google/gwt/validation/example/client/Book.java b/user/test/com/google/gwt/validation/example/client/Book.java
deleted file mode 100644
index 4267176..0000000
--- a/user/test/com/google/gwt/validation/example/client/Book.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.example.client;
-
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Size;
-import javax.validation.groups.Default;
-
-/**
- * From the JSR 303 spec.
- */
-public class Book {
- private String title;
- private String description;
- @Valid
- @NotNull
- private Author author;
-
- @NotEmpty(groups = {FirstLevelCheck.class, Default.class})
- @Size(max = 30)
- public String getTitle() {
- return title;
- }
-
- public void setTitle(String title) {
- this.title = title;
- }
-
- public Author getAuthor() {
- return author;
- }
-
- public void setAuthor(Author author) {
- this.author = author;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setAuthor(String description) {
- this.description = description;
- }
-}
diff --git a/user/test/com/google/gwt/validation/example/client/ExampleValidatorFactory.java b/user/test/com/google/gwt/validation/example/client/ExampleValidatorFactory.java
deleted file mode 100644
index 05f1a70..0000000
--- a/user/test/com/google/gwt/validation/example/client/ExampleValidatorFactory.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.example.client;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.validation.client.GwtValidation;
-import com.google.gwt.validation.client.AbstractGwtValidatorFactory;
-import com.google.gwt.validation.client.impl.AbstractGwtValidator;
-
-import javax.validation.Validator;
-import javax.validation.groups.Default;
-
-/**
- * Factory to create the Validator specified by {@link GwtValidator}.
- *
- * GWT.create instances of this class
- */
-public class ExampleValidatorFactory extends AbstractGwtValidatorFactory {
-
- /**
- * Marks constraints that should run on the client.
- */
- public interface ClientGroup {
- }
-
- /**
- * Validator Interface annotated with the list of classes to validate on the
- * client.
- */
- @GwtValidation(
- value = {Author.class},
- groups = {Default.class, ClientGroup.class})
- public interface GwtValidator extends Validator {
- }
-
- /**
- * Marks constraints that should run on the server.
- */
- public interface ServerGroup {
- }
-
- @Override
- public AbstractGwtValidator createValidator() {
- return GWT.create(GwtValidator.class);
- }
-}
diff --git a/user/test/com/google/gwt/validation/example/client/FirstLevelCheck.java b/user/test/com/google/gwt/validation/example/client/FirstLevelCheck.java
deleted file mode 100644
index e560fee..0000000
--- a/user/test/com/google/gwt/validation/example/client/FirstLevelCheck.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.example.client;
-
-/**
- * A example group for validation.
- */
-public interface FirstLevelCheck {
-
-}
diff --git a/user/test/com/google/gwt/validation/example/client/NotEmpty.java b/user/test/com/google/gwt/validation/example/client/NotEmpty.java
deleted file mode 100644
index e21489c..0000000
--- a/user/test/com/google/gwt/validation/example/client/NotEmpty.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.example.client;
-
-import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
-import static java.lang.annotation.ElementType.CONSTRUCTOR;
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.validation.Constraint;
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
-import javax.validation.Payload;
-import javax.validation.ReportAsSingleViolation;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Size;
-
-/**
- * The annotated element size must at least 1 and cannot be null. From the JSR
- * 303 spec.
- */
-@Documented
-@NotNull
-@Size(min = 1)
-@ReportAsSingleViolation
-@Constraint(validatedBy = NotEmpty.NotEmptyValidator.class)
-@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER})
-@Retention(RUNTIME)
-public @interface NotEmpty {
- String message() default "{com.google.gwt.validation.example.client.NotEmpty.message}";
-
- Class<?>[] groups() default {};
-
- Class<? extends Payload>[] payload() default {};
-
- /**
- * From the JSR 303 spec.
- */
- @Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER})
- @Retention(RUNTIME)
- @Documented
- @interface List {
- NotEmpty[] value();
- }
- /**
- * Sample composite validator.
- */
- class NotEmptyValidator implements ConstraintValidator<NotEmpty, String> {
- public void initialize(NotEmpty constraintAnnotation) {
- }
-
- public boolean isValid(String value, ConstraintValidatorContext context) {
- return true;
- }
- }
-}
diff --git a/user/test/com/google/gwt/validation/rebind/GwtSpecificValidatorCreatorTest.java b/user/test/com/google/gwt/validation/rebind/GwtSpecificValidatorCreatorTest.java
deleted file mode 100644
index 7f735d4..0000000
--- a/user/test/com/google/gwt/validation/rebind/GwtSpecificValidatorCreatorTest.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.rebind;
-
-import static com.google.gwt.validation.rebind.GwtSpecificValidatorCreator.getValidatorForType;
-
-import com.google.gwt.thirdparty.guava.common.collect.ImmutableList;
-import com.google.gwt.thirdparty.guava.common.collect.ImmutableSet;
-import com.google.gwt.validation.client.constraints.SizeValidatorForCollection;
-import com.google.gwt.validation.client.constraints.SizeValidatorForString;
-
-import junit.framework.TestCase;
-
-import java.lang.annotation.Annotation;
-import java.util.List;
-import java.util.Set;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.constraints.Size;
-
-/**
- * NonGWT tests for {@link GwtSpecificValidatorCreator}.
- */
-public class GwtSpecificValidatorCreatorTest extends TestCase {
-
- private static Set<Class<? extends ConstraintValidator<? extends Annotation, ?>>> copyOf(
- Class<? extends ConstraintValidator<? extends Annotation, ?>>... classes) {
- return ImmutableSet.copyOf(classes);
- }
-
- ImmutableList<Class<? extends ConstraintValidator<Size, ?>>> sizeValidators = ImmutableList.<Class<? extends ConstraintValidator<Size, ?>>> of(
- SizeValidatorForCollection.class, SizeValidatorForString.class);
-
- @SuppressWarnings("unchecked")
- public void testGetValidatorForType_collection() throws Exception {
- ImmutableSet<Class<? extends ConstraintValidator<Size, ?>>> actual = getValidatorForType(
- List.class, sizeValidators);
- assertEquals(copyOf(SizeValidatorForCollection.class), actual);
- }
-
- @SuppressWarnings("unchecked")
- public void testGetValidatorForType_string() throws Exception {
- Class<String> target = String.class;
- ImmutableSet<Class<? extends ConstraintValidator<Size, ?>>> actual = getValidatorForType(
- target, sizeValidators);
- assertEquals(copyOf(SizeValidatorForString.class), actual);
- }
-}
diff --git a/user/test/com/google/gwt/validation/rebind/UtilTest.java b/user/test/com/google/gwt/validation/rebind/UtilTest.java
deleted file mode 100644
index 1e42976..0000000
--- a/user/test/com/google/gwt/validation/rebind/UtilTest.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.rebind;
-
-import static com.google.gwt.validation.rebind.Util.findBestMatches;
-
-import com.google.gwt.thirdparty.guava.common.base.Function;
-import com.google.gwt.thirdparty.guava.common.base.Functions;
-import com.google.gwt.thirdparty.guava.common.collect.ImmutableList;
-import com.google.gwt.thirdparty.guava.common.collect.ImmutableSet;
-import com.google.gwt.thirdparty.guava.common.collect.Iterables;
-
-import junit.framework.TestCase;
-
-import java.util.List;
-import java.util.Set;
-
-/**
- * Tests for {@link Util}.
- */
-public class UtilTest extends TestCase {
-
- private class Alice {
- }
-
- private class Bob {
- }
-
- private class Bobby extends Bob {
- }
- private class Bobby2 extends Bobby {
- }
-
- private interface C1 {
- }
-
- private interface C2 {
- }
-
- private class Chuck implements C1, C2 {
- }
-
- private final static Function<Class<?>, Class<?>> classIdentity = Functions.identity();
-
- private static void assertContentsInOrder(List<Class<?>> actual,
- Class<?>... classes) {
- assertEquals(ImmutableList.copyOf(classes), ImmutableList.copyOf(actual));
- }
-
- private static ImmutableList<Class<?>> list(Class<?>... classes) {
- return ImmutableList.copyOf(classes);
- }
-
- private static ImmutableSet<Class<?>> set(Class<?>... classes) {
- return ImmutableSet.copyOf(classes);
- }
-
- public void testBestMatches_Bobby2() {
- Set<Class<?>> actual = findBestMatches(Bobby2.class,
- set(Alice.class, Bob.class, Bobby.class));
- assertEquals(1, actual.size());
- assertEquals(Bobby.class, Iterables.get(actual, 0));
- }
-
- public void testBestMatches_none() {
- Set<Class<?>> actual = Util.findBestMatches(Bob.class, set(Alice.class));
- assertEquals(0, actual.size());
- }
-
- public void testBestMatches_one() {
- Set<Class<?>> actual = findBestMatches(Bob.class,
- set(Alice.class, Bob.class));
- assertEquals(1, actual.size());
- assertEquals(Bob.class, Iterables.get(actual, 0));
- }
-
- public void testBestMatches_two() {
- Set<Class<?>> actual = findBestMatches(Chuck.class, set(C1.class, C2.class));
- assertEquals(2, actual.size());
- }
-
- public void testSortMostSpecificFirst_chuck() {
-
- List<Class<?>> actual = Util.sortMostSpecificFirst(
- list(C2.class, C1.class, Chuck.class), classIdentity);
- assertContentsInOrder(actual, Chuck.class, C2.class, C1.class);
- }
-
- public void testSortMostSpecificFirst_double() {
- List<Class<?>> actual = Util.sortMostSpecificFirst(
- list(Alice.class, Alice.class, Bob.class), classIdentity);
- assertContentsInOrder(actual, Alice.class, Bob.class);
- }
-
- public void testSortMostSpecificFirst_one() {
- List<Class<?>> actual = Util.sortMostSpecificFirst(list(Alice.class),
- classIdentity);
- assertContentsInOrder(actual, Alice.class);
- }
-}
diff --git a/user/test/com/google/gwt/validation/tck/ConstraintApplicationGwtSuite.java b/user/test/com/google/gwt/validation/tck/ConstraintApplicationGwtSuite.java
deleted file mode 100644
index 56a7303..0000000
--- a/user/test/com/google/gwt/validation/tck/ConstraintApplicationGwtSuite.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.tck;
-
-
-import junit.framework.Test;
-
-import org.hibernate.jsr303.tck.tests.constraints.application.ValidationRequirementGwtTest;
-import org.hibernate.jsr303.tck.util.TckTestSuiteWrapper;
-
-/**
- * Tck Tests for the {@code constraints application} package.
- */
-public class ConstraintApplicationGwtSuite {
- public static Test suite() {
- TckTestSuiteWrapper suite = new TckTestSuiteWrapper(
- "TCK for GWT Validation, constraints application package");
- suite.addTestSuite(ValidationRequirementGwtTest.class);
- return suite;
- }
-}
diff --git a/user/test/com/google/gwt/validation/tck/ConstraintCompositionGwtSuite.java b/user/test/com/google/gwt/validation/tck/ConstraintCompositionGwtSuite.java
deleted file mode 100644
index 0a798ab..0000000
--- a/user/test/com/google/gwt/validation/tck/ConstraintCompositionGwtSuite.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.tck;
-
-
-import junit.framework.Test;
-
-import org.hibernate.jsr303.tck.tests.constraints.constraintcomposition.ConstraintCompositionCompileTest;
-import org.hibernate.jsr303.tck.tests.constraints.constraintcomposition.ConstraintCompositionGwtTest;
-import org.hibernate.jsr303.tck.util.TckTestSuiteWrapper;
-
-/**
- * Tck Tests for the {@code constraints composition} package.
- */
-public class ConstraintCompositionGwtSuite {
- public static Test suite() {
- TckTestSuiteWrapper suite = new TckTestSuiteWrapper(
- "TCK for GWT Validation, constraints composition package");
- suite.addTestSuite(ConstraintCompositionCompileTest.class);
- suite.addTestSuite(ConstraintCompositionGwtTest.class);
- return suite;
- }
-}
diff --git a/user/test/com/google/gwt/validation/tck/ConstraintsGroupsGwtSuite.java b/user/test/com/google/gwt/validation/tck/ConstraintsGroupsGwtSuite.java
deleted file mode 100644
index 70b5111..0000000
--- a/user/test/com/google/gwt/validation/tck/ConstraintsGroupsGwtSuite.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.tck;
-
-
-import junit.framework.Test;
-
-import org.hibernate.jsr303.tck.tests.constraints.groups.GroupGwtTest;
-import org.hibernate.jsr303.tck.util.TckTestSuiteWrapper;
-
-/**
- * Tck Tests for the {@code constraints groups} package.
- */
-public class ConstraintsGroupsGwtSuite {
- public static Test suite() {
- TckTestSuiteWrapper suite = new TckTestSuiteWrapper(
- "TCK for GWT Validation, constraints groups package");
- suite.addTestSuite(GroupGwtTest.class);
- return suite;
- }
-}
diff --git a/user/test/com/google/gwt/validation/tck/ConstraintsInheritanceGwtSuite.java b/user/test/com/google/gwt/validation/tck/ConstraintsInheritanceGwtSuite.java
deleted file mode 100644
index 9834fcc..0000000
--- a/user/test/com/google/gwt/validation/tck/ConstraintsInheritanceGwtSuite.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.tck;
-
-
-import junit.framework.Test;
-
-import org.hibernate.jsr303.tck.tests.constraints.inheritance.ConstraintInheritanceGwtTest;
-import org.hibernate.jsr303.tck.util.TckTestSuiteWrapper;
-
-/**
- * Tck Tests for the {@code constraints inheritance} package.
- */
-public class ConstraintsInheritanceGwtSuite {
- public static Test suite() {
- TckTestSuiteWrapper suite = new TckTestSuiteWrapper(
- "TCK for GWT Validation, constraints inheritance package");
- suite.addTestSuite(ConstraintInheritanceGwtTest.class);
- return suite;
- }
-}
diff --git a/user/test/com/google/gwt/validation/tck/CustomConstraintGwtSuite.java b/user/test/com/google/gwt/validation/tck/CustomConstraintGwtSuite.java
deleted file mode 100644
index 09beccb..0000000
--- a/user/test/com/google/gwt/validation/tck/CustomConstraintGwtSuite.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.tck;
-
-
-import junit.framework.Test;
-
-import org.hibernate.jsr303.tck.tests.constraints.customconstraint.CustomConstraintValidatorGwtTest;
-import org.hibernate.jsr303.tck.util.TckTestSuiteWrapper;
-
-/**
- * Tck Tests for the {@code constraints customconstraint} package.
- */
-public class CustomConstraintGwtSuite {
- public static Test suite() {
- TckTestSuiteWrapper suite = new TckTestSuiteWrapper(
- "TCK for GWT Validation, constraints customconstraint package");
- suite.addTestSuite(CustomConstraintValidatorGwtTest.class);
- return suite;
- }
-}
diff --git a/user/test/com/google/gwt/validation/tck/GraphNavigationGwtSuite.java b/user/test/com/google/gwt/validation/tck/GraphNavigationGwtSuite.java
deleted file mode 100644
index 8f16a7e..0000000
--- a/user/test/com/google/gwt/validation/tck/GraphNavigationGwtSuite.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.tck;
-
-import junit.framework.Test;
-
-import org.hibernate.jsr303.tck.tests.validation.graphnavigation.GraphNavigationGwtTest;
-import org.hibernate.jsr303.tck.util.TckTestSuiteWrapper;
-
-/**
- * Tck Tests for the {@code validation graphnavigation} package.
- */
-public class GraphNavigationGwtSuite {
- public static Test suite() {
- TckTestSuiteWrapper suite = new TckTestSuiteWrapper(
- "TCK for GWT Validation, validation graphnavigation package");
- suite.addTestSuite(GraphNavigationGwtTest.class);
- return suite;
- }
-}
diff --git a/user/test/com/google/gwt/validation/tck/MessageInterpolationGwtSuite.java b/user/test/com/google/gwt/validation/tck/MessageInterpolationGwtSuite.java
deleted file mode 100644
index ad5e4db..0000000
--- a/user/test/com/google/gwt/validation/tck/MessageInterpolationGwtSuite.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.tck;
-
-
-import junit.framework.Test;
-
-import org.hibernate.jsr303.tck.tests.messageinterpolation.MessageInterpolationGwtTest;
-import org.hibernate.jsr303.tck.util.TckTestSuiteWrapper;
-
-/**
- * Tck Tests for the {@code messageinterpolation} package.
- */
-public class MessageInterpolationGwtSuite {
- public static Test suite() {
- TckTestSuiteWrapper suite = new TckTestSuiteWrapper(
- "TCK for GWT Validation, messageinterpolation package");
- suite.addTestSuite(MessageInterpolationGwtTest.class);
- return suite;
- }
-}
diff --git a/user/test/com/google/gwt/validation/tck/MetadataGwtSuite.java b/user/test/com/google/gwt/validation/tck/MetadataGwtSuite.java
deleted file mode 100644
index 3a147fb..0000000
--- a/user/test/com/google/gwt/validation/tck/MetadataGwtSuite.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.tck;
-
-
-
-import junit.framework.Test;
-
-import org.hibernate.jsr303.tck.tests.metadata.BeanDescriptorGwtTest;
-import org.hibernate.jsr303.tck.tests.metadata.ConstraintDescriptorGwtTest;
-import org.hibernate.jsr303.tck.tests.metadata.ElementDescriptorGwtTest;
-import org.hibernate.jsr303.tck.tests.metadata.PropertyDescriptorGwtTest;
-import org.hibernate.jsr303.tck.util.TckTestSuiteWrapper;
-
-/**
- * Tck Tests for the {@code metadata} package.
- */
-public class MetadataGwtSuite {
- public static Test suite() {
- TckTestSuiteWrapper suite = new TckTestSuiteWrapper(
- "TCK for GWT Validation, metadata package");
- suite.addTestSuite(BeanDescriptorGwtTest.class);
- suite.addTestSuite(ConstraintDescriptorGwtTest.class);
- suite.addTestSuite(ElementDescriptorGwtTest.class);
- suite.addTestSuite(PropertyDescriptorGwtTest.class);
- return suite;
- }
-}
diff --git a/user/test/com/google/gwt/validation/tck/ValidationGwtSuite.java b/user/test/com/google/gwt/validation/tck/ValidationGwtSuite.java
deleted file mode 100644
index 702b97d..0000000
--- a/user/test/com/google/gwt/validation/tck/ValidationGwtSuite.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.tck;
-
-import junit.framework.Test;
-
-import org.hibernate.jsr303.tck.tests.validation.PropertyPathGwtTest;
-import org.hibernate.jsr303.tck.tests.validation.ValidateCompileTest;
-import org.hibernate.jsr303.tck.tests.validation.ValidateGwtTest;
-import org.hibernate.jsr303.tck.tests.validation.ValidatePropertyGwtTest;
-import org.hibernate.jsr303.tck.tests.validation.ValidateValueGwtTest;
-import org.hibernate.jsr303.tck.tests.validation.ValidationGwtTest;
-import org.hibernate.jsr303.tck.util.TckTestSuiteWrapper;
-
-/**
- * Tck Tests for the {@code validation} package.
- */
-public class ValidationGwtSuite {
- public static Test suite() {
- TckTestSuiteWrapper suite = new TckTestSuiteWrapper(
- "TCK for GWT Validation, validation package");
- suite.addTestSuite(PropertyPathGwtTest.class);
- suite.addTestSuite(ValidateGwtTest.class);
- suite.addTestSuite(ValidateCompileTest.class);
- suite.addTestSuite(ValidatePropertyGwtTest.class);
- suite.addTestSuite(ValidateValueGwtTest.class);
- suite.addTestSuite(ValidationGwtTest.class);
- return suite;
- }
-}
diff --git a/user/test/com/google/gwt/validation/tck/ValidatorFactoryGwtSuite.java b/user/test/com/google/gwt/validation/tck/ValidatorFactoryGwtSuite.java
deleted file mode 100644
index b9ff6d7..0000000
--- a/user/test/com/google/gwt/validation/tck/ValidatorFactoryGwtSuite.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.tck;
-
-
-
-import junit.framework.Test;
-
-import org.hibernate.jsr303.tck.tests.validatorfactory.CustomConstraintValidatorGwtTest;
-import org.hibernate.jsr303.tck.util.TckTestSuiteWrapper;
-
-/**
- * Tck Tests for the {@code validatorfactory} package.
- */
-public class ValidatorFactoryGwtSuite {
- public static Test suite() {
- TckTestSuiteWrapper suite = new TckTestSuiteWrapper(
- "TCK for GWT Validation, validatorfactory package");
- suite.addTestSuite(CustomConstraintValidatorGwtTest.class);
- return suite;
- }
-}
diff --git a/user/test/com/google/gwt/validation/tck/ValidatorResolutionGwtSuite.java b/user/test/com/google/gwt/validation/tck/ValidatorResolutionGwtSuite.java
deleted file mode 100644
index fb204fb..0000000
--- a/user/test/com/google/gwt/validation/tck/ValidatorResolutionGwtSuite.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.tck;
-
-
-import junit.framework.Test;
-
-import org.hibernate.jsr303.tck.tests.constraints.validatorresolution.ValidatorResolutionCompileTest;
-import org.hibernate.jsr303.tck.tests.constraints.validatorresolution.ValidatorResolutionGwtTest;
-import org.hibernate.jsr303.tck.util.TckTestSuiteWrapper;
-
-/**
- * Tck Tests for the {@code validator resolution} package.
- */
-public class ValidatorResolutionGwtSuite {
- public static Test suite() {
- TckTestSuiteWrapper suite = new TckTestSuiteWrapper(
- "TCK for GWT Validation, validator resolution package");
- suite.addTestSuite(ValidatorResolutionCompileTest.class);
- suite.addTestSuite(ValidatorResolutionGwtTest.class);
- return suite;
- }
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/AssertFalseValidatorTest.java b/user/test/com/google/gwt/validation/testing/constraints/AssertFalseValidatorTest.java
deleted file mode 100644
index 2774770..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/AssertFalseValidatorTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.AssertFalseValidator;
-
-import javax.validation.constraints.AssertFalse;
-
-/**
- * Tests for {@link AssertFalseValidator}.
- */
-public class AssertFalseValidatorTest extends
- ConstraintValidatorTestCase<AssertFalse, Boolean> {
-
- @SuppressWarnings("unused")
- @AssertFalse
- private Boolean defaultField;
-
- protected AssertFalseValidator createValidator() {
- return new AssertFalseValidator();
- }
-
- public void testIsValid_false() {
- Boolean value = Boolean.FALSE;
- boolean expected = true;
- assertConstraintValidator(value, expected);
- }
-
- public void testIsValid_true() {
- assertConstraintValidator(Boolean.TRUE, false);
- }
-
- @Override
- protected Class<AssertFalse> getAnnotationClass() {
- return AssertFalse.class;
- }
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/AssertTrueValidatorTest.java b/user/test/com/google/gwt/validation/testing/constraints/AssertTrueValidatorTest.java
deleted file mode 100644
index a09624e..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/AssertTrueValidatorTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.AssertTrueValidator;
-
-import javax.validation.constraints.AssertTrue;
-
-/**
- * Tests for {@link AssertTrueValidator}.
- */
-public class AssertTrueValidatorTest extends
- ConstraintValidatorTestCase<AssertTrue, Boolean> {
-
- @SuppressWarnings("unused")
- @AssertTrue
- private Boolean defaultField;
-
- @Override
- protected AssertTrueValidator createValidator() {
- return new AssertTrueValidator();
- }
-
- public void testIsValid_false() {
- assertConstraintValidator(Boolean.FALSE, false);
- }
-
- public void testIsValid_true() {
- assertConstraintValidator(Boolean.TRUE, true);
- }
-
- @Override
- protected Class<AssertTrue> getAnnotationClass() {
- return AssertTrue.class;
- }
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/ConstraintValidatorTestCase.java b/user/test/com/google/gwt/validation/testing/constraints/ConstraintValidatorTestCase.java
deleted file mode 100644
index 7ad37ee..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/ConstraintValidatorTestCase.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import junit.framework.TestCase;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
-
-/**
- * TestCase for {@link javax.validation.ConstraintValidator}s.
- * <p>
- * Subclasses must :
- * <ul>
- * <li>implement {@link #getAnnotationClass()}</li>
- * <li>implement {@link #createValidator()}.</li>
- * <li>define a field called <code>defaultField</code> and annotate it with the
- * constraint Annotation under test</li>
- * </ul>
- *
- * <p>
- * If additional instances of the annotation need to be tested you can get there
- * value with {@link #getAnnotation(Class, Class, String)}
- *
- * @param <A> The constraint Annotation of the ConstraintValidator under test
- * @param <T> The bean type of the ConstraintValidator under test
- */
-public abstract class ConstraintValidatorTestCase<A extends Annotation, T>
- extends TestCase {
-
- public final static String DEFAULT_ANNOTATED_FIELD_NAME = "defaultField";
-
- // Validators are reusable but not thread safe
- protected final ConstraintValidator<A, T> validator = createValidator();
-
- // private ConstraintValidatorContext context;
-
- public ConstraintValidatorTestCase() {
- super();
- }
-
- /**
- * All constraints except {@link NotNull} should return true for a null value.
- */
- public final void testIsValid_null() {
- ConstraintValidatorTestCase.assertConstraintValidator(validator,
- getDefaultAnnotation(), null, null, isNullValid());
- }
-
- /**
- * Override this if a null value should not be valid. This is called by
- * {@link #testIsValid_null()}
- */
- protected boolean isNullValid() {
- return true;
- }
-
- /**
- * Get the annotation of type {@link #getAnnotationClass()} on the field named
- * <code>defaultField</code>.
- */
- protected final A getDefaultAnnotation() {
- return getAnnotation(getAnnotationClass(), this.getClass(),
- DEFAULT_ANNOTATED_FIELD_NAME);
- }
-
- protected abstract Class<A> getAnnotationClass();
-
- protected A getAnnotation(Class<A> annotationClass, Class<?> objectClass,
- String fieldName) {
-
- for (Field field : objectClass.getDeclaredFields()) {
- if (field.getName().equals(fieldName)) {
- A annotation = field.getAnnotation(annotationClass);
- if (annotation == null) {
- throw new IllegalArgumentException(objectClass + "." + fieldName
- + " is not annotated with " + annotationClass);
- }
- return annotation;
- }
- }
- throw new IllegalArgumentException(objectClass
- + " does not have a field called " + fieldName);
- }
-
- protected abstract ConstraintValidator<A, T> createValidator();
-
- /**
- * Assert result of validating <code>value</code> with <code>validator</code>
- * initialized with the annotation of the <code>defaultField</code>.
- *
- * @param value the Value to validate
- * @param expected the expected result of a calling <code>isValid</code>
- */
- protected void assertConstraintValidator(T value, boolean expected) {
- assertConstraintValidator(validator, getDefaultAnnotation(), null, value,
- expected);
- }
-
- /**
- * Asserts the validity of a value using the given validator, annotation, and
- * context.
- *
- * @param <T> object type
- * @param <A> the constraint annotation type
- * @param validator the {@link ConstraintValidator} to test
- * @param annotation the constraint annotation to initialize the validator.
- * @param context The context for the validator
- * @param value the value to validate.
- * @param expected the expected result
- */
- public static <T, A extends Annotation> void assertConstraintValidator(
- ConstraintValidator<A, T> validator, A annotation,
- ConstraintValidatorContext context, T value, boolean expected) {
- validator.initialize(annotation);
- String message = validator.getClass().getName() + "(" + annotation
- + ").isValid(" + value + ", " + context + ")";
- assertEquals(message, expected, validator.isValid(value, context));
- }
-
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/DecimalMaxValidatorForNumberTest.java b/user/test/com/google/gwt/validation/testing/constraints/DecimalMaxValidatorForNumberTest.java
deleted file mode 100644
index f39674f..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/DecimalMaxValidatorForNumberTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.DecimalMaxValidatorForNumber;
-
-import javax.validation.constraints.DecimalMax;
-
-/**
- * Tests for {@link DecimalMaxValidatorForNumber}.
- */
-public class DecimalMaxValidatorForNumberTest extends
- ConstraintValidatorTestCase<DecimalMax, Number> {
- private static Double BELOW = Double.valueOf(922392239223.08);
- private static Double SAME = Double.valueOf(922392239223.09);
- private static Double ABOVE = Double.valueOf(922392239223.10);
-
- @SuppressWarnings("unused")
- @DecimalMax("922392239223.09")
- private double defaultField;
-
- protected DecimalMaxValidatorForNumber createValidator() {
- return new DecimalMaxValidatorForNumber();
- }
-
- public void testIsValid_below() {
- assertConstraintValidator(BELOW, true);
- }
-
- public void testIsValid_same() {
- assertConstraintValidator(SAME, true);
- }
-
- public void testIsValid_above() {
- assertConstraintValidator(ABOVE, false);
- }
-
- @Override
- protected Class<DecimalMax> getAnnotationClass() {
- return DecimalMax.class;
- }
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/DecimalMaxValidatorForStringTest.java b/user/test/com/google/gwt/validation/testing/constraints/DecimalMaxValidatorForStringTest.java
deleted file mode 100644
index 15c69a5..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/DecimalMaxValidatorForStringTest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.DecimalMaxValidatorForString;
-
-import javax.validation.constraints.DecimalMax;
-
-/**
- * Tests for {@link DecimalMaxValidatorForString}.
- */
-public class DecimalMaxValidatorForStringTest extends
- ConstraintValidatorTestCase<DecimalMax, String> {
- private static String BELOW = "922392239223.08";
- private static String SAME = "922392239223.09";
- private static String ABOVE = "922392239223.10";
-
- @SuppressWarnings("unused")
- @DecimalMax("922392239223.09")
- private String defaultField;
-
- protected DecimalMaxValidatorForString createValidator() {
- return new DecimalMaxValidatorForString();
- }
-
- public void testIsValid_below() {
- assertConstraintValidator(BELOW, true);
- }
-
- public void testIsValid_same() {
- assertConstraintValidator(SAME, true);
- }
-
- public void testIsValid_above() {
- assertConstraintValidator(ABOVE, false);
- }
-
- public void testIsValid_invalid() {
- assertConstraintValidator("invalid", false);
- }
-
- @Override
- protected Class<DecimalMax> getAnnotationClass() {
- return DecimalMax.class;
- }
-
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/DecimalMinValidatorForNumberTest.java b/user/test/com/google/gwt/validation/testing/constraints/DecimalMinValidatorForNumberTest.java
deleted file mode 100644
index 8c66325..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/DecimalMinValidatorForNumberTest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.DecimalMinValidatorForNumber;
-
-import javax.validation.constraints.DecimalMin;
-
-/**
- * Tests for {@link DecimalMinValidatorForNumber}.
- */
-public class DecimalMinValidatorForNumberTest extends
- ConstraintValidatorTestCase<DecimalMin, Number> {
- private static Double BELOW = Double.valueOf(922392239223.08);
- private static Double ABOVE = Double.valueOf(922392239223.10);
-
- @SuppressWarnings("unused")
- @DecimalMin("922392239223.09")
- private double defaultField;
-
- protected DecimalMinValidatorForNumber createValidator() {
- return new DecimalMinValidatorForNumber();
- }
-
- public void testIsValid_below() {
- assertConstraintValidator(BELOW, false);
- }
-
- // Because of rounding error we can't actually test for the exact vale
-
- public void testIsValid_above() {
- assertConstraintValidator(ABOVE, true);
- }
-
- @Override
- protected Class<DecimalMin> getAnnotationClass() {
- return DecimalMin.class;
- }
-
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/DecimalMinValidatorForStringTest.java b/user/test/com/google/gwt/validation/testing/constraints/DecimalMinValidatorForStringTest.java
deleted file mode 100644
index ea733b6..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/DecimalMinValidatorForStringTest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.DecimalMinValidatorForString;
-
-import javax.validation.constraints.DecimalMin;
-
-/**
- * Tests for {@link DecimalMinValidatorForString}.
- */
-public class DecimalMinValidatorForStringTest extends
- ConstraintValidatorTestCase<DecimalMin, String> {
- private static String BELOW = "922392239223.08";
- private static String SAME = "922392239223.09";
- private static String ABOVE = "922392239223.10";
-
- @SuppressWarnings("unused")
- @DecimalMin("922392239223.09")
- private double defaultField;
-
- protected DecimalMinValidatorForString createValidator() {
- return new DecimalMinValidatorForString();
- }
-
- public void testIsValid_below() {
- assertConstraintValidator(BELOW, false);
- }
-
- public void testIsValid_same() {
- assertConstraintValidator(SAME, true);
- }
-
- public void testIsValid_above() {
- assertConstraintValidator(ABOVE, true);
- }
-
- public void testIsValid_invalid() {
- assertConstraintValidator("invalid", false);
- }
-
- @Override
- protected Class<DecimalMin> getAnnotationClass() {
- return DecimalMin.class;
- }
-
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/DigitsValidatorForNumberTest.java b/user/test/com/google/gwt/validation/testing/constraints/DigitsValidatorForNumberTest.java
deleted file mode 100644
index fffbc38..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/DigitsValidatorForNumberTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.DigitsValidatorForNumber;
-
-import java.math.BigDecimal;
-
-import javax.validation.constraints.Digits;
-
-/**
- * Tests for {@link DigitsValidatorForNumber}.
- */
-public class DigitsValidatorForNumberTest extends
- ConstraintValidatorTestCase<Digits, Number> {
-
- private static BigDecimal GOOD = new BigDecimal("1234.12");
- private static BigDecimal INT_TO_BIG = new BigDecimal("12345.12");
- private static BigDecimal INT_SMALL = new BigDecimal("123.12");
- private static BigDecimal DECIMAL_TO_BIG = new BigDecimal("1234.123");
- private static BigDecimal DECIMAL_SMALL = new BigDecimal("1234.1");
-
- @SuppressWarnings("unused")
- @Digits(integer = 4, fraction = 2)
- private double defaultField;
-
- protected DigitsValidatorForNumber createValidator() {
- return new DigitsValidatorForNumber();
- }
-
- public void testIsValid_decimalToBig() {
- assertConstraintValidator(DECIMAL_SMALL, true);
- }
-
- public void testIsValid_decimalToSmall() {
- assertConstraintValidator(DECIMAL_TO_BIG, false);
- }
-
- public void testIsValid_good() {
- assertConstraintValidator(GOOD, true);
- }
-
- public void testIsValid_intToBig() {
- assertConstraintValidator(INT_TO_BIG, false);
- }
-
- public void testIsValid_intToSmall() {
- assertConstraintValidator(INT_SMALL, true);
- }
-
- @Override
- protected Class<Digits> getAnnotationClass() {
- return Digits.class;
- }
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/DigitsValidatorForStringTest.java b/user/test/com/google/gwt/validation/testing/constraints/DigitsValidatorForStringTest.java
deleted file mode 100644
index 7fca0bf..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/DigitsValidatorForStringTest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.DigitsValidatorForString;
-
-import javax.validation.constraints.Digits;
-
-/**
- * Tests for {@link DigitsValidatorForString}.
- */
-public class DigitsValidatorForStringTest extends
- ConstraintValidatorTestCase<Digits, String> {
-
- private static String GOOD = "1234.12";
- private static String INT_TO_BIG = "12345.12";
- private static String INT_SMALL = "123.12";
- private static String DECIMAL_TO_BIG = "1234.123";
- private static String DECIMAL_SMALL = "1234.1";
-
- @SuppressWarnings("unused")
- @Digits(integer = 4, fraction = 2)
- private double defaultField;
-
- protected DigitsValidatorForString createValidator() {
- return new DigitsValidatorForString();
- }
-
- public void testIsValid_decimalToBig() {
- assertConstraintValidator(DECIMAL_SMALL, true);
- }
-
- public void testIsValid_decimalToSmall() {
- assertConstraintValidator(DECIMAL_TO_BIG, false);
- }
-
- public void testIsValid_good() {
- assertConstraintValidator(GOOD, true);
- }
-
- public void testIsValid_intToBig() {
- assertConstraintValidator(INT_TO_BIG, false);
- }
-
- public void testIsValid_intToSmall() {
- assertConstraintValidator(INT_SMALL, true);
- }
-
- public void testIsValid_invalid() {
- assertConstraintValidator("invalid", false);
- }
-
- @Override
- protected Class<Digits> getAnnotationClass() {
- return Digits.class;
- }
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/FutureValidatorForDateTest.java b/user/test/com/google/gwt/validation/testing/constraints/FutureValidatorForDateTest.java
deleted file mode 100644
index 65c03e7..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/FutureValidatorForDateTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.FutureValidatorForDate;
-
-import java.util.Date;
-
-import javax.validation.constraints.Future;
-
-/**
- * Tests for {@link FutureValidatorForDate}.
- */
-public class FutureValidatorForDateTest extends
- ConstraintValidatorTestCase<Future, Date> {
-
- @SuppressWarnings("unused")
- @Future
- private Date defaultField;
-
- protected FutureValidatorForDate createValidator() {
- return new FutureValidatorForDate();
- }
-
- public void testAssertIsValid_nowMinus1000() {
- assertConstraintValidator(new Date(new Date().getTime() - 1000), false);
- }
-
- public void testAssertIsValid_nowPlus1000() {
- assertConstraintValidator(new Date(new Date().getTime() + 1000), true);
- }
-
- @Override
- protected Class<Future> getAnnotationClass() {
- return Future.class;
- }
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/MaxValidatorForNumberTest.java b/user/test/com/google/gwt/validation/testing/constraints/MaxValidatorForNumberTest.java
deleted file mode 100644
index 25a3f99..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/MaxValidatorForNumberTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.MaxValidatorForNumber;
-
-import javax.validation.constraints.Max;
-
-/**
- * Tests for {@link MaxValidatorForNumber}.
- */
-public class MaxValidatorForNumberTest extends
- ConstraintValidatorTestCase<Max, Number> {
- private static long SAME = 123456789L;
- private static long SMALLER = SAME - 1L;
- private static long BIGGER = SAME + 1L;
-
- @Max(123456789L)
- public long defaultField;
-
- public void testIsValid_same() {
- assertConstraintValidator(Long.valueOf(SAME), true);
- }
-
- public void testIsValid_smaller() {
- assertConstraintValidator(Long.valueOf(SMALLER), true);
- }
-
- public void testIsValid_bigger() {
- assertConstraintValidator(Long.valueOf(BIGGER), false);
- }
-
- public void testIsValid_minValue() {
- assertConstraintValidator(Long.valueOf(Long.MIN_VALUE), true);
- }
-
- public void testIsValid_maxValue() {
- assertConstraintValidator(Long.valueOf(Long.MAX_VALUE), false);
- }
-
- @Override
- protected MaxValidatorForNumber createValidator() {
- return new MaxValidatorForNumber();
- }
-
- @Override
- protected Class<Max> getAnnotationClass() {
- return Max.class;
- }
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/MaxValidatorForStringTest.java b/user/test/com/google/gwt/validation/testing/constraints/MaxValidatorForStringTest.java
deleted file mode 100644
index cabdc19..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/MaxValidatorForStringTest.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.MaxValidatorForString;
-
-import javax.validation.constraints.Max;
-
-/**
- * Tests for {@link MaxValidatorForString}.
- */
-public class MaxValidatorForStringTest extends
- ConstraintValidatorTestCase<Max, String> {
- private static String SAME = "123456789";
- private static String SMALLER = "123456788";
- private static String BIGGER = "123456790";
-
- @Max(123456789)
- public String defaultField;
-
- public void testIsValid_same() {
- assertConstraintValidator(SAME, true);
- }
-
- public void testIsValid_smaller() {
- assertConstraintValidator(SMALLER, true);
- }
-
- public void testIsValid_bigger() {
- assertConstraintValidator(BIGGER, false);
- }
-
- public void testIsValid_minValue() {
- assertConstraintValidator(Long.valueOf(Long.MIN_VALUE).toString(), true);
- }
-
- public void testIsValid_maxValue() {
- assertConstraintValidator(Long.valueOf(Long.MAX_VALUE).toString(), false);
- }
-
- public void testIsValid_invalid() {
- assertConstraintValidator("invalid", false);
- }
-
- @Override
- protected MaxValidatorForString createValidator() {
- return new MaxValidatorForString();
- }
-
- @Override
- protected Class<Max> getAnnotationClass() {
- return Max.class;
- }
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/MinValidatorForNumberTest.java b/user/test/com/google/gwt/validation/testing/constraints/MinValidatorForNumberTest.java
deleted file mode 100644
index e1aad5e..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/MinValidatorForNumberTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.MinValidatorForNumber;
-
-import javax.validation.constraints.Min;
-
-/**
- * Tests for {@link MinValidatorForNumber}.
- */
-public class MinValidatorForNumberTest extends
- ConstraintValidatorTestCase<Min, Number> {
- private static long SAME = 123456789L;
- private static long SMALLER = SAME - 1L;
- private static long BIGGER = SAME + 1L;
-
- @Min(123456789L)
- public long defaultField;
-
- public void testIsValid_same() {
- assertConstraintValidator(Long.valueOf(SAME), true);
- }
-
- public void testIsValid_smaller() {
- assertConstraintValidator(Long.valueOf(SMALLER), false);
- }
-
- public void testIsValid_bigger() {
- assertConstraintValidator(Long.valueOf(BIGGER), true);
- }
-
- public void testIsValid_minValue() {
- assertConstraintValidator(Long.valueOf(Long.MIN_VALUE), false);
- }
-
- public void testIsValid_maxValue() {
- assertConstraintValidator(Long.valueOf(Long.MAX_VALUE), true);
- }
-
- @Override
- protected MinValidatorForNumber createValidator() {
- return new MinValidatorForNumber();
- }
-
- @Override
- protected Class<Min> getAnnotationClass() {
- return Min.class;
- }
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/MinValidatorForStringTest.java b/user/test/com/google/gwt/validation/testing/constraints/MinValidatorForStringTest.java
deleted file mode 100644
index 0a6c091..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/MinValidatorForStringTest.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.MinValidatorForString;
-
-import javax.validation.constraints.Min;
-
-/**
- * Tests for {@link MinValidatorForString}.
- */
-public class MinValidatorForStringTest extends
- ConstraintValidatorTestCase<Min, String> {
- private static String SAME = "123456789";
- private static String SMALLER = "123456788";
- private static String BIGGER = "123456790";
-
- @Min(123456789)
- public String defaultField;
-
- public void testIsValid_same() {
- assertConstraintValidator(SAME, true);
- }
-
- public void testIsValid_smaller() {
- assertConstraintValidator(SMALLER, false);
- }
-
- public void testIsValid_bigger() {
- assertConstraintValidator(BIGGER, true);
- }
-
- public void testIsValid_minValue() {
- assertConstraintValidator(Long.valueOf(Long.MIN_VALUE).toString(), false);
- }
-
- public void testIsValid_maxValue() {
- assertConstraintValidator(Long.valueOf(Long.MAX_VALUE).toString(), true);
- }
-
- public void testIsValid_invalid() {
- assertConstraintValidator("invalid", false);
- }
-
- @Override
- protected MinValidatorForString createValidator() {
- return new MinValidatorForString();
- }
-
- @Override
- protected Class<Min> getAnnotationClass() {
- return Min.class;
- }
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/NotNullValidatorTest.java b/user/test/com/google/gwt/validation/testing/constraints/NotNullValidatorTest.java
deleted file mode 100644
index 4a11f40..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/NotNullValidatorTest.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.NotNullValidator;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.constraints.NotNull;
-
-/**
- * Tests for {@link NotNullValidator}.
- */
-public class NotNullValidatorTest extends
- ConstraintValidatorTestCase<NotNull, Object> {
-
- @SuppressWarnings("unused")
- @NotNull
- private String defaultField;
-
- public void testIsValid_notNull() {
- ConstraintValidatorTestCase.assertConstraintValidator(validator,
- getDefaultAnnotation(), null, new Object(), true);
- }
-
- @Override
- protected boolean isNullValid() {
- return false;
- }
-
- @Override
- protected Class<NotNull> getAnnotationClass() {
- return NotNull.class;
- }
-
- @Override
- protected ConstraintValidator<NotNull, Object> createValidator() {
- return new NotNullValidator();
- }
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/NullValidatorTest.java b/user/test/com/google/gwt/validation/testing/constraints/NullValidatorTest.java
deleted file mode 100644
index 5c17697..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/NullValidatorTest.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.NullValidator;
-
-import javax.validation.constraints.Null;
-
-/**
- * Tests for {@link NullValidator}.
- */
-public class NullValidatorTest extends
- ConstraintValidatorTestCase<Null, Object> {
-
- @SuppressWarnings("unused")
- @Null
- private Object defaultField;
-
- protected NullValidator createValidator() {
- return new NullValidator();
- }
-
- public void testIsValid_notNull() {
- assertConstraintValidator("this is not null", false);
- }
-
- @Override
- protected Class<Null> getAnnotationClass() {
- return Null.class;
- }
-
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/PastValidatorForDateTest.java b/user/test/com/google/gwt/validation/testing/constraints/PastValidatorForDateTest.java
deleted file mode 100644
index a791372..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/PastValidatorForDateTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.PastValidatorForDate;
-
-import java.util.Date;
-
-import javax.validation.constraints.Past;
-
-/**
- * Tests for {@link PastValidatorForDate}.
- */
-public class PastValidatorForDateTest extends
- ConstraintValidatorTestCase<Past, Date> {
-
- @SuppressWarnings("unused")
- @Past
- private Date defaultField;
-
- protected PastValidatorForDate createValidator() {
- return new PastValidatorForDate();
- }
-
- public void testAssertIsValid_nowMinus1000() {
- assertConstraintValidator(new Date(new Date().getTime() - 1000), true);
- }
-
- public void testAssertIsValid_nowPlus1000() {
- assertConstraintValidator(new Date(new Date().getTime() + 1000), false);
- }
-
- @Override
- protected Class<Past> getAnnotationClass() {
- return Past.class;
- }
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/PatternValidatorTest.java b/user/test/com/google/gwt/validation/testing/constraints/PatternValidatorTest.java
deleted file mode 100644
index 727e04e..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/PatternValidatorTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.PatternValidator;
-
-import java.util.Date;
-
-import javax.validation.constraints.Pattern;
-
-/**
- * Tests for {@link PatternValidator}.
- */
-public class PatternValidatorTest extends
- ConstraintValidatorTestCase<Pattern, String> {
-
- @SuppressWarnings("unused")
- @Pattern(regexp = "g..d")
- private Date defaultField;
-
- public void testAssertIsValid_goad() {
- assertConstraintValidator("goad", true);
- }
-
- public void testAssertIsValid_good() {
- assertConstraintValidator("good", true);
- }
-
- public void testAssertIsValid_goood() {
- assertConstraintValidator("goood", false);
- }
-
- public void testAssertIsValid_not_good() {
- assertConstraintValidator("this is not good", false);
- }
-
- protected PatternValidator createValidator() {
- return new PatternValidator();
- }
-
- @Override
- protected Class<Pattern> getAnnotationClass() {
- return Pattern.class;
- }
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfBooleanTest.java b/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfBooleanTest.java
deleted file mode 100644
index 598c4aa..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfBooleanTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.SizeValidatorForArrayOfBoolean;
-
-import java.util.Date;
-
-import javax.validation.constraints.Size;
-
-/**
- * Tests for {@link SizeValidatorForArrayOfBoolean}.
- */
-public class SizeValidatorForArrayOfBooleanTest extends
- ConstraintValidatorTestCase<Size, boolean[]> {
-
- @SuppressWarnings("unused")
- @Size(min = 2, max = 5)
- private Date defaultField;
-
- protected SizeValidatorForArrayOfBoolean createValidator() {
- return new SizeValidatorForArrayOfBoolean();
- }
-
- public void testAssertIsValid_short() {
- assertConstraintValidator(createArray(1), false);
- }
-
- public void testAssertIsValid_min() {
- assertConstraintValidator(createArray(2), true);
- }
-
- public void testAssertIsValid_max() {
- assertConstraintValidator(createArray(5), true);
- }
-
- public void testAssertIsValid_long() {
- assertConstraintValidator(createArray(6), false);
- }
-
- private boolean[] createArray(int size) {
- boolean[] array = new boolean[size];
- for (int i = 0; i < size; i++) {
- array[i] = (i % 2 == 0);
- }
- return array;
- }
-
- @Override
- protected Class<Size> getAnnotationClass() {
- return Size.class;
- }
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfByteTest.java b/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfByteTest.java
deleted file mode 100644
index b893b49..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfByteTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.SizeValidatorForArrayOfByte;
-
-import java.util.Date;
-
-import javax.validation.constraints.Size;
-
-/**
- * Tests for {@link SizeValidatorForArrayOfByte}.
- */
-public class SizeValidatorForArrayOfByteTest extends
- ConstraintValidatorTestCase<Size, byte[]> {
-
- @SuppressWarnings("unused")
- @Size(min = 2, max = 5)
- private Date defaultField;
-
- protected SizeValidatorForArrayOfByte createValidator() {
- return new SizeValidatorForArrayOfByte();
- }
-
- public void testAssertIsValid_short() {
- assertConstraintValidator(createArray(1), false);
- }
-
- public void testAssertIsValid_min() {
- assertConstraintValidator(createArray(2), true);
- }
-
- public void testAssertIsValid_max() {
- assertConstraintValidator(createArray(5), true);
- }
-
- public void testAssertIsValid_long() {
- assertConstraintValidator(createArray(6), false);
- }
-
- private byte[] createArray(int size) {
- byte[] array = new byte[size];
- for (int i = 0; i < size; i++) {
- array[i] = (byte) i;
- }
- return array;
- }
-
- @Override
- protected Class<Size> getAnnotationClass() {
- return Size.class;
- }
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfCharTest.java b/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfCharTest.java
deleted file mode 100644
index febd2e1..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfCharTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.SizeValidatorForArrayOfChar;
-
-import java.util.Date;
-
-import javax.validation.constraints.Size;
-
-/**
- * Tests for {@link SizeValidatorForArrayOfChar}.
- */
-public class SizeValidatorForArrayOfCharTest extends
- ConstraintValidatorTestCase<Size, char[]> {
-
- @SuppressWarnings("unused")
- @Size(min = 2, max = 5)
- private Date defaultField;
-
- protected SizeValidatorForArrayOfChar createValidator() {
- return new SizeValidatorForArrayOfChar();
- }
-
- public void testAssertIsValid_short() {
- assertConstraintValidator(createArray(1), false);
- }
-
- public void testAssertIsValid_min() {
- assertConstraintValidator(createArray(2), true);
- }
-
- public void testAssertIsValid_max() {
- assertConstraintValidator(createArray(5), true);
- }
-
- public void testAssertIsValid_long() {
- assertConstraintValidator(createArray(6), false);
- }
-
- private char[] createArray(int size) {
- char[] array = new char[size];
- for (int i = 0; i < size; i++) {
- array[i] = (char) i;
- }
- return array;
- }
-
- @Override
- protected Class<Size> getAnnotationClass() {
- return Size.class;
- }
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfDoubleTest.java b/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfDoubleTest.java
deleted file mode 100644
index d558396..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfDoubleTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.SizeValidatorForArrayOfDouble;
-
-import java.util.Date;
-
-import javax.validation.constraints.Size;
-
-/**
- * Tests for {@link SizeValidatorForArrayOfDouble}.
- */
-public class SizeValidatorForArrayOfDoubleTest extends
- ConstraintValidatorTestCase<Size, double[]> {
-
- @SuppressWarnings("unused")
- @Size(min = 2, max = 5)
- private Date defaultField;
-
- protected SizeValidatorForArrayOfDouble createValidator() {
- return new SizeValidatorForArrayOfDouble();
- }
-
- public void testAssertIsValid_short() {
- assertConstraintValidator(createArray(1), false);
- }
-
- public void testAssertIsValid_min() {
- assertConstraintValidator(createArray(2), true);
- }
-
- public void testAssertIsValid_max() {
- assertConstraintValidator(createArray(5), true);
- }
-
- public void testAssertIsValid_long() {
- assertConstraintValidator(createArray(6), false);
- }
-
- private double[] createArray(int size) {
- double[] array = new double[size];
- for (int i = 0; i < size; i++) {
- array[i] = i;
- }
- return array;
- }
-
- @Override
- protected Class<Size> getAnnotationClass() {
- return Size.class;
- }
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfFloatTest.java b/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfFloatTest.java
deleted file mode 100644
index 0d7aca2..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfFloatTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.SizeValidatorForArrayOfFloat;
-
-import java.util.Date;
-
-import javax.validation.constraints.Size;
-
-/**
- * Tests for {@link SizeValidatorForArrayOfFloat}.
- */
-public class SizeValidatorForArrayOfFloatTest extends
- ConstraintValidatorTestCase<Size, float[]> {
-
- @SuppressWarnings("unused")
- @Size(min = 2, max = 5)
- private Date defaultField;
-
- protected SizeValidatorForArrayOfFloat createValidator() {
- return new SizeValidatorForArrayOfFloat();
- }
-
- public void testAssertIsValid_short() {
- assertConstraintValidator(createArray(1), false);
- }
-
- public void testAssertIsValid_min() {
- assertConstraintValidator(createArray(2), true);
- }
-
- public void testAssertIsValid_max() {
- assertConstraintValidator(createArray(5), true);
- }
-
- public void testAssertIsValid_long() {
- assertConstraintValidator(createArray(6), false);
- }
-
- private float[] createArray(int size) {
- float[] array = new float[size];
- for (int i = 0; i < size; i++) {
- array[i] = i;
- }
- return array;
- }
-
- @Override
- protected Class<Size> getAnnotationClass() {
- return Size.class;
- }
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfIntTest.java b/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfIntTest.java
deleted file mode 100644
index 5b44f0c..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfIntTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.SizeValidatorForArrayOfInt;
-
-import java.util.Date;
-
-import javax.validation.constraints.Size;
-
-/**
- * Tests for {@link SizeValidatorForArrayOfInt}.
- */
-public class SizeValidatorForArrayOfIntTest extends
- ConstraintValidatorTestCase<Size, int[]> {
-
- @SuppressWarnings("unused")
- @Size(min = 2, max = 5)
- private Date defaultField;
-
- protected SizeValidatorForArrayOfInt createValidator() {
- return new SizeValidatorForArrayOfInt();
- }
-
- public void testAssertIsValid_short() {
- assertConstraintValidator(createArray(1), false);
- }
-
- public void testAssertIsValid_min() {
- assertConstraintValidator(createArray(2), true);
- }
-
- public void testAssertIsValid_max() {
- assertConstraintValidator(createArray(5), true);
- }
-
- public void testAssertIsValid_long() {
- assertConstraintValidator(createArray(6), false);
- }
-
- private int[] createArray(int size) {
- int[] array = new int[size];
- for (int i = 0; i < size; i++) {
- array[i] = i;
- }
- return array;
- }
-
- @Override
- protected Class<Size> getAnnotationClass() {
- return Size.class;
- }
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfLongTest.java b/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfLongTest.java
deleted file mode 100644
index 440befc..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfLongTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.SizeValidatorForArrayOfLong;
-
-import java.util.Date;
-
-import javax.validation.constraints.Size;
-
-/**
- * Tests for {@link SizeValidatorForArrayOfLong}.
- */
-public class SizeValidatorForArrayOfLongTest extends
- ConstraintValidatorTestCase<Size, long[]> {
-
- @SuppressWarnings("unused")
- @Size(min = 2, max = 5)
- private Date defaultField;
-
- protected SizeValidatorForArrayOfLong createValidator() {
- return new SizeValidatorForArrayOfLong();
- }
-
- public void testAssertIsValid_short() {
- assertConstraintValidator(createArray(1), false);
- }
-
- public void testAssertIsValid_min() {
- assertConstraintValidator(createArray(2), true);
- }
-
- public void testAssertIsValid_max() {
- assertConstraintValidator(createArray(5), true);
- }
-
- public void testAssertIsValid_long() {
- assertConstraintValidator(createArray(6), false);
- }
-
- private long[] createArray(int size) {
- long[] array = new long[size];
- for (int i = 0; i < size; i++) {
- array[i] = i;
- }
- return array;
- }
-
- @Override
- protected Class<Size> getAnnotationClass() {
- return Size.class;
- }
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfObjectTest.java b/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfObjectTest.java
deleted file mode 100644
index a93b307..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfObjectTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.SizeValidatorForArrayOfObject;
-
-import java.util.Date;
-
-import javax.validation.constraints.Size;
-
-/**
- * Tests for {@link SizeValidatorForArrayOfObject}.
- */
-public class SizeValidatorForArrayOfObjectTest extends
- ConstraintValidatorTestCase<Size, Object[]> {
-
- @SuppressWarnings("unused")
- @Size(min = 2, max = 5)
- private Date defaultField;
-
- protected SizeValidatorForArrayOfObject createValidator() {
- return new SizeValidatorForArrayOfObject();
- }
-
- public void testAssertIsValid_short() {
- assertConstraintValidator(createArray(1), false);
- }
-
- public void testAssertIsValid_min() {
- assertConstraintValidator(createArray(2), true);
- }
-
- public void testAssertIsValid_max() {
- assertConstraintValidator(createArray(5), true);
- }
-
- public void testAssertIsValid_long() {
- assertConstraintValidator(createArray(6), false);
- }
-
- private Object[] createArray(int size) {
- Object[] array = new Object[size];
- for (int i = 0; i < size; i++) {
- array[i] = Integer.valueOf(i);
- }
- return array;
- }
-
- @Override
- protected Class<Size> getAnnotationClass() {
- return Size.class;
- }
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfShortTest.java b/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfShortTest.java
deleted file mode 100644
index ad34615..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForArrayOfShortTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.SizeValidatorForArrayOfShort;
-
-import java.util.Date;
-
-import javax.validation.constraints.Size;
-
-/**
- * Tests for {@link SizeValidatorForArrayOfShort}.
- */
-public class SizeValidatorForArrayOfShortTest extends
- ConstraintValidatorTestCase<Size, short[]> {
-
- @SuppressWarnings("unused")
- @Size(min = 2, max = 5)
- private Date defaultField;
-
- protected SizeValidatorForArrayOfShort createValidator() {
- return new SizeValidatorForArrayOfShort();
- }
-
- public void testAssertIsValid_short() {
- assertConstraintValidator(createArray(1), false);
- }
-
- public void testAssertIsValid_min() {
- assertConstraintValidator(createArray(2), true);
- }
-
- public void testAssertIsValid_max() {
- assertConstraintValidator(createArray(5), true);
- }
-
- public void testAssertIsValid_long() {
- assertConstraintValidator(createArray(6), false);
- }
-
- private short[] createArray(int size) {
- short[] array = new short[size];
- for (int i = 0; i < size; i++) {
- array[i] = (short) i;
- }
- return array;
- }
-
- @Override
- protected Class<Size> getAnnotationClass() {
- return Size.class;
- }
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForCollectionTest.java b/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForCollectionTest.java
deleted file mode 100644
index 5a81d84..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForCollectionTest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.SizeValidatorForCollection;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
-
-import javax.validation.constraints.Size;
-
-/**
- * Tests for {@link SizeValidatorForCollection}.
- */
-public class SizeValidatorForCollectionTest extends
- ConstraintValidatorTestCase<Size, Collection<?>> {
-
- @SuppressWarnings("unused")
- @Size(min = 2, max = 5)
- private Date defaultField;
-
- protected SizeValidatorForCollection createValidator() {
- return new SizeValidatorForCollection();
- }
-
- public void testAssertIsValid_short() {
- assertConstraintValidator(createList(1), false);
- }
-
- public void testAssertIsValid_min() {
- assertConstraintValidator(createList(2), true);
- }
-
- public void testAssertIsValid_max() {
- assertConstraintValidator(createList(5), true);
- }
-
- public void testAssertIsValid_long() {
- assertConstraintValidator(createList(6), false);
- }
-
- private Collection<Integer> createList(int size) {
- List<Integer> list = new ArrayList<Integer>(size);
- for (int i = 1; i <= size; i++) {
- Integer key = Integer.valueOf(i);
- list.add(key);
- }
- return list;
- }
-
- @Override
- protected Class<Size> getAnnotationClass() {
- return Size.class;
- }
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForMapTest.java b/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForMapTest.java
deleted file mode 100644
index 8b50d34..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForMapTest.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.SizeValidatorForMap;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.validation.constraints.Size;
-
-/**
- * Tests for {@link SizeValidatorForMap}.
- */
-public class SizeValidatorForMapTest extends
- ConstraintValidatorTestCase<Size, Map<?, ?>> {
-
- @SuppressWarnings("unused")
- @Size(min = 2, max = 5)
- private Date defaultField;
-
- protected SizeValidatorForMap createValidator() {
- return new SizeValidatorForMap();
- }
-
- public void testAssertIsValid_short() {
- assertConstraintValidator(createMap(1), false);
- }
-
- public void testAssertIsValid_min() {
- assertConstraintValidator(createMap(2), true);
- }
-
- public void testAssertIsValid_max() {
- assertConstraintValidator(createMap(5), true);
- }
-
- public void testAssertIsValid_long() {
- assertConstraintValidator(createMap(6), false);
- }
-
- private Map<Integer, String> createMap(int size) {
- Map<Integer, String> map = new HashMap<Integer, String>(size);
- for (int i = 1; i <= size; i++) {
- Integer key = Integer.valueOf(i);
- map.put(key, key.toString());
- }
- return map;
- }
-
- @Override
- protected Class<Size> getAnnotationClass() {
- return Size.class;
- }
-}
diff --git a/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForStringTest.java b/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForStringTest.java
deleted file mode 100644
index a27d0be..0000000
--- a/user/test/com/google/gwt/validation/testing/constraints/SizeValidatorForStringTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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 com.google.gwt.validation.testing.constraints;
-
-import com.google.gwt.validation.client.constraints.SizeValidatorForString;
-
-import java.util.Date;
-
-import javax.validation.constraints.Size;
-
-/**
- * Tests for {@link SizeValidatorForString}.
- */
-public class SizeValidatorForStringTest extends
- ConstraintValidatorTestCase<Size, String> {
-
- @SuppressWarnings("unused")
- @Size(min = 2, max = 5)
- private Date defaultField;
-
- protected SizeValidatorForString createValidator() {
- return new SizeValidatorForString();
- }
-
- public void testAssertIsValid_short() {
- assertConstraintValidator("1", false);
- }
-
- public void testAssertIsValid_min() {
- assertConstraintValidator("12", true);
- }
-
- public void testAssertIsValid_max() {
- assertConstraintValidator("12345", true);
- }
-
- public void testAssertIsValid_long() {
- assertConstraintValidator("123456", false);
- }
-
- @Override
- protected Class<Size> getAnnotationClass() {
- return Size.class;
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/Jsr303Tck.gwt.xml b/user/test/org/hibernate/jsr303/tck/Jsr303Tck.gwt.xml
deleted file mode 100644
index 0ed12fb..0000000
--- a/user/test/org/hibernate/jsr303/tck/Jsr303Tck.gwt.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-This is a HACK, is not a complete Validation TCK solution.
-It is only enough to run the tests in the GWT Validation TCK.
--->
-<module>
- <inherits name='com.google.gwt.validation.Validation' />
- <inherits name='org.jboss.test.audit.JbossTestAudit' />
- <inherits name='org.jboss.testharness.JbossTestHarness' />
- <inherits name='org.testng.TestNg' />
- <source path="">
- <include name="common/*.java" />
- <include name="util/client/*.java" />
- </source>
- <super-source path="super" />
-</module>
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/tests/ValidationTck.gwt.xml b/user/test/org/hibernate/jsr303/tck/tests/ValidationTck.gwt.xml
deleted file mode 100644
index 8a58706..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/ValidationTck.gwt.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd">
-<!--
- Copyright 2010 Google Inc.
-
- 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.
--->
-<module >
- <!-- all tck test inherit this module -->
- <inherits name="com.google.gwt.user.User" />
- <inherits name="org.hibernate.jsr303.tck.Jsr303Tck" />
- <inherits name="org.hibernate.validator.HibernateValidator" />
- <source path="">
- <include name="none" />
- </source>
-</module>
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/application/TckTest.gwt.xml b/user/test/org/hibernate/jsr303/tck/tests/constraints/application/TckTest.gwt.xml
deleted file mode 100644
index 920c549..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/application/TckTest.gwt.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd">
-<!--
- Copyright 2010 Google Inc.
-
- 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.
--->
-<module>
- <inherits name="org.hibernate.jsr303.tck.tests.ValidationTck" />
- <source path="">
- <include name="*.java" />
- </source>
- <replace-with class="org.hibernate.jsr303.tck.tests.constraints.application.TckTestValidatorFactory">
- <when-type-is class="javax.validation.ValidatorFactory"/>
- </replace-with>
-</module>
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/application/TckTestValidatorFactory.java b/user/test/org/hibernate/jsr303/tck/tests/constraints/application/TckTestValidatorFactory.java
deleted file mode 100644
index 2916689..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/application/TckTestValidatorFactory.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.constraints.application;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.validation.client.AbstractGwtValidatorFactory;
-import com.google.gwt.validation.client.GwtValidation;
-import com.google.gwt.validation.client.impl.AbstractGwtValidator;
-
-import javax.validation.Validator;
-
-/**
- * {@link AbstractGwtValidatorFactory} implementation that uses
- * {@link com.google.gwt.validation.client.GwtValidation GwtValidation}.
- */
-public final class TckTestValidatorFactory extends AbstractGwtValidatorFactory {
- /**
- * Marker Interface for {@link GWT#create(Class)}.
- */
- @GwtValidation(value = {
- Building.class, SuperWoman.class, Visibility.class, Woman.class})
- public static interface GwtValidator extends Validator {
- }
-
- @Override
- public AbstractGwtValidator createValidator() {
- return GWT.create(GwtValidator.class);
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/application/ValidationRequirementGwtTest.java b/user/test/org/hibernate/jsr303/tck/tests/constraints/application/ValidationRequirementGwtTest.java
deleted file mode 100644
index d68ec32..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/application/ValidationRequirementGwtTest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.constraints.application;
-
-import com.google.gwt.junit.client.GWTTestCase;
-
-import org.hibernate.jsr303.tck.util.client.Failing;
-
-/**
- * Wraps {@link ValidationRequirementTest} .
- */
-public class ValidationRequirementGwtTest extends GWTTestCase {
- ValidationRequirementTest delegate = new ValidationRequirementTest();
-
- /**
- * This test is disabled in the TCK.
- */
- public void disabledTestIgnoreStaticFieldsAndProperties() {
- delegate.testIgnoreStaticFieldsAndProperties();
- }
-
- @Override
- public String getModuleName() {
- return "org.hibernate.jsr303.tck.tests.constraints.application.TckTest";
- }
-
- @Failing(issue = 5798)
- public void testClassLevelConstraints() {
- delegate.testClassLevelConstraints();
- }
-
- public void testConstraintAppliedOnFieldAndProperty() {
- delegate.testConstraintAppliedOnFieldAndProperty();
- }
-
- public void testFieldAccess() {
- delegate.testFieldAccess();
- }
-
- public void testFieldAndPropertyVisibilityIsNotConstrained() {
- delegate.testFieldAndPropertyVisibilityIsNotConstrained();
- }
-
- public void testPropertyAccess() {
- delegate.testPropertyAccess();
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/ConstraintCompositionCompileTest.java b/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/ConstraintCompositionCompileTest.java
deleted file mode 100644
index 338b25a..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/ConstraintCompositionCompileTest.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.constraints.constraintcomposition;
-
-import com.google.gwt.core.ext.TreeLogger.Type;
-import com.google.gwt.core.ext.UnableToCompleteException;
-import com.google.gwt.dev.util.UnitTestTreeLogger;
-
-import static org.hibernate.jsr303.tck.util.TckGeneratorTestUtils.assertModuleFails;
-import static org.hibernate.jsr303.tck.util.TckGeneratorTestUtils.getFullyQaulifiedModuleName;
-
-import org.hibernate.jsr303.tck.util.TckCompileTestCase;
-
-import javax.validation.ConstraintDefinitionException;
-import javax.validation.UnexpectedTypeException;
-
-/**
- * Test wrapper for {@link ConstraintCompositionTest} tests that are meant to
- * fail to compile.
- */
-public class ConstraintCompositionCompileTest extends TckCompileTestCase {
-
- /**
- * Replacement for
- * {@link ConstraintCompositionTest#testAllComposingConstraintsMustBeApplicableToAnnotatedType()}
- *
- * @throws UnableToCompleteException
- */
- public void testAllComposingConstraintsMustBeApplicableToAnnotatedType()
- throws UnableToCompleteException {
- UnitTestTreeLogger.Builder builder = new UnitTestTreeLogger.Builder();
- builder.expect(
- Type.ERROR,
- "No @org.hibernate.jsr303.tck.tests.constraints.constraintcomposition.NotEmpty("
- + "message={constraint.notEmpty}, payload=[], groups=[]) "
- + "ConstraintValidator for type int", UnexpectedTypeException.class);
- builder.setLowestLogLevel(Type.INFO);
- UnitTestTreeLogger testLogger = builder.createLogger();
- assertModuleFails(testLogger,
- getFullyQaulifiedModuleName(getClass(), "MustBeApplicableTest"),
- MustBeApplicableValidatorFactory.MustBeApplicableValidator.class,
- Shoe.class);
- }
-
- /**
- * Replacement for
- * {@link ConstraintCompositionTest#testOverriddenAttributesMustMatchInType()}
- *
- * @throws UnableToCompleteException
- */
- public void testOverriddenAttributesMustMatchInType()
- throws UnableToCompleteException {
- UnitTestTreeLogger.Builder builder = new UnitTestTreeLogger.Builder();
- builder.expect(Type.ERROR, "Unable to create a validator for "
- + "org.hibernate.jsr303.tck.tests.constraints.constraintcomposition."
- + "ConstraintCompositionTest.DummyEntityWithZipCode "
- + "because The overriding type of a composite constraint must be "
- + "identical to the overridden one. "
- + "Expected int found class java.lang.String",
- ConstraintDefinitionException.class);
- builder.setLowestLogLevel(Type.INFO);
- UnitTestTreeLogger testLogger = builder.createLogger();
- assertModuleFails(
- testLogger,
- getFullyQaulifiedModuleName(getClass(),
- "OverriddenAttributesMustMatchInTypeTest"),
- OverriddenAttributesMustMatchInTypeValidatorFactory.OverriddenAttributesMustMatchInTypeValidator.class);
- }
-
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/ConstraintCompositionGwtTest.java b/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/ConstraintCompositionGwtTest.java
deleted file mode 100644
index 859183a..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/ConstraintCompositionGwtTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.constraints.constraintcomposition;
-
-import com.google.gwt.junit.client.GWTTestCase;
-
-import org.hibernate.jsr303.tck.util.client.Failing;
-
-/**
- * Wraps {@link ConstraintCompositionTest}.
- */
-public class ConstraintCompositionGwtTest extends GWTTestCase {
-
- private final ConstraintCompositionTest delegate = new ConstraintCompositionTest();
-
- @Override
- public String getModuleName() {
- return "org.hibernate.jsr303.tck.tests.constraints.constraintcomposition.TckTest";
- }
-
- public void testAttributesDefinedOnComposingConstraints() {
- delegate.testAttributesDefinedOnComposingConstraints();
- }
-
- public void testComposedConstraints() {
- delegate.testComposedConstraints();
- }
-
- public void testComposedConstraintsAreRecursive() {
- delegate.testComposedConstraintsAreRecursive();
- }
-
- public void testEachFailingConstraintCreatesConstraintViolation() {
- delegate.testEachFailingConstraintCreatesConstraintViolation();
- }
-
- public void testGroupsDefinedOnMainAnnotationAreInherited() {
- delegate.testGroupsDefinedOnMainAnnotationAreInherited();
- }
-
- @Failing(issue = 5799)
- public void testOnlySingleConstraintViolation() {
- delegate.testOnlySingleConstraintViolation();
- }
-
- public void testPayloadPropagationInComposedConstraints() {
- delegate.testPayloadPropagationInComposedConstraints();
- }
-
- public void testValidationOfMainAnnotationIsAlsoApplied() {
- delegate.testValidationOfMainAnnotationIsAlsoApplied();
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/MustBeApplicableTest.gwt.xml b/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/MustBeApplicableTest.gwt.xml
deleted file mode 100644
index 4d13849..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/MustBeApplicableTest.gwt.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd">
-<!--
- Copyright 2010 Google Inc.
-
- 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.
--->
-<module>
- <inherits name="org.hibernate.jsr303.tck.tests.ValidationTck" />
- <source path="">
- <include name="*.java" />
- <exclude name="*CompileTest.java" />
- </source>
- <replace-with class="org.hibernate.jsr303.tck.tests.constraints.constraintcomposition.MustBeApplicableValidatorFactory">
- <when-type-is class="javax.validation.ValidatorFactory"/>
- </replace-with>
-</module>
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/MustBeApplicableValidatorFactory.java b/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/MustBeApplicableValidatorFactory.java
deleted file mode 100644
index d3997fc..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/MustBeApplicableValidatorFactory.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.hibernate.jsr303.tck.tests.constraints.constraintcomposition;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.validation.client.AbstractGwtValidatorFactory;
-import com.google.gwt.validation.client.GwtValidation;
-import com.google.gwt.validation.client.impl.AbstractGwtValidator;
-
-import javax.validation.Validator;
-
-/**
- * {@link AbstractGwtValidatorFactory} implementation that uses
- * {@link com.google.gwt.validation.client.GwtValidation GwtValidation}.
- */
-public final class MustBeApplicableValidatorFactory extends
- AbstractGwtValidatorFactory {
-
- /**
- * Validator for
- * {@link ConstraintCompositionTest#testAllComposingConstraintsMustBeApplicableToAnnotatedType()}
- */
- @GwtValidation(value = {Shoe.class})
- public static interface MustBeApplicableValidator extends Validator {
- }
-
- @Override
- public AbstractGwtValidator createValidator() {
- return GWT.create(MustBeApplicableValidator.class);
- }
-}
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/OverriddenAttributesMustMatchInTypeTest.gwt.xml b/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/OverriddenAttributesMustMatchInTypeTest.gwt.xml
deleted file mode 100644
index 95895a8..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/OverriddenAttributesMustMatchInTypeTest.gwt.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd">
-<!--
- Copyright 2010 Google Inc.
-
- 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.
--->
-<module>
- <inherits name="org.hibernate.jsr303.tck.tests.ValidationTck" />
- <source path="">
- <include name="*.java" />
- <exclude name="*CompileTest.java" />
- </source>
- <replace-with class="org.hibernate.jsr303.tck.tests.constraints.constraintcomposition.OverriddenAttributesMustMatchInTypeValidatorFactory">
- <when-type-is class="javax.validation.ValidatorFactory"/>
- </replace-with>
-</module>
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/OverriddenAttributesMustMatchInTypeValidatorFactory.java b/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/OverriddenAttributesMustMatchInTypeValidatorFactory.java
deleted file mode 100644
index 04be602..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/OverriddenAttributesMustMatchInTypeValidatorFactory.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.hibernate.jsr303.tck.tests.constraints.constraintcomposition;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.validation.client.AbstractGwtValidatorFactory;
-import com.google.gwt.validation.client.GwtValidation;
-import com.google.gwt.validation.client.impl.AbstractGwtValidator;
-
-import org.hibernate.jsr303.tck.tests.constraints.constraintcomposition.ConstraintCompositionTest.DummyEntityWithZipCode;
-
-import javax.validation.Validator;
-
-/**
- * {@link AbstractGwtValidatorFactory} implementation that uses
- * {@link com.google.gwt.validation.client.GwtValidation GwtValidation}.
- */
-public final class OverriddenAttributesMustMatchInTypeValidatorFactory extends
- AbstractGwtValidatorFactory {
-
- /**
- * Validator for
- * {@link ConstraintCompositionTest#testOverriddenAttributesMustMatchInType()}
- */
- @GwtValidation(value = {DummyEntityWithZipCode.class})
- public static interface OverriddenAttributesMustMatchInTypeValidator extends
- Validator {
- }
-
- @Override
- public AbstractGwtValidator createValidator() {
- return GWT.create(OverriddenAttributesMustMatchInTypeValidator.class);
- }
-}
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/TckTest.gwt.xml b/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/TckTest.gwt.xml
deleted file mode 100644
index f3c9ac1..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/TckTest.gwt.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd">
-<!--
- Copyright 2010 Google Inc.
-
- 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.
--->
-<module>
- <inherits name="org.hibernate.jsr303.tck.tests.ValidationTck" />
- <source path="">
- <include name="*.java" />
- <exclude name="*CompileTest.java" />
- </source>
- <replace-with class="org.hibernate.jsr303.tck.tests.constraints.constraintcomposition.TckTestValidatorFactory">
- <when-type-is class="javax.validation.ValidatorFactory"/>
- </replace-with>
-</module>
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/TckTestValidatorFactory.java b/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/TckTestValidatorFactory.java
deleted file mode 100644
index bca5b15..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/TckTestValidatorFactory.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.constraints.constraintcomposition;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.validation.client.AbstractGwtValidatorFactory;
-import com.google.gwt.validation.client.GwtValidation;
-import com.google.gwt.validation.client.impl.AbstractGwtValidator;
-
-import javax.validation.Validator;
-
-/**
- * {@link AbstractGwtValidatorFactory} implementation that uses
- * {@link com.google.gwt.validation.client.GwtValidation GwtValidation}.
- */
-public final class TckTestValidatorFactory extends AbstractGwtValidatorFactory {
- /**
- * Marker Interface for {@link GWT#create(Class)}.
- */
- @GwtValidation(value = {
- Address.class, FrenchAddress.class, Friend.class, GermanAddress.class
- // TODO(nchalko) handle ConstraintDefinitionException
- // ConstraintCompositionGwtTest.DummyEntityWithZipCode.class
- })
- public static interface GwtValidator extends Validator {
- }
-
- @Override
- public AbstractGwtValidator createValidator() {
- return GWT.create(GwtValidator.class);
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/customconstraint/CustomConstraintValidatorCompileTest.java b/user/test/org/hibernate/jsr303/tck/tests/constraints/customconstraint/CustomConstraintValidatorCompileTest.java
deleted file mode 100644
index 68e65d8..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/customconstraint/CustomConstraintValidatorCompileTest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.constraints.customconstraint;
-
-import com.google.gwt.core.ext.TreeLogger.Type;
-import com.google.gwt.core.ext.UnableToCompleteException;
-import com.google.gwt.dev.util.UnitTestTreeLogger;
-
-import static org.hibernate.jsr303.tck.util.TckGeneratorTestUtils.assertModuleFails;
-import static org.hibernate.jsr303.tck.util.TckGeneratorTestUtils.getFullyQaulifiedModuleName;
-
-import org.hibernate.jsr303.tck.tests.constraints.customconstraint.CustomConstraintValidatorTest.OddShoe;
-import org.hibernate.jsr303.tck.util.TckCompileTestCase;
-
-import javax.validation.UnexpectedTypeException;
-
-/**
- * Test wrapper for {@link CustomConstraintValidatorTest} that are meant to fail
- * to compile.
- */
-public class CustomConstraintValidatorCompileTest extends TckCompileTestCase {
-
- /**
- * Replacement for
- * {@link CustomConstraintValidatorTest#testUnexpectedTypeExceptionIsRaisedForInvalidType()}
- *
- * @throws UnableToCompleteException
- */
- public void testUnexpectedTypeExceptionIsRaisedForInvalidType()
- throws UnableToCompleteException {
- UnitTestTreeLogger.Builder builder = new UnitTestTreeLogger.Builder();
- builder.expect(
- Type.ERROR,
- "No @org.hibernate.jsr303.tck.tests.constraints.customconstraint.Positive("
- + "message={validation.positive}, payload=[], groups=[]) "
- + "ConstraintValidator for type class java.lang.String",
- UnexpectedTypeException.class);
- builder.setLowestLogLevel(Type.INFO);
- UnitTestTreeLogger testLogger = builder.createLogger();
- assertModuleFails(testLogger,
- getFullyQaulifiedModuleName(getClass(), "TckCompileTest"),
- TckCompileTestValidatorFactory.GwtValidator.class, OddShoe.class);
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/customconstraint/CustomConstraintValidatorGwtTest.java b/user/test/org/hibernate/jsr303/tck/tests/constraints/customconstraint/CustomConstraintValidatorGwtTest.java
deleted file mode 100644
index ec4bc98..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/customconstraint/CustomConstraintValidatorGwtTest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.constraints.customconstraint;
-
-import com.google.gwt.junit.client.GWTTestCase;
-
-import javax.validation.ValidationException;
-
-/**
- * Test wrapper for {@link CustomConstraintValidatorTest}.
- */
-public class CustomConstraintValidatorGwtTest extends GWTTestCase {
- private final CustomConstraintValidatorTest delegate = new CustomConstraintValidatorTest();
-
- @Override
- public String getModuleName() {
- return "org.hibernate.jsr303.tck.tests.constraints.customconstraint.TckTest";
- }
-
- public void testDefaultPropertyPath() {
- delegate.testDefaultPropertyPath();
- }
-
- public void testIsValidIsCalledForEachValidation() {
- delegate.testIsValidIsCalledForEachValidation();
- }
-
- public void testNonInterpolatedMessageParameterIsUsed() {
- delegate.testNonInterpolatedMessageParameterIsUsed();
- }
-
- public void testOneConstraintViolationPerFailingConstraint() {
- delegate.testOneConstraintViolationPerFailingConstraint();
- }
-
- public void testRightValidatorIsSelectedAndInitializedCalled() {
- delegate.testRightValidatorIsSelectedAndInitializedCalled();
- }
-
- public void testRuntimeExceptionFromInitializeIsWrapped() {
- try {
- delegate.testRuntimeExceptionFromInitializeIsWrapped();
- fail("Expected a " + ValidationException.class);
- } catch (ValidationException expected) {
- // expected
- }
- }
-
- public void testRuntimeExceptionFromIsValidIsWrapped() {
- try {
- delegate.testRuntimeExceptionFromIsValidIsWrapped();
- fail("Expected a " + ValidationException.class);
- } catch (ValidationException expected) {
- // expected
- }
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/customconstraint/TckCompileTest.gwt.xml b/user/test/org/hibernate/jsr303/tck/tests/constraints/customconstraint/TckCompileTest.gwt.xml
deleted file mode 100644
index 82adec3..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/customconstraint/TckCompileTest.gwt.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd">
-<!--
- Copyright 2010 Google Inc.
-
- 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.
--->
-<module>
- <inherits name="org.hibernate.jsr303.tck.tests.ValidationTck" />
- <source path="">
- <include name="*.java" />
- <exclude name="*CompileTest.java" />
- </source>
- <replace-with class="org.hibernate.jsr303.tck.tests.constraints.customconstraint.TckCompileTestValidatorFactory">
- <when-type-is class="javax.validation.ValidatorFactory"/>
- </replace-with>
-</module>
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/customconstraint/TckCompileTestValidatorFactory.java b/user/test/org/hibernate/jsr303/tck/tests/constraints/customconstraint/TckCompileTestValidatorFactory.java
deleted file mode 100644
index ecfe8fc..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/customconstraint/TckCompileTestValidatorFactory.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.constraints.customconstraint;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.validation.client.AbstractGwtValidatorFactory;
-import com.google.gwt.validation.client.GwtValidation;
-import com.google.gwt.validation.client.impl.AbstractGwtValidator;
-
-import org.hibernate.jsr303.tck.tests.constraints.customconstraint.CustomConstraintValidatorTest.OddShoe;
-
-import javax.validation.Validator;
-
-/**
- * {@link AbstractGwtValidatorFactory} implementation that uses
- * {@link com.google.gwt.validation.client.GwtValidation GwtValidation}.
- */
-public final class TckCompileTestValidatorFactory extends AbstractGwtValidatorFactory {
- /**
- * Marker Interface to {@link GWT#create(Class)}.
- */
- @GwtValidation(value = {OddShoe.class})
- public static interface GwtValidator extends Validator {
- }
-
- @Override
- public AbstractGwtValidator createValidator() {
- return GWT.create(GwtValidator.class);
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/customconstraint/TckTest.gwt.xml b/user/test/org/hibernate/jsr303/tck/tests/constraints/customconstraint/TckTest.gwt.xml
deleted file mode 100644
index 37c38b9..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/customconstraint/TckTest.gwt.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd">
-<!--
- Copyright 2010 Google Inc.
-
- 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.
--->
-<module>
- <inherits name="org.hibernate.jsr303.tck.tests.ValidationTck" />
- <source path="">
- <include name="*.java" />
- <exclude name="*CompileTest.java" />
- </source>
- <replace-with class="org.hibernate.jsr303.tck.tests.constraints.customconstraint.TckTestValidatorFactory">
- <when-type-is class="javax.validation.ValidatorFactory"/>
- </replace-with>
-</module>
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/customconstraint/TckTestValidatorFactory.java b/user/test/org/hibernate/jsr303/tck/tests/constraints/customconstraint/TckTestValidatorFactory.java
deleted file mode 100644
index 49fb83c..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/customconstraint/TckTestValidatorFactory.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.constraints.customconstraint;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.validation.client.AbstractGwtValidatorFactory;
-import com.google.gwt.validation.client.GwtValidation;
-import com.google.gwt.validation.client.impl.AbstractGwtValidator;
-
-import org.hibernate.jsr303.tck.tests.constraints.customconstraint.CustomConstraintValidatorTest.Freezer;
-import org.hibernate.jsr303.tck.tests.constraints.customconstraint.CustomConstraintValidatorTest.Shoe;
-
-import javax.validation.Validator;
-
-/**
- * {@link AbstractGwtValidatorFactory} implementation that uses
- * {@link com.google.gwt.validation.client.GwtValidation GwtValidation}.
- */
-public final class TckTestValidatorFactory extends AbstractGwtValidatorFactory {
- /**
- * Marker Interface to {@link GWT#create(Class)}.
- */
- @GwtValidation(value = {Author.class, Freezer.class, Shoe.class})
- public static interface GwtValidator extends Validator {
- }
-
- @Override
- public AbstractGwtValidator createValidator() {
- return GWT.create(GwtValidator.class);
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/groups/GroupGwtTest.java b/user/test/org/hibernate/jsr303/tck/tests/constraints/groups/GroupGwtTest.java
deleted file mode 100644
index 7eb31ba..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/groups/GroupGwtTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.constraints.groups;
-
-import com.google.gwt.junit.client.GWTTestCase;
-
-import org.hibernate.jsr303.tck.util.client.Failing;
-
-/**
- * Test wrapper for {@link GroupTest}.
- */
-public class GroupGwtTest extends GWTTestCase {
- private final GroupTest delegate = new GroupTest();
-
- @Override
- public String getModuleName() {
- return "org.hibernate.jsr303.tck.tests.constraints.groups.TckTest";
- }
-
- public void testConstraintCanBelongToMoreThanOneGroup() {
- delegate.testConstraintCanBelongToMoreThanOneGroup();
- }
-
- public void testConstraintWithNoExplicitlySpecifiedGroupBelongsToDefault() {
- delegate.testConstraintWithNoExplicitlySpecifiedGroupBelongsToDefault();
- }
-
- public void testCyclicGroupSequence() {
- delegate.testCyclicGroupSequence();
- }
-
- public void testGroups() {
- delegate.testGroups();
- }
-
- @Failing(issue = 5801)
- public void testGroupSequence() {
- delegate.testGroupSequence();
- }
-
- public void testGroupSequenceFollowedByGroup() {
- delegate.testGroupSequenceFollowedByGroup();
- }
-
- @Failing(issue = 5801)
- public void testImplicitGrouping() {
- delegate.testImplicitGrouping();
- }
-
- @Failing(issue = 5801)
- public void testValidateAgainstDifferentGroups() {
- delegate.testValidateAgainstDifferentGroups();
- }
-
- public void testValidationFailureInMultipleGroups() {
- delegate.testValidationFailureInMultipleGroups();
- }
-
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/groups/TckTest.gwt.xml b/user/test/org/hibernate/jsr303/tck/tests/constraints/groups/TckTest.gwt.xml
deleted file mode 100644
index dab9c49..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/groups/TckTest.gwt.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd">
-<!--
- Copyright 2010 Google Inc.
-
- 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.
--->
-<module>
- <inherits name="org.hibernate.jsr303.tck.tests.ValidationTck" />
- <source path="">
- <include name="*.java" />
- </source>
- <replace-with class="org.hibernate.jsr303.tck.tests.constraints.groups.TckTestValidatorFactory">
- <when-type-is class="javax.validation.ValidatorFactory"/>
- </replace-with>
-</module>
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/groups/TckTestValidatorFactory.java b/user/test/org/hibernate/jsr303/tck/tests/constraints/groups/TckTestValidatorFactory.java
deleted file mode 100644
index 709ee5b..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/groups/TckTestValidatorFactory.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.constraints.groups;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.validation.client.AbstractGwtValidatorFactory;
-import com.google.gwt.validation.client.GwtValidation;
-import com.google.gwt.validation.client.impl.AbstractGwtValidator;
-
-import javax.validation.Validator;
-
-/**
- * {@link AbstractGwtValidatorFactory} implementation that uses
- * {@link com.google.gwt.validation.client.GwtValidation GwtValidation}.
- */
-public final class TckTestValidatorFactory extends AbstractGwtValidatorFactory {
- /**
- * Marker Interface to {@link GWT#create(Class)}.
- */
- @GwtValidation(value = {Animal.class, Book.class, Order.class, User.class})
- public static interface GwtValidator extends Validator {
- }
-
- @Override
- public AbstractGwtValidator createValidator() {
- return GWT.create(GwtValidator.class);
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/inheritance/ConstraintInheritanceGwtTest.java b/user/test/org/hibernate/jsr303/tck/tests/constraints/inheritance/ConstraintInheritanceGwtTest.java
deleted file mode 100644
index 5b71fb4..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/inheritance/ConstraintInheritanceGwtTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.constraints.inheritance;
-
-import com.google.gwt.junit.client.GWTTestCase;
-
-/**
- * Test wrapper for {@link ConstraintInheritanceTest}. .
- */
-public class ConstraintInheritanceGwtTest extends GWTTestCase {
- private final ConstraintInheritanceTest delegate = new ConstraintInheritanceTest();
-
- @Override
- public String getModuleName() {
- return "org.hibernate.jsr303.tck.tests.constraints.inheritance.TckTest";
- }
-
- public void testConstraintsOnInterfaceAreInherited() {
- delegate.testConstraintsOnInterfaceAreInherited();
- }
-
- public void testConstraintsOnSuperClassAreInherited() {
- delegate.testConstraintsOnSuperClassAreInherited();
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/inheritance/TckTest.gwt.xml b/user/test/org/hibernate/jsr303/tck/tests/constraints/inheritance/TckTest.gwt.xml
deleted file mode 100644
index 0246c75..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/inheritance/TckTest.gwt.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd">
-<!--
- Copyright 2010 Google Inc.
-
- 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.
--->
-<module>
- <inherits name="org.hibernate.jsr303.tck.tests.ValidationTck" />
- <source path="">
- <include name="*.java" />
- </source>
- <replace-with class="org.hibernate.jsr303.tck.tests.constraints.inheritance.TckTestValidatorFactory">
- <when-type-is class="javax.validation.ValidatorFactory"/>
- </replace-with>
-</module>
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/inheritance/TckTestValidatorFactory.java b/user/test/org/hibernate/jsr303/tck/tests/constraints/inheritance/TckTestValidatorFactory.java
deleted file mode 100644
index 0686d7d..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/inheritance/TckTestValidatorFactory.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.constraints.inheritance;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.validation.client.AbstractGwtValidatorFactory;
-import com.google.gwt.validation.client.GwtValidation;
-import com.google.gwt.validation.client.impl.AbstractGwtValidator;
-
-import javax.validation.Validator;
-
-/**
- * {@link AbstractGwtValidatorFactory} implementation that uses
- * {@link com.google.gwt.validation.client.GwtValidation GwtValidation}.
- */
-public final class TckTestValidatorFactory extends AbstractGwtValidatorFactory {
- /**
- * Marker Interface to {@link GWT#create(Class)}.
- */
- @GwtValidation(value = {Bar.class})
- public static interface GwtValidator extends Validator {
- }
-
- @Override
- public AbstractGwtValidator createValidator() {
- return GWT.create(GwtValidator.class);
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/AmbiguousValidatorFactory.gwt.xml b/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/AmbiguousValidatorFactory.gwt.xml
deleted file mode 100644
index c827904..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/AmbiguousValidatorFactory.gwt.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd">
-<!--
- Copyright 2010 Google Inc.
-
- 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.
--->
-<module>
- <inherits name="org.hibernate.jsr303.tck.tests.ValidationTck" />
- <source path="">
- <include name="*.java" />
- <exclude name="*CompileTest.java" />
- </source>
- <replace-with class="org.hibernate.jsr303.tck.tests.constraints.validatorresolution.AmbiguousValidatorFactory">
- <when-type-is class="javax.validation.ValidatorFactory"/>
- </replace-with>
-</module>
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/AmbiguousValidatorFactory.java b/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/AmbiguousValidatorFactory.java
deleted file mode 100644
index a9db99e..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/AmbiguousValidatorFactory.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.hibernate.jsr303.tck.tests.constraints.validatorresolution;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.validation.client.AbstractGwtValidatorFactory;
-import com.google.gwt.validation.client.GwtValidation;
-import com.google.gwt.validation.client.impl.AbstractGwtValidator;
-
-import javax.validation.Validator;
-
-/**
- * {@link AbstractGwtValidatorFactory} implementation that uses
- * {@link com.google.gwt.validation.client.GwtValidation GwtValidation}.
- */
-public final class AmbiguousValidatorFactory extends
- AbstractGwtValidatorFactory {
-
- /**
- * Validator for
- * {@link ValidatorResolutionTest#testAmbiguousValidatorResolution()}
- */
- @GwtValidation(value = {Foo.class})
- public static interface AmbiguousValidator extends Validator {
- }
-
- @Override
- public AbstractGwtValidator createValidator() {
- return GWT.create(AmbiguousValidator.class);
- }
-}
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/TckTest.gwt.xml b/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/TckTest.gwt.xml
deleted file mode 100644
index 52be2f1..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/TckTest.gwt.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd">
-<!--
- Copyright 2010 Google Inc.
-
- 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.
--->
-<module>
- <inherits name="org.hibernate.jsr303.tck.tests.ValidationTck" />
- <source path="">
- <include name="*.java" />
- <exclude name="*CompileTest.java" />
- </source>
- <replace-with class="org.hibernate.jsr303.tck.tests.constraints.validatorresolution.TckTestValidatorFactory">
- <when-type-is class="javax.validation.ValidatorFactory"/>
- </replace-with>
-</module>
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/TckTestValidatorFactory.java b/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/TckTestValidatorFactory.java
deleted file mode 100644
index 0fba419..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/TckTestValidatorFactory.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.constraints.validatorresolution;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.validation.client.AbstractGwtValidatorFactory;
-import com.google.gwt.validation.client.GwtValidation;
-import com.google.gwt.validation.client.impl.AbstractGwtValidator;
-
-import org.hibernate.jsr303.tck.tests.constraints.validatorresolution.ValidatorResolutionTest.CustomClass;
-import org.hibernate.jsr303.tck.tests.constraints.validatorresolution.ValidatorResolutionTest.CustomInterfaceImpl;
-import org.hibernate.jsr303.tck.tests.constraints.validatorresolution.ValidatorResolutionTest.SubClassAHolder;
-import org.hibernate.jsr303.tck.tests.constraints.validatorresolution.ValidatorResolutionTest.SubClassBHolder;
-
-import javax.validation.Validator;
-
-/**
- * {@link AbstractGwtValidatorFactory} implementation that uses
- * {@link com.google.gwt.validation.client.GwtValidation GwtValidation}.
- */
-public final class TckTestValidatorFactory extends AbstractGwtValidatorFactory {
- /**
- * Marker Interface for {@link GWT#create(Class)}.
- */
- @GwtValidation(value = {
- CustomClass.class, CustomInterfaceImpl.class, MinMax.class,
- SubClassAHolder.class, SubClassBHolder.class, Suburb.class})
- public static interface GwtValidator extends Validator {
- }
-
- @Override
- public AbstractGwtValidator createValidator() {
- return GWT.create(GwtValidator.class);
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/UnexpectedTypeValidatorFactory.gwt.xml b/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/UnexpectedTypeValidatorFactory.gwt.xml
deleted file mode 100644
index 8b73617..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/UnexpectedTypeValidatorFactory.gwt.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd">
-<!--
- Copyright 2010 Google Inc.
-
- 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.
--->
-<module>
- <inherits name="org.hibernate.jsr303.tck.tests.ValidationTck" />
- <source path="">
- <include name="*.java" />
- <exclude name="*CompileTest.java" />
- </source>
- <replace-with class="org.hibernate.jsr303.tck.tests.constraints.validatorresolution.UnexectedTypeValidatorFactory">
- <when-type-is class="javax.validation.ValidatorFactory"/>
- </replace-with>
-</module>
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/UnexpectedTypeValidatorFactory.java b/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/UnexpectedTypeValidatorFactory.java
deleted file mode 100644
index e19d1e8..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/UnexpectedTypeValidatorFactory.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.hibernate.jsr303.tck.tests.constraints.validatorresolution;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.validation.client.AbstractGwtValidatorFactory;
-import com.google.gwt.validation.client.GwtValidation;
-import com.google.gwt.validation.client.impl.AbstractGwtValidator;
-
-import javax.validation.Validator;
-
-/**
- * {@link AbstractGwtValidatorFactory} implementation that uses
- * {@link com.google.gwt.validation.client.GwtValidation GwtValidation}.
- */
-public final class UnexpectedTypeValidatorFactory extends
- AbstractGwtValidatorFactory {
-
- /**
- * Validator for
- * {@link ValidatorResolutionTest#testUnexpectedTypeInValidatorResolution()}
- */
- @GwtValidation(value = {Bar.class})
- public static interface UnexpectedTypeValidator extends Validator {
- }
-
- @Override
- public AbstractGwtValidator createValidator() {
- return GWT.create(UnexpectedTypeValidator.class);
- }
-}
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/ValidatorResolutionCompileTest.java b/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/ValidatorResolutionCompileTest.java
deleted file mode 100644
index bee414f..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/ValidatorResolutionCompileTest.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.constraints.validatorresolution;
-
-import com.google.gwt.core.ext.TreeLogger.Type;
-import com.google.gwt.core.ext.UnableToCompleteException;
-import com.google.gwt.dev.util.UnitTestTreeLogger;
-
-import static org.hibernate.jsr303.tck.util.TckGeneratorTestUtils.assertModuleFails;
-import static org.hibernate.jsr303.tck.util.TckGeneratorTestUtils.getFullyQaulifiedModuleName;
-
-import org.hibernate.jsr303.tck.tests.constraints.validatorresolution.AmbiguousValidatorFactory.AmbiguousValidator;
-import org.hibernate.jsr303.tck.tests.constraints.validatorresolution.UnexpectedTypeValidatorFactory.UnexpectedTypeValidator;
-import org.hibernate.jsr303.tck.util.TckCompileTestCase;
-
-import javax.validation.ValidationException;
-
-/**
- * Wraps {@link ValidatorResolutionTest} .
- */
-public class ValidatorResolutionCompileTest extends TckCompileTestCase {
-
- /**
- * Replaces {@link ValidatorResolutionTest#testAmbiguousValidatorResolution()}
- */
- public void testAmbiguousValidatorResolution()
- throws UnableToCompleteException {
- UnitTestTreeLogger.Builder builder = new UnitTestTreeLogger.Builder();
- builder.expect(
- Type.ERROR,
- "More than one maximally specific "
- + "@org.hibernate.jsr303.tck.tests.constraints.validatorresolution.Ambiguous"
- + "(message=foobar, payload=[], groups=[]) "
- + "ConstraintValidator for type "
- + "class org.hibernate.jsr303.tck.tests.constraints.validatorresolution.Bar, "
- + "found [class org.hibernate.jsr303.tck.tests.constraints.validatorresolution.Ambiguous$AmbiguousValidatorForDummy,"
- + " class org.hibernate.jsr303.tck.tests.constraints.validatorresolution.Ambiguous$AmbiguousValidatorForSerializable]",
- ValidationException.class);
- builder.setLowestLogLevel(Type.INFO);
- UnitTestTreeLogger testLogger = builder.createLogger();
- assertModuleFails(
- testLogger,
- getFullyQaulifiedModuleName(getClass(),
- AmbiguousValidatorFactory.class.getSimpleName()),
- AmbiguousValidator.class, Foo.class);
- }
-
- public void testUnexpectedTypeInValidatorResolution()
- throws UnableToCompleteException {
- UnitTestTreeLogger.Builder builder = new UnitTestTreeLogger.Builder();
- builder.expect(
- Type.ERROR,
- "No @javax.validation.constraints.Size(message={javax.validation.constraints.Size.message},"
- + " min=0, max=2147483647, payload=[], groups=[]) "
- + "ConstraintValidator for type class java.lang.Integer",
- ValidationException.class);
- builder.setLowestLogLevel(Type.INFO);
- UnitTestTreeLogger testLogger = builder.createLogger();
- assertModuleFails(
- testLogger,
- getFullyQaulifiedModuleName(getClass(),
- UnexpectedTypeValidatorFactory.class.getSimpleName()),
- UnexpectedTypeValidator.class, Bar.class);
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/ValidatorResolutionGwtTest.java b/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/ValidatorResolutionGwtTest.java
deleted file mode 100644
index c7b7070..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/ValidatorResolutionGwtTest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.constraints.validatorresolution;
-
-import com.google.gwt.junit.client.GWTTestCase;
-
-import org.hibernate.jsr303.tck.util.client.Failing;
-
-/**
- * Wraps {@link ValidatorResolutionTest} .
- */
-public class ValidatorResolutionGwtTest extends GWTTestCase {
- ValidatorResolutionTest delegate = new ValidatorResolutionTest();
- @Override
- public String getModuleName() {
- return "org.hibernate.jsr303.tck.tests.constraints.validatorresolution.TckTest";
- }
-
- public void testResolutionOfMinMaxForDifferentTypes() {
- delegate.testResolutionOfMinMaxForDifferentTypes();
- }
-
- @Failing(issue = 5806)
- public void testResolutionOfMultipleSizeValidators() {
- delegate.testResolutionOfMultipleSizeValidators();
- }
-
- public void testTargetedTypeIsField() {
- delegate.testTargetedTypeIsField();
- }
-
- public void testTargetedTypeIsGetter() {
- delegate.testTargetedTypeIsGetter();
- }
-
- public void testTargetTypeIsClass() {
- delegate.testTargetTypeIsClass();
- }
-
- public void testTargetTypeIsInterface() {
- delegate.testTargetTypeIsInterface();
- }
-
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/messageinterpolation/MessageInterpolationGwtTest.java b/user/test/org/hibernate/jsr303/tck/tests/messageinterpolation/MessageInterpolationGwtTest.java
deleted file mode 100644
index 5a71397..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/messageinterpolation/MessageInterpolationGwtTest.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.messageinterpolation;
-
-import com.google.gwt.junit.client.GWTTestCase;
-
-import org.hibernate.jsr303.tck.util.client.Failing;
-
-/**
- * Wraps {@link MessageInterpolationTest}.
- */
-public class MessageInterpolationGwtTest extends GWTTestCase {
- private final MessageInterpolationTest delegate = new MessageInterpolationTest();
-
- @Override
- public String getModuleName() {
- return "org.hibernate.jsr303.tck.tests.messageinterpolation.TckTest";
- }
-
- public void testConstraintAttributeValuesAreInterpolated() {
- delegate.testConstraintAttributeValuesAreInterpolated();
- }
-
- public void testDefaultMessageInterpolatorIsNotNull() {
- delegate.testDefaultMessageInterpolatorIsNotNull();
- }
-
- public void testIfNoLocaleIsSpecifiedTheDefaultLocaleIsAssumed() {
- delegate.testIfNoLocaleIsSpecifiedTheDefaultLocaleIsAssumed();
- }
-
- public void testLiteralCurlyBraces() {
- delegate.testLiteralCurlyBraces();
- }
-
- @Failing(issue = 5763)
- public void testMessageInterpolationWithLocale() {
- delegate.testMessageInterpolationWithLocale();
- }
-
- public void testMessagesCanBeOverriddenAtConstraintLevel() {
- delegate.testMessagesCanBeOverriddenAtConstraintLevel();
- }
-
- public void testParametersAreExtractedFromBeanValidationProviderBundle() {
- delegate.testParametersAreExtractedFromBeanValidationProviderBundle();
- }
-
- public void testRecursiveMessageInterpolation() {
- delegate.testRecursiveMessageInterpolation();
- }
-
- public void testSuccessfulInterpolationOfValidationMessagesValue() {
- delegate.testSuccessfulInterpolationOfValidationMessagesValue();
- }
-
- public void testUnknownTokenInterpolation() {
- delegate.testUnknownTokenInterpolation();
- }
-
- public void testUnSuccessfulInterpolation() {
- delegate.testUnSuccessfulInterpolation();
- }
-
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/messageinterpolation/TckTest.gwt.xml b/user/test/org/hibernate/jsr303/tck/tests/messageinterpolation/TckTest.gwt.xml
deleted file mode 100644
index 668b796..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/messageinterpolation/TckTest.gwt.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd">
-<!--
- Copyright 2010 Google Inc.
-
- 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.
--->
-<module>
- <inherits name="org.hibernate.jsr303.tck.tests.ValidationTck" />
- <source path="">
- <include name="*.java" />
- </source>
- <replace-with class="org.hibernate.jsr303.tck.tests.messageinterpolation.TckUserValidationMessageProvider">
- <when-type-is class="com.google.gwt.validation.client.UserValidationMessagesResolver" />
- </replace-with>
- <replace-with class="org.hibernate.jsr303.tck.tests.messageinterpolation.TckTestValidatorFactory">
- <when-type-is class="javax.validation.ValidatorFactory"/>
- </replace-with>
-</module>
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/tests/messageinterpolation/TckTestValidatorFactory.java b/user/test/org/hibernate/jsr303/tck/tests/messageinterpolation/TckTestValidatorFactory.java
deleted file mode 100644
index e4dadc9..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/messageinterpolation/TckTestValidatorFactory.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.messageinterpolation;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.validation.client.AbstractGwtValidatorFactory;
-import com.google.gwt.validation.client.GwtValidation;
-import com.google.gwt.validation.client.impl.AbstractGwtValidator;
-
-import org.hibernate.jsr303.tck.tests.messageinterpolation.MessageInterpolationTest.DummyEntity;
-import org.hibernate.jsr303.tck.tests.messageinterpolation.MessageInterpolationTest.Person;
-
-import javax.validation.Validator;
-
-/**
- * {@link AbstractGwtValidatorFactory} implementation that uses
- * {@link com.google.gwt.validation.client.GwtValidation GwtValidation}.
- */
-public final class TckTestValidatorFactory extends AbstractGwtValidatorFactory {
- /**
- * Marker Interface for {@link GWT#create(Class)}.
- */
- @GwtValidation(value = {DummyEntity.class, Person.class})
- public static interface GwtValidator extends Validator {
- }
-
- @Override
- public AbstractGwtValidator createValidator() {
- return GWT.create(GwtValidator.class);
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/messageinterpolation/TckUserValidationMessageProvider.java b/user/test/org/hibernate/jsr303/tck/tests/messageinterpolation/TckUserValidationMessageProvider.java
deleted file mode 100644
index 1e06390..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/messageinterpolation/TckUserValidationMessageProvider.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.messageinterpolation;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.i18n.client.ConstantsWithLookup;
-import com.google.gwt.validation.client.AbstractValidationMessageResolver;
-import com.google.gwt.validation.client.UserValidationMessagesResolver;
-
-/**
- * Custom messages from {@link ValidationMessages}.
- */
-public class TckUserValidationMessageProvider extends
- AbstractValidationMessageResolver implements
- UserValidationMessagesResolver {
-
- public TckUserValidationMessageProvider() {
- super((ConstantsWithLookup) GWT.create(ValidationMessages.class));
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/messageinterpolation/ValidationMessages.java b/user/test/org/hibernate/jsr303/tck/tests/messageinterpolation/ValidationMessages.java
deleted file mode 100644
index 0f1e9cc..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/messageinterpolation/ValidationMessages.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.messageinterpolation;
-
-/**
- * Interface to represent the constants contained in resource bundle:
- * 'ValidationMessages.properties'.
- */
-public interface ValidationMessages extends com.google.gwt.i18n.client.ConstantsWithLookup {
-
- /**
- * Translated "replacement worked".
- *
- * @return translated "replacement worked"
- */
- @DefaultStringValue("replacement worked")
- @Key("foo")
- String foo();
-
- /**
- * Translated "may not be null".
- *
- * @return translated "may not be null"
- */
- @DefaultStringValue("may not be null")
- @Key("javax.validation.constraints.NotNull.message")
- String javax_validation_constraints_NotNull_message();
-
- /**
- * Translated "{replace.in.user.bundle2}".
- *
- * @return translated "{replace.in.user.bundle2}"
- */
- @DefaultStringValue("{replace.in.user.bundle2}")
- @Key("replace.in.user.bundle1")
- String replace_in_user_bundle1();
-
- /**
- * Translated "recursion worked".
- *
- * @return translated "recursion worked"
- */
- @DefaultStringValue("recursion worked")
- @Key("replace.in.user.bundle2")
- String replace_in_user_bundle2();
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/messageinterpolation/ValidationMessages.properties b/user/test/org/hibernate/jsr303/tck/tests/messageinterpolation/ValidationMessages.properties
deleted file mode 100644
index f22947e..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/messageinterpolation/ValidationMessages.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-javax.validation.constraints.NotNull.message=may not be null
-foo=replacement worked
-replace.in.user.bundle1={replace.in.user.bundle2}
-replace.in.user.bundle2=recursion worked
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/tests/messageinterpolation/ValidationMessages_de.properties b/user/test/org/hibernate/jsr303/tck/tests/messageinterpolation/ValidationMessages_de.properties
deleted file mode 100644
index 5485599..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/messageinterpolation/ValidationMessages_de.properties
+++ /dev/null
@@ -1 +0,0 @@
-javax.validation.constraints.NotNull.message=kann nicht null sein
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/tests/metadata/BeanDescriptorGwtTest.java b/user/test/org/hibernate/jsr303/tck/tests/metadata/BeanDescriptorGwtTest.java
deleted file mode 100644
index d2a0bcd..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/metadata/BeanDescriptorGwtTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.metadata;
-
-import com.google.gwt.junit.client.GWTTestCase;
-
-/**
- * Test wrapper for {@link BeanDescriptorTest}.
- */
-public class BeanDescriptorGwtTest extends GWTTestCase {
- private final BeanDescriptorTest delegate = new BeanDescriptorTest();
-
- @Override
- public String getModuleName() {
- return "org.hibernate.jsr303.tck.tests.metadata.TckTest";
- }
-
- public void testGetConstrainedProperties() {
- delegate.testGetConstrainedProperties();
- }
-
- public void testGetConstrainedPropertiesForUnconstrainedEntity() {
- delegate.testGetConstrainedPropertiesForUnconstrainedEntity();
- }
-
- public void testGetConstraintForConstrainedProperty() {
- delegate.testGetConstraintForConstrainedProperty();
- }
-
- public void testGetConstraintForUnConstrainedProperty() {
- delegate.testGetConstraintForUnConstrainedProperty();
- }
-
- public void testGetConstraintsForNonExistingProperty() {
- delegate.testGetConstraintsForNonExistingProperty();
- }
-
- public void testGetConstraintsForNullProperty() {
- delegate.testGetConstraintsForNullProperty();
- }
-
- public void testIsBeanConstrainedDueToConstraintOnEntity() {
- delegate.testIsBeanConstrainedDueToConstraintOnEntity();
- }
-
- public void testIsBeanConstrainedDueToConstraintOnInterface() {
- delegate.testIsBeanConstrainedDueToConstraintOnInterface();
- }
-
- public void testIsBeanConstrainedDueToConstraintProperty() {
- delegate.testIsBeanConstrainedDueToConstraintProperty();
- }
-
- public void testIsBeanConstrainedDueToValidAnnotation() {
- delegate.testIsBeanConstrainedDueToValidAnnotation();
- }
-
- public void testUnconstrainedClass() {
- delegate.testUnconstrainedClass();
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/metadata/ConstraintDescriptorGwtTest.java b/user/test/org/hibernate/jsr303/tck/tests/metadata/ConstraintDescriptorGwtTest.java
deleted file mode 100644
index 28a7566..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/metadata/ConstraintDescriptorGwtTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.metadata;
-
-import com.google.gwt.junit.client.GWTTestCase;
-
-/**
- * Test wrapper for {@link ConstraintDescriptorTest}.
- */
-public class ConstraintDescriptorGwtTest extends GWTTestCase {
- private final ConstraintDescriptorTest delegate = new ConstraintDescriptorTest();
-
- @Override
- public String getModuleName() {
- return "org.hibernate.jsr303.tck.tests.metadata.TckTest";
- }
-
- public void testAnnotationAndMapParametersReflectParameterOverriding() {
- delegate.testAnnotationAndMapParametersReflectParameterOverriding();
- }
-
- public void testComposingConstraints() {
- delegate.testComposingConstraints();
- }
-
- public void testComposingConstraintsPayload() {
- delegate.testComposingConstraintsPayload();
- }
-
- public void testDefaultGroupIsReturnedIfNoGroupSpecifiedInDeclaration() {
- delegate.testDefaultGroupIsReturnedIfNoGroupSpecifiedInDeclaration();
- }
-
- public void testEmptyComposingConstraints() {
- delegate.testEmptyComposingConstraints();
- }
-
- public void testGetAttributesFromConstraintDescriptor() {
- delegate.testGetAttributesFromConstraintDescriptor();
- }
-
- public void testGetGroups() {
- delegate.testGetGroups();
- }
-
- public void testGetGroupsOnInterface() {
- delegate.testGetGroupsOnInterface();
- }
-
- public void testGetGroupsWithImplicitGroup() {
- delegate.testGetGroupsWithImplicitGroup();
- }
-
- public void testPayload() {
- delegate.testPayload();
- }
-
- public void testReportAsSingleViolation() {
- delegate.testReportAsSingleViolation();
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/metadata/ElementDescriptorGwtTest.java b/user/test/org/hibernate/jsr303/tck/tests/metadata/ElementDescriptorGwtTest.java
deleted file mode 100644
index 63fffe1..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/metadata/ElementDescriptorGwtTest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.metadata;
-
-import com.google.gwt.junit.client.GWTTestCase;
-
-import org.hibernate.jsr303.tck.util.client.Failing;
-
-/**
- * Test wrapper for {@link ElementDescriptorTest}.
- */
-public class ElementDescriptorGwtTest extends GWTTestCase {
- private final ElementDescriptorTest delegate = new ElementDescriptorTest();
-
- @Override
- public String getModuleName() {
- return "org.hibernate.jsr303.tck.tests.metadata.TckTest";
- }
-
- @Failing(issue = 5932)
- public void testDeclaredOn() {
- delegate.testDeclaredOn();
- }
-
- public void testGetConstraintDescriptors() {
- delegate.testGetConstraintDescriptors();
- }
-
- public void testGetElementClass() {
- delegate.testGetElementClass();
- }
-
- public void testHasConstraints() {
- delegate.testHasConstraints();
- }
-
- @Failing(issue = 5932)
- public void testLookingAt() {
- delegate.testLookingAt();
- }
-
- @Failing(issue = 5932)
- public void testUnorderedAndMatchingGroups() {
- delegate.testUnorderedAndMatchingGroups();
- }
-
- @Failing(issue = 5932)
- public void testUnorderedAndMatchingGroupsWithDefaultGroupOverriding() {
- delegate.testUnorderedAndMatchingGroupsWithDefaultGroupOverriding();
- }
-
- @Failing(issue = 5932)
- public void testUnorderedAndMatchingGroupsWithInheritance() {
- delegate.testUnorderedAndMatchingGroupsWithInheritance();
- }
-
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/metadata/PropertyDescriptorGwtTest.java b/user/test/org/hibernate/jsr303/tck/tests/metadata/PropertyDescriptorGwtTest.java
deleted file mode 100644
index bdc551b..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/metadata/PropertyDescriptorGwtTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.metadata;
-
-import com.google.gwt.junit.client.GWTTestCase;
-
-/**
- * Test wrapper for {@link PropertyDescriptorTest}.
- */
-public class PropertyDescriptorGwtTest extends GWTTestCase {
- private final PropertyDescriptorTest delegate = new PropertyDescriptorTest();
-
- @Override
- public String getModuleName() {
- return "org.hibernate.jsr303.tck.tests.metadata.TckTest";
- }
-
- public void testIsCascaded() {
- delegate.testIsCascaded();
- }
-
- public void testIsNotCascaded() {
- delegate.testIsNotCascaded();
- }
-
- public void testPropertyName() {
- delegate.testPropertyName();
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/metadata/TckTest.gwt.xml b/user/test/org/hibernate/jsr303/tck/tests/metadata/TckTest.gwt.xml
deleted file mode 100644
index cddeb2b..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/metadata/TckTest.gwt.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd">
-<!--
- Copyright 2010 Google Inc.
-
- 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.
--->
-<module>
- <inherits name="org.hibernate.jsr303.tck.tests.ValidationTck" />
- <source path="">
- <include name="*.java" />
- </source>
- <replace-with class="org.hibernate.jsr303.tck.tests.metadata.TckTestValidatorFactory">
- <when-type-is class="javax.validation.ValidatorFactory"/>
- </replace-with>
-</module>
diff --git a/user/test/org/hibernate/jsr303/tck/tests/metadata/TckTestValidatorFactory.java b/user/test/org/hibernate/jsr303/tck/tests/metadata/TckTestValidatorFactory.java
deleted file mode 100644
index a6fbc25..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/metadata/TckTestValidatorFactory.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.metadata;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.validation.client.AbstractGwtValidatorFactory;
-import com.google.gwt.validation.client.GwtValidation;
-import com.google.gwt.validation.client.impl.AbstractGwtValidator;
-
-import javax.validation.Validator;
-
-/**
- * Test {@link AbstractGwtValidatorFactory} for
- * {@link com.google.gwt.validation.tck.MetadataGwtSuite}.
- */
-public final class TckTestValidatorFactory extends AbstractGwtValidatorFactory {
- /**
- * Marker Interface to {@link GWT#create(Class)}.
- */
- @GwtValidation(value = {
- Account.class, Customer.class, Man.class, Order.class, Person.class,
- SubClass.class, SuperClass.class, UnconstraintEntity.class})
- public static interface GwtValidator extends Validator {
- }
-
- @Override
- public AbstractGwtValidator createValidator() {
- return GWT.create(GwtValidator.class);
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/validation/AbstractValidationTest.java b/user/test/org/hibernate/jsr303/tck/tests/validation/AbstractValidationTest.java
deleted file mode 100644
index a51d70b..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/validation/AbstractValidationTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.validation;
-
-import com.google.gwt.junit.client.GWTTestCase;
-
-/**
- * Abstract Validation test for the {@code validation} package.
- */
-public abstract class AbstractValidationTest extends GWTTestCase {
-
- public AbstractValidationTest() {
- super();
- }
-
- @Override
- public String getModuleName() {
- return "org.hibernate.jsr303.tck.tests.validation.TckTest";
- }
-}
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/tests/validation/PropertyPathGwtTest.java b/user/test/org/hibernate/jsr303/tck/tests/validation/PropertyPathGwtTest.java
deleted file mode 100644
index 93c8ddf..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/validation/PropertyPathGwtTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.validation;
-
-import org.hibernate.jsr303.tck.util.client.Failing;
-
-/**
- * Test wrapper for {@link PropertyPathTest}.
- */
-public class PropertyPathGwtTest extends AbstractValidationTest {
-
- private final PropertyPathTest delegate = new PropertyPathTest();
-
- public void testPropertyPathSet() {
- delegate.testPropertyPathSet();
- }
-
- public void testPropertyPathTraversedObject() {
- delegate.testPropertyPathTraversedObject();
- }
-
- public void testPropertyPathWithArray() {
- delegate.testPropertyPathWithArray();
- }
-
- public void testPropertyPathWithConstraintViolationForRootObject() {
- delegate.testPropertyPathWithConstraintViolationForRootObject();
- }
-
- public void testPropertyPathWithList() {
- delegate.testPropertyPathWithList();
- }
-
- public void testPropertyPathWithMap() {
- delegate.testPropertyPathWithMap();
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/validation/TckCompileTest.gwt.xml b/user/test/org/hibernate/jsr303/tck/tests/validation/TckCompileTest.gwt.xml
deleted file mode 100644
index 383eeaf..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/validation/TckCompileTest.gwt.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd">
-<!--
- Copyright 2010 Google Inc.
-
- 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.
--->
-<module>
- <inherits name="org.hibernate.jsr303.tck.tests.ValidationTck" />
- <source path="">
- <include name="*.java" />
- <exclude name="*CompileTest.java" />
- </source>
- <replace-with class="org.hibernate.jsr303.tck.tests.validation.TckCompileTestValidatorFactory">
- <when-type-is class="javax.validation.ValidatorFactory"/>
- </replace-with>
-</module>
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/tests/validation/TckCompileTestValidatorFactory.java b/user/test/org/hibernate/jsr303/tck/tests/validation/TckCompileTestValidatorFactory.java
deleted file mode 100644
index e035f94..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/validation/TckCompileTestValidatorFactory.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.validation;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.validation.client.AbstractGwtValidatorFactory;
-import com.google.gwt.validation.client.GwtValidation;
-import com.google.gwt.validation.client.impl.AbstractGwtValidator;
-
-import javax.validation.Validator;
-
-/**
- * {@link AbstractGwtValidatorFactory} implementation that uses
- * {@link com.google.gwt.validation.client.GwtValidation GwtValidation}.
- */
-public final class TckCompileTestValidatorFactory extends AbstractGwtValidatorFactory {
- /**
- * Marker Interface for {@link GWT#create(Class)}.
- */
- @GwtValidation(value = {Boy.class})
- public static interface GwtValidator extends Validator {
- }
-
- @Override
- public AbstractGwtValidator createValidator() {
- return GWT.create(GwtValidator.class);
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/validation/TckTest.gwt.xml b/user/test/org/hibernate/jsr303/tck/tests/validation/TckTest.gwt.xml
deleted file mode 100644
index ea01d16..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/validation/TckTest.gwt.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd">
-<!--
- Copyright 2010 Google Inc.
-
- 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.
--->
-<module>
- <inherits name="org.hibernate.jsr303.tck.tests.ValidationTck" />
- <source path="">
- <include name="*.java" />
- <exclude name="*CompileTest.java" />
- </source>
- <replace-with class="org.hibernate.jsr303.tck.tests.validation.TckTestValidatorFactory">
- <when-type-is class="javax.validation.ValidatorFactory"/>
- </replace-with>
-</module>
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/tests/validation/TckTestValidatorFactory.java b/user/test/org/hibernate/jsr303/tck/tests/validation/TckTestValidatorFactory.java
deleted file mode 100644
index 12cb1b7..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/validation/TckTestValidatorFactory.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.validation;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.validation.client.AbstractGwtValidatorFactory;
-import com.google.gwt.validation.client.GwtValidation;
-import com.google.gwt.validation.client.impl.AbstractGwtValidator;
-
-import org.hibernate.jsr303.tck.tests.validation.PropertyPathTest.ActorDB;
-import org.hibernate.jsr303.tck.tests.validation.PropertyPathTest.VerySpecialClass;
-import org.hibernate.jsr303.tck.tests.validation.ValidateTest.Car;
-
-import javax.validation.Validator;
-
-/**
- * {@link AbstractGwtValidatorFactory} implementation that uses
- * {@link com.google.gwt.validation.client.GwtValidation GwtValidation}.
- */
-public final class TckTestValidatorFactory extends AbstractGwtValidatorFactory {
- /**
- * Marker Interface for {@link GWT#create(Class)}.
- */
- @GwtValidation(value = {
- ActorArrayBased.class, ActorDB.class, ActorListBased.class, Actor.class,
- Address.class, BadlyBehavedEntity.class, Car.class, Customer.class,
- Engine.class, Order.class, VerySpecialClass.class})
- public static interface GwtValidator extends Validator {
- }
-
- @Override
- public AbstractGwtValidator createValidator() {
- return GWT.create(GwtValidator.class);
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/validation/ValidateCompileTest.java b/user/test/org/hibernate/jsr303/tck/tests/validation/ValidateCompileTest.java
deleted file mode 100644
index 577229d..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/validation/ValidateCompileTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.validation;
-
-import com.google.gwt.core.ext.TreeLogger.Type;
-import com.google.gwt.core.ext.UnableToCompleteException;
-import com.google.gwt.dev.util.UnitTestTreeLogger;
-
-import static org.hibernate.jsr303.tck.util.TckGeneratorTestUtils.assertModuleFails;
-import static org.hibernate.jsr303.tck.util.TckGeneratorTestUtils.getFullyQaulifiedModuleName;
-
-import org.hibernate.jsr303.tck.util.TckCompileTestCase;
-
-import javax.validation.ValidationException;
-
-/**
- * Test wrapper for {@link ValidateTest} methods that are suppose to fail to
- * compile.
- */
-public class ValidateCompileTest extends TckCompileTestCase {
-
- public void testValidatedPropertyDoesNotFollowJavaBeansConvention()
- throws UnableToCompleteException {
- UnitTestTreeLogger.Builder builder = new UnitTestTreeLogger.Builder();
- builder.expect(
- Type.ERROR,
- "Unable to create a validator for org.hibernate.jsr303.tck.tests.validation.Boy because "
- + "Annotated methods must follow the JavaBeans naming convention. age() does not.",
- ValidationException.class);
- builder.setLowestLogLevel(Type.INFO);
- UnitTestTreeLogger testLogger = builder.createLogger();
- assertModuleFails(testLogger,
- getFullyQaulifiedModuleName(getClass(), "TckCompileTest"),
- TckCompileTestValidatorFactory.GwtValidator.class);
- }
-}
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/tests/validation/ValidateGwtTest.java b/user/test/org/hibernate/jsr303/tck/tests/validation/ValidateGwtTest.java
deleted file mode 100644
index 2d129f7..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/validation/ValidateGwtTest.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.validation;
-
-import org.hibernate.jsr303.tck.util.client.Failing;
-
-import javax.validation.ValidationException;
-
-/**
- * Test wrapper for {@link ValidateTest}.
- */
-public class ValidateGwtTest extends AbstractValidationTest {
-
- private final ValidateTest delegate = new ValidateTest();
-
- public void testConstraintDescriptorWithoutExplicitGroup() {
- delegate.testConstraintDescriptorWithoutExplicitGroup();
- }
-
- public void testConstraintViolation() {
- delegate.testConstraintViolation();
- }
-
- @Failing(issue = 5930)
- public void testGraphValidationWithArray() {
- delegate.testGraphValidationWithArray();
- }
-
- @Failing(issue = 5930)
- public void testGraphValidationWithList() {
- delegate.testGraphValidationWithList();
- }
-
- @Failing(issue = 5930)
- public void testMultipleConstraintViolationOfDifferentTypes() {
- delegate.testMultipleConstraintViolationOfDifferentTypes();
- }
-
- public void testMultipleViolationOfTheSameType() {
- delegate.testMultipleViolationOfTheSameType();
- }
-
- public void testNullParameterToGetConstraintsForClass() {
- try {
- delegate.testNullParameterToGetConstraintsForClass();
- fail("Expected a " + IllegalArgumentException.class);
- } catch (IllegalArgumentException ignore) {
- // Expected
- }
- }
-
- public void testObjectTraversion() {
- delegate.testObjectTraversion();
- }
-
- public void testOnlyFirstGroupInSequenceGetEvaluated() {
- delegate.testOnlyFirstGroupInSequenceGetEvaluated();
- }
-
- public void testPassingNullAsGroup() {
- delegate.testPassingNullAsGroup();
- }
-
- public void testUnexpectedExceptionsInValidateGetWrappedInValidationExceptions() {
- try {
- delegate.testUnexpectedExceptionsInValidateGetWrappedInValidationExceptions();
- fail("Expected a " + ValidationException.class);
- } catch (ValidationException ignore) {
- // Expected
- }
- }
-
- public void testValidateWithNullGroup() {
- try {
- delegate.testValidateWithNullGroup();
- fail("Expected a " + IllegalArgumentException.class);
- } catch (IllegalArgumentException ignore) {
- // Expected
- }
- }
-
- public void testValidateWithNullValue() {
- try {
- delegate.testValidateWithNullValue();
- fail("Expected a " + IllegalArgumentException.class);
- } catch (IllegalArgumentException ignore) {
- // Expected
- }
- }
-
- public void testValidationIsPolymorphic() {
- delegate.testValidationIsPolymorphic();
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/validation/ValidatePropertyGwtTest.java b/user/test/org/hibernate/jsr303/tck/tests/validation/ValidatePropertyGwtTest.java
deleted file mode 100644
index f4b340b..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/validation/ValidatePropertyGwtTest.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.validation;
-
-import org.hibernate.jsr303.tck.util.client.Failing;
-
-import javax.validation.ValidationException;
-
-/**
- * Test wrapper for {@link ValidatePropertyTest}.
- */
-public class ValidatePropertyGwtTest extends AbstractValidationTest {
-
- private final ValidatePropertyTest delegate = new ValidatePropertyTest();
-
- // Add Property Prefix so test name is unique in the suite.
- public void testPropertyIllegalArgumentExceptionIsThrownForNullValue() {
- delegate.testIllegalArgumentExceptionIsThrownForNullValue();
- }
-
- // Add Property Prefix so test name is unique in the suite.
- public void testPropertyPassingNullAsGroup() {
- delegate.testPassingNullAsGroup();
- }
-
- // Add Property Prefix so test name is unique in the suite.
- public void testPropertyUnexpectedExceptionsInValidatePropertyGetWrappedInValidationExceptions() {
- // Wrap the test to catch the @Test expected exception.
- try {
- delegate.testUnexpectedExceptionsInValidatePropertyGetWrappedInValidationExceptions();
- fail("Expected a " + ValidationException.class);
- } catch (ValidationException expected) {
- }
- }
-
- public void testValidateProperty() {
- delegate.testValidateProperty();
- }
-
- public void testValidatePropertyWithEmptyProperty() {
- delegate.testValidatePropertyWithEmptyProperty();
- }
-
- public void testValidatePropertyWithInvalidPropertyPath() {
- delegate.testValidatePropertyWithInvalidPropertyPath();
- }
-
- public void testValidatePropertyWithNullProperty() {
- delegate.testValidatePropertyWithNullProperty();
- }
-
- @Failing(issue = 5804)
- public void testValidIsNotHonoredValidateProperty() {
- delegate.testValidIsNotHonoredValidateProperty();
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/validation/ValidateValueGwtTest.java b/user/test/org/hibernate/jsr303/tck/tests/validation/ValidateValueGwtTest.java
deleted file mode 100644
index ff7cd1a..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/validation/ValidateValueGwtTest.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.validation;
-
-import org.hibernate.jsr303.tck.util.client.Failing;
-
-/**
- * Test wrapper for {@link ValidateValueTest}.
- */
-public class ValidateValueGwtTest extends AbstractValidationTest {
-
- private final ValidateValueTest delegate = new ValidateValueTest();
-
- public void testExistingPropertyWoConstraintsNorCascaded() {
- delegate.testExistingPropertyWoConstraintsNorCascaded();
- }
-
- @Failing(issue = 5804)
- public void testValidateValue() {
- delegate.testValidateValue();
- }
-
- @Failing(issue = 5804)
- public void testValidateValueFailure() {
- delegate.testValidateValueFailure();
- }
-
- public void testValidateValuePassingNullAsGroup() {
- delegate.testValidateValuePassingNullAsGroup();
- }
-
- public void testValidateValueSuccess() {
- delegate.testValidateValueSuccess();
- }
-
- public void testValidateValueWithEmptyPropertyPath() {
- delegate.testValidateValueWithEmptyPropertyPath();
- }
-
- public void testValidateValueWithInvalidPropertyPath() {
- delegate.testValidateValueWithInvalidPropertyPath();
- }
-
- public void testValidateValueWithNullObject() {
- delegate.testValidateValueWithNullObject();
- }
-
- public void testValidateValueWithNullPropertyName() {
- delegate.testValidateValueWithNullPropertyName();
- }
-
- // This passes but the desired behavior is still not working
- public void testValidIsNotHonoredValidateValue() {
- delegate.testValidIsNotHonoredValidateValue();
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/validation/ValidationGwtTest.java b/user/test/org/hibernate/jsr303/tck/tests/validation/ValidationGwtTest.java
deleted file mode 100644
index e78aaff..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/validation/ValidationGwtTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.validation;
-
-import org.hibernate.jsr303.tck.util.client.TestNotCompatible;
-import org.hibernate.jsr303.tck.util.client.TestNotCompatible.Reason;
-
-/**
- * Test wrapper for {@link ValidationTest}.
- */
-public class ValidationGwtTest extends AbstractValidationTest {
-
- private final ValidationTest delegate = new ValidationTest();
-
- public void testBuildDefaultValidatorFactory() {
- delegate.testBuildDefaultValidatorFactory();
- }
-
- public void testCustomValidationProviderResolution() {
- delegate.testCustomValidationProviderResolution();
- }
-
- public void testSpecificValidationProvider() {
- delegate.testSpecificValidationProvider();
- }
-
- @TestNotCompatible(reason = Reason.REFLECTION,
- whereTested = "This test checks the methods of the API itself, it does not need to be tested here also.")
- public void testVerifyMethodsOfValidationObjects() {
- // This method is excluded because it does not compile.
- // delegate.testVerifyMethodsOfValidationObjects();
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/validation/graphnavigation/GraphNavigationGwtTest.java b/user/test/org/hibernate/jsr303/tck/tests/validation/graphnavigation/GraphNavigationGwtTest.java
deleted file mode 100644
index 026d08e..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/validation/graphnavigation/GraphNavigationGwtTest.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.validation.graphnavigation;
-
-import com.google.gwt.junit.client.GWTTestCase;
-
-import org.hibernate.jsr303.tck.util.client.Failing;
-
-/**
- * Test wrapper for {@link GraphNavigationTest}.
- */
-public class GraphNavigationGwtTest extends GWTTestCase {
-
- private final GraphNavigationTest delegate = new GraphNavigationTest();
-
- @Override
- public String getModuleName() {
- return "org.hibernate.jsr303.tck.tests.validation.graphnavigation.TckTest";
- }
-
- public void testContainedIterable() {
- delegate.testContainedIterable();
- }
-
- public void testContainedMap() {
- delegate.testContainedMap();
- }
-
- public void testContainedSet() {
- delegate.testContainedSet();
- }
-
- @Failing(issue = 5946)
- public void testFullGraphValidationBeforeNextGroupInSequence() {
- delegate.testFullGraphValidationBeforeNextGroupInSequence();
- }
-
- @Failing(issue = 5946)
- public void testGraphNavigationDeterminism() {
- delegate.testGraphNavigationDeterminism();
- }
-
- public void testNoEndlessLoop() {
- delegate.testNoEndlessLoop();
- }
-
- public void testNullReferencesGetIgnored() {
- delegate.testNullReferencesGetIgnored();
- }
-
- public void testTypeOfContainedValueIsDeterminedAtRuntime() {
- delegate.testTypeOfContainedValueIsDeterminedAtRuntime();
- }
-
- public void testTypeOfContainedValuesIsDeterminedAtRuntime() {
- delegate.testTypeOfContainedValuesIsDeterminedAtRuntime();
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/validation/graphnavigation/TckTest.gwt.xml b/user/test/org/hibernate/jsr303/tck/tests/validation/graphnavigation/TckTest.gwt.xml
deleted file mode 100644
index 29ee564..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/validation/graphnavigation/TckTest.gwt.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd">
-<!--
- Copyright 2010 Google Inc.
-
- 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.
--->
-<module>
- <inherits name="org.hibernate.jsr303.tck.tests.ValidationTck" />
- <source path="">
- <include name="*.java" />
- </source>
- <replace-with class="org.hibernate.jsr303.tck.tests.validation.graphnavigation.TckTestValidatorFactory">
- <when-type-is class="javax.validation.ValidatorFactory"/>
- </replace-with>
-</module>
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/tests/validation/graphnavigation/TckTestValidatorFactory.java b/user/test/org/hibernate/jsr303/tck/tests/validation/graphnavigation/TckTestValidatorFactory.java
deleted file mode 100644
index 5baadb2..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/validation/graphnavigation/TckTestValidatorFactory.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.validation.graphnavigation;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.validation.client.AbstractGwtValidatorFactory;
-import com.google.gwt.validation.client.GwtValidation;
-import com.google.gwt.validation.client.impl.AbstractGwtValidator;
-
-import javax.validation.Validator;
-
-/**
- * {@link AbstractGwtValidatorFactory} implementation that uses
- * {@link com.google.gwt.validation.client.GwtValidation GwtValidation}.
- */
-public final class TckTestValidatorFactory extends AbstractGwtValidatorFactory {
- /**
- * Marker Interface for {@link GWT#create(Class)}.
- */
- @GwtValidation(value = {
- AnimalCaretaker.class, Condor.class, Elephant.class, GameReserve.class,
- MultiCage.class, MultiCage.class, Parent.class, SingleCage.class,
- User.class, Zebra.class, Zoo.class})
- public static interface GwtValidator extends Validator {
- }
-
- @Override
- public AbstractGwtValidator createValidator() {
- return GWT.create(GwtValidator.class);
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/validatorfactory/CustomConstraintValidatorGwtTest.java b/user/test/org/hibernate/jsr303/tck/tests/validatorfactory/CustomConstraintValidatorGwtTest.java
deleted file mode 100644
index 480da20..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/validatorfactory/CustomConstraintValidatorGwtTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.validatorfactory;
-
-import com.google.gwt.junit.client.GWTTestCase;
-
-import org.hibernate.jsr303.tck.util.client.Failing;
-
-/**
- * Wraps
- * {@link org.hibernate.jsr303.tck.tests.constraints.customconstraint.CustomConstraintValidatorTest}
- * .
- */
-public class CustomConstraintValidatorGwtTest extends GWTTestCase {
- CustomConstraintValidatorTest delegate = new CustomConstraintValidatorTest();
-
- @Override
- public String getModuleName() {
- return "org.hibernate.jsr303.tck.tests.validatorfactory.TckTest";
- }
-
-
- public void testDefaultConstructorInValidatorCalled() {
- delegate.testDefaultConstructorInValidatorCalled();
- }
-
- @Failing(issue = 5805)
- public void testRuntimeExceptionInValidatorCreationIsWrapped() {
- delegate.testRuntimeExceptionInValidatorCreationIsWrapped();
- }
-
- @Failing(issue = 5805)
- public void testValidationExceptionIsThrownInCaseFactoryReturnsNull() {
- delegate.testValidationExceptionIsThrownInCaseFactoryReturnsNull();
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/validatorfactory/TckTest.gwt.xml b/user/test/org/hibernate/jsr303/tck/tests/validatorfactory/TckTest.gwt.xml
deleted file mode 100644
index d562da5..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/validatorfactory/TckTest.gwt.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd">
-<!--
- Copyright 2010 Google Inc.
-
- 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.
--->
-<module>
- <inherits name="org.hibernate.jsr303.tck.tests.ValidationTck" />
- <source path="">
- <include name="*.java" />
- </source>
- <replace-with class="org.hibernate.jsr303.tck.tests.validatorfactory.TckTestValidatorFactory">
- <when-type-is class="javax.validation.ValidatorFactory"/>
- </replace-with>
-</module>
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/tests/validatorfactory/TckTestValidatorFactory.java b/user/test/org/hibernate/jsr303/tck/tests/validatorfactory/TckTestValidatorFactory.java
deleted file mode 100644
index 2ae5b00..0000000
--- a/user/test/org/hibernate/jsr303/tck/tests/validatorfactory/TckTestValidatorFactory.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.tests.validatorfactory;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.validation.client.AbstractGwtValidatorFactory;
-import com.google.gwt.validation.client.GwtValidation;
-import com.google.gwt.validation.client.impl.AbstractGwtValidator;
-
-import org.hibernate.jsr303.tck.tests.validatorfactory.CustomConstraintValidatorTest.Dummy;
-import org.hibernate.jsr303.tck.tests.validatorfactory.CustomConstraintValidatorTest.SecondDummy;
-
-import javax.validation.Validator;
-
-/**
- * {@link AbstractGwtValidatorFactory} implementation that uses
- * {@link com.google.gwt.validation.client.GwtValidation GwtValidation}.
- */
-public final class TckTestValidatorFactory extends AbstractGwtValidatorFactory {
- /**
- * Marker Interface for {@link GWT#create(Class)}.
- */
- @GwtValidation(value = {Dummy.class, SecondDummy.class})
- public static interface GwtValidator extends Validator {
- }
-
- @Override
- public AbstractGwtValidator createValidator() {
- return GWT.create(GwtValidator.class);
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/util/TckCompileTestCase.java b/user/test/org/hibernate/jsr303/tck/util/TckCompileTestCase.java
deleted file mode 100644
index dd7f4da..0000000
--- a/user/test/org/hibernate/jsr303/tck/util/TckCompileTestCase.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.util;
-
-import com.google.gwt.junit.client.GWTTestCase;
-import com.google.gwt.validation.rebind.BeanHelper;
-
-/**
- * Abstract TestCase for TCK tests that are expected to fail to compile.
- */
-public abstract class TckCompileTestCase extends GWTTestCase {
-
- public TckCompileTestCase() {
- super();
- }
-
- @Override
- public final String getModuleName() {
- return null; // Run as JRE tests
- }
-
- @Override
- protected void gwtSetUp() throws Exception {
- super.gwtSetUp();
- BeanHelper.clearBeanHelpersForTests();
- }
-
- @Override
- protected void gwtTearDown() throws Exception {
- BeanHelper.clearBeanHelpersForTests();
- super.gwtTearDown();
- }
-
-}
\ No newline at end of file
diff --git a/user/test/org/hibernate/jsr303/tck/util/TckGeneratorTestUtils.java b/user/test/org/hibernate/jsr303/tck/util/TckGeneratorTestUtils.java
deleted file mode 100644
index 66908c6..0000000
--- a/user/test/org/hibernate/jsr303/tck/util/TckGeneratorTestUtils.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.util;
-
-import com.google.gwt.core.ext.TreeLogger;
-import com.google.gwt.core.ext.UnableToCompleteException;
-import com.google.gwt.core.ext.linker.ArtifactSet;
-import com.google.gwt.dev.cfg.ModuleDef;
-import com.google.gwt.dev.cfg.ModuleDefLoader;
-import com.google.gwt.dev.javac.StandardGeneratorContext;
-import com.google.gwt.dev.shell.FailErrorLogger;
-import com.google.gwt.dev.util.UnitTestTreeLogger;
-import com.google.gwt.dev.util.log.CompositeTreeLogger;
-import com.google.gwt.dev.util.log.PrintWriterTreeLogger;
-import com.google.gwt.validation.rebind.BeanHelper;
-import com.google.gwt.validation.rebind.GwtSpecificValidatorGenerator;
-import com.google.gwt.validation.rebind.ValidatorGenerator;
-
-import junit.framework.Assert;
-
-import java.io.File;
-
-import javax.validation.Validator;
-
-/**
- * Static utilities useful for testing TCK Generators.
- */
-public class TckGeneratorTestUtils {
-
- private final static boolean LOG_TO_CONSOLE = false;
-
- /**
- * Asserts that calling
- * {@link ValidatorGenerator#generate(TreeLogger, com.google.gwt.core.ext.GeneratorContext, String)}
- * causes a {@link UnableToCompleteException} with exactly the log messages
- * specified in {@code testLogger}.
- *
- * @param testLogger test logger with expected log messages set.
- * @param fullyQaulifiedModuleName the gwt Module to load.
- * @param validatorClass the Validator to generate.
- * @throws UnableToCompleteException if The module or derived CompilationState
- * can not be loaded.
- */
- public static void assertModuleFails(UnitTestTreeLogger testLogger,
- String fullyQaulifiedModuleName,
- Class<? extends Validator> validatorClass)
- throws UnableToCompleteException {
- TreeLogger logger = createFailLogger();
- StandardGeneratorContext context = createGeneratorContext(
- fullyQaulifiedModuleName, logger);
- ValidatorGenerator generator = new ValidatorGenerator();
- try {
- generator.generate(testLogger, context, validatorClass.getCanonicalName());
- context.finish(logger);
- Assert.fail("Expected a " + UnableToCompleteException.class);
- } catch (UnableToCompleteException expected) {
- // expected
- }
- testLogger.assertCorrectLogEntries();
- }
-
- /**
- * Asserts that calling
- * {@link ValidatorGenerator#generate(TreeLogger, com.google.gwt.core.ext.GeneratorContext, String)}
- * causes a {@link UnableToCompleteException} with exactly the log messages
- * specified in {@code testLogger}.
- *
- * @param testLogger test logger with expected log messages set.
- * @param fullyQaulifiedModuleName the gwt Module to load.
- * @param validatorClass the Validator to generate.
- * @param beanType the type of bean to create a validator for.
- * @throws UnableToCompleteException if The module or derived CompilationState
- * can not be loaded.
- */
- public static void assertModuleFails(UnitTestTreeLogger testLogger,
- String fullyQaulifiedModuleName,
- Class<? extends Validator> validatorClass, Class<?> beanType)
- throws UnableToCompleteException {
- TreeLogger logger = createFailLogger();
- StandardGeneratorContext context = createGeneratorContext(
- fullyQaulifiedModuleName, logger);
-
- ValidatorGenerator generator = new ValidatorGenerator();
- GwtSpecificValidatorGenerator specificGenerator = new GwtSpecificValidatorGenerator();
- generator.generate(testLogger, context, validatorClass.getCanonicalName());
- context.finish(logger);
- try {
- specificGenerator.generate(
- testLogger,
- context,
- BeanHelper.createBeanHelper(beanType, testLogger, context).getFullyQualifiedValidatorName());
- Assert.fail("Expected a " + UnableToCompleteException.class);
- } catch (UnableToCompleteException expected) {
- // expected
- }
- testLogger.assertCorrectLogEntries();
- }
-
- /**
- * Creates the fully qualified GWT module name using the package of
- * {@code clazz} and the {@code moduleNam}
- *
- * @param clazz the class whose package the module is in.
- * @param moduleName the module name.
- * @return the fully qualified module name.
- */
- public static String getFullyQaulifiedModuleName(Class<?> clazz,
- String moduleName) {
- return clazz.getPackage().getName() + "." + moduleName;
- }
-
- private static TreeLogger createFailLogger() {
- TreeLogger logger = LOG_TO_CONSOLE ? new CompositeTreeLogger(
- new PrintWriterTreeLogger(), new FailErrorLogger())
- : new FailErrorLogger();
- return logger;
- }
-
- private static StandardGeneratorContext createGeneratorContext(
- String fullyQaulifiedModuleName, TreeLogger logger)
- throws UnableToCompleteException {
- ModuleDef module = ModuleDefLoader.loadFromClassPath(logger,
- fullyQaulifiedModuleName);
- File genDir = new File(System.getProperty("java.io.tmpdir"));
-
- ArtifactSet allGenreatedArtifacts = new ArtifactSet();
- boolean isProd = false;
- StandardGeneratorContext context = new StandardGeneratorContext(
- module.getCompilationState(logger), module, genDir,
- allGenreatedArtifacts, isProd);
- return context;
- }
-
-}
diff --git a/user/test/org/hibernate/jsr303/tck/util/TckTestSuiteWrapper.java b/user/test/org/hibernate/jsr303/tck/util/TckTestSuiteWrapper.java
deleted file mode 100644
index f9aa7d7..0000000
--- a/user/test/org/hibernate/jsr303/tck/util/TckTestSuiteWrapper.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.util;
-
-import static com.google.gwt.thirdparty.guava.common.base.Predicates.and;
-import static com.google.gwt.thirdparty.guava.common.base.Predicates.not;
-import static com.google.gwt.thirdparty.guava.common.base.Predicates.or;
-import static com.google.gwt.thirdparty.guava.common.collect.ImmutableList.copyOf;
-import static com.google.gwt.thirdparty.guava.common.collect.Iterables.filter;
-
-import com.google.gwt.junit.tools.GWTTestSuite;
-import com.google.gwt.thirdparty.guava.common.base.Predicate;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-
-import org.hibernate.jsr303.tck.util.client.Failing;
-import org.hibernate.jsr303.tck.util.client.NonTckTest;
-import org.hibernate.jsr303.tck.util.client.NotSupported;
-import org.hibernate.jsr303.tck.util.client.TestNotCompatible;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.Vector;
-
-/**
- * Wrapper for {@link GWTTestSuite} to prevent selected methods from running.
- *
- * Copied code from {@link junit.framework.TestSuite} and modified to exclude
- * test methods with select annotations.
- */
-public class TckTestSuiteWrapper extends GWTTestSuite {
-
- private static final Predicate<Method> HAS_FAILING = createHasAnnotationPredicate(Failing.class);
- private static final Predicate<Method> HAS_NON_TCK_TEST = createHasAnnotationPredicate(NonTckTest.class);
- private static final Predicate<Method> HAS_NOT_SUPPORTED = createHasAnnotationPredicate(NotSupported.class);
- private static final Predicate<Method> HAS_TEST_NOT_COMPATIBLE = createHasAnnotationPredicate(TestNotCompatible.class);
-
- private static final Predicate<Method> INCLUDE_FAILING = createHasProperty(Failing.INCLUDE);
- private static final Predicate<Method> INCLUDE_NOT_SUPPORTED = createHasProperty(NotSupported.INCLUDE);
- private static final Predicate<Method> INCLUDE_TEST_NOT_COMPATIBLE = createHasProperty(TestNotCompatible.INCLUDE);
- private static final Predicate<Method> EXCLUDE_NON_TCK_TEST = createHasProperty(NonTckTest.EXCLUDE);
-
- @SuppressWarnings("unchecked")
- private static final Predicate<Method> METHOD_FILTER = and(
- or(INCLUDE_NOT_SUPPORTED, not(HAS_NOT_SUPPORTED)),
- or(INCLUDE_TEST_NOT_COMPATIBLE, not(HAS_TEST_NOT_COMPATIBLE)),
- not(and(EXCLUDE_NON_TCK_TEST, HAS_NON_TCK_TEST)),
- or(INCLUDE_FAILING, not(HAS_FAILING))
- );
-
- public static Predicate<Method> createHasAnnotationPredicate(
- final Class<? extends Annotation> annotationClass) {
- return new Predicate<Method>() {
-
- public boolean apply(Method method) {
- return method.getAnnotation(annotationClass) != null;
- }
- };
- }
-
- private static <T> Predicate<T> createHasProperty(final String property) {
- return new Predicate<T>() {
- public boolean apply(T arg0) {
- String include = System.getProperty(property);
- return Boolean.parseBoolean(include);
- }
- };
- }
-
- public TckTestSuiteWrapper(String name) {
- super(name);
- }
-
- /**
- * Adds the tests from the given class to the suite.
- */
- @Override
- public void addTestSuite(Class theClass) {
-
- String fName = theClass.getName();
- try {
- getTestConstructor(theClass); // Avoid generating multiple error messages
- } catch (NoSuchMethodException e) {
- addTest(warning("Class " + theClass.getName()
- + " has no public constructor TestCase(String name) or TestCase()"));
- return;
- }
-
- if (!Modifier.isPublic(theClass.getModifiers())) {
- addTest(warning("Class " + theClass.getName() + " is not public"));
- return;
- }
-
- Class superClass = theClass;
- Vector names = new Vector();
- while (Test.class.isAssignableFrom(superClass)) {
- for (Method method : filter(copyOf(superClass.getDeclaredMethods()),
- METHOD_FILTER)) {
- addTestMethod(method, names, theClass);
- }
- superClass = superClass.getSuperclass();
- }
- if (testCount() == 0)
- addTest(warning("No tests found in " + theClass.getName()));
- }
-
- private void addTestMethod(Method m, Vector names, Class theClass) {
- String name = m.getName();
- if (names.contains(name))
- return;
- if (!isPublicTestMethod(m)) {
- if (isTestMethod(m))
- addTest(warning("Test method isn't public: " + m.getName()));
- return;
- }
- names.addElement(name);
- addTest(createTest(theClass, name));
- }
-
- private boolean ingoreMethod(Method m) {
- return HAS_FAILING.apply(m);
- }
-
- private boolean isPublicTestMethod(Method m) {
- return isTestMethod(m) && Modifier.isPublic(m.getModifiers());
- }
-
- private boolean isTestMethod(Method m) {
- String name = m.getName();
- Class[] parameters = m.getParameterTypes();
- Class returnType = m.getReturnType();
- return parameters.length == 0 && name.startsWith("test")
- && returnType.equals(Void.TYPE);
- }
-}
diff --git a/user/test/org/hibernate/jsr303/tck/util/TckTestSuiteWrapperTest.java b/user/test/org/hibernate/jsr303/tck/util/TckTestSuiteWrapperTest.java
deleted file mode 100644
index 1e6e5cd..0000000
--- a/user/test/org/hibernate/jsr303/tck/util/TckTestSuiteWrapperTest.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.util;
-
-import com.google.gwt.junit.client.GWTTestCase;
-
-import junit.framework.TestCase;
-
-import org.hibernate.jsr303.tck.util.client.Failing;
-import org.hibernate.jsr303.tck.util.client.NonTckTest;
-import org.hibernate.jsr303.tck.util.client.NotSupported;
-import org.hibernate.jsr303.tck.util.client.NotSupported.Reason;
-
-/**
- * Tests for {@link TckTestSuiteWrapper}.
- */
-public class TckTestSuiteWrapperTest extends TestCase {
-
- /**
- * Sample test with a method annotated as {@link Failing}.
- */
- public static class Fail extends Base {
-
- public Fail() {
- }
-
- @Failing(issue = 123)
- public void testFailing() {
- }
-
- public void testOne() {
- }
-
- public void testTwo() {
- }
- }
-
- /**
- * Sample test with a method annotated as {@link NonTckTest}.
- */
- public static class Non extends Base {
-
- public Non() {
- }
-
- @NonTckTest
- public void testNon() {
- }
-
- public void testOne() {
- }
-
- public void testTwo() {
- }
- }
-
- /**
- * Sample test without annotated test messages.
- */
- public static class Normal extends Base {
-
- public Normal() {
- }
-
- public void testOne() {
- }
-
- public void testTwo() {
- }
- }
-
- /**
- * Sample test with a method annotated as {@link NotSupported}.
- */
- public static class Not extends Base {
-
- public Not() {
- }
-
- @NotSupported(reason = Reason.IO)
- public void testFailing() {
- }
-
- public void testOne() {
- }
-
- public void testTwo() {
- }
- }
-
- private abstract static class Base extends GWTTestCase {
-
- public Base() {
- }
-
- @Override
- public final String getModuleName() {
- return "org.hibernate.jsr303.tck.tests.metadata.TckTest";
- }
- }
-
- private TckTestSuiteWrapper suite;
-
- public void checkAddTest(Class<? extends GWTTestCase> clazz, int expected) {
- suite.addTestSuite(clazz);
- assertEquals(expected, suite.testAt(0).countTestCases());
- }
-
- public void testAddTestMarkedFailing() throws Exception {
- checkAddTest(Fail.class, 2);
- }
-
- public void testAddTestMarkedNotSupported() throws Exception {
- checkAddTest(Not.class, 2);
- }
-
- public void testAddTestNon() throws Exception {
- checkAddTest(Non.class, 3);
- }
-
- public void testAddTestNormal() throws Exception {
- checkAddTest(Normal.class, 2);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- suite = new TckTestSuiteWrapper("Test");
- }
-
-}
diff --git a/user/test/org/hibernate/jsr303/tck/util/UtilJreSuite.java b/user/test/org/hibernate/jsr303/tck/util/UtilJreSuite.java
deleted file mode 100644
index 5e87704..0000000
--- a/user/test/org/hibernate/jsr303/tck/util/UtilJreSuite.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.util;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-
-/**
- * Test Suite for non GWT tests.
- */
-public class UtilJreSuite {
-
- public static Test suite() {
- TestSuite suite = new TestSuite("Test suite for tck utility classes");
- suite.addTestSuite(TckTestSuiteWrapperTest.class);
- return suite;
- }
-
-}
diff --git a/user/test/org/hibernate/jsr303/tck/util/client/Failing.java b/user/test/org/hibernate/jsr303/tck/util/client/Failing.java
deleted file mode 100644
index f742a30..0000000
--- a/user/test/org/hibernate/jsr303/tck/util/client/Failing.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.util.client;
-
-import org.hibernate.jsr303.tck.util.TckTestSuiteWrapper;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Marks a testMethod as Failing to prevent it from running in the standard TCK
- * tests. Used by the {@link TckTestSuiteWrapper}.
- */
-@Target({METHOD})
-@Retention(RUNTIME)
-@Documented
-public @interface Failing {
- /**
- * The JVM property name checked by {@link TckTestSuiteWrapper}. If the JVM
- * property {@value} is set to true the {@link TckTestSuiteWrapper} will run
- * tests annotated {@link Failing}.
- */
- String INCLUDE = "com.google.gwt.sample.validationtck.util.Failing.include";
-
- /**
- * The GWT issue for fixing this failing test.
- * <p>
- * The issue is at
- * http://code.google.com/p/google-web-toolkit/issues/detail?id={@code <issue>}
- */
- int issue();
-}
diff --git a/user/test/org/hibernate/jsr303/tck/util/client/NonTckTest.java b/user/test/org/hibernate/jsr303/tck/util/client/NonTckTest.java
deleted file mode 100644
index ef1f899..0000000
--- a/user/test/org/hibernate/jsr303/tck/util/client/NonTckTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.util.client;
-
-import org.hibernate.jsr303.tck.util.TckTestSuiteWrapper;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Marks a testMethod as not part of the TCK. The test is run by default but it
- * is excluded from TCK reports. Used by the {@link TckTestSuiteWrapper}.
- */
-@Target({METHOD})
-@Retention(RUNTIME)
-@Documented
-public @interface NonTckTest {
- /**
- * The JVM property name checked by {@link TckTestSuiteWrapper}. If the JVM
- * property {@value} is set to true the {@link TckTestSuiteWrapper} will not
- * run the tests annotated {@link Failing}.
- */
- String EXCLUDE = "com.google.gwt.sample.validationtck.util.NotTckTest.exclude";
-}
diff --git a/user/test/org/hibernate/jsr303/tck/util/client/NotSupported.java b/user/test/org/hibernate/jsr303/tck/util/client/NotSupported.java
deleted file mode 100644
index cf49ea7..0000000
--- a/user/test/org/hibernate/jsr303/tck/util/client/NotSupported.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.util.client;
-
-import org.hibernate.jsr303.tck.util.TckTestSuiteWrapper;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Marks a testMethod as not supported to prevent it from running in the
- * standard tests. Use this when the behavior being tested is not supported by
- * GWT Validation. Used by the {@link TckTestSuiteWrapper}.
- */
-@Target({METHOD})
-@Retention(RUNTIME)
-@Documented
-public @interface NotSupported {
- /**
- * Constants for why a test is not supported.
- */
- public enum Reason {
- XML, IO, CALENDAR
- }
-
- /**
- * The JVM property name checked by {@link TckTestSuiteWrapper}. If the JVM
- * property {@value} is set to true the {@link TckTestSuiteWrapper} will run
- * tests annotated {@link NotSupported}.
- */
- String INCLUDE = "com.google.gwt.sample.validationtck.util.NotSupported.include";
-
- Reason reason();
-}
diff --git a/user/test/org/hibernate/jsr303/tck/util/client/TestNotCompatible.java b/user/test/org/hibernate/jsr303/tck/util/client/TestNotCompatible.java
deleted file mode 100644
index aaeb06c..0000000
--- a/user/test/org/hibernate/jsr303/tck/util/client/TestNotCompatible.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * 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.jsr303.tck.util.client;
-
-import org.hibernate.jsr303.tck.util.TckTestSuiteWrapper;
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Marks a testMethod as not compatible to prevent it from running in the
- * standard tests. Use this when the test code is not supported by GWT, but the
- * behavior is tested in some other way. Used by the {@link TckTestSuiteWrapper}
- * .
- */
-@Target({METHOD})
-@Retention(RUNTIME)
-@Documented
-public @interface TestNotCompatible {
- /**
- * Constants for why a test is not supported.
- */
- public enum Reason {
- REFLECTION
- }
-
- /**
- * The JVM property name checked by {@link TckTestSuiteWrapper}. If the JVM
- * property {@value} is set to true the {@link TckTestSuiteWrapper} will run
- * tests annotated {@link TestNotCompatible}.
- */
- String INCLUDE = "com.google.gwt.sample.validationtck.util.TestNotCompatible.include";
-
- Reason reason();
-
- String whereTested();
-}
diff --git a/user/test/org/jboss/test/audit/JbossTestAudit.gwt.xml b/user/test/org/jboss/test/audit/JbossTestAudit.gwt.xml
deleted file mode 100644
index 28f34b9..0000000
--- a/user/test/org/jboss/test/audit/JbossTestAudit.gwt.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-This is a HACK, is not a general solution for using JBoss Test Audit.
-It is only enough to run the tests in the GWT Validation TCK.
--->
-<module>
- <inherits name="com.google.gwt.user.User" />
- <source path="">
- </source>
-</module>
\ No newline at end of file
diff --git a/user/test/org/jboss/testharness/JbossTestHarness.gwt.xml b/user/test/org/jboss/testharness/JbossTestHarness.gwt.xml
deleted file mode 100644
index 8c8fa5d..0000000
--- a/user/test/org/jboss/testharness/JbossTestHarness.gwt.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-This is a HACK, is not a general solution for using JBoss Test Harness.
-It is only enough to run the tests in the GWT Validation TCK.
--->
-<module>
- <inherits name="org.testng.TestNg" />
- <source path="api">
- <include name="DeploymentException.java"/>
- </source>
- <super-source path="super" />
-</module>
\ No newline at end of file
diff --git a/user/test/org/testng/TestNg.gwt.xml b/user/test/org/testng/TestNg.gwt.xml
deleted file mode 100644
index d0a2fcb..0000000
--- a/user/test/org/testng/TestNg.gwt.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-This is a HACK, is not a general solution for using TestNg.
-It is only enough to run the tests in the GWT Validation TCK.
--->
-<module>
- <inherits name="com.google.gwt.user.User" />
- <inherits name="com.google.gwt.junit.JUnit" />
- <source path="annotations">
- <exclude name="ITestAnnotation.java" />
- <exclude name="Listeners.java" />
- <exclude name="Optional.java" />
- </source>
- <source path="collections" />
- <source path="">
- <include name="Assert.java" />
- <include name="AssertJUnit.java" />
- <include name="IClass.java" />
- <include name="IHookable.java" />
- <include name="IHookCallBack.java" />
- <include name="ITestResult.java" />
- <include name="ITestNGListener.java" />
- <include name="ITestNGMethod.java" />
- <include name="IAttributes.java" />
- <include name="IRetryAnalyzer.java" />
- <include name="ITestClass.java" />
- </source>
- <super-source path="super" />
-</module>
\ No newline at end of file