Add more TCK tests
[JSR 303 TCK Result] 90 of 257 (35.02%) Pass with 29 Failures and 12 Errors.
Review at http://gwt-code-reviews.appspot.com/1298802
Review by: rchandia@google.com
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@9621 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/test/com/google/gwt/validation/tck/MetadataGwtSuite.java b/user/test/com/google/gwt/validation/tck/MetadataGwtSuite.java
index 3ce44a9..3a147fb 100644
--- a/user/test/com/google/gwt/validation/tck/MetadataGwtSuite.java
+++ b/user/test/com/google/gwt/validation/tck/MetadataGwtSuite.java
@@ -20,6 +20,9 @@
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;
/**
@@ -30,6 +33,9 @@
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
index b0335f3..9e486b9 100644
--- a/user/test/com/google/gwt/validation/tck/ValidationGwtSuite.java
+++ b/user/test/com/google/gwt/validation/tck/ValidationGwtSuite.java
@@ -18,6 +18,7 @@
import junit.framework.Test;
import org.hibernate.jsr303.tck.tests.validation.PropertyPathGwtTest;
+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;
@@ -31,6 +32,7 @@
TckTestSuiteWrapper suite = new TckTestSuiteWrapper(
"TCK for GWT Validation, validation package");
suite.addTestSuite(PropertyPathGwtTest.class);
+ suite.addTestSuite(ValidateGwtTest.class);
suite.addTestSuite(ValidatePropertyGwtTest.class);
suite.addTestSuite(ValidateValueGwtTest.class);
suite.addTestSuite(ValidationGwtTest.class);
diff --git a/user/test/org/hibernate/jsr303/tck/tests/metadata/ConstraintDescriptorGwtTest.java b/user/test/org/hibernate/jsr303/tck/tests/metadata/ConstraintDescriptorGwtTest.java
new file mode 100644
index 0000000..89a0f39
--- /dev/null
+++ b/user/test/org/hibernate/jsr303/tck/tests/metadata/ConstraintDescriptorGwtTest.java
@@ -0,0 +1,80 @@
+/*
+ * 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 ConstraintDescriptorTest}.
+ */
+public class ConstraintDescriptorGwtTest extends GWTTestCase {
+ private final ConstraintDescriptorTest delegate = new ConstraintDescriptorTest();
+
+ @Override
+ public String getModuleName() {
+ return "org.hibernate.jsr303.tck.tests.metadata.TckTest";
+ }
+
+ @Failing(issue = 5931)
+ public void testAnnotationAndMapParametersReflectParameterOverriding() {
+ delegate.testAnnotationAndMapParametersReflectParameterOverriding();
+ }
+
+ @Failing(issue = 5931)
+ public void testComposingConstraints() {
+ delegate.testComposingConstraints();
+ }
+
+ @Failing(issue = 5931)
+ public void testComposingConstraintsPayload() {
+ delegate.testComposingConstraintsPayload();
+ }
+
+ public void testDefaultGroupIsReturnedIfNoGroupSpecifiedInDeclaration() {
+ delegate.testDefaultGroupIsReturnedIfNoGroupSpecifiedInDeclaration();
+ }
+
+ @Failing(issue = 5931)
+ 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
new file mode 100644
index 0000000..63fffe1
--- /dev/null
+++ b/user/test/org/hibernate/jsr303/tck/tests/metadata/ElementDescriptorGwtTest.java
@@ -0,0 +1,70 @@
+/*
+ * 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
new file mode 100644
index 0000000..bdc551b
--- /dev/null
+++ b/user/test/org/hibernate/jsr303/tck/tests/metadata/PropertyDescriptorGwtTest.java
@@ -0,0 +1,42 @@
+/*
+ * 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/TckTestValidatorFactory.java b/user/test/org/hibernate/jsr303/tck/tests/metadata/TckTestValidatorFactory.java
index 9813906..a6fbc25 100644
--- a/user/test/org/hibernate/jsr303/tck/tests/metadata/TckTestValidatorFactory.java
+++ b/user/test/org/hibernate/jsr303/tck/tests/metadata/TckTestValidatorFactory.java
@@ -31,8 +31,8 @@
* Marker Interface to {@link GWT#create(Class)}.
*/
@GwtValidation(value = {
- Account.class, Customer.class, Man.class, Order.class,
- UnconstraintEntity.class})
+ Account.class, Customer.class, Man.class, Order.class, Person.class,
+ SubClass.class, SuperClass.class, UnconstraintEntity.class})
public static interface GwtValidator extends Validator {
}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/validation/TckTestValidatorFactory.java b/user/test/org/hibernate/jsr303/tck/tests/validation/TckTestValidatorFactory.java
index 6be0de3..f3e0055 100644
--- a/user/test/org/hibernate/jsr303/tck/tests/validation/TckTestValidatorFactory.java
+++ b/user/test/org/hibernate/jsr303/tck/tests/validation/TckTestValidatorFactory.java
@@ -22,6 +22,7 @@
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;
@@ -36,8 +37,8 @@
@GwtValidation(value = {
// Actor must be after its subclasses
ActorDB.class, ActorArrayBased.class, ActorListBased.class, Actor.class,
- Address.class, BadlyBehavedEntity.class, Customer.class, Engine.class,
- Order.class, VerySpecialClass.class})
+ Address.class, BadlyBehavedEntity.class, Car.class,
+ Customer.class, Engine.class, Order.class, VerySpecialClass.class})
public static interface GwtValidator extends Validator {
}
diff --git a/user/test/org/hibernate/jsr303/tck/tests/validation/ValidateGwtTest.java b/user/test/org/hibernate/jsr303/tck/tests/validation/ValidateGwtTest.java
new file mode 100644
index 0000000..12a9d9c
--- /dev/null
+++ b/user/test/org/hibernate/jsr303/tck/tests/validation/ValidateGwtTest.java
@@ -0,0 +1,114 @@
+/*
+ * 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
+ }
+ }
+
+ @Failing(issue = 5929)
+ public void testValidatedPropertyDoesNotFollowJavaBeansConvention() {
+ delegate.testValidatedPropertyDoesNotFollowJavaBeansConvention();
+ }
+
+ 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
+ }
+ }
+
+ @Failing(issue = 5930)
+ 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
index 5c72d4e..93bb063 100644
--- a/user/test/org/hibernate/jsr303/tck/tests/validation/ValidatePropertyGwtTest.java
+++ b/user/test/org/hibernate/jsr303/tck/tests/validation/ValidatePropertyGwtTest.java
@@ -26,15 +26,18 @@
private final ValidatePropertyTest delegate = new ValidatePropertyTest();
- public void testIllegalArgumentExceptionIsThrownForNullValue() {
+ // Add Property Prefix so test name is unique in the suite.
+ public void testPropertyIllegalArgumentExceptionIsThrownForNullValue() {
delegate.testIllegalArgumentExceptionIsThrownForNullValue();
}
- public void testPassingNullAsGroup() {
+ // Add Property Prefix so test name is unique in the suite.
+ public void testPropertyPassingNullAsGroup() {
delegate.testPassingNullAsGroup();
}
- public void testUnexpectedExceptionsInValidatePropertyGetWrappedInValidationExceptions() {
+ // 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();