Hibernate SVN: r17246 - beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-08-06 11:33:38 -0400 (Thu, 06 Aug 2009)
New Revision: 17246
Added:
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/ValidationTest.java
Log:
Added tests for Validation class
Copied: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/ValidationTest.java (from rev 17238, beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/ValidateTest.java)
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/ValidationTest.java (rev 0)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/ValidationTest.java 2009-08-06 15:33:38 UTC (rev 17246)
@@ -0,0 +1,98 @@
+// $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.validation;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.test.audit.annotations.SpecAssertion;
+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.fail;
+import org.testng.annotations.Test;
+
+import org.hibernate.jsr303.tck.util.TestUtil;
+
+/**
+ * Tests for the implementation of <code>Validator</code>.
+ *
+ * @author Hardy Ferentschik
+ */
+@Artifact(artifactType = ArtifactType.JSR303)
+@Classes({ TestUtil.class, TestUtil.PathImpl.class, TestUtil.NodeImpl.class })
+public class ValidationTest extends AbstractTest {
+
+ @Test
+ @SpecAssertion(section = "4.4.5", id = "a")
+ public void testVerifyMethodsOfValidationObjects() {
+ Class<?> validatorClass = javax.validation.Validation.class;
+
+ List<Method> expectedValidationMethods = new ArrayList<Method>();
+ Method buildDefaultValidatorFactoryMethod = null;
+ try {
+ buildDefaultValidatorFactoryMethod = validatorClass.getMethod( "buildDefaultValidatorFactory" );
+ }
+ catch ( NoSuchMethodException e ) {
+ fail( "Validation class is mising bootstrap method." );
+ }
+ expectedValidationMethods.add( buildDefaultValidatorFactoryMethod );
+
+ Method byDefaultProviderMethod = null;
+ try {
+ byDefaultProviderMethod = validatorClass.getMethod( "byDefaultProvider" );
+ }
+ catch ( NoSuchMethodException e ) {
+ fail( "Validation class is mising bootstrap method." );
+ }
+ expectedValidationMethods.add( byDefaultProviderMethod );
+
+ Method byProviderMethod = null;
+ try {
+ byProviderMethod = validatorClass.getMethod( "byProvider", Class.class );
+ }
+ catch ( NoSuchMethodException e ) {
+ fail( "Validation class is mising bootstrap method." );
+ }
+ expectedValidationMethods.add( byProviderMethod );
+
+ Method[] validationMethods = validatorClass.getMethods();
+ for ( Method m : validationMethods ) {
+ if ( expectedValidationMethods.contains( m ) || m.getDeclaringClass() != validatorClass ) {
+ continue;
+ }
+ if ( Modifier.isPublic( m.getModifiers() ) || Modifier.isProtected( m.getModifiers() ) ) {
+ fail( "Validation cannot have a non private method on top of the specified ones. " + m.getName() + " not allowed." );
+ }
+ }
+
+ Field[] validationFields = validatorClass.getFields();
+ for ( Field f : validationFields ) {
+ if ( f.getDeclaringClass() != validatorClass ) {
+ continue;
+ }
+ if ( Modifier.isPublic( f.getModifiers() ) || Modifier.isProtected( f.getModifiers() ) ) {
+ fail( "Validation cannot have a non private field. " + f.getName() + " not allowed." );
+ }
+ }
+ }
+}
\ No newline at end of file
16 years, 8 months
Hibernate SVN: r17245 - core/branches/INFINISPAN/cache-infinispan.
by hibernate-commits@lists.jboss.org
Author: galder.zamarreno(a)jboss.com
Date: 2009-08-06 10:41:10 -0400 (Thu, 06 Aug 2009)
New Revision: 17245
Modified:
core/branches/INFINISPAN/cache-infinispan/
Log:
Added .project svn ignore.
Property changes on: core/branches/INFINISPAN/cache-infinispan
___________________________________________________________________
Name: svn:ignore
- target
.classpath
+ target
.classpath
.project
16 years, 8 months
Hibernate SVN: r17244 - in core/branches/INFINISPAN/cache-infinispan: src/main/java/org/hibernate/cache/infinispan and 2 other directories.
by hibernate-commits@lists.jboss.org
Author: galder.zamarreno(a)jboss.com
Date: 2009-08-06 10:36:33 -0400 (Thu, 06 Aug 2009)
New Revision: 17244
Added:
core/branches/INFINISPAN/cache-infinispan/src/main/java/org/hibernate/cache/infinispan/DataTypeConfig.java
core/branches/INFINISPAN/cache-infinispan/src/main/resources/org/hibernate/cache/infinispan/builder/infinispan-configs.xml
core/branches/INFINISPAN/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/InfinispanRegionFactoryTestCase.java
Removed:
core/branches/INFINISPAN/cache-infinispan/.settings/
core/branches/INFINISPAN/cache-infinispan/src/main/resources/org/hibernate/cache/infinispan/builder/ispn4-configs.xml
Modified:
core/branches/INFINISPAN/cache-infinispan/src/main/java/org/hibernate/cache/infinispan/InfinispanRegionFactory.java
core/branches/INFINISPAN/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/InfinispanTest.java
Log:
[ISPN-6] Defined data type and individual entity/collection configuration properties and added UT for them.
Added: core/branches/INFINISPAN/cache-infinispan/src/main/java/org/hibernate/cache/infinispan/DataTypeConfig.java
===================================================================
--- core/branches/INFINISPAN/cache-infinispan/src/main/java/org/hibernate/cache/infinispan/DataTypeConfig.java (rev 0)
+++ core/branches/INFINISPAN/cache-infinispan/src/main/java/org/hibernate/cache/infinispan/DataTypeConfig.java 2009-08-06 14:36:33 UTC (rev 17244)
@@ -0,0 +1,112 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.hibernate.cache.infinispan;
+
+import java.util.Locale;
+
+import org.infinispan.eviction.EvictionStrategy;
+
+/**
+ * This class represents parameters that can be configured for general
+ * entity/collection/query/timestamp data type caches and overrides for
+ * individual entity or collection caches.
+ *
+ * @author Galder Zamarreño
+ */
+public class DataTypeConfig {
+
+ private String cache;
+
+ private EvictionStrategy strategy;
+
+ private long wakeUpInterval;
+
+ private int maxEntries;
+
+ private long lifespan;
+
+ private long maxIdle;
+
+ public String getCache() {
+ return cache;
+ }
+
+ public void setCache(String cache) {
+ this.cache = cache;
+ }
+
+ public EvictionStrategy getStrategy() {
+ return strategy;
+ }
+
+ public void setStrategy(String strategy) {
+ this.strategy = EvictionStrategy.valueOf(uc(strategy));
+ }
+
+ public long getWakeUpInterval() {
+ return wakeUpInterval;
+ }
+
+ public void setWakeUpInterval(long wakeUpInterval) {
+ this.wakeUpInterval = wakeUpInterval;
+ }
+
+ public int getMaxEntries() {
+ return maxEntries;
+ }
+
+ public void setMaxEntries(int maxEntries) {
+ this.maxEntries = maxEntries;
+ }
+
+ public long getLifespan() {
+ return lifespan;
+ }
+
+ public void setLifespan(long lifespan) {
+ this.lifespan = lifespan;
+ }
+
+ public long getMaxIdle() {
+ return maxIdle;
+ }
+
+ public void setMaxIdle(long maxIdle) {
+ this.maxIdle = maxIdle;
+ }
+
+ @Override
+ public String toString() {
+ return new StringBuilder().append(getClass().getSimpleName()).append('{')
+ .append("cache=").append(cache)
+ .append(", strategy=").append(strategy)
+ .append(", wakeUpInterval=").append(wakeUpInterval)
+ .append(", maxEntries=").append(maxEntries)
+ .append(", lifespan=").append(lifespan)
+ .append(", maxIdle=").append(maxIdle)
+ .append('}').toString();
+ }
+
+ private String uc(String s) {
+ return s == null ? null : s.toUpperCase(Locale.ENGLISH);
+ }
+}
Modified: core/branches/INFINISPAN/cache-infinispan/src/main/java/org/hibernate/cache/infinispan/InfinispanRegionFactory.java
===================================================================
--- core/branches/INFINISPAN/cache-infinispan/src/main/java/org/hibernate/cache/infinispan/InfinispanRegionFactory.java 2009-08-06 14:18:54 UTC (rev 17243)
+++ core/branches/INFINISPAN/cache-infinispan/src/main/java/org/hibernate/cache/infinispan/InfinispanRegionFactory.java 2009-08-06 14:36:33 UTC (rev 17244)
@@ -1,5 +1,9 @@
package org.hibernate.cache.infinispan;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
import java.util.Properties;
import org.hibernate.cache.CacheDataDescription;
@@ -25,16 +29,95 @@
* regions.
*
* @author Chris Bredesen
+ * @author Galder Zamarreño
*/
public class InfinispanRegionFactory implements RegionFactory {
private static final Logger log = LoggerFactory.getLogger(InfinispanRegionFactory.class);
+ private static final String PREFIX = "hibernate.cache.infinispan.";
+
+ private static final String CONFIG_SUFFIX = ".cfg";
+
+ private static final String STRATEGY_SUFFIX = ".eviction.strategy";
+
+ private static final String WAKE_UP_INTERVAL_SUFFIX = ".eviction.wake_up_interval";
+
+ private static final String MAX_ENTRIES_SUFFIX = ".eviction.max_entries";
+
+ private static final String LIFESPAN_SUFFIX = ".eviction.lifespan";
+
+ private static final String MAX_IDLE_SUFFIX = ".eviction.max_idle";
+
+ /**
+ * Classpath or filesystem resource containing Infinispan configurations the factory should use.
+ *
+ * @see #DEF_INFINISPAN_CONFIG_RESOURCE
+ */
public static final String INFINISPAN_CONFIG_RESOURCE_PROP = "hibernate.cache.infinispan.cfg";
+
+ private static final String ENTITY_KEY = "entity";
- public static final String DEF_INFINISPAN_CONFIG_RESOURCE = "org/hibernate/cache/infinispan/builder/ispn4-configs.xml";
+ /**
+ * Name of the configuration that should be used for entity caches.
+ *
+ * @see #DEF_ENTITY_RESOURCE
+ */
+ public static final String ENTITY_CACHE_RESOURCE_PROP = PREFIX + ENTITY_KEY + CONFIG_SUFFIX;
+ private static final String COLLECTION_KEY = "collection";
+
+ /**
+ * Name of the configuration that should be used for collection caches.
+ * No default value, as by default we try to use the same Infinispan cache
+ * instance we use for entity caching.
+ *
+ * @see #ENTITY_CACHE_RESOURCE_PROP
+ * @see #DEF_ENTITY_RESOURCE
+ */
+ public static final String COLLECTION_CACHE_RESOURCE_PROP = PREFIX + COLLECTION_KEY + CONFIG_SUFFIX;
+
+ private static final String TIMESTAMP_KEY = "timestamp";
+
+ /**
+ * Name of the configuration that should be used for timestamp caches.
+ *
+ * @see #DEF_TS_RESOURCE
+ */
+ public static final String TIMESTAMP_CACHE_RESOURCE_PROP = PREFIX + TIMESTAMP_KEY + CONFIG_SUFFIX;
+
+ private static final String QUERY_KEY = "query";
+
+ /**
+ * Name of the configuration that should be used for query caches.
+ *
+ * @see #DEF_QUERY_RESOURCE
+ */
+ public static final String QUERY_CACHE_RESOURCE_PROP = PREFIX + QUERY_KEY + CONFIG_SUFFIX;
+
+ /**
+ * Default value for {@link #INFINISPAN_RESOURCE_PROP}. Specifies the "infinispan-configs.xml" file in this package.
+ */
+ public static final String DEF_INFINISPAN_CONFIG_RESOURCE = "org/hibernate/cache/infinispan/builder/infinispan-configs.xml";
+
+ /**
+ * Default value for {@link #ENTITY_CACHE_RESOURCE_PROP}.
+ */
+ public static final String DEF_ENTITY_RESOURCE = "entity";
+
+ /**
+ * Default value for {@link #TIMESTAMP_CACHE_RESOURCE_PROP}.
+ */
+ public static final String DEF_TIMESTAMP_RESOURCE = "timestamp";
+
+ /**
+ * Default value for {@link #QUERY_CACHE_RESOURCE_PROP}.
+ */
+ public static final String DEF_QUERY_RESOURCE = "local-query";
+
private CacheManager manager;
+
+ private final Map<String, DataTypeConfig> configs = new HashMap<String, DataTypeConfig>();
/**
* Create a new instance using the default configuration.
@@ -57,7 +140,6 @@
public CollectionRegion buildCollectionRegion(String regionName, Properties properties,
CacheDataDescription metadata) throws CacheException {
log.debug("Building collection cache region [" + regionName + "]");
- // TODO: Clarify whether for collections, we should just pick the entity name without the collection name from the CacheManager
return new InfinispanCollectionRegion(manager.getCache(regionName), regionName, metadata);
}
@@ -67,6 +149,7 @@
public EntityRegion buildEntityRegion(String regionName, Properties properties,
CacheDataDescription metadata) throws CacheException {
log.debug("Building entity cache region [" + regionName + "]");
+ // TODO: check the configs map for this region and do the corresponding work
return new InfinispanEntityRegion(manager.getCache(regionName), regionName, metadata);
}
@@ -118,6 +201,56 @@
try {
String configLoc = PropertiesHelper.getString(INFINISPAN_CONFIG_RESOURCE_PROP, properties, DEF_INFINISPAN_CONFIG_RESOURCE);
manager = new DefaultCacheManager(configLoc);
+ initDefaultCacheNames();
+
+ Enumeration keys = properties.propertyNames();
+ while (keys.hasMoreElements()) {
+ String key = (String) keys.nextElement();
+ int prefixLoc = -1;
+ if ((prefixLoc = key.indexOf(PREFIX)) != -1) {
+ DataTypeConfig cfgOverride = null;
+ int suffixLoc = -1;
+ if ((suffixLoc = key.indexOf(CONFIG_SUFFIX)) != -1) {
+ cfgOverride = getOrCreateConfig(key, prefixLoc, suffixLoc);
+ cfgOverride.setCache(PropertiesHelper.extractPropertyValue(key, properties));
+// String name = key.substring(prefixLoc + PREFIX.length(), suffixLoc);
+// cfgOverride = configs.get(name);
+// if (cfgOverride == null) {
+// cfgOverride = new DataTypeConfig();
+// configs.put(name, cfgOverride);
+// }
+// String cache = null;
+// if (name.equals(ENTITY_CACHE_RESOURCE_PROP)) {
+// cache = PropertiesHelper.getString(ENTITY_CACHE_RESOURCE_PROP, properties, DEF_ENTITY_RESOURCE);
+// } else if (name.equals(COLLECTION_CACHE_RESOURCE_PROP)) {
+// cache = PropertiesHelper.getString(COLLECTION_CACHE_RESOURCE_PROP, properties, DEF_ENTITY_RESOURCE);
+// } else if (name.equals(TIMESTAMP_CACHE_RESOURCE_PROP)) {
+// cache = PropertiesHelper.getString(TIMESTAMP_CACHE_RESOURCE_PROP, properties, DEF_TIMESTAMP_RESOURCE);
+// } else if (name.equals(QUERY_CACHE_RESOURCE_PROP)) {
+// cache = PropertiesHelper.getString(QUERY_CACHE_RESOURCE_PROP, properties, DEF_QUERY_RESOURCE);
+// } else {
+// cache = PropertiesHelper.extractPropertyValue(key, properties);
+// }
+// cfgOverride.setCache(cache);
+ } else if ((suffixLoc = key.indexOf(STRATEGY_SUFFIX)) != -1) {
+ cfgOverride = getOrCreateConfig(key, prefixLoc, suffixLoc);
+ cfgOverride.setStrategy(PropertiesHelper.extractPropertyValue(key, properties));
+ } else if ((suffixLoc = key.indexOf(WAKE_UP_INTERVAL_SUFFIX)) != -1) {
+ cfgOverride = getOrCreateConfig(key, prefixLoc, suffixLoc);
+ cfgOverride.setWakeUpInterval(Long.parseLong(PropertiesHelper.extractPropertyValue(key, properties)));
+ } else if ((suffixLoc = key.indexOf(MAX_ENTRIES_SUFFIX)) != -1) {
+ cfgOverride = getOrCreateConfig(key, prefixLoc, suffixLoc);
+ cfgOverride.setMaxEntries(PropertiesHelper.getInt(key, properties, -1));
+ } else if ((suffixLoc = key.indexOf(LIFESPAN_SUFFIX)) != -1) {
+ cfgOverride = getOrCreateConfig(key, prefixLoc, suffixLoc);
+ cfgOverride.setLifespan(Long.parseLong(PropertiesHelper.extractPropertyValue(key, properties)));
+ } else if ((suffixLoc = key.indexOf(MAX_IDLE_SUFFIX)) != -1) {
+ cfgOverride = getOrCreateConfig(key, prefixLoc, suffixLoc);
+ cfgOverride.setMaxIdle(Long.parseLong(PropertiesHelper.extractPropertyValue(key, properties)));
+ }
+ }
+
+ }
} catch (CacheException ce) {
throw ce;
} catch (Throwable t) {
@@ -132,5 +265,42 @@
log.debug("Stopping Infinispan CacheManager");
manager.stop();
}
+
+ /**
+ * Returns an unmodifiable map containing configured entity/collection type configuration overrides.
+ * This method should be used primarily for testing/checking purpouses.
+ *
+ * @return an unmodifiable map.
+ */
+ public Map<String, DataTypeConfig> getConfigs() {
+ return Collections.unmodifiableMap(configs);
+ }
+
+ private void initDefaultCacheNames() {
+ DataTypeConfig entity = new DataTypeConfig();
+ entity.setCache(DEF_ENTITY_RESOURCE);
+ configs.put(ENTITY_KEY, entity);
+ DataTypeConfig collection = new DataTypeConfig();
+ collection.setCache(DEF_ENTITY_RESOURCE);
+ configs.put(COLLECTION_KEY, collection);
+
+ DataTypeConfig timestamp = new DataTypeConfig();
+ timestamp.setCache(DEF_TIMESTAMP_RESOURCE);
+ configs.put(TIMESTAMP_KEY, timestamp);
+
+ DataTypeConfig query = new DataTypeConfig();
+ query.setCache(DEF_QUERY_RESOURCE);
+ configs.put(QUERY_KEY, query);
+ }
+
+ private DataTypeConfig getOrCreateConfig(String key, int prefixLoc, int suffixLoc) {
+ String name = key.substring(prefixLoc + PREFIX.length(), suffixLoc);
+ DataTypeConfig cfgOverride = configs.get(name);
+ if (cfgOverride == null) {
+ cfgOverride = new DataTypeConfig();
+ configs.put(name, cfgOverride);
+ }
+ return cfgOverride;
+ }
}
\ No newline at end of file
Copied: core/branches/INFINISPAN/cache-infinispan/src/main/resources/org/hibernate/cache/infinispan/builder/infinispan-configs.xml (from rev 17234, core/branches/INFINISPAN/cache-infinispan/src/main/resources/org/hibernate/cache/infinispan/builder/ispn4-configs.xml)
===================================================================
--- core/branches/INFINISPAN/cache-infinispan/src/main/resources/org/hibernate/cache/infinispan/builder/infinispan-configs.xml (rev 0)
+++ core/branches/INFINISPAN/cache-infinispan/src/main/resources/org/hibernate/cache/infinispan/builder/infinispan-configs.xml 2009-08-06 14:36:33 UTC (rev 17244)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:infinispan:config:4.0">
+ <global>
+ <transport transportClass = "org.infinispan.remoting.transport.jgroups.JGroupsTransport"
+ clusterName="infinispan-hibernate-cluster" distributedSyncTimeout="50000">
+ <!-- Note that the JGroups transport uses sensible defaults if no configuration property is defined. -->
+ <!-- TODO: Change to udp.xml once streaming transfer requirement has been removed. -->
+ <property name="configurationFile" value="flush-udp.xml"/>
+ <!-- See the JGroupsTransport javadocs for more flags -->
+ </transport>
+ <serialization marshallerClass="org.infinispan.marshall.VersionAwareMarshaller" version="4.0"/>
+ </global>
+
+ <default>
+ <!-- Used to register JMX statistics in any available MBean server -->
+ <jmxStatistics enabled="false"/>
+ </default>
+
+ <!-- Default configuration is appropriate for entity/collection caching. -->
+ <namedCache name="entity">
+ <clustering mode="invalidation">
+ <stateRetrieval fetchInMemoryState="false" timeout="20000"/>
+ <sync replTimeout="20000"/>
+ </clustering>
+ <!-- Note: REPEATABLE_READ is only useful if the application evicts/clears entities
+ from the Hibernate Session and then expects to repeatably re-read them in
+ the same transaction. Otherwise, the Session's internal cache provides a
+ repeatable-read semantic. Before choosing this config, carefully read the docs
+ and make sure you really need REPEATABLE_READ.
+ -->
+ <locking isolationLevel="READ_COMMITTED" concurrencyLevel="1000" lockAcquisitionTimeout="15000"/>
+ <!--
+ Eviction configuration. WakeupInterval defines how often the eviction thread runs, in milliseconds. 0 means
+ the eviction thread will never run. A separate executor is used for eviction in each cache.
+ -->
+ <eviction wakeUpInterval="5000" maxEntries="10000" strategy="FIFO"/>
+ <expiration maxIdle="100000"/>
+ <lazyDeserialization enabled="true"/>
+ </namedCache>
+
+ <!-- A config appropriate for query caching. Does not replicate
+ queries. DO NOT STORE TIMESTAMPS IN THIS CACHE.
+ -->
+ <namedCache name="local-query">
+ <locking isolationLevel="READ_COMMITTED" concurrencyLevel="1000" lockAcquisitionTimeout="15000"/>
+ <!--
+ Eviction configuration. WakeupInterval defines how often the eviction thread runs, in milliseconds. 0 means
+ the eviction thread will never run. A separate executor is used for eviction in each cache.
+ -->
+ <eviction wakeUpInterval="5000" maxEntries="10000" strategy="FIFO"/>
+ <expiration maxIdle="100000"/>
+ </namedCache>
+
+ <!-- Optimized for timestamp caching. A clustered timestamp cache
+ is required if query caching is used, even if the query cache
+ itself is configured with CacheMode=LOCAL.
+ -->
+ <namedCache name="timestamp">
+ <clustering mode="REPL">
+ <stateRetrieval fetchInMemoryState="true" timeout="20000"/>
+ <async/>
+ </clustering>
+ <locking isolationLevel="READ_COMMITTED" concurrencyLevel="1000" lockAcquisitionTimeout="15000"/>
+ <lazyDeserialization enabled="true"/>
+ <!-- Don't ever evict modification timestamps -->
+ <eviction strategy="NONE"/>
+ </namedCache>
+
+</infinispan>
\ No newline at end of file
Deleted: core/branches/INFINISPAN/cache-infinispan/src/main/resources/org/hibernate/cache/infinispan/builder/ispn4-configs.xml
===================================================================
--- core/branches/INFINISPAN/cache-infinispan/src/main/resources/org/hibernate/cache/infinispan/builder/ispn4-configs.xml 2009-08-06 14:18:54 UTC (rev 17243)
+++ core/branches/INFINISPAN/cache-infinispan/src/main/resources/org/hibernate/cache/infinispan/builder/ispn4-configs.xml 2009-08-06 14:36:33 UTC (rev 17244)
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:infinispan:config:4.0">
- <global>
- <transport transportClass = "org.infinispan.remoting.transport.jgroups.JGroupsTransport"
- clusterName="infinispan-hibernate-cluster" distributedSyncTimeout="50000">
- <!-- Note that the JGroups transport uses sensible defaults if no configuration property is defined. -->
- <!-- TODO: Change to udp.xml once streaming transfer requirement has been removed. -->
- <property name="configurationFile" value="flush-udp.xml"/>
- <!-- See the JGroupsTransport javadocs for more flags -->
- </transport>
- <serialization marshallerClass="org.infinispan.marshall.VersionAwareMarshaller" version="4.0"/>
- </global>
-
- <!-- Default configuration is appropriate for entity/collection caching. -->
- <default>
- <clustering mode="invalidation">
- <stateRetrieval fetchInMemoryState="false" timeout="20000"/>
- <sync replTimeout="20000"/>
- </clustering>
- <!-- Note: REPEATABLE_READ is only useful if the application evicts/clears entities
- from the Hibernate Session and then expects to repeatably re-read them in
- the same transaction. Otherwise, the Session's internal cache provides a
- repeatable-read semantic. Before choosing this config, carefully read the docs
- and make sure you really need REPEATABLE_READ.
- -->
- <locking isolationLevel="READ_COMMITTED" concurrencyLevel="1000" lockAcquisitionTimeout="15000"/>
- <!--
- Eviction configuration. WakeupInterval defines how often the eviction thread runs, in milliseconds. 0 means
- the eviction thread will never run. A separate executor is used for eviction in each cache.
- -->
- <eviction wakeUpInterval="5000" maxEntries="10000" strategy="FIFO"/>
- <expiration maxIdle="100000"/>
- <lazyDeserialization enabled="true"/>
- </default>
-
- <!-- A config appropriate for query caching. Does not replicate
- queries. DO NOT STORE TIMESTAMPS IN THIS CACHE.
- -->
- <namedCache name="org.hibernate.cache.StandardQueryCache">
- <locking isolationLevel="READ_COMMITTED" concurrencyLevel="1000" lockAcquisitionTimeout="15000"/>
- <!--
- Eviction configuration. WakeupInterval defines how often the eviction thread runs, in milliseconds. 0 means
- the eviction thread will never run. A separate executor is used for eviction in each cache.
- -->
- <eviction wakeUpInterval="5000" maxEntries="10000" strategy="FIFO"/>
- <expiration maxIdle="100000"/>
- </namedCache>
-
- <!-- Optimized for timestamp caching. A clustered timestamp cache
- is required if query caching is used, even if the query cache
- itself is configured with CacheMode=LOCAL.
- -->
- <namedCache name="org.hibernate.cache.UpdateTimestampsCache">
- <clustering mode="REPL">
- <stateRetrieval fetchInMemoryState="true" timeout="20000"/>
- <async/>
- </clustering>
- <locking isolationLevel="READ_COMMITTED" concurrencyLevel="1000" lockAcquisitionTimeout="15000"/>
- <!-- Don't ever evict modification timestamps -->
- <lazyDeserialization enabled="true"/>
- </namedCache>
-
-</infinispan>
\ No newline at end of file
Added: core/branches/INFINISPAN/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/InfinispanRegionFactoryTestCase.java
===================================================================
--- core/branches/INFINISPAN/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/InfinispanRegionFactoryTestCase.java (rev 0)
+++ core/branches/INFINISPAN/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/InfinispanRegionFactoryTestCase.java 2009-08-06 14:36:33 UTC (rev 17244)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.hibernate.test.cache.infinispan;
+
+import java.util.Properties;
+
+import org.hibernate.cache.infinispan.InfinispanRegionFactory;
+import org.infinispan.eviction.EvictionStrategy;
+
+import junit.framework.TestCase;
+
+/**
+ * InfinispanRegionFactoryTestCase.
+ *
+ * @author Galder Zamarreño
+ */
+public class InfinispanRegionFactoryTestCase extends TestCase {
+
+ public void testConfigurationProcessing() {
+ final String person = "com.acme.Person";
+ final String addresses = "com.acme.Person.addresses";
+ Properties p = new Properties();
+ p.setProperty("hibernate.cache.infinispan.com.acme.Person.cfg", "person-cache");
+ p.setProperty("hibernate.cache.infinispan.com.acme.Person.eviction.strategy", "LRU");
+ p.setProperty("hibernate.cache.infinispan.com.acme.Person.eviction.wake_up_interval", "2000");
+ p.setProperty("hibernate.cache.infinispan.com.acme.Person.eviction.max_entries", "5000 ");
+ p.setProperty("hibernate.cache.infinispan.com.acme.Person.eviction.lifespan", "60000");
+ p.setProperty("hibernate.cache.infinispan.com.acme.Person.eviction.max_idle", "30000");
+ p.setProperty("hibernate.cache.infinispan.com.acme.Person.addresses.cfg", "person-addresses-cache");
+ p.setProperty("hibernate.cache.infinispan.com.acme.Person.addresses.eviction.lifespan", "120000");
+ p.setProperty("hibernate.cache.infinispan.com.acme.Person.addresses.eviction.max_idle", "60000");
+ p.setProperty("hibernate.cache.infinispan.query.cfg", "my-query-cache");
+ p.setProperty("hibernate.cache.infinispan.query.eviction.strategy", "FIFO");
+ p.setProperty("hibernate.cache.infinispan.query.eviction.wake_up_interval", "3000");
+ p.setProperty("hibernate.cache.infinispan.query.eviction.max_entries", "10000");
+
+ InfinispanRegionFactory factory = new InfinispanRegionFactory();
+ factory.start(null, p);
+
+ assertEquals("entity", factory.getConfigs().get("entity").getCache());
+ assertEquals("entity", factory.getConfigs().get("collection").getCache());
+ assertEquals("timestamp", factory.getConfigs().get("timestamp").getCache());
+
+ assertEquals("person-cache", factory.getConfigs().get(person).getCache());
+ assertEquals(EvictionStrategy.LRU, factory.getConfigs().get(person).getStrategy());
+ assertEquals(2000, factory.getConfigs().get(person).getWakeUpInterval());
+ assertEquals(5000, factory.getConfigs().get(person).getMaxEntries());
+ assertEquals(60000, factory.getConfigs().get(person).getLifespan());
+ assertEquals(30000, factory.getConfigs().get(person).getMaxIdle());
+
+ assertEquals("person-addresses-cache", factory.getConfigs().get(addresses).getCache());
+ assertEquals(120000, factory.getConfigs().get(addresses).getLifespan());
+ assertEquals(60000, factory.getConfigs().get(addresses).getMaxIdle());
+
+ assertEquals("my-query-cache", factory.getConfigs().get("query").getCache());
+ assertEquals(EvictionStrategy.FIFO, factory.getConfigs().get("query").getStrategy());
+ assertEquals(3000, factory.getConfigs().get("query").getWakeUpInterval());
+ assertEquals(10000, factory.getConfigs().get("query").getMaxEntries());
+ }
+
+ public void testTimestampNoEvictionValidation() {
+ // Timestamp cache cannot have evictions configured, so add corresponding test.
+ }
+}
Modified: core/branches/INFINISPAN/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/InfinispanTest.java
===================================================================
--- core/branches/INFINISPAN/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/InfinispanTest.java 2009-08-06 14:18:54 UTC (rev 17243)
+++ core/branches/INFINISPAN/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/InfinispanTest.java 2009-08-06 14:36:33 UTC (rev 17244)
@@ -3,6 +3,9 @@
import org.hibernate.cache.infinispan.InfinispanRegionFactory;
import org.hibernate.test.cache.BaseRegionFactoryTestCase;
+/**
+ * TODO: what is this exactly testing???
+ */
public class InfinispanTest extends BaseRegionFactoryTestCase {
public InfinispanTest( String x ) {
16 years, 8 months
Hibernate SVN: r17243 - in core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria: expression and 2 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2009-08-06 10:18:54 -0400 (Thu, 06 Aug 2009)
New Revision: 17243
Added:
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/BasicFunctionExpression.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/CastFunction.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/FunctionExpression.java
Removed:
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/FunctionExpressionImpl.java
Modified:
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/QueryBuilderImpl.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/ExpressionImpl.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/ParameterExpressionImpl.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/AverageAggregrateFunction.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/SumAggregateFunction.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/ComparisonPredicate.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/InPredicate.java
Log:
EJB-447 : Implement JPA 2.0 criteria apis (support for casts, completed IN-predicate support & parameter creation)
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/QueryBuilderImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/QueryBuilderImpl.java 2009-08-06 13:04:10 UTC (rev 17242)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/QueryBuilderImpl.java 2009-08-06 14:18:54 UTC (rev 17243)
@@ -527,10 +527,7 @@
* {@inheritDoc}
*/
public <T> ParameterExpression<T> parameter(Class<T> paramClass) {
- // TODO : AFAICT there is really no way to implement this one correctly.
- // the problem is the need to report getPosition...
- throw new UnsupportedOperationException( "Note yet implemented!" );
-// return new ParameterExpressionImpl( this, paramClass, ??? );
+ return new ParameterExpressionImpl<T>( this, paramClass );
}
/**
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/ExpressionImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/ExpressionImpl.java 2009-08-06 13:04:10 UTC (rev 17242)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/ExpressionImpl.java 2009-08-06 14:18:54 UTC (rev 17243)
@@ -26,9 +26,10 @@
import javax.persistence.criteria.Predicate;
import org.hibernate.ejb.criteria.QueryBuilderImpl;
+import org.hibernate.ejb.criteria.expression.function.CastFunction;
/**
- * TODO : javadoc
+ * Models an expression in the criteria query language.
*
* @author Steve Ebersole
*/
@@ -41,8 +42,9 @@
* {@inheritDoc}
*/
public <X> Expression<X> as(Class<X> type) {
- // TODO-STEVE : implement - needs a cast expression
- throw new UnsupportedOperationException( "Not yet implemented!" );
+ return type.equals( getJavaType() )
+ ? (Expression<X>) this
+ : new CastFunction<X, T>( queryBuilder(), type, this );
}
/**
Deleted: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/FunctionExpressionImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/FunctionExpressionImpl.java 2009-08-06 13:04:10 UTC (rev 17242)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/FunctionExpressionImpl.java 2009-08-06 14:18:54 UTC (rev 17243)
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301 USA
- */
-package org.hibernate.ejb.criteria.expression;
-
-import java.util.List;
-import java.util.Arrays;
-import javax.persistence.criteria.Expression;
-
-import org.hibernate.ejb.criteria.QueryBuilderImpl;
-
-/**
- * TODO : javadoc
- *
- * @author Steve Ebersole
- */
-public class FunctionExpressionImpl<X> extends ExpressionImpl<X> implements Expression<X> {
- private final String functionName;
- private final List<Expression<?>> argumentExpressions;
-
- public FunctionExpressionImpl(
- QueryBuilderImpl queryBuilder,
- Class<X> javaType,
- String functionName,
- List<Expression<?>> argumentExpressions) {
- super( queryBuilder, javaType );
- this.functionName = functionName;
- this.argumentExpressions = argumentExpressions;
- }
-
- public FunctionExpressionImpl(
- QueryBuilderImpl queryBuilder,
- Class<X> javaType,
- String functionName,
- Expression<?>... argumentExpressions) {
- super( queryBuilder, javaType );
- this.functionName = functionName;
- this.argumentExpressions = Arrays.asList( argumentExpressions );
- }
-
- public String getFunctionName() {
- return functionName;
- }
-
- public List<Expression<?>> getArgumentExpressions() {
- return argumentExpressions;
- }
-}
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/ParameterExpressionImpl.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/ParameterExpressionImpl.java 2009-08-06 13:04:10 UTC (rev 17242)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/ParameterExpressionImpl.java 2009-08-06 14:18:54 UTC (rev 17243)
@@ -53,6 +53,14 @@
this.position = position;
}
+ public ParameterExpressionImpl(
+ QueryBuilderImpl queryBuilder,
+ Class<T> javaType) {
+ super( queryBuilder, javaType );
+ this.name = null;
+ this.position = null;
+ }
+
public String getName() {
return name;
}
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/AverageAggregrateFunction.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/AverageAggregrateFunction.java 2009-08-06 13:04:10 UTC (rev 17242)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/AverageAggregrateFunction.java 2009-08-06 14:18:54 UTC (rev 17243)
@@ -23,7 +23,6 @@
import javax.persistence.criteria.Expression;
-import org.hibernate.ejb.criteria.expression.FunctionExpressionImpl;
import org.hibernate.ejb.criteria.QueryBuilderImpl;
/**
@@ -34,7 +33,7 @@
*
* @author Steve Ebersole
*/
-public class AverageAggregrateFunction extends FunctionExpressionImpl<Double> {
+public class AverageAggregrateFunction extends BasicFunctionExpression<Double> {
public AverageAggregrateFunction(
QueryBuilderImpl queryBuilder,
Expression<? extends Number> expression) {
Copied: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/BasicFunctionExpression.java (from rev 17227, core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/FunctionExpressionImpl.java)
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/BasicFunctionExpression.java (rev 0)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/BasicFunctionExpression.java 2009-08-06 14:18:54 UTC (rev 17243)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ */
+package org.hibernate.ejb.criteria.expression.function;
+
+import org.hibernate.ejb.criteria.expression.*;
+import java.util.List;
+import java.util.Arrays;
+import javax.persistence.criteria.Expression;
+
+import org.hibernate.ejb.criteria.QueryBuilderImpl;
+
+/**
+ * TODO : javadoc
+ *
+ * @author Steve Ebersole
+ */
+public class BasicFunctionExpression<X> extends ExpressionImpl<X> implements Expression<X> {
+ private final String functionName;
+ private final List<Expression<?>> argumentExpressions;
+
+ public BasicFunctionExpression(
+ QueryBuilderImpl queryBuilder,
+ Class<X> javaType,
+ String functionName,
+ List<Expression<?>> argumentExpressions) {
+ super( queryBuilder, javaType );
+ this.functionName = functionName;
+ this.argumentExpressions = argumentExpressions;
+ }
+
+ public BasicFunctionExpression(
+ QueryBuilderImpl queryBuilder,
+ Class<X> javaType,
+ String functionName,
+ Expression<?>... argumentExpressions) {
+ super( queryBuilder, javaType );
+ this.functionName = functionName;
+ this.argumentExpressions = Arrays.asList( argumentExpressions );
+ }
+
+ public String getFunctionName() {
+ return functionName;
+ }
+
+ public List<Expression<?>> getArgumentExpressions() {
+ return argumentExpressions;
+ }
+}
Added: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/CastFunction.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/CastFunction.java (rev 0)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/CastFunction.java 2009-08-06 14:18:54 UTC (rev 17243)
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ */
+package org.hibernate.ejb.criteria.expression.function;
+
+import org.hibernate.ejb.criteria.QueryBuilderImpl;
+import org.hibernate.ejb.criteria.expression.ExpressionImpl;
+
+/**
+ * Models a <tt>CAST</tt> function.
+ *
+ * @param <T> The cast result type.
+ * @param <Y> The type of the expression to be cast.
+ *
+ * @author Steve Ebersole
+ */
+public class CastFunction<T,Y> extends ExpressionImpl<T> implements FunctionExpression<T> {
+ public static final String CAST_NAME = "cast";
+
+ private final ExpressionImpl<Y> castSource;
+
+ public CastFunction(
+ QueryBuilderImpl queryBuilder,
+ Class<T> javaType,
+ ExpressionImpl<Y> castSource) {
+ super( queryBuilder, javaType );
+ this.castSource = castSource;
+ }
+
+ public String getFunctionName() {
+ return CAST_NAME;
+ }
+
+ public ExpressionImpl<Y> getCastSource() {
+ return castSource;
+ }
+
+}
Added: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/FunctionExpression.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/FunctionExpression.java (rev 0)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/FunctionExpression.java 2009-08-06 14:18:54 UTC (rev 17243)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ */
+package org.hibernate.ejb.criteria.expression.function;
+
+import javax.persistence.criteria.Expression;
+
+/**
+ * Models an expression resolved as a SQL function call.
+ *
+ * @param <T> The type of the function result.
+ *
+ * @author Steve Ebersole
+ */
+public interface FunctionExpression<T> extends Expression<T> {
+ public String getFunctionName();
+}
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/SumAggregateFunction.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/SumAggregateFunction.java 2009-08-06 13:04:10 UTC (rev 17242)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/expression/function/SumAggregateFunction.java 2009-08-06 14:18:54 UTC (rev 17243)
@@ -23,7 +23,6 @@
import javax.persistence.criteria.Expression;
-import org.hibernate.ejb.criteria.expression.FunctionExpressionImpl;
import org.hibernate.ejb.criteria.QueryBuilderImpl;
/**
@@ -34,7 +33,7 @@
*
* @author Steve Ebersole
*/
-public class SumAggregateFunction<N extends Number> extends FunctionExpressionImpl<N> {
+public class SumAggregateFunction<N extends Number> extends BasicFunctionExpression<N> {
public SumAggregateFunction(
QueryBuilderImpl queryBuilder,
Expression<N> expression) {
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/ComparisonPredicate.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/ComparisonPredicate.java 2009-08-06 13:04:10 UTC (rev 17242)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/ComparisonPredicate.java 2009-08-06 14:18:54 UTC (rev 17243)
@@ -24,9 +24,10 @@
import javax.persistence.criteria.Expression;
import org.hibernate.ejb.criteria.QueryBuilderImpl;
+import org.hibernate.ejb.criteria.expression.LiteralExpression;
/**
- * TODO : javadoc
+ * Models a basic relational comparison predicate.
*
* @author Steve Ebersole
*/
@@ -54,9 +55,7 @@
super( queryBuilder );
this.comparisonOperator = comparisonOperator;
this.leftHandSide = leftHandSide;
- // TODO : generate a parameter expression once those are ready...
- this.rightHandSide = null;
- throw new UnsupportedOperationException( "Not yet implemented!" );
+ this.rightHandSide = new LiteralExpression( queryBuilder, rightHandSide );
}
public ComparisonOperator getComparisonOperator() {
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/InPredicate.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/InPredicate.java 2009-08-06 13:04:10 UTC (rev 17242)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/predicate/InPredicate.java 2009-08-06 14:18:54 UTC (rev 17243)
@@ -28,6 +28,7 @@
import javax.persistence.criteria.Expression;
import org.hibernate.ejb.criteria.QueryBuilderImpl;
+import org.hibernate.ejb.criteria.expression.LiteralExpression;
/**
* TODO : javadoc
@@ -91,9 +92,7 @@
QueryBuilderImpl queryBuilder,
Expression<? extends T> expression,
T... values) {
- super( queryBuilder );
- // TODO : implements - needs parameter expressions
- throw new UnsupportedOperationException( "Not yet implemented!" );
+ this( queryBuilder, expression, Arrays.asList( values ) );
}
/**
@@ -108,12 +107,16 @@
Expression<? extends T> expression,
Collection<T> values) {
super( queryBuilder );
- // TODO : implements - needs parameter expressions
- throw new UnsupportedOperationException( "Not yet implemented!" );
+ this.expression = expression;
+ // TODO : size this?
+ this.values = new ArrayList<Expression<? extends T>>();
+ for ( T value : values ) {
+ this.values.add( new LiteralExpression<T>( queryBuilder, value ) );
+ }
}
+ @SuppressWarnings("unchecked")
public Expression<T> getExpression() {
- //noinspection unchecked
return ( Expression<T> ) expression;
}
@@ -126,8 +129,7 @@
}
public InPredicate<T> value(T value) {
- // TODO : implements - needs parameter expressions
- throw new UnsupportedOperationException( "Not yet implemented!" );
+ return value( new LiteralExpression<T>( queryBuilder(), value ) );
}
public InPredicate<T> value(Expression<? extends T> value) {
16 years, 8 months
Hibernate SVN: r17242 - validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-08-06 09:04:10 -0400 (Thu, 06 Aug 2009)
New Revision: 17242
Modified:
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/messageinterpolation/MessageInterpolationTest.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ResourceBundleMessageInterpolator.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/messageinterpolation/ResourceBundleMessageInterpolatorTest.java
Log:
HV-186 - ResourceBundleMessageInterpolator has to allow all characters as message parameter
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/messageinterpolation/MessageInterpolationTest.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/messageinterpolation/MessageInterpolationTest.java 2009-08-06 12:21:47 UTC (rev 17241)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/messageinterpolation/MessageInterpolationTest.java 2009-08-06 13:04:10 UTC (rev 17242)
@@ -1,4 +1,4 @@
-// $Id:$
+// $Id$
/*
* JBoss, Home of Professional Open Source
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
@@ -93,8 +93,8 @@
actual = interpolator.interpolate( "This {foo} just fine", context );
assertEquals( actual, expected, "Wrong substitution" );
- expected = "{} { replacement worked }";
- actual = interpolator.interpolate( "{} { {foo} }", context );
+ expected = "{} replacement worked {unkown}";
+ actual = interpolator.interpolate( "{} {foo} {unkown}", context );
assertEquals( actual, expected, "Wrong substitution" );
}
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ResourceBundleMessageInterpolator.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ResourceBundleMessageInterpolator.java 2009-08-06 12:21:47 UTC (rev 17241)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ResourceBundleMessageInterpolator.java 2009-08-06 13:04:10 UTC (rev 17242)
@@ -44,7 +44,7 @@
/**
* Regular expression used to do message interpolation.
*/
- private static final Pattern messageParameterPattern = Pattern.compile( "(\\{[\\w\\.]+\\})" );
+ private static final Pattern messageParameterPattern = Pattern.compile( "(\\{[^\\}]+?\\})" );
/**
* The default locale for the current user.
@@ -83,18 +83,12 @@
defaultBundlesMap.put( defaultLocale, ResourceBundle.getBundle( DEFAULT_VALIDATION_MESSAGES, defaultLocale ) );
}
- /**
- * {@inheritDoc}
- */
public String interpolate(String message, Context context) {
// probably no need for caching, but it could be done by parameters since the map
// is immutable and uniquely built per Validation definition, the comparaison has to be based on == and not equals though
return interpolateMessage( message, context.getConstraintDescriptor().getAttributes(), defaultLocale );
}
- /**
- * {@inheritDoc}
- */
public String interpolate(String message, Context context, Locale locale) {
return interpolateMessage( message, context.getConstraintDescriptor().getAttributes(), locale );
}
Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/messageinterpolation/ResourceBundleMessageInterpolatorTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/messageinterpolation/ResourceBundleMessageInterpolatorTest.java 2009-08-06 12:21:47 UTC (rev 17241)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/messageinterpolation/ResourceBundleMessageInterpolatorTest.java 2009-08-06 13:04:10 UTC (rev 17242)
@@ -33,15 +33,15 @@
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
+import org.hibernate.validation.engine.MessageInterpolatorContext;
+import org.hibernate.validation.engine.ResourceBundleMessageInterpolator;
import org.hibernate.validation.metadata.ConstraintDescriptorImpl;
import org.hibernate.validation.metadata.ConstraintHelper;
import org.hibernate.validation.util.annotationfactory.AnnotationDescriptor;
import org.hibernate.validation.util.annotationfactory.AnnotationFactory;
-import org.hibernate.validation.engine.ResourceBundleMessageInterpolator;
-import org.hibernate.validation.engine.MessageInterpolatorContext;
/**
- * Tests for message resolution.
+ * Tests for message interpolation.
*
* @author Hardy Ferentschik
*/
@@ -73,20 +73,20 @@
public void testSuccessfulInterpolation() {
interpolator = new ResourceBundleMessageInterpolator( new TestResourceBundle() );
MessageInterpolator.Context context = new MessageInterpolatorContext( notNullDescriptor, null );
- String expected = "replacement worked";
- String actual = interpolator.interpolate( "{foo}", context );
+ String expected = "message interpolation successfull";
+ String actual = interpolator.interpolate( "{simple.key}", context );
assertEquals( actual, expected, "Wrong substitution" );
- expected = "replacement worked replacement worked";
- actual = interpolator.interpolate( "{foo} {foo}", context );
+ expected = "message interpolation successfull message interpolation successfull";
+ actual = interpolator.interpolate( "{simple.key} {simple.key}", context );
assertEquals( actual, expected, "Wrong substitution" );
- expected = "This replacement worked just fine";
- actual = interpolator.interpolate( "This {foo} just fine", context );
+ expected = "The message interpolation successfull completed";
+ actual = interpolator.interpolate( "The {simple.key} completed", context );
assertEquals( actual, expected, "Wrong substitution" );
- expected = "{} { replacement worked }";
- actual = interpolator.interpolate( "{} { {foo} }", context );
+ expected = "{{simple.key}}";
+ actual = interpolator.interpolate( "{{simple.key}}", context );
assertEquals( actual, expected, "Wrong substitution" );
}
@@ -134,6 +134,26 @@
}
@Test
+ public void testKeyWithDashes() {
+ interpolator = new ResourceBundleMessageInterpolator( new TestResourceBundle() );
+ MessageInterpolator.Context context = new MessageInterpolatorContext( notNullDescriptor, null );
+
+ String expected = "message interpolation successfull"; // unkown token {}
+ String actual = interpolator.interpolate( "{key-with-dashes}", context );
+ assertEquals( actual, expected, "Wrong substitution" );
+ }
+
+ @Test
+ public void testKeyWithSpaces() {
+ interpolator = new ResourceBundleMessageInterpolator( new TestResourceBundle() );
+ MessageInterpolator.Context context = new MessageInterpolatorContext( notNullDescriptor, null );
+
+ String expected = "message interpolation successfull"; // unkown token {}
+ String actual = interpolator.interpolate( "{key with spaces}", context );
+ assertEquals( actual, expected, "Wrong substitution" );
+ }
+
+ @Test
public void testDefaultInterpolation() {
interpolator = new ResourceBundleMessageInterpolator( new TestResourceBundle() );
MessageInterpolator.Context context = new MessageInterpolatorContext( notNullDescriptor, null );
@@ -239,7 +259,9 @@
public TestResourceBundle() {
testResources = new HashMap<String, String>();
// add some test messages
- testResources.put( "foo", "replacement worked" );
+ testResources.put( "simple.key", "message interpolation successfull" );
+ testResources.put( "key-with-dashes", "message interpolation successfull" );
+ testResources.put( "key with spaces", "message interpolation successfull" );
testResources.put( "replace.in.user.bundle1", "{replace.in.user.bundle2}" );
testResources.put( "replace.in.user.bundle2", "{replace.in.default.bundle1}" );
16 years, 8 months
Hibernate SVN: r17241 - in validator/trunk/hibernate-validator/src: test/java/org/hibernate/validation/constraints and 2 other directories.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-08-06 08:21:47 -0400 (Thu, 06 Aug 2009)
New Revision: 17241
Added:
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/ConstraintValidatorContextTest.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/Interval.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/Item.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/StartLessThanEnd.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/StartLessThanEndImpl.java
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintValidatorContextImpl.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/PathImpl.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ValidatorImpl.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/util/TestUtil.java
validator/trunk/hibernate-validator/src/test/suite/unit-tests.xml
Log:
HV-198 - Wront constraint violation path when adding subnode error to subnode
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintValidatorContextImpl.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintValidatorContextImpl.java 2009-08-06 12:18:35 UTC (rev 17240)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintValidatorContextImpl.java 2009-08-06 12:21:47 UTC (rev 17241)
@@ -97,7 +97,8 @@
}
public NodeBuilderDefinedContext addSubNode(String name) {
- PathImpl path = PathImpl.createNewPath( name );
+ PathImpl path = PathImpl.createShallowCopy( propertyPath );
+ path.addNode( new NodeImpl( name ) );
return new NodeBuilderImpl( messageTemplate, path );
}
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/PathImpl.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/PathImpl.java 2009-08-06 12:18:35 UTC (rev 17240)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/PathImpl.java 2009-08-06 12:21:47 UTC (rev 17241)
@@ -68,11 +68,11 @@
return path;
}
- public static PathImpl createShallowCopy(PathImpl path) {
+ public static PathImpl createShallowCopy(Path path) {
return path == null ? null : new PathImpl( path );
}
- private PathImpl(PathImpl path) {
+ private PathImpl(Path path) {
this.nodeList = new ArrayList<Node>();
for ( Object aPath : path ) {
nodeList.add( new NodeImpl( ( Node ) aPath ) );
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ValidatorImpl.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ValidatorImpl.java 2009-08-06 12:18:35 UTC (rev 17240)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ValidatorImpl.java 2009-08-06 12:21:47 UTC (rev 17241)
@@ -322,7 +322,9 @@
}
else {
newPath = PathImpl.createShallowCopy( path );
- newPath.addNode( new NodeImpl( metaConstraint.getPropertyName() ) );
+ if ( metaConstraint.getElementType() != ElementType.TYPE ) {
+ newPath.addNode( new NodeImpl( metaConstraint.getPropertyName() ) );
+ }
}
localExecutionContext.setPropertyPath( newPath );
@@ -678,7 +680,7 @@
final BeanMetaData<T> metaData = getBeanMetaData( clazz );
//use precomputed method list as ReflectionHelper#containsMember is slow
- if ( ! metaData.isPropertyPresent( elem.getName() ) ) {
+ if ( !metaData.isPropertyPresent( elem.getName() ) ) {
throw new IllegalArgumentException(
"Invalid property path. There is no property " + elem.getName() + " in entity " + metaData.getBeanClass()
.getName()
Added: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/ConstraintValidatorContextTest.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/ConstraintValidatorContextTest.java (rev 0)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/ConstraintValidatorContextTest.java 2009-08-06 12:21:47 UTC (rev 17241)
@@ -0,0 +1,51 @@
+// $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.validation.constraints;
+
+import java.util.Set;
+import javax.validation.ConstraintViolation;
+import javax.validation.Validator;
+
+import org.testng.annotations.Test;
+
+import org.hibernate.validation.util.TestUtil;
+import static org.hibernate.validation.util.TestUtil.assertCorrectPropertyPaths;
+import static org.hibernate.validation.util.TestUtil.assertNumberOfViolations;
+
+/**
+ * @author Hardy Ferentschik
+ */
+public class ConstraintValidatorContextTest {
+
+ /**
+ * HV-198
+ */
+ @Test
+ public void testCorrectAnnotationTypeForWithReportAsSingleViolation() {
+ Validator validator = TestUtil.getValidator();
+
+ Item item = new Item();
+ item.interval = new Interval();
+ item.interval.start = 10;
+ item.interval.end = 5;
+
+ Set<ConstraintViolation<Item>> constraintViolations = validator.validate( item );
+ assertNumberOfViolations( constraintViolations, 1 );
+ assertCorrectPropertyPaths( constraintViolations, "interval.start" );
+ }
+}
Added: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/Interval.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/Interval.java (rev 0)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/Interval.java 2009-08-06 12:21:47 UTC (rev 17241)
@@ -0,0 +1,28 @@
+// $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.validation.constraints;
+
+/**
+ * @author Hardy Ferentschik
+ */
+@StartLessThanEnd
+class Interval
+{
+ int start;
+ int end;
+}
Added: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/Item.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/Item.java (rev 0)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/Item.java 2009-08-06 12:21:47 UTC (rev 17241)
@@ -0,0 +1,28 @@
+// $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.validation.constraints;
+
+import javax.validation.Valid;
+
+/**
+ * @author Hardy Ferentschik
+ */
+class Item {
+ @Valid
+ Interval interval;
+}
Added: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/StartLessThanEnd.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/StartLessThanEnd.java (rev 0)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/StartLessThanEnd.java 2009-08-06 12:21:47 UTC (rev 17241)
@@ -0,0 +1,41 @@
+// $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.validation.constraints;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import javax.validation.Constraint;
+import javax.validation.ConstraintPayload;
+
+
+/**
+ * @author Hardy Ferentschik
+ */
+(a)Target(ElementType.TYPE)
+(a)Retention(RetentionPolicy.RUNTIME)
+@Constraint(validatedBy = StartLessThanEndImpl.class)
+public @interface StartLessThanEnd {
+ String message() default "x";
+
+ Class<?>[] groups() default { };
+
+ Class<? extends ConstraintPayload>[] payload() default { };
+}
+
Added: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/StartLessThanEndImpl.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/StartLessThanEndImpl.java (rev 0)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/constraints/StartLessThanEndImpl.java 2009-08-06 12:21:47 UTC (rev 17241)
@@ -0,0 +1,39 @@
+// $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.validation.constraints;
+
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+
+/**
+ * @author Hardy Ferentschik
+ */
+public class StartLessThanEndImpl implements ConstraintValidator<StartLessThanEnd, Interval> {
+
+ public void initialize(StartLessThanEnd constraintAnnotation) {
+ }
+
+ public boolean isValid(Interval value, ConstraintValidatorContext c) {
+ if ( value.start > value.end ) {
+ c.disableDefaultError();
+ c.buildErrorWithMessageTemplate( c.getDefaultErrorMessageTemplate() ).addSubNode( "start" ).addError();
+ return false;
+ }
+ return true;
+ }
+}
Modified: validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/util/TestUtil.java
===================================================================
--- validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/util/TestUtil.java 2009-08-06 12:18:35 UTC (rev 17240)
+++ validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/util/TestUtil.java 2009-08-06 12:21:47 UTC (rev 17241)
@@ -165,7 +165,7 @@
}
}
if ( !containsPath ) {
- fail( expectedPath + " is not in the list of path instances contained in the actual constraint violations" );
+ fail( expectedPath + " is not in the list of path instances contained in the actual constraint violations: " + propertyPathsOfViolations );
}
}
}
Modified: validator/trunk/hibernate-validator/src/test/suite/unit-tests.xml
===================================================================
--- validator/trunk/hibernate-validator/src/test/suite/unit-tests.xml 2009-08-06 12:18:35 UTC (rev 17240)
+++ validator/trunk/hibernate-validator/src/test/suite/unit-tests.xml 2009-08-06 12:21:47 UTC (rev 17241)
@@ -4,6 +4,7 @@
<test name="Unit tests">
<packages>
<package name="org.hibernate.validation.bootstrap"/>
+ <package name="org.hibernate.validation.constraints"/>
<package name="org.hibernate.validation.constraints.impl"/>
<package name="org.hibernate.validation.constraints.composition"/>
<package name="org.hibernate.validation.engine"/>
16 years, 8 months
Hibernate SVN: r17240 - in beanvalidation/trunk/validation-tck/src/main: resources and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-08-06 08:18:35 -0400 (Thu, 06 Aug 2009)
New Revision: 17240
Modified:
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/validatorcontext/ConstraintValidatorContextTest.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/validatorcontext/DummyBean.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/validatorcontext/DummyValidator.java
beanvalidation/trunk/validation-tck/src/main/resources/tck-audit.xml
Log:
ConstraintValidatorContext tests
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/validatorcontext/ConstraintValidatorContextTest.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/validatorcontext/ConstraintValidatorContextTest.java 2009-08-06 10:32:05 UTC (rev 17239)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/validatorcontext/ConstraintValidatorContextTest.java 2009-08-06 12:18:35 UTC (rev 17240)
@@ -23,20 +23,19 @@
import javax.validation.ConstraintViolation;
import javax.validation.Validator;
+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.assertTrue;
-import static org.testng.Assert.fail;
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.assertCorrectPropertyPaths;
-import static org.hibernate.jsr303.tck.util.TestUtil.assertEqualPaths;
/**
* @author Hardy Ferentschik
@@ -46,11 +45,12 @@
public class ConstraintValidatorContextTest extends AbstractTest {
@Test
- public void testNoCustomization() {
+ @SpecAssertion(section = "2.4", id = "l")
+ public void testDefaultError() {
Validator validator = TestUtil.getValidatorUnderTest();
DummyValidator.disableDefaultError( false );
- DummyValidator.setErrorMessages( null );
+ DummyValidator.setCustomErrorMessages( null );
DummyBean bean = new DummyBean( "foobar" );
@@ -59,16 +59,14 @@
assertCorrectConstraintViolationMessages( constraintViolations, "dummy message" );
}
- /**
- * @todo Is this the right behaviour? The spec is not quite clear about this.
- */
@Test
- public void testDisableDefaultErrorWithoutCustomError() {
+ @SpecAssertion(section = "2.4", id = "m")
+ public void testDisableDefaultErrorWithoutAddingCustomError() {
Validator validator = TestUtil.getValidatorUnderTest();
DummyValidator.disableDefaultError( true );
Map<String, String> errors = new HashMap<String, String>();
- DummyValidator.setErrorMessages( errors );
+ DummyValidator.setCustomErrorMessages( errors );
DummyBean bean = new DummyBean( "foobar" );
@@ -77,50 +75,43 @@
}
@Test
- public void testDisableDefaultErrorWithCustomErrors() {
+ @SpecAssertions({
+ @SpecAssertion(section = "2.4", id = "m")
+ })
+ public void testDisableDefaultErrorWithCustomErrorNoSubNode() {
Validator validator = TestUtil.getValidatorUnderTest();
DummyValidator.disableDefaultError( true );
Map<String, String> errors = new HashMap<String, String>();
- errors.put( "message1", "property1" );
- DummyValidator.setErrorMessages( errors );
+ errors.put( null, "message1" );
+ DummyValidator.setCustomErrorMessages( errors );
DummyBean bean = new DummyBean( "foobar" );
Set<ConstraintViolation<DummyBean>> constraintViolations = validator.validate( bean );
assertCorrectNumberOfViolations( constraintViolations, 1 );
assertCorrectConstraintViolationMessages( constraintViolations, "message1" );
- assertCorrectPropertyPaths( constraintViolations, "property1" );
+ assertCorrectPropertyPaths( constraintViolations, "value" );
}
@Test
- public void testNestedValidation() {
+ @SpecAssertions({
+ @SpecAssertion(section = "2.4", id = "m"),
+ @SpecAssertion(section = "2.4", id = "q")
+ })
+ public void testDisableDefaultErrorWithCustomErrorWithSubNode() {
Validator validator = TestUtil.getValidatorUnderTest();
- DummyValidator.disableDefaultError( false );
- DummyValidator.setErrorMessages( null );
+ DummyValidator.disableDefaultError( true );
+ Map<String, String> errors = new HashMap<String, String>();
+ errors.put( "subnode", "subnode message" );
+ DummyValidator.setCustomErrorMessages( errors );
- DummyBean bean = new DummyBean( "foo" );
- bean.setNestedDummy( new DummyBean( "bar" ) );
+ DummyBean bean = new DummyBean( "foobar" );
Set<ConstraintViolation<DummyBean>> constraintViolations = validator.validate( bean );
- assertEquals( constraintViolations.size(), 2, "Wrong number of constraints" );
- boolean validatedNestedBean = false;
- for ( ConstraintViolation<DummyBean> violation : constraintViolations ) {
-
- if ( assertEqualPaths( violation.getPropertyPath(), TestUtil.PathImpl.createPathFromString( "value" ) ) ) {
- assertEquals( "dummy message", violation.getMessage(), "Wrong message" );
- }
- else if ( assertEqualPaths(
- violation.getPropertyPath(), TestUtil.PathImpl.createPathFromString( "nestedDummy.value" )
- ) ) {
- assertEquals( "dummy message", violation.getMessage(), "Wrong message" );
- validatedNestedBean = true;
- }
- else {
- fail( "Wrong property " + violation.getMessage() );
- }
- }
- assertTrue( validatedNestedBean );
+ assertCorrectNumberOfViolations( constraintViolations, 1 );
+ assertCorrectConstraintViolationMessages( constraintViolations, "subnode message" );
+ assertCorrectPropertyPaths( constraintViolations, "value.subnode" );
}
}
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/validatorcontext/DummyBean.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/validatorcontext/DummyBean.java 2009-08-06 10:32:05 UTC (rev 17239)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/validatorcontext/DummyBean.java 2009-08-06 12:18:35 UTC (rev 17240)
@@ -17,8 +17,6 @@
*/
package org.hibernate.jsr303.tck.tests.validation.validatorcontext;
-import javax.validation.Valid;
-
/**
* @author Hardy Ferentschik
*/
@@ -27,14 +25,8 @@
@Dummy
String value;
- @Valid
- DummyBean nestedDummy;
public DummyBean(String value) {
this.value = value;
}
-
- public void setNestedDummy(DummyBean nestedDummy) {
- this.nestedDummy = nestedDummy;
- }
}
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/validatorcontext/DummyValidator.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/validatorcontext/DummyValidator.java 2009-08-06 10:32:05 UTC (rev 17239)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/validatorcontext/DummyValidator.java 2009-08-06 12:18:35 UTC (rev 17240)
@@ -41,8 +41,14 @@
if ( errorMessages != null ) {
for ( Map.Entry<String, String> entry : errorMessages.entrySet() ) {
- constraintValidatorContext.buildErrorWithMessageTemplate( entry.getKey() )
- .addSubNode( entry.getValue() ).addError();
+ if ( entry.getKey() == null ) {
+ constraintValidatorContext.buildErrorWithMessageTemplate( entry.getValue() ).addError();
+ }
+ else {
+ constraintValidatorContext.buildErrorWithMessageTemplate( entry.getValue() )
+ .addSubNode( entry.getKey() )
+ .addError();
+ }
}
}
@@ -53,7 +59,7 @@
disableDefaultError = b;
}
- public static void setErrorMessages(Map<String, String> errorMessages) {
+ public static void setCustomErrorMessages(Map<String, String> errorMessages) {
DummyValidator.errorMessages = errorMessages;
}
}
\ No newline at end of file
Modified: beanvalidation/trunk/validation-tck/src/main/resources/tck-audit.xml
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/resources/tck-audit.xml 2009-08-06 10:32:05 UTC (rev 17239)
+++ beanvalidation/trunk/validation-tck/src/main/resources/tck-audit.xml 2009-08-06 12:18:35 UTC (rev 17240)
@@ -200,11 +200,8 @@
path to the bean or property hosting the constraint</text>
</assertion>
<assertion id="q">
- <text>The leaf of the propertyPath can be adjusted by use of ConstraintValidatorCon-
- text.addError(String, String). In this case, propertyPath is the concatenation of
- the default propertyPath value . (dot) if propertyPath is not an empty string (ie
- not representing the root object) and the property string passed to the addError
- method </text>
+ <text>You can point an error to a subpath of this default path by using the er-
+ ror builder fluent API.</text>
</assertion>
</section>
<section id="2.5" title="The ConstraintValidatorFactory">
16 years, 8 months
Hibernate SVN: r17239 - in beanvalidation/trunk/validation-tck/src/main: java/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition and 13 other directories.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-08-06 06:32:05 -0400 (Thu, 06 Aug 2009)
New Revision: 17239
Modified:
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/application/Building.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/application/Citizen.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/application/Person.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/application/SuperWoman.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/application/Visibility.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/application/Woman.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/Shoe.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/nestedconstraintcomposition/FirstCompositeConstraint1.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/nestedconstraintcomposition/FirstCompositeConstraint2.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/nestedconstraintcomposition/FirstCompositeConstraint3.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/nestedconstraintcomposition/FirstCompositeConstraint4.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/nestedconstraintcomposition/SecondCompositeConstraint.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/nestedconstraintcomposition/SecondCompositeConstraintSingleViolation.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/Address.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/Car.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/User.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/ZipCodeCoherenceChecker.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/groupsequence/SequenceResolutionTest.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/groupsequence/TestEntity.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/groupsequenceisolation/A.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/groupsequenceisolation/B1.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/groupsequenceisolation/B2.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/groupsequenceisolation/B3.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/groupsequenceisolation/C.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/groupsequenceisolation/D1.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/groupsequenceisolation/E.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/groupsequenceisolation/F1.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/groupsequenceisolation/IsAdult.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/invalidconstraintdefinitions/InvalidGroupsType.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/invalidconstraintdefinitions/InvalidMessageType.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/invalidconstraintdefinitions/InvalidPayloadClass.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/Bar.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/BaseClass.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/Foo.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/SerializableBarSubclass.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/SubClassA.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/SubClassB.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/messageinterpolation/MessageInterpolationTest.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/metadata/Severity.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/metadata/UnconstraintEntity.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/BadlyBehavedEntity.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/First.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/Last.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/Second.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/graphnavigation/Animal.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/graphnavigation/AnimalCaretaker.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/graphnavigation/Condor.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/graphnavigation/Elephant.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/graphnavigation/GameReserve.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/graphnavigation/Herd.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/graphnavigation/MultiCage.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/graphnavigation/SingleCage.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/graphnavigation/Zebra.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/graphnavigation/Zoo.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/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/User.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/constraintdeclaration/GroupIsNotAllowedAsElementNameTest.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/constraintdeclaration/MandatoryNameAttributeTest.java
beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/constraintdeclaration/MessageIsNotAllowedAsElementNameTest.java
beanvalidation/trunk/validation-tck/src/main/resources/tck-audit.xml
Log:
Made sure a consistent class header is used
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/application/Building.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/application/Citizen.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/application/Person.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/application/SuperWoman.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/application/Visibility.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/application/Woman.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/Shoe.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/nestedconstraintcomposition/FirstCompositeConstraint1.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/nestedconstraintcomposition/FirstCompositeConstraint2.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/nestedconstraintcomposition/FirstCompositeConstraint3.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/nestedconstraintcomposition/FirstCompositeConstraint4.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/nestedconstraintcomposition/SecondCompositeConstraint.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/constraintcomposition/nestedconstraintcomposition/SecondCompositeConstraintSingleViolation.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/Address.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/Address.java 2009-08-06 09:00:05 UTC (rev 17238)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/Address.java 2009-08-06 10:32:05 UTC (rev 17239)
@@ -1,3 +1,20 @@
+// $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.constraints.groups;
import javax.validation.GroupSequence;
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/Car.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/Car.java 2009-08-06 09:00:05 UTC (rev 17238)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/Car.java 2009-08-06 10:32:05 UTC (rev 17239)
@@ -1,3 +1,20 @@
+// $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.constraints.groups;
import javax.validation.GroupSequence;
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/User.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/User.java 2009-08-06 09:00:05 UTC (rev 17238)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/User.java 2009-08-06 10:32:05 UTC (rev 17239)
@@ -1,3 +1,20 @@
+// $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.constraints.groups;
import javax.validation.GroupSequence;
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/ZipCodeCoherenceChecker.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/ZipCodeCoherenceChecker.java 2009-08-06 09:00:05 UTC (rev 17238)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/ZipCodeCoherenceChecker.java 2009-08-06 10:32:05 UTC (rev 17239)
@@ -1,3 +1,20 @@
+// $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.constraints.groups;
import java.lang.annotation.Documented;
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/groupsequence/SequenceResolutionTest.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/groupsequence/TestEntity.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/groupsequenceisolation/A.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/groupsequenceisolation/B1.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/groupsequenceisolation/B2.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/groupsequenceisolation/B3.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/groupsequenceisolation/C.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/groupsequenceisolation/D1.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/groupsequenceisolation/E.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/groupsequenceisolation/F1.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/groupsequenceisolation/IsAdult.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/groupsequenceisolation/IsAdult.java 2009-08-06 09:00:05 UTC (rev 17238)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/groupsequenceisolation/IsAdult.java 2009-08-06 10:32:05 UTC (rev 17239)
@@ -1,4 +1,4 @@
-// $Id: Positive.java 16835 2009-06-18 16:29:46Z hardy.ferentschik $
+// $Id$
/*
* JBoss, Home of Professional Open Source
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/groups/groupsequenceisolation/IsAdult.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/invalidconstraintdefinitions/InvalidGroupsType.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/invalidconstraintdefinitions/InvalidGroupsType.java 2009-08-06 09:00:05 UTC (rev 17238)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/invalidconstraintdefinitions/InvalidGroupsType.java 2009-08-06 10:32:05 UTC (rev 17239)
@@ -1,4 +1,4 @@
-// $Id: InvalidDefaultGroup.java 16691 2009-06-04 09:18:14Z hardy.ferentschik $
+// $Id$
/*
* JBoss, Home of Professional Open Source
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/invalidconstraintdefinitions/InvalidGroupsType.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/invalidconstraintdefinitions/InvalidMessageType.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/invalidconstraintdefinitions/InvalidMessageType.java 2009-08-06 09:00:05 UTC (rev 17238)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/invalidconstraintdefinitions/InvalidMessageType.java 2009-08-06 10:32:05 UTC (rev 17239)
@@ -1,4 +1,4 @@
-// $Id: InvalidDefaultGroup.java 16691 2009-06-04 09:18:14Z hardy.ferentschik $
+// $Id$
/*
* JBoss, Home of Professional Open Source
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/invalidconstraintdefinitions/InvalidMessageType.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/invalidconstraintdefinitions/InvalidPayloadClass.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/invalidconstraintdefinitions/InvalidPayloadClass.java 2009-08-06 09:00:05 UTC (rev 17238)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/invalidconstraintdefinitions/InvalidPayloadClass.java 2009-08-06 10:32:05 UTC (rev 17239)
@@ -1,4 +1,4 @@
-// $Id: InvalidDefaultGroup.java 16691 2009-06-04 09:18:14Z hardy.ferentschik $
+// $Id$
/*
* JBoss, Home of Professional Open Source
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/invalidconstraintdefinitions/InvalidPayloadClass.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/Bar.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/Bar.java 2009-08-06 09:00:05 UTC (rev 17238)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/Bar.java 2009-08-06 10:32:05 UTC (rev 17239)
@@ -1,4 +1,4 @@
-// : Person.java 69 2008-09-08 11:05:07Z hardy.ferentschik $
+// $Id$
/*
* JBoss, Home of Professional Open Source
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/BaseClass.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/Foo.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/Foo.java 2009-08-06 09:00:05 UTC (rev 17238)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/Foo.java 2009-08-06 10:32:05 UTC (rev 17239)
@@ -1,4 +1,4 @@
-// : Person.java 69 2008-09-08 11:05:07Z hardy.ferentschik $
+// $Id$
/*
* JBoss, Home of Professional Open Source
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/SerializableBarSubclass.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/SerializableBarSubclass.java 2009-08-06 09:00:05 UTC (rev 17238)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/SerializableBarSubclass.java 2009-08-06 10:32:05 UTC (rev 17239)
@@ -1,4 +1,4 @@
-// : Person.java 69 2008-09-08 11:05:07Z hardy.ferentschik $
+// $Id$
/*
* JBoss, Home of Professional Open Source
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/SubClassA.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/constraints/validatorresolution/SubClassB.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/messageinterpolation/MessageInterpolationTest.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/metadata/Severity.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/metadata/Severity.java 2009-08-06 09:00:05 UTC (rev 17238)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/metadata/Severity.java 2009-08-06 10:32:05 UTC (rev 17239)
@@ -1,3 +1,20 @@
+// $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.metadata;
import javax.validation.ConstraintPayload;
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/metadata/Severity.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/metadata/UnconstraintEntity.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/metadata/UnconstraintEntity.java 2009-08-06 09:00:05 UTC (rev 17238)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/metadata/UnconstraintEntity.java 2009-08-06 10:32:05 UTC (rev 17239)
@@ -1,4 +1,4 @@
-// : Person.java 69 2008-09-08 11:05:07Z hardy.ferentschik $
+// $Id$
/*
* JBoss, Home of Professional Open Source
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/BadlyBehavedEntity.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/First.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/First.java 2009-08-06 09:00:05 UTC (rev 17238)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/First.java 2009-08-06 10:32:05 UTC (rev 17239)
@@ -1,3 +1,20 @@
+// $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.validation;
/**
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/Last.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/Last.java 2009-08-06 09:00:05 UTC (rev 17238)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/Last.java 2009-08-06 10:32:05 UTC (rev 17239)
@@ -1,3 +1,20 @@
+// $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.validation;
/**
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/Second.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/Second.java 2009-08-06 09:00:05 UTC (rev 17238)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/Second.java 2009-08-06 10:32:05 UTC (rev 17239)
@@ -1,3 +1,20 @@
+// $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.validation;
/**
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/graphnavigation/Animal.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/graphnavigation/AnimalCaretaker.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/graphnavigation/Condor.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/graphnavigation/Elephant.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/graphnavigation/GameReserve.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/graphnavigation/Herd.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/graphnavigation/MultiCage.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/graphnavigation/SingleCage.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/graphnavigation/Zebra.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/validation/graphnavigation/Zoo.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: 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-08-06 09:00:05 UTC (rev 17238)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/MultipleFieldDefinitionTest.java 2009-08-06 10:32:05 UTC (rev 17239)
@@ -1,4 +1,4 @@
-// $Id: InvalidXmlConfigurationTest.java 16948 2009-06-25 10:10:13Z hardy.ferentschik $
+// $Id$
/*
* JBoss, Home of Professional Open Source
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/MultipleFieldDefinitionTest.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: 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-08-06 09:00:05 UTC (rev 17238)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/MultipleGetterDefinitionTest.java 2009-08-06 10:32:05 UTC (rev 17239)
@@ -1,4 +1,4 @@
-// $Id: InvalidXmlConfigurationTest.java 16948 2009-06-25 10:10:13Z hardy.ferentschik $
+// $Id$
/*
* JBoss, Home of Professional Open Source
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/MultipleGetterDefinitionTest.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/User.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/User.java 2009-08-06 09:00:05 UTC (rev 17238)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/User.java 2009-08-06 10:32:05 UTC (rev 17239)
@@ -1,3 +1,20 @@
+// $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.constraints.NotNull;
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/constraintdeclaration/GroupIsNotAllowedAsElementNameTest.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/constraintdeclaration/GroupIsNotAllowedAsElementNameTest.java 2009-08-06 09:00:05 UTC (rev 17238)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/constraintdeclaration/GroupIsNotAllowedAsElementNameTest.java 2009-08-06 10:32:05 UTC (rev 17239)
@@ -1,4 +1,4 @@
-// $Id: InvalidXmlConfigurationTest.java 16948 2009-06-25 10:10:13Z hardy.ferentschik $
+// $Id$
/*
* JBoss, Home of Professional Open Source
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/constraintdeclaration/GroupIsNotAllowedAsElementNameTest.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/constraintdeclaration/MandatoryNameAttributeTest.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/constraintdeclaration/MandatoryNameAttributeTest.java 2009-08-06 09:00:05 UTC (rev 17238)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/constraintdeclaration/MandatoryNameAttributeTest.java 2009-08-06 10:32:05 UTC (rev 17239)
@@ -1,4 +1,4 @@
-// $Id: InvalidXmlConfigurationTest.java 16948 2009-06-25 10:10:13Z hardy.ferentschik $
+// $Id$
/*
* JBoss, Home of Professional Open Source
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/constraintdeclaration/MandatoryNameAttributeTest.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/constraintdeclaration/MessageIsNotAllowedAsElementNameTest.java
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/constraintdeclaration/MessageIsNotAllowedAsElementNameTest.java 2009-08-06 09:00:05 UTC (rev 17238)
+++ beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/constraintdeclaration/MessageIsNotAllowedAsElementNameTest.java 2009-08-06 10:32:05 UTC (rev 17239)
@@ -1,4 +1,4 @@
-// $Id: InvalidXmlConfigurationTest.java 16948 2009-06-25 10:10:13Z hardy.ferentschik $
+// $Id$
/*
* JBoss, Home of Professional Open Source
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
Property changes on: beanvalidation/trunk/validation-tck/src/main/java/org/hibernate/jsr303/tck/tests/xmlconfiguration/constraintdeclaration/MessageIsNotAllowedAsElementNameTest.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: beanvalidation/trunk/validation-tck/src/main/resources/tck-audit.xml
===================================================================
--- beanvalidation/trunk/validation-tck/src/main/resources/tck-audit.xml 2009-08-06 09:00:05 UTC (rev 17238)
+++ beanvalidation/trunk/validation-tck/src/main/resources/tck-audit.xml 2009-08-06 10:32:05 UTC (rev 17239)
@@ -755,9 +755,8 @@
</assertion>
<assertion id="d">
<text>Use the provider implementation associated with the Configuration implementation
- described in the XML configuration (under validation-config.default-provider see
- Section 4.4.6) if defined: the value of this element is the fully qualified class
- name of the Configuration sub interface uniquely identifying the provider.</text>
+ described in the XML configuration if defined: the value of this element is the fully qualified class name
+ of the ValidationProvider implementation uniquely identifying the provider.</text>
</assertion>
<assertion id="e">
<text>Use the first provider implementation returned by
16 years, 8 months