You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(39) |
Dec
(10) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(19) |
Feb
(150) |
Mar
(10) |
Apr
|
May
(8) |
Jun
(11) |
Jul
(27) |
Aug
(52) |
Sep
(35) |
Oct
(30) |
Nov
(18) |
Dec
(4) |
2008 |
Jan
(76) |
Feb
(121) |
Mar
(39) |
Apr
(55) |
May
(18) |
Jun
(49) |
Jul
(32) |
Aug
(4) |
Sep
(10) |
Oct
|
Nov
(3) |
Dec
(33) |
2009 |
Jan
(19) |
Feb
(87) |
Mar
(69) |
Apr
(38) |
May
(47) |
Jun
(20) |
Jul
(5) |
Aug
(76) |
Sep
(145) |
Oct
(34) |
Nov
(8) |
Dec
(68) |
2010 |
Jan
(150) |
Feb
(379) |
Mar
(191) |
Apr
(100) |
May
(525) |
Jun
(269) |
Jul
(127) |
Aug
(190) |
Sep
(190) |
Oct
(29) |
Nov
(147) |
Dec
(83) |
2011 |
Jan
(188) |
Feb
(81) |
Mar
(43) |
Apr
(97) |
May
(63) |
Jun
(129) |
Jul
(17) |
Aug
(124) |
Sep
(6) |
Oct
(20) |
Nov
(67) |
Dec
(23) |
2012 |
Jan
(6) |
Feb
(14) |
Mar
(181) |
Apr
(64) |
May
(102) |
Jun
(47) |
Jul
(26) |
Aug
(3) |
Sep
(1) |
Oct
(14) |
Nov
(13) |
Dec
(23) |
2013 |
Jan
(4) |
Feb
(14) |
Mar
(18) |
Apr
(14) |
May
(27) |
Jun
(27) |
Jul
(5) |
Aug
(2) |
Sep
(74) |
Oct
(79) |
Nov
(21) |
Dec
(97) |
2014 |
Jan
(6) |
Feb
(3) |
Mar
(8) |
Apr
|
May
(5) |
Jun
|
Jul
(9) |
Aug
(6) |
Sep
(3) |
Oct
(10) |
Nov
(6) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
(1) |
Apr
(25) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <fg...@us...> - 2008-02-03 21:07:36
|
Revision: 595 http://openutils.svn.sourceforge.net/openutils/?rev=595&view=rev Author: fgiust Date: 2008-02-03 13:07:40 -0800 (Sun, 03 Feb 2008) Log Message: ----------- [maven-release-plugin] prepare release openutils-dbmigration-2.0 Modified Paths: -------------- trunk/openutils-dbmigration/pom.xml Modified: trunk/openutils-dbmigration/pom.xml =================================================================== --- trunk/openutils-dbmigration/pom.xml 2008-02-03 21:02:50 UTC (rev 594) +++ trunk/openutils-dbmigration/pom.xml 2008-02-03 21:07:40 UTC (rev 595) @@ -1,5 +1,4 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>net.sourceforge.openutils</groupId> @@ -9,7 +8,7 @@ </parent> <artifactId>openutils-dbmigration</artifactId> <name>openutils db migration</name> - <version>2.0-SNAPSHOT</version> + <version>2.0</version> <description /> <dependencies> <dependency> @@ -94,4 +93,10 @@ <properties> <spring.version>2.5.1</spring.version> </properties> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-dbmigration-2.0</url> + </scm> </project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-02-03 21:02:47
|
Revision: 594 http://openutils.svn.sourceforge.net/openutils/?rev=594&view=rev Author: fgiust Date: 2008-02-03 13:02:50 -0800 (Sun, 03 Feb 2008) Log Message: ----------- try to avoid spring-web dependency Modified Paths: -------------- trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java Modified: trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java =================================================================== --- trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java 2008-02-01 10:59:57 UTC (rev 593) +++ trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java 2008-02-03 21:02:50 UTC (rev 594) @@ -17,17 +17,19 @@ import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; import org.springframework.core.io.Resource; import org.springframework.core.io.UrlResource; import org.springframework.util.ResourceUtils; -import org.springframework.web.context.ServletContextAware; +import org.springframework.web.context.WebApplicationContext; /** * @author fgiust * @version $Id: $ */ -public class EnvironmentPropertyConfigurer extends PropertyPlaceholderConfigurer implements ServletContextAware +public class EnvironmentPropertyConfigurer extends PropertyPlaceholderConfigurer implements ApplicationContextAware { /** @@ -66,14 +68,6 @@ private boolean inherit = true; /** - * {@inheritDoc} - */ - public void setServletContext(ServletContext servletContext) - { - this.servletContext = servletContext; - } - - /** * Setter for <code>fileLocation</code>. * @param fileLocation The fileLocation to set. */ @@ -309,4 +303,21 @@ return properties.getProperty(key); } + /** + * {@inheritDoc} + */ + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException + { + try + { + if (applicationContext instanceof WebApplicationContext) + { + this.servletContext = ((WebApplicationContext) applicationContext).getServletContext(); + } + } + catch (NoClassDefFoundError e) + { + // ignore, we are not in a web project or spring web is not available + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2008-02-01 10:59:57
|
Revision: 593 http://openutils.svn.sourceforge.net/openutils/?rev=593&view=rev Author: molaschi Date: 2008-02-01 02:59:57 -0800 (Fri, 01 Feb 2008) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-bshd5/pom.xml Modified: trunk/openutils-bshd5/pom.xml =================================================================== --- trunk/openutils-bshd5/pom.xml 2008-02-01 10:59:48 UTC (rev 592) +++ trunk/openutils-bshd5/pom.xml 2008-02-01 10:59:57 UTC (rev 593) @@ -8,7 +8,7 @@ </parent> <artifactId>openutils-bshd5</artifactId> <name>openutils base Spring-Hibernate DAO for java 5.0</name> - <version>2.0.1</version> + <version>2.0.2-SNAPSHOT</version> <description>openutils base Spring-Hibernate DAO for java 5.0</description> <dependencies> <dependency> @@ -105,10 +105,4 @@ <properties> <spring.version>2.5.1</spring.version> </properties> - - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-bshd5-2.0.1</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-bshd5-2.0.1</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-bshd5-2.0.1</url> - </scm> </project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2008-02-01 10:59:44
|
Revision: 592 http://openutils.svn.sourceforge.net/openutils/?rev=592&view=rev Author: molaschi Date: 2008-02-01 02:59:48 -0800 (Fri, 01 Feb 2008) Log Message: ----------- [maven-release-plugin] copy for tag openutils-bshd5-2.0.1 Added Paths: ----------- tags/openutils-bshd5-2.0.1/ tags/openutils-bshd5-2.0.1/pom.xml tags/openutils-bshd5-2.0.1/src/main/java/it/openutils/hibernate/example/EnhancedExample.java Removed Paths: ------------- tags/openutils-bshd5-2.0.1/pom.xml tags/openutils-bshd5-2.0.1/src/main/java/it/openutils/hibernate/example/EnhancedExample.java Copied: tags/openutils-bshd5-2.0.1 (from rev 589, trunk/openutils-bshd5) Deleted: tags/openutils-bshd5-2.0.1/pom.xml =================================================================== --- trunk/openutils-bshd5/pom.xml 2008-01-31 22:35:00 UTC (rev 589) +++ tags/openutils-bshd5-2.0.1/pom.xml 2008-02-01 10:59:48 UTC (rev 592) @@ -1,108 +0,0 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils</artifactId> - <version>7</version> - <relativePath>..</relativePath> - </parent> - <artifactId>openutils-bshd5</artifactId> - <name>openutils base Spring-Hibernate DAO for java 5.0</name> - <version>2.0.1-SNAPSHOT</version> - <description>openutils base Spring-Hibernate DAO for java 5.0</description> - <dependencies> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>1.4.3</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>jcl104-over-slf4j</artifactId> - <version>1.4.3</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-jdbc</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-beans</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-orm</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-aop</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate</artifactId> - <version>3.2.1.ga</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - <exclusion> - <groupId>cglib</groupId> - <artifactId>cglib</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>cglib</groupId> - <artifactId>cglib-nodep</artifactId> - <version>2.1_3</version> - </dependency> - <dependency> - <groupId>commons-beanutils</groupId> - <artifactId>commons-beanutils</artifactId> - <version>1.7.0</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.3</version> - </dependency> - </dependencies> - <properties> - <spring.version>2.5.1</spring.version> - </properties> -</project> \ No newline at end of file Copied: tags/openutils-bshd5-2.0.1/pom.xml (from rev 591, trunk/openutils-bshd5/pom.xml) =================================================================== --- tags/openutils-bshd5-2.0.1/pom.xml (rev 0) +++ tags/openutils-bshd5-2.0.1/pom.xml 2008-02-01 10:59:48 UTC (rev 592) @@ -0,0 +1,114 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils</artifactId> + <version>7</version> + <relativePath>..</relativePath> + </parent> + <artifactId>openutils-bshd5</artifactId> + <name>openutils base Spring-Hibernate DAO for java 5.0</name> + <version>2.0.1</version> + <description>openutils base Spring-Hibernate DAO for java 5.0</description> + <dependencies> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.4.3</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl104-over-slf4j</artifactId> + <version>1.4.3</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-jdbc</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-beans</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-orm</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate</artifactId> + <version>3.2.1.ga</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + <exclusion> + <groupId>cglib</groupId> + <artifactId>cglib</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>cglib</groupId> + <artifactId>cglib-nodep</artifactId> + <version>2.1_3</version> + </dependency> + <dependency> + <groupId>commons-beanutils</groupId> + <artifactId>commons-beanutils</artifactId> + <version>1.7.0</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.3</version> + </dependency> + </dependencies> + <properties> + <spring.version>2.5.1</spring.version> + </properties> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-bshd5-2.0.1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-bshd5-2.0.1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-bshd5-2.0.1</url> + </scm> +</project> \ No newline at end of file Deleted: tags/openutils-bshd5-2.0.1/src/main/java/it/openutils/hibernate/example/EnhancedExample.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/EnhancedExample.java 2008-01-31 22:35:00 UTC (rev 589) +++ tags/openutils-bshd5-2.0.1/src/main/java/it/openutils/hibernate/example/EnhancedExample.java 2008-02-01 10:59:48 UTC (rev 592) @@ -1,305 +0,0 @@ -package it.openutils.hibernate.example; - -import java.lang.reflect.InvocationTargetException; -import java.math.BigDecimal; -import java.sql.Timestamp; -import java.util.Calendar; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.apache.commons.beanutils.PropertyUtils; -import org.apache.commons.lang.ClassUtils; -import org.apache.commons.lang.StringUtils; -import org.hibernate.Criteria; -import org.hibernate.HibernateException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.dao.DataRetrievalFailureException; - - -/** - * @author Fabrizio Giustina - * @version $Id: $ - */ -public final class EnhancedExample -{ - - /** - * Logger. - */ - private static Logger log = LoggerFactory.getLogger(EnhancedExample.class); - - private Map<String, FilterMetadata> metadata; - - private EnhancedExample(Criteria crit, Object filter, Map<String, FilterMetadata> metadata) - { - this.metadata = metadata == null ? new HashMap<String, FilterMetadata>(0) : metadata; - fillCriteria(null, crit, filter); - } - - /** - * Fills a criteria object calling addCondition() for any non-null property or for any component in collections. - * @param crit Criteria - * @param filter javabean which will be analyzed for non-null properties - * @param metadata Map of property names - filter metadata - * @throws HibernateException exception while building the criteria - */ - public static void create(Criteria crit, Object filter, Map<String, FilterMetadata> metadata) - throws HibernateException - { - new EnhancedExample(crit, filter, metadata); - } - - /** - * Adds contitions to an existing criteria or create sub-criteria for associations. - * @param crit Criteria - * @param propertyName property name in parent bean - * @param value property value - * @throws HibernateException exception while building the criteria - */ - private void addCondition(Criteria crit, String propertyName, Object value, Object parentObject) - throws HibernateException - { - - String simplePropertyName = StringUtils.contains(propertyName, ".") ? StringUtils.substringAfterLast( - propertyName, - ".") : propertyName; - - if (isSimpleType(value) || value.getClass().isEnum()) - { - - // don't filter on empty strings! - if (value instanceof String && StringUtils.isBlank((String) value)) - { - return; - } - - FilterMetadata fmd = metadata.get(propertyName); - - if (fmd == null) - { - fmd = FilterMetadata.EQUAL; - } - - fmd.createFilter(crit, simplePropertyName, value); - - } - else - { - if (containsSomething(value)) - { - // @todo handle multiple associations in lists? - // see http://opensource2.atlassian.com/projects/hibernate/browse/HHH-879 - if ((value instanceof Set || value instanceof List) && !((Collection< ? >) value).isEmpty()) - { - // collection: the new criteria has already been created, now we only nee to analize content - - for (Object element : ((Collection< ? >) value)) - { - - log.debug("crit.createCriteria({})", simplePropertyName); - Criteria childrenCriteria = crit.createCriteria(simplePropertyName); - fillCriteria(propertyName, childrenCriteria, element); - } - } - else if ((value instanceof Map) && !((Map< ? , ? >) value).isEmpty()) - { - FilterMetadata fmd = metadata.get(propertyName); - - if (fmd != null) - { - fmd.createFilter(crit, simplePropertyName, value); - } - else - { - log.warn( - "Maps are not handled without a FilterMetadata. Property is {} and value is {}.", - propertyName, - value); - } - } - else - { - log.debug("crit.createCriteria({})", simplePropertyName); - Criteria childrenCriteria = crit.createCriteria(simplePropertyName); - fillCriteria(propertyName, childrenCriteria, value); - } - } - } - } - - /** - * Check if the bean contains at least a valid property. - * @param bean javabean - * @return <code>true</code> if the bean contains at least a valid property - */ - @SuppressWarnings("unchecked") - private boolean containsSomething(Object bean) - { - - if (bean == null) - { - return false; - } - if (isSimpleType(bean)) - { - return true; - } - - if (bean instanceof Collection) - { - - Collection< ? > coll = ((Collection< ? >) bean); - if (coll.isEmpty()) - { - return false; - } - - if (containsSomething(coll.iterator().next())) - { - return true; - } - } - else if (bean instanceof Map) - { - Map< ? , ? > coll = ((Map< ? , ? >) bean); - if (coll.isEmpty()) - { - return false; - } - - if (containsSomething(coll.values().iterator().next())) - { - return true; - } - } - - Map<String, Object> properties; - try - { - properties = PropertyUtils.describe(bean); - } - catch (Throwable e) - { - if (e instanceof InvocationTargetException) - { - e = ((InvocationTargetException) e).getTargetException(); - } - - log.error("Unable to build filter, PropertyUtils.describe throws an exception while analizing class " - + ClassUtils.getShortClassName(bean, "NULL"), e); - return false; - } - - for (Map.Entry<String, Object> property : properties.entrySet()) - { - - if (!PropertyUtils.isWriteable(bean, property.getKey())) - { - // skip readonly properties - continue; - } - - Object propertyValue = property.getValue(); - if (propertyValue == null) - { - continue; - } - - if (isSimpleType(propertyValue) || containsSomething(propertyValue)) - { - return true; - } - } - - return false; - } - - /** - * Fills a criteria object calling addCondition() for any non-null property or for any component in collections. - * @param crit Criteria - * @param filter javabean which will be analyzed for non-null properties - * @throws HibernateException exception while building the criteria - */ - @SuppressWarnings("unchecked") - private void fillCriteria(String parentPropertyName, Criteria crit, Object filter) throws HibernateException - { - if ((filter instanceof Set || filter instanceof List) && !((Collection< ? >) filter).isEmpty()) - { - // collection: the new criteria has already been created, now we only need to analize content - for (Object element : ((Collection< ? >) filter)) - { - fillCriteria(parentPropertyName, crit, element); - } - } - - Map<String, Object> properties; - try - { - properties = PropertyUtils.describe(filter); - } - catch (Throwable e) - { - if (e instanceof InvocationTargetException) - { - e = ((InvocationTargetException) e).getTargetException(); - } - - throw new DataRetrievalFailureException( - "Unable to build filter, PropertyUtils.describe throws an exception while analizing class " - + ClassUtils.getShortClassName(filter, "NULL") - + ":" - + e.getClass(), - e); - } - - Iterator<String> iterator = properties.keySet().iterator(); - while (iterator.hasNext()) - { - String propertyName = iterator.next(); - - Object value = properties.get(propertyName); - - // add only non-null values, ignore read-only properties - if (value != null && PropertyUtils.isWriteable(filter, propertyName)) - { - String composedPropertyName = (parentPropertyName == null) ? propertyName : parentPropertyName - + "." - + propertyName; - addCondition(crit, composedPropertyName, value, filter); - } - } - } - - /** - * Check if the given object is a simple java type - * @param object object to check - * @return <code>true</code>if the given object is a simple type - */ - private boolean isSimpleType(Object object) - { - - Class< ? extends Object> objClass = object.getClass(); - - return objClass.isPrimitive() - || objClass.equals(Integer.class) - || objClass.equals(Long.class) - || objClass.equals(Short.class) - || objClass.equals(Boolean.class) - || objClass.equals(String.class) - || objClass.equals(Double.class) - || objClass.equals(Float.class) - || objClass.equals(Date.class) - || objClass.equals(Byte.class) - || objClass.equals(BigDecimal.class) - || objClass.equals(Timestamp.class) - || objClass.equals(Character.class) - || Calendar.class.isAssignableFrom(objClass); - } - -} Copied: tags/openutils-bshd5-2.0.1/src/main/java/it/openutils/hibernate/example/EnhancedExample.java (from rev 590, trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/EnhancedExample.java) =================================================================== --- tags/openutils-bshd5-2.0.1/src/main/java/it/openutils/hibernate/example/EnhancedExample.java (rev 0) +++ tags/openutils-bshd5-2.0.1/src/main/java/it/openutils/hibernate/example/EnhancedExample.java 2008-02-01 10:59:48 UTC (rev 592) @@ -0,0 +1,306 @@ +package it.openutils.hibernate.example; + +import java.lang.reflect.InvocationTargetException; +import java.math.BigDecimal; +import java.sql.Timestamp; +import java.util.Calendar; +import java.util.Collection; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.commons.beanutils.PropertyUtils; +import org.apache.commons.lang.ClassUtils; +import org.apache.commons.lang.StringUtils; +import org.hibernate.Criteria; +import org.hibernate.HibernateException; +import org.hibernate.mapping.Value; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.dao.DataRetrievalFailureException; + + +/** + * @author Fabrizio Giustina + * @version $Id: $ + */ +public final class EnhancedExample +{ + + /** + * Logger. + */ + private static Logger log = LoggerFactory.getLogger(EnhancedExample.class); + + private Map<String, FilterMetadata> metadata; + + private EnhancedExample(Criteria crit, Object filter, Map<String, FilterMetadata> metadata) + { + this.metadata = metadata == null ? new HashMap<String, FilterMetadata>(0) : metadata; + fillCriteria(null, crit, filter); + } + + /** + * Fills a criteria object calling addCondition() for any non-null property or for any component in collections. + * @param crit Criteria + * @param filter javabean which will be analyzed for non-null properties + * @param metadata Map of property names - filter metadata + * @throws HibernateException exception while building the criteria + */ + public static void create(Criteria crit, Object filter, Map<String, FilterMetadata> metadata) + throws HibernateException + { + new EnhancedExample(crit, filter, metadata); + } + + /** + * Adds contitions to an existing criteria or create sub-criteria for associations. + * @param crit Criteria + * @param propertyName property name in parent bean + * @param value property value + * @throws HibernateException exception while building the criteria + */ + private void addCondition(Criteria crit, String propertyName, Object value, Object parentObject) + throws HibernateException + { + + String simplePropertyName = StringUtils.contains(propertyName, ".") ? StringUtils.substringAfterLast( + propertyName, + ".") : propertyName; + + if (isSimpleType(value) || value.getClass().isEnum()) + { + + // don't filter on empty strings! + if (value instanceof String && StringUtils.isBlank((String) value)) + { + return; + } + + FilterMetadata fmd = metadata.get(propertyName); + + if (fmd == null) + { + fmd = FilterMetadata.EQUAL; + } + + fmd.createFilter(crit, simplePropertyName, value); + + } + else + { + if (containsSomething(value)) + { + // @todo handle multiple associations in lists? + // see http://opensource2.atlassian.com/projects/hibernate/browse/HHH-879 + if ((value instanceof Set || value instanceof List) && !((Collection< ? >) value).isEmpty()) + { + // collection: the new criteria has already been created, now we only nee to analize content + + for (Object element : ((Collection< ? >) value)) + { + + log.debug("crit.createCriteria({})", simplePropertyName); + Criteria childrenCriteria = crit.createCriteria(simplePropertyName); + fillCriteria(propertyName, childrenCriteria, element); + } + } + else if ((value instanceof Map) && !((Map< ? , ? >) value).isEmpty()) + { + FilterMetadata fmd = metadata.get(propertyName); + + if (fmd != null) + { + fmd.createFilter(crit, simplePropertyName, value); + } + else + { + log.warn( + "Maps are not handled without a FilterMetadata. Property is {} and value is {}.", + propertyName, + value); + } + } + else + { + log.debug("crit.createCriteria({})", simplePropertyName); + Criteria childrenCriteria = crit.createCriteria(simplePropertyName); + fillCriteria(propertyName, childrenCriteria, value); + } + } + } + } + + /** + * Check if the bean contains at least a valid property. + * @param bean javabean + * @return <code>true</code> if the bean contains at least a valid property + */ + @SuppressWarnings("unchecked") + private boolean containsSomething(Object bean) + { + + if (bean == null) + { + return false; + } + if (isSimpleType(bean) || bean.getClass().isEnum()) + { + return true; + } + + if (bean instanceof Collection) + { + + Collection< ? > coll = ((Collection< ? >) bean); + if (coll.isEmpty()) + { + return false; + } + + if (containsSomething(coll.iterator().next())) + { + return true; + } + } + else if (bean instanceof Map) + { + Map< ? , ? > coll = ((Map< ? , ? >) bean); + if (coll.isEmpty()) + { + return false; + } + + if (containsSomething(coll.values().iterator().next())) + { + return true; + } + } + + Map<String, Object> properties; + try + { + properties = PropertyUtils.describe(bean); + } + catch (Throwable e) + { + if (e instanceof InvocationTargetException) + { + e = ((InvocationTargetException) e).getTargetException(); + } + + log.error("Unable to build filter, PropertyUtils.describe throws an exception while analizing class " + + ClassUtils.getShortClassName(bean, "NULL"), e); + return false; + } + + for (Map.Entry<String, Object> property : properties.entrySet()) + { + + if (!PropertyUtils.isWriteable(bean, property.getKey())) + { + // skip readonly properties + continue; + } + + Object propertyValue = property.getValue(); + if (propertyValue == null) + { + continue; + } + + if (isSimpleType(propertyValue) || containsSomething(propertyValue)) + { + return true; + } + } + + return false; + } + + /** + * Fills a criteria object calling addCondition() for any non-null property or for any component in collections. + * @param crit Criteria + * @param filter javabean which will be analyzed for non-null properties + * @throws HibernateException exception while building the criteria + */ + @SuppressWarnings("unchecked") + private void fillCriteria(String parentPropertyName, Criteria crit, Object filter) throws HibernateException + { + if ((filter instanceof Set || filter instanceof List) && !((Collection< ? >) filter).isEmpty()) + { + // collection: the new criteria has already been created, now we only need to analize content + for (Object element : ((Collection< ? >) filter)) + { + fillCriteria(parentPropertyName, crit, element); + } + } + + Map<String, Object> properties; + try + { + properties = PropertyUtils.describe(filter); + } + catch (Throwable e) + { + if (e instanceof InvocationTargetException) + { + e = ((InvocationTargetException) e).getTargetException(); + } + + throw new DataRetrievalFailureException( + "Unable to build filter, PropertyUtils.describe throws an exception while analizing class " + + ClassUtils.getShortClassName(filter, "NULL") + + ":" + + e.getClass(), + e); + } + + Iterator<String> iterator = properties.keySet().iterator(); + while (iterator.hasNext()) + { + String propertyName = iterator.next(); + + Object value = properties.get(propertyName); + + // add only non-null values, ignore read-only properties + if (value != null && PropertyUtils.isWriteable(filter, propertyName)) + { + String composedPropertyName = (parentPropertyName == null) ? propertyName : parentPropertyName + + "." + + propertyName; + addCondition(crit, composedPropertyName, value, filter); + } + } + } + + /** + * Check if the given object is a simple java type + * @param object object to check + * @return <code>true</code>if the given object is a simple type + */ + private boolean isSimpleType(Object object) + { + + Class< ? extends Object> objClass = object.getClass(); + + return objClass.isPrimitive() + || objClass.equals(Integer.class) + || objClass.equals(Long.class) + || objClass.equals(Short.class) + || objClass.equals(Boolean.class) + || objClass.equals(String.class) + || objClass.equals(Double.class) + || objClass.equals(Float.class) + || objClass.equals(Date.class) + || objClass.equals(Byte.class) + || objClass.equals(BigDecimal.class) + || objClass.equals(Timestamp.class) + || objClass.equals(Character.class) + || Calendar.class.isAssignableFrom(objClass); + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2008-02-01 10:59:20
|
Revision: 591 http://openutils.svn.sourceforge.net/openutils/?rev=591&view=rev Author: molaschi Date: 2008-02-01 02:59:20 -0800 (Fri, 01 Feb 2008) Log Message: ----------- Modified Paths: -------------- trunk/openutils-bshd5/pom.xml Modified: trunk/openutils-bshd5/pom.xml =================================================================== --- trunk/openutils-bshd5/pom.xml 2008-02-01 10:34:37 UTC (rev 590) +++ trunk/openutils-bshd5/pom.xml 2008-02-01 10:59:20 UTC (rev 591) @@ -8,7 +8,7 @@ </parent> <artifactId>openutils-bshd5</artifactId> <name>openutils base Spring-Hibernate DAO for java 5.0</name> - <version>2.0.1-SNAPSHOT</version> + <version>2.0.1</version> <description>openutils base Spring-Hibernate DAO for java 5.0</description> <dependencies> <dependency> @@ -105,4 +105,10 @@ <properties> <spring.version>2.5.1</spring.version> </properties> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-bshd5-2.0.1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-bshd5-2.0.1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-bshd5-2.0.1</url> + </scm> </project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2008-02-01 10:34:48
|
Revision: 590 http://openutils.svn.sourceforge.net/openutils/?rev=590&view=rev Author: molaschi Date: 2008-02-01 02:34:37 -0800 (Fri, 01 Feb 2008) Log Message: ----------- bug fix for Enum in EnhancedExample Modified Paths: -------------- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/EnhancedExample.java Modified: trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/EnhancedExample.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/EnhancedExample.java 2008-01-31 22:35:00 UTC (rev 589) +++ trunk/openutils-bshd5/src/main/java/it/openutils/hibernate/example/EnhancedExample.java 2008-02-01 10:34:37 UTC (rev 590) @@ -17,6 +17,7 @@ import org.apache.commons.lang.StringUtils; import org.hibernate.Criteria; import org.hibernate.HibernateException; +import org.hibernate.mapping.Value; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.dao.DataRetrievalFailureException; @@ -146,7 +147,7 @@ { return false; } - if (isSimpleType(bean)) + if (isSimpleType(bean) || bean.getClass().isEnum()) { return true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-01-31 22:34:56
|
Revision: 589 http://openutils.svn.sourceforge.net/openutils/?rev=589&view=rev Author: fgiust Date: 2008-01-31 14:35:00 -0800 (Thu, 31 Jan 2008) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-testing-junit/pom.xml Modified: trunk/openutils-testing-junit/pom.xml =================================================================== --- trunk/openutils-testing-junit/pom.xml 2008-01-31 22:34:54 UTC (rev 588) +++ trunk/openutils-testing-junit/pom.xml 2008-01-31 22:35:00 UTC (rev 589) @@ -8,7 +8,7 @@ </parent> <artifactId>openutils-testing-junit</artifactId> <name>openutils test utils (junit)</name> - <version>2.0.2</version> + <version>2.0.3-SNAPSHOT</version> <description>openutils test utils</description> <dependencies> <dependency> @@ -156,10 +156,4 @@ <properties> <spring.version>2.5.1</spring.version> </properties> - - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-junit-2.0.2</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-junit-2.0.2</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-testing-junit-2.0.2</url> - </scm> </project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-01-31 22:34:48
|
Revision: 588 http://openutils.svn.sourceforge.net/openutils/?rev=588&view=rev Author: fgiust Date: 2008-01-31 14:34:54 -0800 (Thu, 31 Jan 2008) Log Message: ----------- [maven-release-plugin] copy for tag openutils-testing-junit-2.0.2 Added Paths: ----------- tags/openutils-testing-junit-2.0.2/ tags/openutils-testing-junit-2.0.2/pom.xml Removed Paths: ------------- tags/openutils-testing-junit-2.0.2/pom.xml Copied: tags/openutils-testing-junit-2.0.2 (from rev 582, trunk/openutils-testing-junit) Deleted: tags/openutils-testing-junit-2.0.2/pom.xml =================================================================== --- trunk/openutils-testing-junit/pom.xml 2008-01-31 22:20:03 UTC (rev 582) +++ tags/openutils-testing-junit-2.0.2/pom.xml 2008-01-31 22:34:54 UTC (rev 588) @@ -1,159 +0,0 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils</artifactId> - <version>7</version> - <relativePath>..</relativePath> - </parent> - <artifactId>openutils-testing-junit</artifactId> - <name>openutils test utils (junit)</name> - <version>2.0.2-SNAPSHOT</version> - <description>openutils test utils</description> - <dependencies> - <dependency> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils-testing</artifactId> - <version>2.0</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-test</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - <exclusion> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>1.4.3</version> - </dependency> - <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <version>1.2.13</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-context</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-orm</artifactId> - <version>${spring.version}</version> - <optional>true</optional> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.3</version> - </dependency> - <dependency> - <groupId>org.dbunit</groupId> - <artifactId>dbunit</artifactId> - <version>2.2</version> - <optional>true</optional> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.4</version> - </dependency> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate</artifactId> - <version>3.2.1.ga</version> - <optional>true</optional> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - <exclusion> - <groupId>cglib</groupId> - <artifactId>cglib</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.apache.derby</groupId> - <artifactId>derby</artifactId> - <version>10.2.2.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>commons-dbcp</groupId> - <artifactId>commons-dbcp</artifactId> - <version>1.2.1</version> - <scope>test</scope> - <exclusions> - <exclusion> - <artifactId>xerces</artifactId> - <groupId>xerces</groupId> - </exclusion> - <exclusion> - <artifactId>xml-apis</artifactId> - <groupId>xml-apis</groupId> - </exclusion> - <exclusion> - <artifactId>commons-logging</artifactId> - <groupId>commons-logging</groupId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-jdbc</artifactId> - <version>${spring.version}</version> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - </dependencies> - <properties> - <spring.version>2.5.1</spring.version> - </properties> -</project> \ No newline at end of file Copied: tags/openutils-testing-junit-2.0.2/pom.xml (from rev 587, trunk/openutils-testing-junit/pom.xml) =================================================================== --- tags/openutils-testing-junit-2.0.2/pom.xml (rev 0) +++ tags/openutils-testing-junit-2.0.2/pom.xml 2008-01-31 22:34:54 UTC (rev 588) @@ -0,0 +1,165 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils</artifactId> + <version>7</version> + <relativePath>..</relativePath> + </parent> + <artifactId>openutils-testing-junit</artifactId> + <name>openutils test utils (junit)</name> + <version>2.0.2</version> + <description>openutils test utils</description> + <dependencies> + <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-testing</artifactId> + <version>2.0.2</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-test</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + <exclusion> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.4.3</version> + </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.13</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-core</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-orm</artifactId> + <version>${spring.version}</version> + <optional>true</optional> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.3</version> + </dependency> + <dependency> + <groupId>org.dbunit</groupId> + <artifactId>dbunit</artifactId> + <version>2.2</version> + <optional>true</optional> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.4</version> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate</artifactId> + <version>3.2.1.ga</version> + <optional>true</optional> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + <exclusion> + <groupId>cglib</groupId> + <artifactId>cglib</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.apache.derby</groupId> + <artifactId>derby</artifactId> + <version>10.2.2.0</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>commons-dbcp</groupId> + <artifactId>commons-dbcp</artifactId> + <version>1.2.1</version> + <scope>test</scope> + <exclusions> + <exclusion> + <artifactId>xerces</artifactId> + <groupId>xerces</groupId> + </exclusion> + <exclusion> + <artifactId>xml-apis</artifactId> + <groupId>xml-apis</groupId> + </exclusion> + <exclusion> + <artifactId>commons-logging</artifactId> + <groupId>commons-logging</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-jdbc</artifactId> + <version>${spring.version}</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + <properties> + <spring.version>2.5.1</spring.version> + </properties> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-junit-2.0.2</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-junit-2.0.2</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-testing-junit-2.0.2</url> + </scm> +</project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-01-31 22:34:39
|
Revision: 587 http://openutils.svn.sourceforge.net/openutils/?rev=587&view=rev Author: fgiust Date: 2008-01-31 14:34:45 -0800 (Thu, 31 Jan 2008) Log Message: ----------- [maven-release-plugin] prepare release openutils-testing-junit-2.0.2 Modified Paths: -------------- trunk/openutils-testing-junit/pom.xml Modified: trunk/openutils-testing-junit/pom.xml =================================================================== --- trunk/openutils-testing-junit/pom.xml 2008-01-31 22:24:40 UTC (rev 586) +++ trunk/openutils-testing-junit/pom.xml 2008-01-31 22:34:45 UTC (rev 587) @@ -1,5 +1,4 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>net.sourceforge.openutils</groupId> @@ -9,7 +8,7 @@ </parent> <artifactId>openutils-testing-junit</artifactId> <name>openutils test utils (junit)</name> - <version>2.0.2-SNAPSHOT</version> + <version>2.0.2</version> <description>openutils test utils</description> <dependencies> <dependency> @@ -157,4 +156,10 @@ <properties> <spring.version>2.5.1</spring.version> </properties> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-junit-2.0.2</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-junit-2.0.2</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-testing-junit-2.0.2</url> + </scm> </project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-01-31 22:24:34
|
Revision: 586 http://openutils.svn.sourceforge.net/openutils/?rev=586&view=rev Author: fgiust Date: 2008-01-31 14:24:40 -0800 (Thu, 31 Jan 2008) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-testing-testng/pom.xml Modified: trunk/openutils-testing-testng/pom.xml =================================================================== --- trunk/openutils-testing-testng/pom.xml 2008-01-31 22:24:31 UTC (rev 585) +++ trunk/openutils-testing-testng/pom.xml 2008-01-31 22:24:40 UTC (rev 586) @@ -8,7 +8,7 @@ </parent> <artifactId>openutils-testing-testng</artifactId> <name>openutils test utils (testng)</name> - <version>2.0.2</version> + <version>2.0.3-SNAPSHOT</version> <description>openutils test utils</description> <dependencies> <dependency> @@ -170,10 +170,4 @@ <properties> <spring.version>2.5.1</spring.version> </properties> - - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-testng-2.0.2</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-testng-2.0.2</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-testing-testng-2.0.2</url> - </scm> </project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-01-31 22:24:30
|
Revision: 585 http://openutils.svn.sourceforge.net/openutils/?rev=585&view=rev Author: fgiust Date: 2008-01-31 14:24:31 -0800 (Thu, 31 Jan 2008) Log Message: ----------- [maven-release-plugin] copy for tag openutils-testing-testng-2.0.2 Added Paths: ----------- tags/openutils-testing-testng-2.0.2/ tags/openutils-testing-testng-2.0.2/pom.xml tags/openutils-testing-testng-2.0.2/src/ Removed Paths: ------------- tags/openutils-testing-testng-2.0.2/pom.xml tags/openutils-testing-testng-2.0.2/src/ Copied: tags/openutils-testing-testng-2.0.2 (from rev 583, trunk/openutils-testing-testng) Deleted: tags/openutils-testing-testng-2.0.2/pom.xml =================================================================== --- trunk/openutils-testing-testng/pom.xml 2008-01-31 22:23:34 UTC (rev 583) +++ tags/openutils-testing-testng-2.0.2/pom.xml 2008-01-31 22:24:31 UTC (rev 585) @@ -1,173 +0,0 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils</artifactId> - <version>7</version> - <relativePath>..</relativePath> - </parent> - <artifactId>openutils-testing-testng</artifactId> - <name>openutils test utils (testng)</name> - <version>2.0.1-SNAPSHOT</version> - <description>openutils test utils</description> - <dependencies> - <dependency> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils-testing</artifactId> - <version>2.0.2</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-test</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - <exclusion> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>1.4.3</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>jcl104-over-slf4j</artifactId> - <version>1.4.3</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-context</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-orm</artifactId> - <version>${spring.version}</version> - <optional>true</optional> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.3</version> - </dependency> - <dependency> - <groupId>org.dbunit</groupId> - <artifactId>dbunit</artifactId> - <version>2.2</version> - <optional>true</optional> - <exclusions> - <exclusion> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - </exclusion> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - <exclusion> - <groupId>junit-addons</groupId> - <artifactId>junit-addons</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <classifier>jdk15</classifier> - <version>5.7</version> - <exclusions> - <exclusion> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate</artifactId> - <version>3.2.1.ga</version> - <optional>true</optional> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - <exclusion> - <groupId>cglib</groupId> - <artifactId>cglib</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.apache.derby</groupId> - <artifactId>derby</artifactId> - <version>10.2.2.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>commons-dbcp</groupId> - <artifactId>commons-dbcp</artifactId> - <version>1.2.1</version> - <scope>test</scope> - <exclusions> - <exclusion> - <artifactId>xerces</artifactId> - <groupId>xerces</groupId> - </exclusion> - <exclusion> - <artifactId>xml-apis</artifactId> - <groupId>xml-apis</groupId> - </exclusion> - <exclusion> - <artifactId>commons-logging</artifactId> - <groupId>commons-logging</groupId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-jdbc</artifactId> - <version>${spring.version}</version> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - </dependencies> - <properties> - <spring.version>2.5.1</spring.version> - </properties> -</project> \ No newline at end of file Copied: tags/openutils-testing-testng-2.0.2/pom.xml (from rev 584, trunk/openutils-testing-testng/pom.xml) =================================================================== --- tags/openutils-testing-testng-2.0.2/pom.xml (rev 0) +++ tags/openutils-testing-testng-2.0.2/pom.xml 2008-01-31 22:24:31 UTC (rev 585) @@ -0,0 +1,179 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils</artifactId> + <version>7</version> + <relativePath>..</relativePath> + </parent> + <artifactId>openutils-testing-testng</artifactId> + <name>openutils test utils (testng)</name> + <version>2.0.2</version> + <description>openutils test utils</description> + <dependencies> + <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-testing</artifactId> + <version>2.0.2</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-test</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.4.3</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl104-over-slf4j</artifactId> + <version>1.4.3</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-core</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-orm</artifactId> + <version>${spring.version}</version> + <optional>true</optional> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.3</version> + </dependency> + <dependency> + <groupId>org.dbunit</groupId> + <artifactId>dbunit</artifactId> + <version>2.2</version> + <optional>true</optional> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + <exclusion> + <groupId>junit-addons</groupId> + <artifactId>junit-addons</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + <classifier>jdk15</classifier> + <version>5.7</version> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate</artifactId> + <version>3.2.1.ga</version> + <optional>true</optional> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + <exclusion> + <groupId>cglib</groupId> + <artifactId>cglib</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.apache.derby</groupId> + <artifactId>derby</artifactId> + <version>10.2.2.0</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>commons-dbcp</groupId> + <artifactId>commons-dbcp</artifactId> + <version>1.2.1</version> + <scope>test</scope> + <exclusions> + <exclusion> + <artifactId>xerces</artifactId> + <groupId>xerces</groupId> + </exclusion> + <exclusion> + <artifactId>xml-apis</artifactId> + <groupId>xml-apis</groupId> + </exclusion> + <exclusion> + <artifactId>commons-logging</artifactId> + <groupId>commons-logging</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-jdbc</artifactId> + <version>${spring.version}</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + <properties> + <spring.version>2.5.1</spring.version> + </properties> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-testng-2.0.2</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-testng-2.0.2</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-testing-testng-2.0.2</url> + </scm> +</project> \ No newline at end of file Copied: tags/openutils-testing-testng-2.0.2/src (from rev 582, trunk/openutils-testing-testng/src) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-01-31 22:24:17
|
Revision: 584 http://openutils.svn.sourceforge.net/openutils/?rev=584&view=rev Author: fgiust Date: 2008-01-31 14:24:22 -0800 (Thu, 31 Jan 2008) Log Message: ----------- [maven-release-plugin] prepare release openutils-testing-testng-2.0.2 Modified Paths: -------------- trunk/openutils-testing-testng/pom.xml Modified: trunk/openutils-testing-testng/pom.xml =================================================================== --- trunk/openutils-testing-testng/pom.xml 2008-01-31 22:23:34 UTC (rev 583) +++ trunk/openutils-testing-testng/pom.xml 2008-01-31 22:24:22 UTC (rev 584) @@ -8,7 +8,7 @@ </parent> <artifactId>openutils-testing-testng</artifactId> <name>openutils test utils (testng)</name> - <version>2.0.1-SNAPSHOT</version> + <version>2.0.2</version> <description>openutils test utils</description> <dependencies> <dependency> @@ -170,4 +170,10 @@ <properties> <spring.version>2.5.1</spring.version> </properties> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-testng-2.0.2</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-testng-2.0.2</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-testing-testng-2.0.2</url> + </scm> </project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-01-31 22:23:28
|
Revision: 583 http://openutils.svn.sourceforge.net/openutils/?rev=583&view=rev Author: fgiust Date: 2008-01-31 14:23:34 -0800 (Thu, 31 Jan 2008) Log Message: ----------- update openutils-testing dependency to 2.0.2 Modified Paths: -------------- trunk/openutils-testing-junit/pom.xml trunk/openutils-testing-testng/pom.xml Property Changed: ---------------- trunk/openutils-testing-testng/ Modified: trunk/openutils-testing-junit/pom.xml =================================================================== --- trunk/openutils-testing-junit/pom.xml 2008-01-31 22:20:03 UTC (rev 582) +++ trunk/openutils-testing-junit/pom.xml 2008-01-31 22:23:34 UTC (rev 583) @@ -1,4 +1,5 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>net.sourceforge.openutils</groupId> @@ -14,7 +15,7 @@ <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-testing</artifactId> - <version>2.0</version> + <version>2.0.2</version> </dependency> <dependency> <groupId>org.springframework</groupId> Property changes on: trunk/openutils-testing-testng ___________________________________________________________________ Name: svn:ignore - .checkstyle target .settings .classpath .project test-output temp-testng-customsuite.xml + .checkstyle target .settings .classpath .project test-output temp-testng-customsuite.xml derby.log release.properties Modified: trunk/openutils-testing-testng/pom.xml =================================================================== --- trunk/openutils-testing-testng/pom.xml 2008-01-31 22:20:03 UTC (rev 582) +++ trunk/openutils-testing-testng/pom.xml 2008-01-31 22:23:34 UTC (rev 583) @@ -14,7 +14,7 @@ <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-testing</artifactId> - <version>2.0</version> + <version>2.0.2</version> </dependency> <dependency> <groupId>org.springframework</groupId> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-01-31 22:20:01
|
Revision: 582 http://openutils.svn.sourceforge.net/openutils/?rev=582&view=rev Author: fgiust Date: 2008-01-31 14:20:03 -0800 (Thu, 31 Jan 2008) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-testing/pom.xml Modified: trunk/openutils-testing/pom.xml =================================================================== --- trunk/openutils-testing/pom.xml 2008-01-31 22:19:56 UTC (rev 581) +++ trunk/openutils-testing/pom.xml 2008-01-31 22:20:03 UTC (rev 582) @@ -8,7 +8,7 @@ </parent> <artifactId>openutils-testing</artifactId> <name>openutils test utils</name> - <version>2.0.2</version> + <version>2.0.3-SNAPSHOT</version> <description>openutils test utils</description> <dependencies> <dependency> @@ -61,10 +61,4 @@ <properties> <spring.version>2.5.1</spring.version> </properties> - - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-2.0.2</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-2.0.2</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-testing-2.0.2</url> - </scm> </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-01-31 22:19:50
|
Revision: 581 http://openutils.svn.sourceforge.net/openutils/?rev=581&view=rev Author: fgiust Date: 2008-01-31 14:19:56 -0800 (Thu, 31 Jan 2008) Log Message: ----------- [maven-release-plugin] copy for tag openutils-testing-2.0.2 Added Paths: ----------- tags/openutils-testing-2.0.2/ tags/openutils-testing-2.0.2/pom.xml tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitConfiguration.java tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitExecution.java tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitTestContext.java tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitUtils.java tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/RegExpTableFilter.java tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/dbunit/ tags/openutils-testing-2.0.2/src/site/apt/dbunit.apt tags/openutils-testing-2.0.2/src/site/apt/index.apt tags/openutils-testing-2.0.2/src/site/changes/ tags/openutils-testing-2.0.2/src/site/changes/changes.xml tags/openutils-testing-2.0.2/src/site/site.xml Removed Paths: ------------- tags/openutils-testing-2.0.2/pom.xml tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitConfiguration.java tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitExecution.java tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitTestContext.java tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitUtils.java tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/RegExpTableFilter.java tags/openutils-testing-2.0.2/src/site/apt/index.apt tags/openutils-testing-2.0.2/src/site/changes/changes.xml tags/openutils-testing-2.0.2/src/site/site.xml Copied: tags/openutils-testing-2.0.2 (from rev 539, trunk/openutils-testing) Deleted: tags/openutils-testing-2.0.2/pom.xml =================================================================== --- trunk/openutils-testing/pom.xml 2008-01-20 19:22:22 UTC (rev 539) +++ tags/openutils-testing-2.0.2/pom.xml 2008-01-31 22:19:56 UTC (rev 581) @@ -1,65 +0,0 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils</artifactId> - <version>6</version> - <relativePath>..</relativePath> - </parent> - <artifactId>openutils-testing</artifactId> - <name>openutils test utils</name> - <version>2.0-SNAPSHOT</version> - <description>openutils test utils</description> - <dependencies> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>1.4.1</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>jcl104-over-slf4j</artifactId> - <version>1.4.1</version> - </dependency> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.3</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-context</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.dbunit</groupId> - <artifactId>dbunit</artifactId> - <version>2.2</version> - <optional>true</optional> - <exclusions> - <exclusion> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - </exclusion> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - <exclusion> - <groupId>junit-addons</groupId> - <artifactId>junit-addons</artifactId> - </exclusion> - </exclusions> - </dependency> - </dependencies> - <properties> - <spring.version>2.5.1</spring.version> - </properties> -</project> Copied: tags/openutils-testing-2.0.2/pom.xml (from rev 580, trunk/openutils-testing/pom.xml) =================================================================== --- tags/openutils-testing-2.0.2/pom.xml (rev 0) +++ tags/openutils-testing-2.0.2/pom.xml 2008-01-31 22:19:56 UTC (rev 581) @@ -0,0 +1,70 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils</artifactId> + <version>7</version> + <relativePath>..</relativePath> + </parent> + <artifactId>openutils-testing</artifactId> + <name>openutils test utils</name> + <version>2.0.2</version> + <description>openutils test utils</description> + <dependencies> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.4.1</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl104-over-slf4j</artifactId> + <version>1.4.1</version> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.3</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.dbunit</groupId> + <artifactId>dbunit</artifactId> + <version>2.2</version> + <optional>true</optional> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + <exclusion> + <groupId>junit-addons</groupId> + <artifactId>junit-addons</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + <properties> + <spring.version>2.5.1</spring.version> + </properties> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-2.0.2</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-2.0.2</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-testing-2.0.2</url> + </scm> +</project> Deleted: tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitConfiguration.java =================================================================== --- trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitConfiguration.java 2008-01-20 19:22:22 UTC (rev 539) +++ tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitConfiguration.java 2008-01-31 22:19:56 UTC (rev 581) @@ -1,38 +0,0 @@ -/* - * Copyright Openmind http://www.openmindonline.it - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package it.openutils.testing; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - - -/** - * @author fgiust - * @version $Id: $ - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -@Inherited -@Documented -public @interface DbUnitConfiguration { - - DbUnitExecution[] dbUnitExecutions() default {}; - -} \ No newline at end of file Copied: tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitConfiguration.java (from rev 549, trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitConfiguration.java) =================================================================== --- tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitConfiguration.java (rev 0) +++ tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitConfiguration.java 2008-01-31 22:19:56 UTC (rev 581) @@ -0,0 +1,44 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package it.openutils.testing; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + + +/** + * A DbUnitConfiguration can contain one or more {@link DbUnitExecution}. + * @author fgiust + * @version $Id: $ + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Inherited +@Documented +public @interface DbUnitConfiguration { + + /** + * Array of {@link DbUnitExecution} + */ + DbUnitExecution[] dbUnitExecutions() default { + + }; + +} \ No newline at end of file Deleted: tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitExecution.java =================================================================== --- trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitExecution.java 2008-01-20 19:22:22 UTC (rev 539) +++ tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitExecution.java 2008-01-31 22:19:56 UTC (rev 581) @@ -1,55 +0,0 @@ -/* - * Copyright Openmind http://www.openmindonline.it - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package it.openutils.testing; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import org.dbunit.operation.DatabaseOperation; - - -/** - * @author fgiust - * @version $Id: $ - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -@Inherited -@Documented -public @interface DbUnitExecution { - - /** - * The resource locations to use for loading dbunit dataset. - */ - String[] datasets() default {}; - - String dataSource() default ""; - - String schema() default ""; - - String excludedTables() default "(^\\$(.*))"; // oracle recycle bin - - boolean truncateAll() default true; - - Class< ? extends DatabaseOperation> truncateOperation() default org.dbunit.operation.TruncateTableOperation.class; - - Class< ? extends DatabaseOperation> insertOperation() default org.dbunit.operation.InsertOperation.class; - -} \ No newline at end of file Copied: tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitExecution.java (from rev 578, trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitExecution.java) =================================================================== --- tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitExecution.java (rev 0) +++ tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitExecution.java 2008-01-31 22:19:56 UTC (rev 581) @@ -0,0 +1,77 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package it.openutils.testing; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.dbunit.operation.DatabaseOperation; + + +/** + * @author fgiust + * @version $Id: $ + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Inherited +@Documented +public @interface DbUnitExecution { + + /** + * The resource locations to use for loading dbunit dataset. + */ + String[] datasets() default { + + }; + + /** + * The name of the datasource to use. If can be left unset only if there is only one DataSource available in the + * Spring context. + */ + String dataSource() default ""; + + /** + * Db schema name that will be given to dbUnit. Can be left unset if not needed (database specific) + */ + String schema() default ""; + + /** + * A regexp that can match table names. Any table matching this regular expression will not be considered by DbUnit. + * By default tables starting with $ are ignored (oracle recycle bin). + */ + String excludedTables() default "(^\\$(.*))"; // oracle recycle bin + + /** + * If true, <strong>all</strong> the tables in the database will be truncated before loading any dataset. + */ + boolean truncateAll() default true; + + /** + * The database operation that will be used to truncate tables. Defaults to org.dbunit.operation.DeleteAllOperation + */ + Class< ? extends DatabaseOperation> truncateOperation() default org.dbunit.operation.DeleteAllOperation.class; + + /** + * The database operation that will be used to load datasets. Defaults to org.dbunit.operation.InsertOperation + */ + Class< ? extends DatabaseOperation> insertOperation() default org.dbunit.operation.InsertOperation.class; + +} \ No newline at end of file Deleted: tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitTestContext.java =================================================================== --- trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitTestContext.java 2008-01-20 19:22:22 UTC (rev 539) +++ tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitTestContext.java 2008-01-31 22:19:56 UTC (rev 581) @@ -1,246 +0,0 @@ -/* - * Copyright Openmind http://www.openmindonline.it - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package it.openutils.testing; - -import java.io.IOException; -import java.net.URL; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; - -import javax.sql.DataSource; - -import org.apache.commons.lang.ArrayUtils; -import org.apache.commons.lang.StringUtils; -import org.dbunit.DatabaseUnitException; -import org.dbunit.database.DatabaseConnection; -import org.dbunit.database.DatabaseSequenceFilter; -import org.dbunit.database.IDatabaseConnection; -import org.dbunit.dataset.DataSetException; -import org.dbunit.dataset.FilteredDataSet; -import org.dbunit.dataset.IDataSet; -import org.dbunit.dataset.filter.ITableFilter; -import org.dbunit.dataset.filter.SequenceTableFilter; -import org.dbunit.operation.DatabaseOperation; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.ApplicationContext; - - -/** - * @author fgiust - * @version $Id: $ - */ -public class DbUnitTestContext -{ - - /** - * Logger. - */ - private static Logger log = LoggerFactory.getLogger(DbUnitTestContext.class); - - private Object testcase; - - private ApplicationContext applicationContext; - - /** - * Dataset cache. - */ - private Map<String, IDataSet> datasetCache = new HashMap<String, IDataSet>(); - - /** - * Truncate dataset cache. This is kept as a static attribute since the creation of the dataset is very expensive - * and it doesn't change across tests. - */ - protected static Map<String, IDataSet> truncateDataSetCache = new HashMap<String, IDataSet>(); - - public DbUnitTestContext(Object testcase, ApplicationContext applicationContext) - { - this.testcase = testcase; - this.applicationContext = applicationContext; - } - - /** - * Setup the Database before running the test method. - * @throws Exception Any exception. - */ - @SuppressWarnings("unchecked") - public void setUpDbUnit() throws Exception - { - DbUnitExecution singleDbUnitExecution = testcase.getClass().getAnnotation(DbUnitExecution.class); - - DbUnitExecution[] executions; - if (singleDbUnitExecution != null) - { - executions = new DbUnitExecution[]{singleDbUnitExecution }; - } - else - { - DbUnitConfiguration dbUnitConfiguration = testcase.getClass().getAnnotation(DbUnitConfiguration.class); - executions = dbUnitConfiguration.dbUnitExecutions(); - } - - for (DbUnitExecution dbUnitExecution : executions) - { - String[] datasets = dbUnitExecution.datasets(); - String dataSourceName = dbUnitExecution.dataSource(); - String schema = dbUnitExecution.schema(); - if (StringUtils.isEmpty(schema)) - { - schema = null; - } - - IDatabaseConnection connection = new DatabaseConnection( - getDatasource(dataSourceName).getConnection(), - schema); - - try - { - ITableFilter tableFilter = new RegExpTableFilter(dbUnitExecution.excludedTables()); - - if (dbUnitExecution.truncateAll()) - { - truncateAll(connection, tableFilter, dataSourceName, dbUnitExecution - .truncateOperation() - .newInstance()); - } - - DatabaseOperation dbOperation = dbUnitExecution.insertOperation().newInstance(); - for (String datasetFile : datasets) - { - importDataSet(createDataset(datasetFile), connection, tableFilter, dataSourceName, dbOperation); - } - } - finally - { - connection.close(); - } - } - } - - /** - * @param datasetFile - * @return - * @throws IOException - * @throws DataSetException - */ - private IDataSet createDataset(String datasetFile) throws IOException, DataSetException - { - IDataSet dataSet = datasetCache.get(datasetFile); - if (dataSet == null) - { - URL datasetUrl = getClass().getResource(datasetFile); - if (datasetUrl == null) - { - throw new IllegalArgumentException("Dataset " + datasetFile + " not found"); - } - dataSet = DbUnitUtils.loadDataset(datasetUrl); - datasetCache.put(datasetFile, dataSet); - } - return dataSet; - } - - private void importDataSet(IDataSet dataSet, IDatabaseConnection connection, ITableFilter tableFilter, - String dataSourceName, DatabaseOperation databaseOperation) throws SQLException, DataSetException, - DatabaseUnitException - { - - if (dataSet == null) - { - throw new IllegalArgumentException("dataSet is null"); - } - - IDataSet orderedDataset = new FilteredDataSet(tableFilter, dataSet); - if (log.isDebugEnabled()) - { - log.debug("Tables: {}", ArrayUtils.toString(orderedDataset.getTableNames())); - } - - // if a sorted dataset is available, use table sequence for sorting - IDataSet truncateDataSet = getTruncateDataset(dataSourceName, connection.getSchema()); - if (truncateDataSet != null) - { - ITableFilter filter = new SequenceTableFilter(truncateDataSet.getTableNames()); - orderedDataset = new FilteredDataSet(filter, dataSet); - } - - if (dataSet != null) - { - databaseOperation.execute(connection, orderedDataset); - } - - } - - /** - * @param connection - * @param tableFilter - * @throws SQLException - * @throws DataSetException - * @throws DatabaseUnitException - */ - private void truncateAll(IDatabaseConnection connection, ITableFilter tableFilter, String dataSourceName, - DatabaseOperation databaseOperation) throws SQLException, DataSetException, DatabaseUnitException - { - IDataSet truncateDataSet = getTruncateDataset(dataSourceName, connection.getSchema()); - if (truncateDataSet == null) - { - log.debug("Generating sorted dataset for initial cleanup"); - IDataSet unsortedDataSet = connection.createDataSet(); - - log.debug("Unfiltered truncateDataSet: {}", ArrayUtils.toString(unsortedDataSet.getTableNames())); - - ITableFilter filter = new DatabaseSequenceFilter(connection, new FilteredDataSet( - tableFilter, - unsortedDataSet).getTableNames()); - truncateDataSet = new FilteredDataSet(tableFilter, new FilteredDataSet(filter, unsortedDataSet)); - storeTruncateDataset(dataSourceName, connection.getSchema(), truncateDataSet); - log.debug("Sorted dataset generated"); - } - - log.debug("Tables truncateDataSet: {}", ArrayUtils.toString(truncateDataSet.getTableNames())); - if (truncateDataSet != null) - { - databaseOperation.execute(connection, truncateDataSet); - } - } - - private IDataSet getTruncateDataset(String datasourceName, String schema) - { - return truncateDataSetCache.get(datasourceName + "_" + StringUtils.defaultString(schema)); - } - - private IDataSet storeTruncateDataset(String datasourceName, String schema, IDataSet dataset) - { - return truncateDataSetCache.put(datasourceName + "_" + StringUtils.defaultString(schema), dataset); - } - - @SuppressWarnings("unchecked") - protected DataSource getDatasource(String name) - { - if (StringUtils.isEmpty(name)) - { - Map<String, DataSource> dsMap = applicationContext.getBeansOfType(DataSource.class); - if (dsMap == null || dsMap.size() != 1) - { - throw new RuntimeException( - "Unable to find a datasource in spring applicationContext, please specify the datasource bean name " - + "using the \"datasource\" attribute of @DbUnitConfiguration"); - } - return dsMap.values().iterator().next(); - } - return (DataSource) applicationContext.getBean(name); - } -} Copied: tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitTestContext.java (from rev 578, trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitTestContext.java) =================================================================== --- tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitTestContext.java (rev 0) +++ tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitTestContext.java 2008-01-31 22:19:56 UTC (rev 581) @@ -0,0 +1,328 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package it.openutils.testing; + +import java.io.IOException; +import java.net.URL; +import java.sql.SQLException; +import java.util.HashMap; +import java.util.Map; + +import javax.sql.DataSource; + +import org.apache.commons.lang.ArrayUtils; +import org.apache.commons.lang.StringUtils; +import org.dbunit.DatabaseUnitException; +import org.dbunit.database.DatabaseConnection; +import org.dbunit.database.DatabaseSequenceFilter; +import org.dbunit.database.IDatabaseConnection; +import org.dbunit.dataset.DataSetException; +import org.dbunit.dataset.FilteredDataSet; +import org.dbunit.dataset.IDataSet; +import org.dbunit.dataset.filter.ITableFilter; +import org.dbunit.dataset.filter.SequenceTableFilter; +import org.dbunit.operation.DatabaseOperation; +import org.dbunit.operation.DeleteAllOperation; +import org.dbunit.operation.DeleteOperation; +import org.dbunit.operation.InsertOperation; +import org.dbunit.operation.RefreshOperation; +import org.dbunit.operation.TruncateTableOperation; +import org.dbunit.operation.UpdateOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.ApplicationContext; + + +/** + * @author fgiust + * @version $Id: $ + */ +public class DbUnitTestContext +{ + + /** + * Truncate dataset cache. This is kept as a static attribute since the creation of the dataset is very expensive + * and it doesn't change across tests. + */ + protected static Map<String, IDataSet> truncateDataSetCache = new HashMap<String, IDataSet>(); + + /** + * Logger. + */ + private static Logger log = LoggerFactory.getLogger(DbUnitTestContext.class); + + /** + * The test instance. + */ + private Object testcase; + + /** + * Spring application context. + */ + private ApplicationContext applicationContext; + + /** + * Dataset cache. + */ + private Map<String, IDataSet> datasetCache = new HashMap<String, IDataSet>(); + + /** + * Instantiates a new DbUnitTestContext + * @param testcase test instance + * @param applicationContext Spring application context + */ + public DbUnitTestContext(Object testcase, ApplicationContext applicationContext) + { + this.testcase = testcase; + this.applicationContext = applicationContext; + } + + /** + * Setup the Database before running the test method. + * @throws Exception Any exception. + */ + @SuppressWarnings("unchecked") + public void setUpDbUnit() throws Exception + { + DbUnitExecution singleDbUnitExecution = testcase.getClass().getAnnotation(DbUnitExecution.class); + + DbUnitExecution[] executions = null; + if (singleDbUnitExecution != null) + { + executions = new DbUnitExecution[]{singleDbUnitExecution }; + } + else + { + DbUnitConfiguration dbUnitConfiguration = testcase.getClass().getAnnotation(DbUnitConfiguration.class); + if (dbUnitConfiguration != null) + { + executions = dbUnitConfiguration.dbUnitExecutions(); + } + } + if (executions != null) + { + for (DbUnitExecution dbUnitExecution : executions) + { + String[] datasets = dbUnitExecution.datasets(); + String dataSourceName = dbUnitExecution.dataSource(); + String schema = dbUnitExecution.schema(); + if (StringUtils.isEmpty(schema)) + { + schema = null; + } + + IDatabaseConnection connection = new DatabaseConnection( + getDatasource(dataSourceName).getConnection(), + schema); + + try + { + ITableFilter tableFilter = new RegExpTableFilter(dbUnitExecution.excludedTables()); + + if (dbUnitExecution.truncateAll()) + { + truncateAll(connection, tableFilter, dataSourceName, getDatabaseOperation(dbUnitExecution + .truncateOperation())); + } + + DatabaseOperation dbOperation = getDatabaseOperation(dbUnitExecution.insertOperation()); + for (String datasetFile : datasets) + { + importDataSet(createDataset(datasetFile), connection, tableFilter, dataSourceName, dbOperation); + } + } + finally + { + connection.close(); + } + } + } + } + + /** + * Instantiates the givec Database Operation. Standard operations in the <code>org.dbunit.operation</code> package + * have protected constructors and needs to be accessed using the public static fields in + * <code>org.dbunit.operation.DatabaseOperation</code>. + * @param dboperationClass db operation class + * @return db operation instance + * @throws InstantiationException if the given db operation class cannot be instantiated + * @throws IllegalAccessException if the given db operation class cannot be instantiated + */ + private DatabaseOperation getDatabaseOperation(Class< ? extends DatabaseOperation> dboperationClass) + throws InstantiationException, IllegalAccessException + { + if (UpdateOperation.class.equals(dboperationClass)) + { + return DatabaseOperation.UPDATE; + } + else if (InsertOperation.class.equals(dboperationClass)) + { + return DatabaseOperation.INSERT; + } + else if (RefreshOperation.class.equals(dboperationClass)) + { + return DatabaseOperation.REFRESH; + } + else if (DeleteOperation.class.equals(dboperationClass)) + { + return DatabaseOperation.DELETE; + } + else if (DeleteAllOperation.class.equals(dboperationClass)) + { + return DatabaseOperation.DELETE_ALL; + } + else if (TruncateTableOperation.class.equals(dboperationClass)) + { + return DatabaseOperation.TRUNCATE_TABLE; + } + else if (DeleteOperation.class.equals(dboperationClass)) + { + return DatabaseOperation.UPDATE; + } + + return dboperationClass.newInstance(); + + } + + /** + * Creates a dataset instance by fetching a file from the classpath + * @param datasetFile name of the file, will be loaded from the classpath + * @return IDataSet instance + * @throws IOException + * @throws DataSetException + */ + private IDataSet createDataset(String datasetFile) throws IOException, DataSetException + { + IDataSet dataSet = datasetCache.get(datasetFile); + if (dataSet == null) + { + URL datasetUrl = getClass().getResource(datasetFile); + if (datasetUrl == null) + { + throw new IllegalArgumentException("Dataset " + datasetFile + " not found"); + } + dataSet = DbUnitUtils.loadDataset(datasetUrl); + datasetCache.put(datasetFile, dataSet); + } + return dataSet; + } + + private void importDataSet(IDataSet dataSet, IDatabaseConnection connection, ITableFilter tableFilter, + String dataSourceName, DatabaseOperation databaseOperation) throws SQLException, DataSetException, + DatabaseUnitException + { + + if (dataSet == null) + { + throw new IllegalArgumentException("dataSet is null"); + } + + IDataSet orderedDataset = new FilteredDataSet(tableFilter, dataSet); + if (log.isDebugEnabled()) + { + log.debug("Tables: {}", ArrayUtils.toString(orderedDataset.getTableNames())); + } + + // if a sorted dataset is available, use table sequence for sorting + IDataSet truncateDataSet = getTruncateDataset(dataSourceName, connection.getSchema()); + if (truncateDataSet != null) + { + ITableFilter filter = new SequenceTableFilter(truncateDataSet.getTableNames()); + orderedDataset = new FilteredDataSet(filter, dataSet); + } + + if (dataSet != null) + { + databaseOperation.execute(connection, orderedDataset); + } + + } + + /** + * @param connection + * @param tableFilter + * @throws SQLException + * @throws DataSetException + * @throws DatabaseUnitException + */ + private void truncateAll(IDatabaseConnection connection, ITableFilter tableFilter, String dataSourceName, + DatabaseOperation databaseOperation) throws SQLException, DataSetException, DatabaseUnitException + { + IDataSet truncateDataSet = getTruncateDataset(dataSourceName, connection.getSchema()); + if (truncateDataSet == null) + { + log.debug("Generating sorted dataset for initial cleanup"); + IDataSet unsortedDataSet = connection.createDataSet(); + + if (log.isDebugEnabled()) + { + log.debug("Unfiltered truncateDataSet: {}", ArrayUtils.toString(unsortedDataSet.getTableNames())); + } + + // excluded unwanted tables + unsortedDataSet = new FilteredDataSet(tableFilter, unsortedDataSet); + + // sort tables + ITableFilter sortingFilter = new DatabaseSequenceFilter(connection, unsortedDataSet.getTableNames()); + truncateDataSet = new FilteredDataSet(sortingFilter, unsortedDataSet); + + storeTruncateDataset(dataSourceName, connection.getSchema(), truncateDataSet); + log.debug("Sorted dataset generated"); + } + + if (truncateDataSet != null) + { + if (log.isDebugEnabled()) + { + log.debug("Tables truncateDataSet: {}", ArrayUtils.toString(truncateDataSet.getTableNames())); + } + databaseOperation.execute(connection, truncateDataSet); + } + } + + private IDataSet getTruncateDataset(String datasourceName, String schema) + { + return truncateDataSetCache.get(datasourceName + "_" + StringUtils.defaultString(schema)); + } + + private IDataSet storeTruncateDataset(String datasourceName, String schema, IDataSet dataset) + { + return truncateDataSetCache.put(datasourceName + "_" + StringUtils.defaultString(schema), dataset); + } + + /** + * Loads a named datasource from the spring context. + * @param name datasource name. + * @return Datasource instance + */ + @SuppressWarnings("unchecked") + protected DataSource getDatasource(String name) + { + if (StringUtils.isEmpty(name)) + { + Map<String, DataSource> dsMap = applicationContext.getBeansOfType(DataSource.class); + if (dsMap == null || dsMap.size() != 1) + { + throw new RuntimeException( + "Unable to find a datasource in spring applicationContext, please specify the datasource bean name " + + "using the \"datasource\" attribute of @DbUnitConfiguration"); + } + return dsMap.values().iterator().next(); + } + return (DataSource) applicationContext.getBean(name); + } + +} Deleted: tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitUtils.java =================================================================== --- trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitUtils.java 2008-01-20 19:22:22 UTC (rev 539) +++ tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitUtils.java 2008-01-31 22:19:56 UTC (rev 581) @@ -1,115 +0,0 @@ -/* - * Copyright Openmind http://www.openmindonline.it - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package it.openutils.testing; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URL; -import java.sql.SQLException; - -import org.apache.commons.lang.StringUtils; -import org.dbunit.database.IDatabaseConnection; -import org.dbunit.dataset.DataSetException; -import org.dbunit.dataset.FilteredDataSet; -import org.dbunit.dataset.IDataSet; -import org.dbunit.dataset.excel.XlsDataSet; -import org.dbunit.dataset.xml.XmlDataSet; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * @author fgiust - * @version $Id: $ - */ -public final class DbUnitUtils -{ - - /** - * Logger. - */ - private static Logger log = LoggerFactory.getLogger(DbUnitUtils.class); - - /** - * @param connection - * @param tableNames - * @param file - * @param xls - * @throws SQLException - * @throws IOException - * @throws DataSetException - */ - public static void exportDataset(IDatabaseConnection connection, String[] tableNames, File file) - throws SQLException, IOException, DataSetException - { - OutputStream fos = null; - - try - { - IDataSet fullDataSet = connection.createDataSet(); - - if (tableNames != null && tableNames.length > 0) - { - fullDataSet = new FilteredDataSet(tableNames, fullDataSet); - } - - fos = new FileOutputStream(file); - if (StringUtils.equalsIgnoreCase(StringUtils.substringAfterLast(file.getName(), "."), "xls")) - { - XlsDataSet.write(fullDataSet, fos); - } - else - { - XmlDataSet.write(fullDataSet, fos); - } - } - finally - { - connection.close(); - fos.close(); - } - - log.debug("Dataset exported at {}", file.getAbsolutePath()); - } - - /** - * @param url - * @return - * @throws IOException - * @throws DataSetException - */ - public static IDataSet loadDataset(URL url) throws IOException, DataSetException - { - if (url == null) - { - throw new IllegalArgumentException("URL is null"); - } - InputStream is = url.openStream(); - IDataSet dataSet = null; - - if (is != null) - { - log.debug("loading dataset {}", url.getFile()); - dataSet = url.getFile().endsWith(".xls") ? new XlsDataSet(is) : new XmlDataSet(is); - is.close(); - } - return dataSet; - } - -} Copied: tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitUtils.java (from rev 579, trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitUtils.java) =================================================================== --- tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitUtils.java (rev 0) +++ tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/DbUnitUtils.java 2008-01-31 22:19:56 UTC (rev 581) @@ -0,0 +1,155 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package it.openutils.testing; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.URL; +import java.sql.SQLException; + +import org.apache.commons.lang.StringUtils; +import org.dbunit.database.IDatabaseConnection; +import org.dbunit.dataset.DataSetException; +import org.dbunit.dataset.FilteredDataSet; +import org.dbunit.dataset.IDataSet; +import org.dbunit.dataset.excel.XlsDataSet; +import org.dbunit.dataset.filter.ITableFilter; +import org.dbunit.dataset.xml.XmlDataSet; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * @author fgiust + * @version $Id: $ + */ +public final class DbUnitUtils +{ + + /** + * Logger. + */ + private static Logger log = LoggerFactory.getLogger(DbUnitUtils.class); + + /** + * Do not instantiate. + */ + private DbUnitUtils() + { + // do not instantiate + } + + /** + * Exports a list of table to an xml/xsl file + * @param file The file name we save the dataset to + * @param connection connection to use + * @param tableNames optional list of table names + * @throws IOException An IO Exception. + * @throws DataSetException A dataset exception. + * @throws SQLException A SQL Exception. + */ + public static void exportDataset(IDatabaseConnection connection, String[] tableNames, File file) + throws SQLException, IOException, DataSetException + { + OutputStream fos = null; + + try + { + IDataSet fullDataSet = connection.createDataSet(); + + if (tableNames != null && tableNames.length > 0) + { + fullDataSet = new FilteredDataSet(tableNames, fullDataSet); + } + + fos = new FileOutputStream(file); + if (StringUtils.equalsIgnoreCase(StringUtils.substringAfterLast(file.getName(), "."), "xls")) + { + XlsDataSet.write(fullDataSet, fos); + } + else + { + XmlDataSet.write(fullDataSet, fos); + } + } + finally + { + fos.close(); + } + + log.debug("Dataset exported at {}", file.getAbsolutePath()); + } + + /** + * Exports a full db saving a dataset for each table. + * @param connection dbunit connection + * @param directory export directory + * @param xls if <code>true</code> export will be done using excel datasets + * @param tableFilter optional table filter + * @throws SQLException sql exception + * @throws DataSetException dbunit exception + * @throws IOException IO exception + */ + public void exportTablesToDir(IDatabaseConnection connection, File directory, boolean xls, ITableFilter tableFilter) + throws SQLException, DataSetException, IOException + + { + directory.mkdirs(); + + IDataSet dataset = connection.createDataSet(); + if (tableFilter != null) + { + dataset = new FilteredDataSet(tableFilter, dataset); + } + + String[] tablenames = dataset.getTableNames(); + + for (String table : tablenames) + { + File exportFile = new File(directory, table + (xls ? ".xls" : ".xml")); + log.info("Exporting {}", table); + DbUnitUtils.exportDataset(connection, new String[]{table }, exportFile); + } + } + + /** + * @param url dataset url (can be an xml or excel file) + * @return loaded dataset + * @throws IOException error reading the file + * @throws DataSetException error loading the dataset + */ + public static IDataSet loadDataset(URL url) throws IOException, DataSetException + { + if (url == null) + { + throw new IllegalArgumentException("URL is null"); + } + InputStream is = url.openStream(); + IDataSet dataSet = null; + + if (is != null) + { + log.debug("loading dataset {}", url.getFile()); + dataSet = url.getFile().endsWith(".xls") ? new XlsDataSet(is) : new XmlDataSet(is); + is.close(); + } + return dataSet; + } + +} Deleted: tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/RegExpTableFilter.java =================================================================== --- trunk/openutils-testing/src/main/java/it/openutils/testing/RegExpTableFilter.java 2008-01-20 19:22:22 UTC (rev 539) +++ tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/RegExpTableFilter.java 2008-01-31 22:19:56 UTC (rev 581) @@ -1,50 +0,0 @@ -/* - * Copyright Openmind http://www.openmindonline.it - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package it.openutils.testing; - -import java.util.regex.Pattern; - -import org.dbunit.dataset.DataSetException; -import org.dbunit.dataset.filter.AbstractTableFilter; - - -/** - * @author fgiust - * @version $Id: $ - */ -public class RegExpTableFilter extends AbstractTableFilter -{ - - private Pattern pattern; - - public RegExpTableFilter(String pattern) - { - if (pattern != null) - { - this.pattern = Pattern.compile(pattern); - } - } - - /** - * {@inheritDoc} - */ - @Override - public boolean isValidName(String tableName) throws DataSetException - { - return pattern == null || !pattern.matcher(tableName).matches(); - } - -} Copied: tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/RegExpTableFilter.java (from rev 549, trunk/openutils-testing/src/main/java/it/openutils/testing/RegExpTableFilter.java) =================================================================== --- tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/RegExpTableFilter.java (rev 0) +++ tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/RegExpTableFilter.java 2008-01-31 22:19:56 UTC (rev 581) @@ -0,0 +1,55 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package it.openutils.testing; + +import java.util.regex.Pattern; + +import org.dbunit.dataset.DataSetException; +import org.dbunit.dataset.filter.AbstractTableFilter; + + +/** + * A table filter that excludes tables mathing the given regexp. + * @author fgiust + * @version $Id: $ + */ +public class RegExpTableFilter extends AbstractTableFilter +{ + + private Pattern pattern; + + /** + * Instantiates a new RegExpTableFilter + * @param pattern regexp pattern + */ + public RegExpTableFilter(String pattern) + { + if (pattern != null) + { + this.pattern = Pattern.compile(pattern); + } + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isValidName(String tableName) throws DataSetException + { + return pattern == null || !pattern.matcher(tableName).matches(); + } + +} Copied: tags/openutils-testing-2.0.2/src/main/java/it/openutils/testing/dbunit (from rev 578, trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit) Copied: tags/openutils-testing-2.0.2/src/site/apt/dbunit.apt (from rev 550, trunk/openutils-testing/src/site/apt/dbunit.apt) =================================================================== --- tags/openutils-testing-2.0.2/src/site/apt/dbunit.apt (rev 0) +++ tags/openutils-testing-2.0.2/src/site/apt/dbunit.apt 2008-01-31 22:19:56 UTC (rev 581) @@ -0,0 +1,76 @@ + -------------------------- + O p e n u t i l s + -------------------------- + Fabrizio Giustina + -------------------------- + + +DbUnit tests + + Openutils provide a base class that take cares of the common operations involved in preparing the test environment using + DbUnit. + + You can extend <<<it.openutils.testing.testng.AbstractDbUnitTestNGSpringContextTests>>> or + <<<it.openutils.testing.junit.AbstractDbUnitJunitSpringContextTests>>>, depending on the test framework of your choice + (remember to include the appropriate dependency, openutils-testing-testng or openutils-testing-junit). + Apart from the underline test framework used, there is no difference in how those class will work. + + Those base classes extend the standard <<<Abstract*SpringContextTests>>> classes provided by Spring, so they support + dependency injection and needs to be configured from a Spring context. + +How to + + All the setup can be configured using annotations. This is a sample test that can make use of data loaded by DbUnit: + ++----------------------------------------------+ + +@ContextConfiguration(locations = {"/spring-tests.xml" }) +@DbUnitExecution(datasets = {"/db1-load.xml" }) +public class SampleDbUnitTest extends AbstractDbUnitTestNGSpringContextTests +{ + @Test + public void testSomething() { + ... + } +} + ++----------------------------------------------+ + + The <<<DbUnitExecution>>> annotation controls how the setup will be performed. It can be configured with a list of file names + (xml od xsl DbUnit datasets) that will be loaded before every single method in this test class is executed. + + In detail the setup that will be performed before each method is: + + * truncate *any table* in the database. This can be turned of by the <<<truncateAll>>> DbUnitExecution parameter + + * load the given datasets into the db + + [] + + You can setup also more than one execution if your tests depend on more than one database or schema, annotating your + class like in this example: + ++----------------------------------------------+ + +@DbUnitConfiguration(dbUnitExecutions = { + @DbUnitExecution(datasets = {"/db1-load.xml" }, dataSource = "dataSource1"), + @DbUnitExecution(datasets = {"/db2-load.xml" }, dataSource = "dataSource2") }) + ++----------------------------------------------+ + + + Note that this test classes don't extend Spring transactional tests, so you need to manually turn on Transactions using + standard Spring annotations: + ++----------------------------------------------+ + +@TestExecutionListeners({TransactionalTestExecutionListener.class }) +@Transactional + ++----------------------------------------------+ + + Also note that the content of your db will definitively be modified by these tests, they are expected to be run on a + test-only instance! + + + Deleted: tags/openutils-testing-2.0.2/src/site/apt/index.apt =================================================================== --- trunk/openutils-testing/src/site/apt/index.apt 2008-01-20 19:22:22 UTC (rev 539) +++ tags/openutils-testing-2.0.2/src/site/apt/index.apt 2008-01-31 22:19:56 UTC (rev 581) @@ -1,8 +0,0 @@ - -------------------------- - O p e n u t i l s - -------------------------- - Fabrizio Giustina - -------------------------- - -openutils-testing - Copied: tags/openutils-testing-2.0.2/src/site/apt/index.apt (from rev 550, trunk/openutils-testing/src/site/apt/index.apt) =================================================================== --- tags/openutils-testing-2.0.2/src/site/apt/index.apt (rev 0) +++ tags/openutils-testing-2.0.2/src/site/apt/index.apt 2008-01-31 22:19:56 UTC (rev 581) @@ -0,0 +1,27 @@ + -------------------------- + O p e n u t i l s + -------------------------- + Fabrizio Giustina + -------------------------- + +openutils-testing + + Openutils-testing extends the standard spring testing framework by providing more high-level base testing classes and utils. + + In particular, it provides a {{{dbunit.html}framework for using with dbunit in Spring test cases}}. + + The openutils-testing jar only contains generic classes that don't depends on any specific test framework. You should + depend on openutils-testing-testng or openutils-testing-junit + + + +Released versions + + openutils-testing-testng: + + {{{http://www.mvnrepository.com/artifact/net.sourceforge.openutils/openutils-testing-testng}http://www.mvnrepository.com/artifact/net.sourceforge.openutils/openutils-testing-testng}} + + openutils-testing-junit: + + {{{http://www.mvnrepository.com/artifact/net.sourceforge.openutils/openutils-testing-junit}http://www.mvnrepository.com/artifact/net.sourceforge.openutils/openutils-testing-junit}} + Copied: tags/openutils-testing-2.0.2/src/site/changes (from rev 578, trunk/openutils-testing/src/site/changes) Deleted: tags/openutils-testing-2.0.2/src/site/changes/changes.xml =================================================================== --- trunk/openutils-testing/src/site/changes/changes.xml 2008-01-31 13:13:40 UTC (rev 578) +++ tags/openutils-testing-2.0.2/src/site/changes/changes.xml 2008-01-31 22:19:56 UTC (rev 581) @@ -1,31 +0,0 @@ -<?xml version="1.0"?> -<!-- - "type" attribute can be: add, remove, update or fix. ---> -<document> - <properties> - <title>Changes</title> - <author email="fgiust(at)users.sourceforge.net">Fabrizio Giustina</author> - </properties> - <body> - <release version="2.0.2" date="in svn" description="2.0.2"> - <action type="add" dev="fgiust"> - New dbunit operation classes for mssql and mysql (extension of standard dbunit operation, but refactored so that - they can be used in annotations). See the javadocs in the it.openutils.testing.dbunit package - </action> - <action type="update" dev="fgiust"> - truncate operation now defaults to DbUnitOperation.DELETE_ALL instead of DbUnitOperation.TRUNCATE. - </action> - <action type="fix" dev="fgiust">DbUnitUtils.exportDataset() doesn't close anymore the provided connection</action> - </release> - <release version="2.0.1" date="2008-01-30" description="2.0.1"> - <action type="fix" dev="fgiust"> - (junit version only). it.openutils.testing.junit.AbstractDbUnitJunitSpringContextTests was totally broken due to - the setup method being protected. Fixed + added tests - </action> - </release> - <release version="2.0" date="2008-01-20" description="2.0 release"> - <action type="update" dev="fgiust">Totally reworked dbunit test framework.</action> - </release> - </body> -</document> \ No newline at end of file Copied: tags/openutils-testing-2.0.2/src/site/changes/changes.xml (from rev 579, trunk/openutils-testing/src/site/changes/changes.xml) =================================================================== --- tags/openutils-testing-2.0.2/src/site/changes/changes.xml (rev 0) +++ tags/openutils-testing-2.0.2/src/site/changes/changes.xml 2008-01-31 22:19:56 UTC (rev 581) @@ -0,0 +1,32 @@ +<?xml version="1.0"?> +<!-- + "type" attribute can be: add, remove, update or fix. +--> +<document> + <properties> + <title>Changes</title> + <author email="fgiust(at)users.sourceforge.net">Fabrizio Giustina</author> + </properties> + <body> + <release version="2.0.2" date="in svn" description="2.0.2"> + <action type="add" dev="fgiust"> + New dbunit operation classes for mssql and mysql (extension of standard dbunit operation, but refactored so that + they can be used in annotations). See the javadocs in the it.openutils.testing.dbunit package + </action> + <action type="update" dev="fgiust"> + truncate operation now defaults to DbUnitOperation.DELETE_ALL instead of DbUnitOperation.TRUNCATE. + </action> + <action type="fix" dev="fgiust">DbUnitUtils.exportDataset() doesn't close anymore the provided connection</action> + <action type="add" dev="fgiust">new DbUnitUtils.exportTablesToDir() utility method</action> + </release> + <release version="2.0.1" date="2008-01-30" description="2.0.1"> + <action type="fix" dev="fgiust"> + (junit version only). it.openutils.testing.junit.AbstractDbUnitJunitSpringContextTests was totally broken due to + the setup method being protected. Fixed + added tests + </action> + </release> + <release version="2.0" date="2008-01-20" description="2.0 release"> + <action type="update" dev="fgiust">Totally reworked dbunit test framework.</action> + </release> + </body> +</document> \ No newline at end of file Deleted: tags/openutils-testing-2.0.2/src/site/site.xml =================================================================== --- trunk/openutils-testing/src/site/site.xml 2008-01-20 19:22:22 UTC (rev 539) +++ tags/openutils-testing-2.0.2/src/site/site.xml 2008-01-31 22:19:56 UTC (rev 581) ... [truncated message content] |
From: <fg...@us...> - 2008-01-31 22:19:32
|
Revision: 580 http://openutils.svn.sourceforge.net/openutils/?rev=580&view=rev Author: fgiust Date: 2008-01-31 14:19:37 -0800 (Thu, 31 Jan 2008) Log Message: ----------- [maven-release-plugin] prepare release openutils-testing-2.0.2 Modified Paths: -------------- trunk/openutils-testing/pom.xml Modified: trunk/openutils-testing/pom.xml =================================================================== --- trunk/openutils-testing/pom.xml 2008-01-31 22:18:50 UTC (rev 579) +++ trunk/openutils-testing/pom.xml 2008-01-31 22:19:37 UTC (rev 580) @@ -8,7 +8,7 @@ </parent> <artifactId>openutils-testing</artifactId> <name>openutils test utils</name> - <version>2.0.1-SNAPSHOT</version> + <version>2.0.2</version> <description>openutils test utils</description> <dependencies> <dependency> @@ -61,4 +61,10 @@ <properties> <spring.version>2.5.1</spring.version> </properties> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-2.0.2</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-2.0.2</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-testing-2.0.2</url> + </scm> </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-01-31 22:18:47
|
Revision: 579 http://openutils.svn.sourceforge.net/openutils/?rev=579&view=rev Author: fgiust Date: 2008-01-31 14:18:50 -0800 (Thu, 31 Jan 2008) Log Message: ----------- new utility method Modified Paths: -------------- trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitUtils.java trunk/openutils-testing/src/site/changes/changes.xml Modified: trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitUtils.java =================================================================== --- trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitUtils.java 2008-01-31 13:13:40 UTC (rev 578) +++ trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitUtils.java 2008-01-31 22:18:50 UTC (rev 579) @@ -29,6 +29,7 @@ import org.dbunit.dataset.FilteredDataSet; import org.dbunit.dataset.IDataSet; import org.dbunit.dataset.excel.XlsDataSet; +import org.dbunit.dataset.filter.ITableFilter; import org.dbunit.dataset.xml.XmlDataSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -96,6 +97,38 @@ } /** + * Exports a full db saving a dataset for each table. + * @param connection dbunit connection + * @param directory export directory + * @param xls if <code>true</code> export will be done using excel datasets + * @param tableFilter optional table filter + * @throws SQLException sql exception + * @throws DataSetException dbunit exception + * @throws IOException IO exception + */ + public void exportTablesToDir(IDatabaseConnection connection, File directory, boolean xls, ITableFilter tableFilter) + throws SQLException, DataSetException, IOException + + { + directory.mkdirs(); + + IDataSet dataset = connection.createDataSet(); + if (tableFilter != null) + { + dataset = new FilteredDataSet(tableFilter, dataset); + } + + String[] tablenames = dataset.getTableNames(); + + for (String table : tablenames) + { + File exportFile = new File(directory, table + (xls ? ".xls" : ".xml")); + log.info("Exporting {}", table); + DbUnitUtils.exportDataset(connection, new String[]{table }, exportFile); + } + } + + /** * @param url dataset url (can be an xml or excel file) * @return loaded dataset * @throws IOException error reading the file Modified: trunk/openutils-testing/src/site/changes/changes.xml =================================================================== --- trunk/openutils-testing/src/site/changes/changes.xml 2008-01-31 13:13:40 UTC (rev 578) +++ trunk/openutils-testing/src/site/changes/changes.xml 2008-01-31 22:18:50 UTC (rev 579) @@ -17,6 +17,7 @@ truncate operation now defaults to DbUnitOperation.DELETE_ALL instead of DbUnitOperation.TRUNCATE. </action> <action type="fix" dev="fgiust">DbUnitUtils.exportDataset() doesn't close anymore the provided connection</action> + <action type="add" dev="fgiust">new DbUnitUtils.exportTablesToDir() utility method</action> </release> <release version="2.0.1" date="2008-01-30" description="2.0.1"> <action type="fix" dev="fgiust"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-01-31 13:13:36
|
Revision: 578 http://openutils.svn.sourceforge.net/openutils/?rev=578&view=rev Author: fgiust Date: 2008-01-31 05:13:40 -0800 (Thu, 31 Jan 2008) Log Message: ----------- a few fixes, start tracking changes in changes.xml Modified Paths: -------------- trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitExecution.java trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitTestContext.java trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitUtils.java Added Paths: ----------- trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/ trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/CleanInsertOperation.java trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MsSqlIndentityCleanInsertOperation.java trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MsSqlIndentityInsertOperation.java trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MySqlAbstractNoFkOperation.java trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MySqlNoFkCleanInsertOperation.java trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MySqlNoFkInsertOperation.java trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MySqlNoFkTruncateOperation.java trunk/openutils-testing/src/site/changes/ trunk/openutils-testing/src/site/changes/changes.xml Modified: trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitExecution.java =================================================================== --- trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitExecution.java 2008-01-30 21:24:20 UTC (rev 577) +++ trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitExecution.java 2008-01-31 13:13:40 UTC (rev 578) @@ -65,10 +65,9 @@ boolean truncateAll() default true; /** - * The database operation that will be used to truncate tables. Defaults to - * org.dbunit.operation.TruncateTableOperation + * The database operation that will be used to truncate tables. Defaults to org.dbunit.operation.DeleteAllOperation */ - Class< ? extends DatabaseOperation> truncateOperation() default org.dbunit.operation.TruncateTableOperation.class; + Class< ? extends DatabaseOperation> truncateOperation() default org.dbunit.operation.DeleteAllOperation.class; /** * The database operation that will be used to load datasets. Defaults to org.dbunit.operation.InsertOperation Modified: trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitTestContext.java =================================================================== --- trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitTestContext.java 2008-01-30 21:24:20 UTC (rev 577) +++ trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitTestContext.java 2008-01-31 13:13:40 UTC (rev 578) @@ -267,19 +267,28 @@ log.debug("Generating sorted dataset for initial cleanup"); IDataSet unsortedDataSet = connection.createDataSet(); - log.debug("Unfiltered truncateDataSet: {}", ArrayUtils.toString(unsortedDataSet.getTableNames())); + if (log.isDebugEnabled()) + { + log.debug("Unfiltered truncateDataSet: {}", ArrayUtils.toString(unsortedDataSet.getTableNames())); + } - ITableFilter filter = new DatabaseSequenceFilter(connection, new FilteredDataSet( - tableFilter, - unsortedDataSet).getTableNames()); - truncateDataSet = new FilteredDataSet(tableFilter, new FilteredDataSet(filter, unsortedDataSet)); + // excluded unwanted tables + unsortedDataSet = new FilteredDataSet(tableFilter, unsortedDataSet); + + // sort tables + ITableFilter sortingFilter = new DatabaseSequenceFilter(connection, unsortedDataSet.getTableNames()); + truncateDataSet = new FilteredDataSet(sortingFilter, unsortedDataSet); + storeTruncateDataset(dataSourceName, connection.getSchema(), truncateDataSet); log.debug("Sorted dataset generated"); } - log.debug("Tables truncateDataSet: {}", ArrayUtils.toString(truncateDataSet.getTableNames())); if (truncateDataSet != null) { + if (log.isDebugEnabled()) + { + log.debug("Tables truncateDataSet: {}", ArrayUtils.toString(truncateDataSet.getTableNames())); + } databaseOperation.execute(connection, truncateDataSet); } } Modified: trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitUtils.java =================================================================== --- trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitUtils.java 2008-01-30 21:24:20 UTC (rev 577) +++ trunk/openutils-testing/src/main/java/it/openutils/testing/DbUnitUtils.java 2008-01-31 13:13:40 UTC (rev 578) @@ -89,7 +89,6 @@ } finally { - connection.close(); fos.close(); } Added: trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/CleanInsertOperation.java =================================================================== --- trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/CleanInsertOperation.java (rev 0) +++ trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/CleanInsertOperation.java 2008-01-31 13:13:40 UTC (rev 578) @@ -0,0 +1,40 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package it.openutils.testing.dbunit; + +import org.dbunit.operation.CompositeOperation; +import org.dbunit.operation.DatabaseOperation; + + +/** + * Mimics the standard <code>DatabaseOperation.CLEAN_INSERT</code> operation with an empty constructor (can be used in + * annotations). + * @author fgiust + * @version $Id: $ + */ +public class CleanInsertOperation extends CompositeOperation +{ + + /** + * @param action1 + * @param action2 + */ + public CleanInsertOperation() + { + super(DatabaseOperation.DELETE_ALL, DatabaseOperation.INSERT); + } + +} Property changes on: trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/CleanInsertOperation.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MsSqlIndentityCleanInsertOperation.java =================================================================== --- trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MsSqlIndentityCleanInsertOperation.java (rev 0) +++ trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MsSqlIndentityCleanInsertOperation.java 2008-01-31 13:13:40 UTC (rev 578) @@ -0,0 +1,40 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package it.openutils.testing.dbunit; + +import org.dbunit.ext.mssql.InsertIdentityOperation; +import org.dbunit.operation.DatabaseOperation; + + +/** + * Extends the standard org.dbunit.ext.mssql.InsertIdentityOperation in order to be able to use this class directly in a + * annotation. Wraps a <code>DatabaseOperation.CLEAN_INSERT</code> operation. + * @see org.dbunit.ext.mssql.InsertIdentityOperation + * @author fgiust + * @version $Id: $ + */ +public class MsSqlIndentityCleanInsertOperation extends InsertIdentityOperation +{ + + /** + * @param operation + */ + public MsSqlIndentityCleanInsertOperation() + { + super(DatabaseOperation.CLEAN_INSERT); + } + +} Property changes on: trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MsSqlIndentityCleanInsertOperation.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MsSqlIndentityInsertOperation.java =================================================================== --- trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MsSqlIndentityInsertOperation.java (rev 0) +++ trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MsSqlIndentityInsertOperation.java 2008-01-31 13:13:40 UTC (rev 578) @@ -0,0 +1,40 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package it.openutils.testing.dbunit; + +import org.dbunit.ext.mssql.InsertIdentityOperation; +import org.dbunit.operation.DatabaseOperation; + + +/** + * Extends the standard org.dbunit.ext.mssql.InsertIdentityOperation in order to be able to use this class directly in a + * annotation. Wraps a <code>DatabaseOperation.INSERT</code> operation. + * @see org.dbunit.ext.mssql.InsertIdentityOperation + * @author fgiust + * @version $Id: $ + */ +public class MsSqlIndentityInsertOperation extends InsertIdentityOperation +{ + + /** + * @param operation + */ + public MsSqlIndentityInsertOperation() + { + super(DatabaseOperation.INSERT); + } + +} Property changes on: trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MsSqlIndentityInsertOperation.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MySqlAbstractNoFkOperation.java =================================================================== --- trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MySqlAbstractNoFkOperation.java (rev 0) +++ trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MySqlAbstractNoFkOperation.java 2008-01-31 13:13:40 UTC (rev 578) @@ -0,0 +1,90 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package it.openutils.testing.dbunit; + +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Statement; + +import org.dbunit.DatabaseUnitException; +import org.dbunit.database.IDatabaseConnection; +import org.dbunit.dataset.IDataSet; +import org.dbunit.operation.AbstractOperation; +import org.dbunit.operation.DatabaseOperation; +import org.dbunit.operation.ExclusiveTransactionException; + + +/** + * Extended operation for dbunit that disables FK checks. + * @author fgiust + * @version $Id: $ + */ +public class MySqlAbstractNoFkOperation extends AbstractOperation +{ + + /** + * Wrapped operation. + */ + private final DatabaseOperation operation; + + /** + * Creates a new InsertIdentityOperation object that decorates the specified operation. + * @param operation wrapped operation + */ + public MySqlAbstractNoFkOperation(DatabaseOperation operation) + { + this.operation = operation; + } + + /** + * {@inheritDoc} + */ + @Override + public void execute(IDatabaseConnection connection, IDataSet dataSet) throws DatabaseUnitException, SQLException + { + Connection jdbcConnection = connection.getConnection(); + Statement statement = jdbcConnection.createStatement(); + + try + { + if (!jdbcConnection.getAutoCommit()) + { + throw new ExclusiveTransactionException(); + } + jdbcConnection.setAutoCommit(false); + + // disable FK + statement.execute("SET FOREIGN_KEY_CHECKS=0"); + + try + { + operation.execute(connection, connection.createDataSet()); + } + finally + { + // enable FK + statement.execute("SET FOREIGN_KEY_CHECKS=1"); + jdbcConnection.commit(); + } + + } + finally + { + jdbcConnection.setAutoCommit(true); + statement.close(); + } + } +} Property changes on: trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MySqlAbstractNoFkOperation.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MySqlNoFkCleanInsertOperation.java =================================================================== --- trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MySqlNoFkCleanInsertOperation.java (rev 0) +++ trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MySqlNoFkCleanInsertOperation.java 2008-01-31 13:13:40 UTC (rev 578) @@ -0,0 +1,37 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package it.openutils.testing.dbunit; + +import org.dbunit.operation.DatabaseOperation; + + +/** + * Extended operation for dbunit that disables FK checks. + * @author fgiust + * @version $Id: $ + */ +public class MySqlNoFkCleanInsertOperation extends MySqlAbstractNoFkOperation +{ + + /** + * @param operation + */ + public MySqlNoFkCleanInsertOperation() + { + super(DatabaseOperation.TRUNCATE_TABLE); + } + +} Property changes on: trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MySqlNoFkCleanInsertOperation.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MySqlNoFkInsertOperation.java =================================================================== --- trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MySqlNoFkInsertOperation.java (rev 0) +++ trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MySqlNoFkInsertOperation.java 2008-01-31 13:13:40 UTC (rev 578) @@ -0,0 +1,37 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package it.openutils.testing.dbunit; + +import org.dbunit.operation.DatabaseOperation; + + +/** + * Extended operation for dbunit that disables FK checks. + * @author fgiust + * @version $Id: $ + */ +public class MySqlNoFkInsertOperation extends MySqlAbstractNoFkOperation +{ + + /** + * @param operation + */ + public MySqlNoFkInsertOperation() + { + super(DatabaseOperation.TRUNCATE_TABLE); + } + +} Property changes on: trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MySqlNoFkInsertOperation.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MySqlNoFkTruncateOperation.java =================================================================== --- trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MySqlNoFkTruncateOperation.java (rev 0) +++ trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MySqlNoFkTruncateOperation.java 2008-01-31 13:13:40 UTC (rev 578) @@ -0,0 +1,37 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package it.openutils.testing.dbunit; + +import org.dbunit.operation.DatabaseOperation; + + +/** + * Extended operation for dbunit that disables FK checks. + * @author fgiust + * @version $Id: $ + */ +public class MySqlNoFkTruncateOperation extends MySqlAbstractNoFkOperation +{ + + /** + * @param operation + */ + public MySqlNoFkTruncateOperation() + { + super(DatabaseOperation.TRUNCATE_TABLE); + } + +} Property changes on: trunk/openutils-testing/src/main/java/it/openutils/testing/dbunit/MySqlNoFkTruncateOperation.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: trunk/openutils-testing/src/site/changes/changes.xml =================================================================== --- trunk/openutils-testing/src/site/changes/changes.xml (rev 0) +++ trunk/openutils-testing/src/site/changes/changes.xml 2008-01-31 13:13:40 UTC (rev 578) @@ -0,0 +1,31 @@ +<?xml version="1.0"?> +<!-- + "type" attribute can be: add, remove, update or fix. +--> +<document> + <properties> + <title>Changes</title> + <author email="fgiust(at)users.sourceforge.net">Fabrizio Giustina</author> + </properties> + <body> + <release version="2.0.2" date="in svn" description="2.0.2"> + <action type="add" dev="fgiust"> + New dbunit operation classes for mssql and mysql (extension of standard dbunit operation, but refactored so that + they can be used in annotations). See the javadocs in the it.openutils.testing.dbunit package + </action> + <action type="update" dev="fgiust"> + truncate operation now defaults to DbUnitOperation.DELETE_ALL instead of DbUnitOperation.TRUNCATE. + </action> + <action type="fix" dev="fgiust">DbUnitUtils.exportDataset() doesn't close anymore the provided connection</action> + </release> + <release version="2.0.1" date="2008-01-30" description="2.0.1"> + <action type="fix" dev="fgiust"> + (junit version only). it.openutils.testing.junit.AbstractDbUnitJunitSpringContextTests was totally broken due to + the setup method being protected. Fixed + added tests + </action> + </release> + <release version="2.0" date="2008-01-20" description="2.0 release"> + <action type="update" dev="fgiust">Totally reworked dbunit test framework.</action> + </release> + </body> +</document> \ No newline at end of file Property changes on: trunk/openutils-testing/src/site/changes/changes.xml ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-01-30 21:24:16
|
Revision: 577 http://openutils.svn.sourceforge.net/openutils/?rev=577&view=rev Author: fgiust Date: 2008-01-30 13:24:20 -0800 (Wed, 30 Jan 2008) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-testing-junit/pom.xml Modified: trunk/openutils-testing-junit/pom.xml =================================================================== --- trunk/openutils-testing-junit/pom.xml 2008-01-30 21:24:08 UTC (rev 576) +++ trunk/openutils-testing-junit/pom.xml 2008-01-30 21:24:20 UTC (rev 577) @@ -8,7 +8,7 @@ </parent> <artifactId>openutils-testing-junit</artifactId> <name>openutils test utils (junit)</name> - <version>2.0.1</version> + <version>2.0.2-SNAPSHOT</version> <description>openutils test utils</description> <dependencies> <dependency> @@ -156,10 +156,4 @@ <properties> <spring.version>2.5.1</spring.version> </properties> - - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-junit-2.0.1</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-junit-2.0.1</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-testing-junit-2.0.1</url> - </scm> </project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-01-30 21:24:08
|
Revision: 576 http://openutils.svn.sourceforge.net/openutils/?rev=576&view=rev Author: fgiust Date: 2008-01-30 13:24:08 -0800 (Wed, 30 Jan 2008) Log Message: ----------- [maven-release-plugin] copy for tag openutils-testing-junit-2.0.1 Added Paths: ----------- tags/openutils-testing-junit-2.0.1/ tags/openutils-testing-junit-2.0.1/pom.xml tags/openutils-testing-junit-2.0.1/src/ Removed Paths: ------------- tags/openutils-testing-junit-2.0.1/pom.xml tags/openutils-testing-junit-2.0.1/src/ Copied: tags/openutils-testing-junit-2.0.1 (from rev 574, trunk/openutils-testing-junit) Deleted: tags/openutils-testing-junit-2.0.1/pom.xml =================================================================== --- trunk/openutils-testing-junit/pom.xml 2008-01-30 21:23:24 UTC (rev 574) +++ tags/openutils-testing-junit-2.0.1/pom.xml 2008-01-30 21:24:08 UTC (rev 576) @@ -1,160 +0,0 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils</artifactId> - <version>7</version> - <relativePath>..</relativePath> - </parent> - <artifactId>openutils-testing-junit</artifactId> - <name>openutils test utils (junit)</name> - <version>2.0.1-SNAPSHOT</version> - <description>openutils test utils</description> - <dependencies> - <dependency> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils-testing</artifactId> - <version>2.0</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-test</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - <exclusion> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>1.4.3</version> - </dependency> - <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <version>1.2.13</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-context</artifactId> - <version>${spring.version}</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-orm</artifactId> - <version>${spring.version}</version> - <optional>true</optional> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.3</version> - </dependency> - <dependency> - <groupId>org.dbunit</groupId> - <artifactId>dbunit</artifactId> - <version>2.2</version> - <optional>true</optional> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.4</version> - </dependency> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate</artifactId> - <version>3.2.1.ga</version> - <optional>true</optional> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - <exclusion> - <groupId>cglib</groupId> - <artifactId>cglib</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.apache.derby</groupId> - <artifactId>derby</artifactId> - <version>10.2.2.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>commons-dbcp</groupId> - <artifactId>commons-dbcp</artifactId> - <version>1.2.1</version> - <scope>test</scope> - <exclusions> - <exclusion> - <artifactId>xerces</artifactId> - <groupId>xerces</groupId> - </exclusion> - <exclusion> - <artifactId>xml-apis</artifactId> - <groupId>xml-apis</groupId> - </exclusion> - <exclusion> - <artifactId>commons-logging</artifactId> - <groupId>commons-logging</groupId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-jdbc</artifactId> - <version>${spring.version}</version> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - </dependencies> - <properties> - <spring.version>2.5.1</spring.version> - </properties> -</project> \ No newline at end of file Copied: tags/openutils-testing-junit-2.0.1/pom.xml (from rev 575, trunk/openutils-testing-junit/pom.xml) =================================================================== --- tags/openutils-testing-junit-2.0.1/pom.xml (rev 0) +++ tags/openutils-testing-junit-2.0.1/pom.xml 2008-01-30 21:24:08 UTC (rev 576) @@ -0,0 +1,165 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils</artifactId> + <version>7</version> + <relativePath>..</relativePath> + </parent> + <artifactId>openutils-testing-junit</artifactId> + <name>openutils test utils (junit)</name> + <version>2.0.1</version> + <description>openutils test utils</description> + <dependencies> + <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-testing</artifactId> + <version>2.0</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-test</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + <exclusion> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.4.3</version> + </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.13</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-core</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring.version}</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-orm</artifactId> + <version>${spring.version}</version> + <optional>true</optional> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.3</version> + </dependency> + <dependency> + <groupId>org.dbunit</groupId> + <artifactId>dbunit</artifactId> + <version>2.2</version> + <optional>true</optional> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.4</version> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate</artifactId> + <version>3.2.1.ga</version> + <optional>true</optional> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + <exclusion> + <groupId>cglib</groupId> + <artifactId>cglib</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.apache.derby</groupId> + <artifactId>derby</artifactId> + <version>10.2.2.0</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>commons-dbcp</groupId> + <artifactId>commons-dbcp</artifactId> + <version>1.2.1</version> + <scope>test</scope> + <exclusions> + <exclusion> + <artifactId>xerces</artifactId> + <groupId>xerces</groupId> + </exclusion> + <exclusion> + <artifactId>xml-apis</artifactId> + <groupId>xml-apis</groupId> + </exclusion> + <exclusion> + <artifactId>commons-logging</artifactId> + <groupId>commons-logging</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-jdbc</artifactId> + <version>${spring.version}</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + <properties> + <spring.version>2.5.1</spring.version> + </properties> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-junit-2.0.1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-junit-2.0.1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-testing-junit-2.0.1</url> + </scm> +</project> \ No newline at end of file Copied: tags/openutils-testing-junit-2.0.1/src (from rev 573, trunk/openutils-testing-junit/src) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-01-30 21:23:51
|
Revision: 575 http://openutils.svn.sourceforge.net/openutils/?rev=575&view=rev Author: fgiust Date: 2008-01-30 13:23:57 -0800 (Wed, 30 Jan 2008) Log Message: ----------- [maven-release-plugin] prepare release openutils-testing-junit-2.0.1 Modified Paths: -------------- trunk/openutils-testing-junit/pom.xml Modified: trunk/openutils-testing-junit/pom.xml =================================================================== --- trunk/openutils-testing-junit/pom.xml 2008-01-30 21:23:24 UTC (rev 574) +++ trunk/openutils-testing-junit/pom.xml 2008-01-30 21:23:57 UTC (rev 575) @@ -1,5 +1,4 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>net.sourceforge.openutils</groupId> @@ -9,7 +8,7 @@ </parent> <artifactId>openutils-testing-junit</artifactId> <name>openutils test utils (junit)</name> - <version>2.0.1-SNAPSHOT</version> + <version>2.0.1</version> <description>openutils test utils</description> <dependencies> <dependency> @@ -157,4 +156,10 @@ <properties> <spring.version>2.5.1</spring.version> </properties> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-junit-2.0.1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-junit-2.0.1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-testing-junit-2.0.1</url> + </scm> </project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-01-30 21:23:21
|
Revision: 574 http://openutils.svn.sourceforge.net/openutils/?rev=574&view=rev Author: fgiust Date: 2008-01-30 13:23:24 -0800 (Wed, 30 Jan 2008) Log Message: ----------- ignore Property Changed: ---------------- trunk/openutils-testing-junit/ Property changes on: trunk/openutils-testing-junit ___________________________________________________________________ Name: svn:ignore - .classpath .project .settings target .checkstyle + .classpath .project .settings target .checkstyle derby.log This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-01-30 21:21:34
|
Revision: 573 http://openutils.svn.sourceforge.net/openutils/?rev=573&view=rev Author: fgiust Date: 2008-01-30 13:21:26 -0800 (Wed, 30 Jan 2008) Log Message: ----------- tests + fixing the protected/public setup Modified Paths: -------------- trunk/openutils-testing-junit/pom.xml trunk/openutils-testing-junit/src/main/java/it/openutils/testing/junit/AbstractDbUnitJunitSpringContextTests.java Added Paths: ----------- trunk/openutils-testing-junit/src/test/ trunk/openutils-testing-junit/src/test/java/ trunk/openutils-testing-junit/src/test/java/it/ trunk/openutils-testing-junit/src/test/java/it/openutils/ trunk/openutils-testing-junit/src/test/java/it/openutils/testing/ trunk/openutils-testing-junit/src/test/java/it/openutils/testing/junit/ trunk/openutils-testing-junit/src/test/java/it/openutils/testing/junit/MultipleDatasourceDbUnitTest.java trunk/openutils-testing-junit/src/test/java/it/openutils/testing/junit/SingleDatasourceDbUnitTest.java trunk/openutils-testing-junit/src/test/resources/ trunk/openutils-testing-junit/src/test/resources/db1-load.xml trunk/openutils-testing-junit/src/test/resources/db2-load.xml trunk/openutils-testing-junit/src/test/resources/log4j.dtd trunk/openutils-testing-junit/src/test/resources/log4j.xml trunk/openutils-testing-junit/src/test/resources/spring-tests.xml Modified: trunk/openutils-testing-junit/pom.xml =================================================================== --- trunk/openutils-testing-junit/pom.xml 2008-01-29 12:02:45 UTC (rev 572) +++ trunk/openutils-testing-junit/pom.xml 2008-01-30 21:21:26 UTC (rev 573) @@ -1,4 +1,5 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>net.sourceforge.openutils</groupId> @@ -114,6 +115,44 @@ </exclusion> </exclusions> </dependency> + <dependency> + <groupId>org.apache.derby</groupId> + <artifactId>derby</artifactId> + <version>10.2.2.0</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>commons-dbcp</groupId> + <artifactId>commons-dbcp</artifactId> + <version>1.2.1</version> + <scope>test</scope> + <exclusions> + <exclusion> + <artifactId>xerces</artifactId> + <groupId>xerces</groupId> + </exclusion> + <exclusion> + <artifactId>xml-apis</artifactId> + <groupId>xml-apis</groupId> + </exclusion> + <exclusion> + <artifactId>commons-logging</artifactId> + <groupId>commons-logging</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-jdbc</artifactId> + <version>${spring.version}</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> </dependencies> <properties> <spring.version>2.5.1</spring.version> Modified: trunk/openutils-testing-junit/src/main/java/it/openutils/testing/junit/AbstractDbUnitJunitSpringContextTests.java =================================================================== --- trunk/openutils-testing-junit/src/main/java/it/openutils/testing/junit/AbstractDbUnitJunitSpringContextTests.java 2008-01-29 12:02:45 UTC (rev 572) +++ trunk/openutils-testing-junit/src/main/java/it/openutils/testing/junit/AbstractDbUnitJunitSpringContextTests.java 2008-01-30 21:21:26 UTC (rev 573) @@ -46,7 +46,7 @@ */ @SuppressWarnings("unchecked") @Before - protected void setUpDbUnit() throws Exception + public void setUpDbUnit() throws Exception { dbUnitTestContext = new DbUnitTestContext(this, applicationContext); dbUnitTestContext.setUpDbUnit(); Added: trunk/openutils-testing-junit/src/test/java/it/openutils/testing/junit/MultipleDatasourceDbUnitTest.java =================================================================== --- trunk/openutils-testing-junit/src/test/java/it/openutils/testing/junit/MultipleDatasourceDbUnitTest.java (rev 0) +++ trunk/openutils-testing-junit/src/test/java/it/openutils/testing/junit/MultipleDatasourceDbUnitTest.java 2008-01-30 21:21:26 UTC (rev 573) @@ -0,0 +1,42 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package it.openutils.testing.junit; + +import it.openutils.testing.DbUnitConfiguration; +import it.openutils.testing.DbUnitExecution; + +import org.junit.Test; +import org.springframework.test.context.ContextConfiguration; + + +/** + * @author fgiust + * @version $Id: $ + */ +@ContextConfiguration(locations = {"/spring-tests.xml" }) +@DbUnitConfiguration(dbUnitExecutions = { + @DbUnitExecution(datasets = {"/db1-load.xml" }, dataSource = "dataSource1"), + @DbUnitExecution(datasets = {"/db2-load.xml" }, dataSource = "dataSource2") }) +public class MultipleDatasourceDbUnitTest extends AbstractDbUnitJunitSpringContextTests +{ + + @Test + public void testLoad() throws Exception + { + // do nothing + } + +} Property changes on: trunk/openutils-testing-junit/src/test/java/it/openutils/testing/junit/MultipleDatasourceDbUnitTest.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: trunk/openutils-testing-junit/src/test/java/it/openutils/testing/junit/SingleDatasourceDbUnitTest.java =================================================================== --- trunk/openutils-testing-junit/src/test/java/it/openutils/testing/junit/SingleDatasourceDbUnitTest.java (rev 0) +++ trunk/openutils-testing-junit/src/test/java/it/openutils/testing/junit/SingleDatasourceDbUnitTest.java 2008-01-30 21:21:26 UTC (rev 573) @@ -0,0 +1,47 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package it.openutils.testing.junit; + +import it.openutils.testing.DbUnitExecution; + +import org.dbunit.operation.InsertOperation; +import org.junit.Test; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.TestExecutionListeners; +import org.springframework.test.context.transaction.TransactionConfiguration; +import org.springframework.test.context.transaction.TransactionalTestExecutionListener; +import org.springframework.transaction.annotation.Transactional; + + +/** + * @author fgiust + * @version $Id: $ + */ +@ContextConfiguration(locations = {"/spring-tests.xml" }) +@DbUnitExecution(datasets = {"/db1-load.xml" }, dataSource = "dataSource1", insertOperation = InsertOperation.class) +@TestExecutionListeners({TransactionalTestExecutionListener.class }) +@Transactional +@TransactionConfiguration(transactionManager = "transactionManager1") +public class SingleDatasourceDbUnitTest extends AbstractDbUnitJunitSpringContextTests +{ + + @Test + public void testLoad() throws Exception + { + // do nothing + } + +} Property changes on: trunk/openutils-testing-junit/src/test/java/it/openutils/testing/junit/SingleDatasourceDbUnitTest.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: trunk/openutils-testing-junit/src/test/resources/db1-load.xml =================================================================== --- trunk/openutils-testing-junit/src/test/resources/db1-load.xml (rev 0) +++ trunk/openutils-testing-junit/src/test/resources/db1-load.xml 2008-01-30 21:21:26 UTC (rev 573) @@ -0,0 +1,8 @@ +<dataset> + <table name="ONE"> + <column>ONE</column> + <row> + <value>1</value> + </row> + </table> +</dataset> Property changes on: trunk/openutils-testing-junit/src/test/resources/db1-load.xml ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: trunk/openutils-testing-junit/src/test/resources/db2-load.xml =================================================================== --- trunk/openutils-testing-junit/src/test/resources/db2-load.xml (rev 0) +++ trunk/openutils-testing-junit/src/test/resources/db2-load.xml 2008-01-30 21:21:26 UTC (rev 573) @@ -0,0 +1,8 @@ +<dataset> + <table name="ONE"> + <column>TWO</column> + <row> + <value>2</value> + </row> + </table> +</dataset> Property changes on: trunk/openutils-testing-junit/src/test/resources/db2-load.xml ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: trunk/openutils-testing-junit/src/test/resources/log4j.dtd =================================================================== --- trunk/openutils-testing-junit/src/test/resources/log4j.dtd (rev 0) +++ trunk/openutils-testing-junit/src/test/resources/log4j.dtd 2008-01-30 21:21:26 UTC (rev 573) @@ -0,0 +1,166 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<!-- Authors: Chris Taylor, Ceki Gulcu. --> + +<!-- Version: 1.2 --> + +<!-- A configuration element consists of optional renderer +elements,appender elements, categories and an optional root +element. --> + +<!ELEMENT log4j:configuration (renderer*, appender*,(category|logger)*,root?, + categoryFactory?)> + +<!-- The "threshold" attribute takes a level value such that all --> +<!-- logging statements with a level equal or below this value are --> +<!-- disabled. --> + +<!-- Setting the "debug" enable the printing of internal log4j logging --> +<!-- statements. --> + +<!-- By default, debug attribute is "null", meaning that we not do touch --> +<!-- internal log4j logging settings. The "null" value for the threshold --> +<!-- attribute can be misleading. The threshold field of a repository --> +<!-- cannot be set to null. The "null" value for the threshold attribute --> +<!-- simply means don't touch the threshold field, the threshold field --> +<!-- keeps its old value. --> + +<!ATTLIST log4j:configuration + xmlns:log4j CDATA #FIXED "http://jakarta.apache.org/log4j/" + threshold (all|debug|info|warn|error|fatal|off|null) "null" + debug (true|false|null) "null" +> + +<!-- renderer elements allow the user to customize the conversion of --> +<!-- message objects to String. --> + +<!ELEMENT renderer EMPTY> +<!ATTLIST renderer + renderedClass CDATA #REQUIRED + renderingClass CDATA #REQUIRED +> + +<!-- Appenders must have a name and a class. --> +<!-- Appenders may contain an error handler, a layout, optional parameters --> +<!-- and filters. They may also reference (or include) other appenders. --> +<!ELEMENT appender (errorHandler?, param*, layout?, filter*, appender-ref*)> +<!ATTLIST appender + name ID #REQUIRED + class CDATA #REQUIRED +> + +<!ELEMENT layout (param*)> +<!ATTLIST layout + class CDATA #REQUIRED +> + +<!ELEMENT filter (param*)> +<!ATTLIST filter + class CDATA #REQUIRED +> + +<!-- ErrorHandlers can be of any class. They can admit any number of --> +<!-- parameters. --> + +<!ELEMENT errorHandler (param*, root-ref?, logger-ref*, appender-ref?)> +<!ATTLIST errorHandler + class CDATA #REQUIRED +> + +<!ELEMENT root-ref EMPTY> + +<!ELEMENT logger-ref EMPTY> +<!ATTLIST logger-ref + ref IDREF #REQUIRED +> + +<!ELEMENT param EMPTY> +<!ATTLIST param + name CDATA #REQUIRED + value CDATA #REQUIRED +> + + +<!-- The priority class is org.apache.log4j.Level by default --> +<!ELEMENT priority (param*)> +<!ATTLIST priority + class CDATA #IMPLIED + value CDATA #REQUIRED +> + +<!-- The level class is org.apache.log4j.Level by default --> +<!ELEMENT level (param*)> +<!ATTLIST level + class CDATA #IMPLIED + value CDATA #REQUIRED +> + + +<!-- If no level element is specified, then the configurator MUST not --> +<!-- touch the level of the named category. --> +<!ELEMENT category (param*,(priority|level)?,appender-ref*)> +<!ATTLIST category + class CDATA #IMPLIED + name CDATA #REQUIRED + additivity (true|false) "true" +> + +<!-- If no level element is specified, then the configurator MUST not --> +<!-- touch the level of the named logger. --> +<!ELEMENT logger (level?,appender-ref*)> +<!ATTLIST logger + name ID #REQUIRED + additivity (true|false) "true" +> + + +<!ELEMENT categoryFactory (param*)> +<!ATTLIST categoryFactory + class CDATA #REQUIRED> + +<!ELEMENT appender-ref EMPTY> +<!ATTLIST appender-ref + ref IDREF #REQUIRED +> + +<!-- If no priority element is specified, then the configurator MUST not --> +<!-- touch the priority of root. --> +<!-- The root category always exists and cannot be subclassed. --> +<!ELEMENT root (param*, (priority|level)?, appender-ref*)> + + +<!-- ==================================================================== --> +<!-- A logging event --> +<!-- ==================================================================== --> +<!ELEMENT log4j:eventSet (log4j:event*)> +<!ATTLIST log4j:eventSet + xmlns:log4j CDATA #FIXED "http://jakarta.apache.org/log4j/" + version (1.1|1.2) "1.2" + includesLocationInfo (true|false) "true" +> + + + +<!ELEMENT log4j:event (log4j:message, log4j:NDC?, log4j:throwable?, + log4j:locationInfo?) > + +<!-- The timestamp format is application dependent. --> +<!ATTLIST log4j:event + logger CDATA #REQUIRED + level CDATA #REQUIRED + thread CDATA #REQUIRED + timestamp CDATA #REQUIRED +> + +<!ELEMENT log4j:message (#PCDATA)> +<!ELEMENT log4j:NDC (#PCDATA)> + +<!ELEMENT log4j:throwable (#PCDATA)> + +<!ELEMENT log4j:locationInfo EMPTY> +<!ATTLIST log4j:locationInfo + class CDATA #REQUIRED + method CDATA #REQUIRED + file CDATA #REQUIRED + line CDATA #REQUIRED +> Property changes on: trunk/openutils-testing-junit/src/test/resources/log4j.dtd ___________________________________________________________________ Name: svn:mime-type + text/xml Name: svn:eol-style + native Added: trunk/openutils-testing-junit/src/test/resources/log4j.xml =================================================================== --- trunk/openutils-testing-junit/src/test/resources/log4j.xml (rev 0) +++ trunk/openutils-testing-junit/src/test/resources/log4j.xml 2008-01-30 21:21:26 UTC (rev 573) @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> +<log4j:configuration> + <!-- log4j test configuration --> + <appender name="test-appender" class="org.apache.log4j.ConsoleAppender"> + <layout class="org.apache.log4j.PatternLayout"> + <param name="ConversionPattern" value="%-5p %c.%M(%C{1}.java:%L) %m%n" /> + </layout> + </appender> + <category name="org"> + <priority value="WARN" /> + </category> + <category name="com"> + <priority value="WARN" /> + </category> + <category name="net"> + <priority value="WARN" /> + </category> + <category name="info"> + <priority value="WARN" /> + </category> + <category name="it"> + <priority value="WARN" /> + </category> + <root> + <priority value="debug" /> + <appender-ref ref="test-appender" /> + </root> +</log4j:configuration> \ No newline at end of file Property changes on: trunk/openutils-testing-junit/src/test/resources/log4j.xml ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: trunk/openutils-testing-junit/src/test/resources/spring-tests.xml =================================================================== --- trunk/openutils-testing-junit/src/test/resources/spring-tests.xml (rev 0) +++ trunk/openutils-testing-junit/src/test/resources/spring-tests.xml 2008-01-30 21:21:26 UTC (rev 573) @@ -0,0 +1,23 @@ +<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:util="http://www.springframework.org/schema/util" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd + http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"> + <bean id="dataSource1" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> + <property name="driverClassName" value="org.apache.derby.jdbc.EmbeddedDriver" /> + <property name="url" value="jdbc:derby:target/test-db1;create=true" /> + <property name="username" value="test" /> + <property name="password" value="test" /> + </bean> + <bean id="transactionManager1" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> + <property name="dataSource" ref="dataSource1" /> + </bean> + <bean id="dataSource2" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> + <property name="driverClassName" value="org.apache.derby.jdbc.EmbeddedDriver" /> + <property name="url" value="jdbc:derby:target/test-db2;create=true" /> + <property name="username" value="test" /> + <property name="password" value="test" /> + </bean> + <bean id="transactionManager2" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> + <property name="dataSource" ref="dataSource2" /> + </bean> +</beans> \ No newline at end of file Property changes on: trunk/openutils-testing-junit/src/test/resources/spring-tests.xml ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fc...@us...> - 2008-01-29 12:59:46
|
Revision: 569 http://openutils.svn.sourceforge.net/openutils/?rev=569&view=rev Author: fcarone Date: 2008-01-29 03:59:58 -0800 (Tue, 29 Jan 2008) Log Message: ----------- Avoid npes if user's groups are not in any role. Modified Paths: -------------- trunk/openutils-usermanagement-dataobjects/src/main/java/it/openutils/usermanagement/dataobjects/User.java Modified: trunk/openutils-usermanagement-dataobjects/src/main/java/it/openutils/usermanagement/dataobjects/User.java =================================================================== --- trunk/openutils-usermanagement-dataobjects/src/main/java/it/openutils/usermanagement/dataobjects/User.java 2008-01-27 15:25:47 UTC (rev 568) +++ trunk/openutils-usermanagement-dataobjects/src/main/java/it/openutils/usermanagement/dataobjects/User.java 2008-01-29 11:59:58 UTC (rev 569) @@ -110,6 +110,10 @@ this.password = password; } + /** + * @return The set of roles related to the user. It returns null if the user is not in any group, or an empty set + * if the groups the user is in, do not belong to any role. + */ public Set<Role> getRoles() { if (groups == null) @@ -121,7 +125,12 @@ for (Group group : groups) { - roles.addAll(group.getRoles()); + Set<Role> groupRoles = group.getRoles(); + if (groupRoles == null) + { + continue; + } + roles.addAll(groupRoles); } return roles; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fc...@us...> - 2008-01-29 12:02:41
|
Revision: 572 http://openutils.svn.sourceforge.net/openutils/?rev=572&view=rev Author: fcarone Date: 2008-01-29 04:02:45 -0800 (Tue, 29 Jan 2008) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-usermanagement-dataobjects/pom.xml Modified: trunk/openutils-usermanagement-dataobjects/pom.xml =================================================================== --- trunk/openutils-usermanagement-dataobjects/pom.xml 2008-01-29 12:02:37 UTC (rev 571) +++ trunk/openutils-usermanagement-dataobjects/pom.xml 2008-01-29 12:02:45 UTC (rev 572) @@ -10,7 +10,7 @@ <artifactId>openutils-usermanagement-dataobjects</artifactId> <packaging>jar</packaging> <name>openutils usermanagement dataobjects</name> - <version>2.0</version> + <version>2.1-SNAPSHOT</version> <description>Usermanagement dataobjects</description> <dependencies> <dependency> @@ -70,10 +70,4 @@ </exclusions> </dependency> </dependencies> - - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-usermanagement-dataobjects-2.0</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-usermanagement-dataobjects-2.0</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-usermanagement-dataobjects-2.0</url> - </scm> </project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |