[hibernate-commits] Hibernate SVN: r17507 - in beanvalidation/trunk/validation-tck/src/main: resources/org/hibernate/jsr303/tck/tests/xmlconfiguration and 1 other directory.
hibernate-commits at lists.jboss.org
hibernate-commits at lists.jboss.org
Fri Sep 11 11:49:40 EDT 2009
Author: hardy.ferentschik
Date: 2009-09-11 11:49:40 -0400 (Fri, 11 Sep 2009)
New Revision: 17507
Added:
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/DuplicateConfigurationTest.java
Removed:
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/MultipleBeanDefinitionTest.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/MultipleFieldDefinitionTest.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/MultipleGetterDefinitionTest.java
beanvalidation/trunk/validation-tck/src/main/resources/org/hibernate/jsr303/tck/tests/xmlconfiguration/validation-MultipleBeanDefinitionTest.xml
beanvalidation/trunk/validation-tck/src/main/resources/org/hibernate/jsr303/tck/tests/xmlconfiguration/validation-MultipleFieldDefinitionTest.xml
beanvalidation/trunk/validation-tck/src/main/resources/org/hibernate/jsr303/tck/tests/xmlconfiguration/validation-MultipleGetterDefinitionTest.xml
Log:
combined several test classes into one
Copied: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/DuplicateConfigurationTest.java (from rev 17502, beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/MultipleBeanDefinitionTest.java)
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/DuplicateConfigurationTest.java (rev 0)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/DuplicateConfigurationTest.java 2009-09-11 15:49:40 UTC (rev 17507)
@@ -0,0 +1,113 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.jsr303.tck.tests.xmlconfiguration;
+
+
+import javax.validation.Configuration;
+import javax.validation.ValidationException;
+
+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.Resource;
+import org.jboss.testharness.impl.packaging.Resources;
+import static org.testng.Assert.fail;
+import org.testng.annotations.Test;
+
+import org.hibernate.jsr303.tck.util.TestUtil;
+
+/**
+ * @author Hardy Ferentschik
+ */
+ at Artifact(artifactType = ArtifactType.JSR303)
+ at Classes({ TestUtil.class, TestUtil.PathImpl.class, TestUtil.NodeImpl.class })
+ at Resources(
+ {
+ @Resource(source = DuplicateConfigurationTest.mappingFile1,
+ destination = "WEB-INF/classes" + DuplicateConfigurationTest.packageName + DuplicateConfigurationTest.mappingFile1),
+ @Resource(source = DuplicateConfigurationTest.mappingFile2,
+ destination = "WEB-INF/classes" + DuplicateConfigurationTest.packageName + DuplicateConfigurationTest.mappingFile2),
+ @Resource(source = DuplicateConfigurationTest.mappingFile3,
+ destination = "WEB-INF/classes" + DuplicateConfigurationTest.packageName + DuplicateConfigurationTest.mappingFile3),
+ @Resource(source = DuplicateConfigurationTest.mappingFile4,
+ destination = "WEB-INF/classes" + DuplicateConfigurationTest.packageName + DuplicateConfigurationTest.mappingFile4)
+ }
+)
+public class DuplicateConfigurationTest extends AbstractTest {
+
+ public final static String packageName = "/org/hibernate/jsr303/tck/tests/xmlconfiguration/";
+ public final static String mappingFile1 = "user-constraints.xml";
+ public final static String mappingFile2 = "user-constraints-MultipleBeanDefinitionTest.xml";
+ public final static String mappingFile3 = "user-constraints-MultipleFieldDefinitionTest.xml";
+ public final static String mappingFile4 = "user-constraints-MultipleGetterDefinitionTest.xml";
+
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section = "7.1", id = "b"),
+ @SpecAssertion(section = "7.1", id = "e")
+ })
+ public void testBeanCannotBeDescribedMoreThanOnce() {
+ try {
+ Configuration<?> config = TestUtil.getConfigurationUnderTest();
+ config.addMapping( TestUtil.getInputStreamForPath( packageName + mappingFile1 ) );
+ config.addMapping( TestUtil.getInputStreamForPath( packageName + mappingFile2 ) );
+ config.buildValidatorFactory().getValidator();
+ fail( "You should not be able to define the same bean multiple times." );
+ }
+ catch ( ValidationException e ) {
+ // success
+ }
+ }
+
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section = "7.1", id = "c"),
+ @SpecAssertion(section = "7.1", id = "e")
+ })
+ public void testFieldMappingCannotOccurMoreThanOnce() {
+ try {
+ Configuration<?> config = TestUtil.getConfigurationUnderTest();
+ config.addMapping( TestUtil.getInputStreamForPath( packageName + mappingFile3 ) );
+ config.buildValidatorFactory().getValidator();
+ fail( "You should not be able to define multiple field mappings per entity" );
+ }
+ catch ( ValidationException e ) {
+ // success
+ }
+ }
+
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section = "7.1", id = "d"),
+ @SpecAssertion(section = "7.1", id = "e")
+ })
+ public void testGetterMappingCannotOccurMoreThanOnce() {
+ try {
+ Configuration<?> config = TestUtil.getConfigurationUnderTest();
+ config.addMapping( TestUtil.getInputStreamForPath( packageName + mappingFile4 ) );
+ config.buildValidatorFactory().getValidator();
+ fail( "You should not be able to define multiple getter mappings per entity" );
+ }
+ catch ( ValidationException e ) {
+ // success
+ }
+ }
+}
\ No newline at end of file
Deleted: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/MultipleBeanDefinitionTest.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/MultipleBeanDefinitionTest.java 2009-09-11 11:15:49 UTC (rev 17506)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/MultipleBeanDefinitionTest.java 2009-09-11 15:49:40 UTC (rev 17507)
@@ -1,67 +0,0 @@
-// $Id$
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-* http://www.apache.org/licenses/LICENSE-2.0
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-package org.hibernate.jsr303.tck.tests.xmlconfiguration;
-
-
-import javax.validation.ValidationException;
-
-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.Resource;
-import org.jboss.testharness.impl.packaging.Resources;
-import org.jboss.testharness.impl.packaging.jsr303.ValidationXml;
-import static org.testng.Assert.fail;
-import org.testng.annotations.Test;
-
-import org.hibernate.jsr303.tck.util.TestUtil;
-
-/**
- * @author Hardy Ferentschik
- */
- at Artifact(artifactType = ArtifactType.JSR303)
- at Classes({ TestUtil.class, TestUtil.PathImpl.class, TestUtil.NodeImpl.class })
- at ValidationXml(value = "validation-MultipleBeanDefinitionTest.xml")
- at Resources(
- {
- @Resource(source = "user-constraints.xml",
- destination = "WEB-INF/classes/org/hibernate/jsr303/tck/tests/xmlconfiguration/user-constraints.xml"),
- @Resource(source = "user-constraints-MultipleBeanDefinitionTest.xml",
- destination = "WEB-INF/classes/org/hibernate/jsr303/tck/tests/xmlconfiguration/user-constraints-MultipleBeanDefinitionTest.xml")
- }
-)
-public class MultipleBeanDefinitionTest extends AbstractTest {
-
- @Test
- @SpecAssertions({
- @SpecAssertion(section = "7.1", id = "b"),
- @SpecAssertion(section = "7.1", id = "e")
- })
- public void testBeanCannotBeDescribedMoreThanOnce() {
- try {
- TestUtil.getValidatorUnderTest();
- fail( "You should not be able to define the same bean multiple times." );
- }
- catch ( ValidationException e ) {
- // success
- }
- }
-}
\ No newline at end of file
Deleted: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/MultipleFieldDefinitionTest.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/MultipleFieldDefinitionTest.java 2009-09-11 11:15:49 UTC (rev 17506)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/MultipleFieldDefinitionTest.java 2009-09-11 15:49:40 UTC (rev 17507)
@@ -1,60 +0,0 @@
-// $Id$
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-* http://www.apache.org/licenses/LICENSE-2.0
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-package org.hibernate.jsr303.tck.tests.xmlconfiguration;
-
-
-import javax.validation.ValidationException;
-
-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.Resource;
-import org.jboss.testharness.impl.packaging.jsr303.ValidationXml;
-import static org.testng.Assert.fail;
-import org.testng.annotations.Test;
-
-import org.hibernate.jsr303.tck.util.TestUtil;
-
-/**
- * @author Hardy Ferentschik
- */
- at Artifact(artifactType = ArtifactType.JSR303)
- at Classes({ TestUtil.class, TestUtil.PathImpl.class, TestUtil.NodeImpl.class })
- at ValidationXml(value = "validation-MultipleFieldDefinitionTest.xml")
- at Resource(source = "user-constraints-MultipleFieldDefinitionTest.xml",
- destination = "WEB-INF/classes/org/hibernate/jsr303/tck/tests/xmlconfiguration/user-constraints-MultipleFieldDefinitionTest.xml")
-public class MultipleFieldDefinitionTest extends AbstractTest {
-
- @Test
- @SpecAssertions({
- @SpecAssertion(section = "7.1", id = "c"),
- @SpecAssertion(section = "7.1", id = "e")
- })
- public void testFieldMappingCannotOccurMoreThanOnce() {
- try {
- TestUtil.getValidatorUnderTest();
- fail( "You should not be able to define multiple field mappings per entity" );
- }
- catch ( ValidationException e ) {
- // success
- }
- }
-}
\ No newline at end of file
Deleted: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/MultipleGetterDefinitionTest.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/MultipleGetterDefinitionTest.java 2009-09-11 11:15:49 UTC (rev 17506)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/MultipleGetterDefinitionTest.java 2009-09-11 15:49:40 UTC (rev 17507)
@@ -1,60 +0,0 @@
-// $Id$
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-* http://www.apache.org/licenses/LICENSE-2.0
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-package org.hibernate.jsr303.tck.tests.xmlconfiguration;
-
-
-import javax.validation.ValidationException;
-
-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.Resource;
-import org.jboss.testharness.impl.packaging.jsr303.ValidationXml;
-import static org.testng.Assert.fail;
-import org.testng.annotations.Test;
-
-import org.hibernate.jsr303.tck.util.TestUtil;
-
-/**
- * @author Hardy Ferentschik
- */
- at Artifact(artifactType = ArtifactType.JSR303)
- at Classes({ TestUtil.class, TestUtil.PathImpl.class, TestUtil.NodeImpl.class })
- at ValidationXml(value = "validation-MultipleGetterDefinitionTest.xml")
- at Resource(source = "user-constraints-MultipleGetterDefinitionTest.xml",
- destination = "WEB-INF/classes/org/hibernate/jsr303/tck/tests/xmlconfiguration/user-constraints-MultipleGetterDefinitionTest.xml")
-public class MultipleGetterDefinitionTest extends AbstractTest {
-
- @Test
- @SpecAssertions({
- @SpecAssertion(section = "7.1", id = "d"),
- @SpecAssertion(section = "7.1", id = "e")
- })
- public void testGetterMappingCannotOccurMoreThanOnce() {
- try {
- TestUtil.getValidatorUnderTest();
- fail( "You should not be able to define multiple getter mappings per entity" );
- }
- catch ( ValidationException e ) {
- // success
- }
- }
-}
\ No newline at end of file
Deleted: beanvalidation/trunk/validation-tck/src/main/resources/org/hibernate/jsr303/tck/tests/xmlconfiguration/validation-MultipleBeanDefinitionTest.xml
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/resources/org/hibernate/jsr303/tck/tests/xmlconfiguration/validation-MultipleBeanDefinitionTest.xml 2009-09-11 11:15:49 UTC (rev 17506)
+++ beanvalidation/trunk/validation-tck/src/main/resources/org/hibernate/jsr303/tck/tests/xmlconfiguration/validation-MultipleBeanDefinitionTest.xml 2009-09-11 15:49:40 UTC (rev 17507)
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<validation-config xmlns="http://jboss.org/xml/ns/javax/validation/configuration"
- xsi:schemaLocation="http://jboss.org/xml/ns/javax/validation/configuration validation-configuration-1.0.xsd"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <constraint-mapping>org/hibernate/jsr303/tck/tests/xmlconfiguration/user-constraints.xml</constraint-mapping>
- <constraint-mapping>org/hibernate/jsr303/tck/tests/xmlconfiguration/user-constraints-MultipleBeanDefinitionTest.xml</constraint-mapping>
-</validation-config>
\ No newline at end of file
Deleted: beanvalidation/trunk/validation-tck/src/main/resources/org/hibernate/jsr303/tck/tests/xmlconfiguration/validation-MultipleFieldDefinitionTest.xml
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/resources/org/hibernate/jsr303/tck/tests/xmlconfiguration/validation-MultipleFieldDefinitionTest.xml 2009-09-11 11:15:49 UTC (rev 17506)
+++ beanvalidation/trunk/validation-tck/src/main/resources/org/hibernate/jsr303/tck/tests/xmlconfiguration/validation-MultipleFieldDefinitionTest.xml 2009-09-11 15:49:40 UTC (rev 17507)
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<validation-config xmlns="http://jboss.org/xml/ns/javax/validation/configuration"
- xsi:schemaLocation="http://jboss.org/xml/ns/javax/validation/configuration validation-configuration-1.0.xsd"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <constraint-mapping>
- org/hibernate/jsr303/tck/tests/xmlconfiguration/user-constraints-MultipleFieldDefinitionTest.xml
- </constraint-mapping>
-</validation-config>
\ No newline at end of file
Deleted: beanvalidation/trunk/validation-tck/src/main/resources/org/hibernate/jsr303/tck/tests/xmlconfiguration/validation-MultipleGetterDefinitionTest.xml
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/resources/org/hibernate/jsr303/tck/tests/xmlconfiguration/validation-MultipleGetterDefinitionTest.xml 2009-09-11 11:15:49 UTC (rev 17506)
+++ beanvalidation/trunk/validation-tck/src/main/resources/org/hibernate/jsr303/tck/tests/xmlconfiguration/validation-MultipleGetterDefinitionTest.xml 2009-09-11 15:49:40 UTC (rev 17507)
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<validation-config xmlns="http://jboss.org/xml/ns/javax/validation/configuration"
- xsi:schemaLocation="http://jboss.org/xml/ns/javax/validation/configuration validation-configuration-1.0.xsd"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <constraint-mapping>
- org/hibernate/jsr303/tck/tests/xmlconfiguration/user-constraints-MultipleGetterDefinitionTest.xml
- </constraint-mapping>
-</validation-config>
\ No newline at end of file
More information about the hibernate-commits
mailing list