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...> - 2007-02-05 21:47:05
|
Revision: 214 http://svn.sourceforge.net/openutils/?rev=214&view=rev Author: fgiust Date: 2007-02-05 13:47:01 -0800 (Mon, 05 Feb 2007) Log Message: ----------- set a fixed length for date parsing and cleanup dead code Modified Paths: -------------- trunk/openutils-spring/pom.xml trunk/openutils-spring/src/main/java/it/openutils/web/spring/BaseFormController.java Modified: trunk/openutils-spring/pom.xml =================================================================== --- trunk/openutils-spring/pom.xml 2007-02-05 21:44:02 UTC (rev 213) +++ trunk/openutils-spring/pom.xml 2007-02-05 21:47:01 UTC (rev 214) @@ -57,7 +57,7 @@ <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> - <version>1.0.1</version> + <version>1.2</version> </dependency> <dependency> <groupId>org.hibernate</groupId> Modified: trunk/openutils-spring/src/main/java/it/openutils/web/spring/BaseFormController.java =================================================================== --- trunk/openutils-spring/src/main/java/it/openutils/web/spring/BaseFormController.java 2007-02-05 21:44:02 UTC (rev 213) +++ trunk/openutils-spring/src/main/java/it/openutils/web/spring/BaseFormController.java 2007-02-05 21:47:01 UTC (rev 214) @@ -38,7 +38,7 @@ // convert java.util.Date SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy"); dateFormat.setLenient(false); - binder.registerCustomEditor(Date.class, null, new CustomDateEditor(dateFormat, true)); + binder.registerCustomEditor(Date.class, null, new CustomDateEditor(dateFormat, true, 10)); // convert Integers and Longs binder.registerCustomEditor(Long.class, null, new CustomNumberEditor(Long.class, true)); @@ -51,23 +51,6 @@ } - // /** - // * Convenience method for getting a i18n key's value. Calling getMessageSourceAccessor() is used because the - // * RequestContext variable is not set in unit tests b/c there's no DispatchServlet Request. - // * @param msgKey - // * @return String - // */ - // public String getText(String msgKey) - // { - // String currentLocale = ThreadLocaleHolder.getLocale(); - // if (currentLocale != null) - // { - // return getMessageSourceAccessor().getMessage(msgKey, new Locale(currentLocale)); - // } - // - // return getMessageSourceAccessor().getMessage(msgKey); - // } - /** * Convenient method for getting a i18n key's value with a single string argument. * @param msgKey @@ -76,26 +59,9 @@ */ public String getText(String msgKey, Object arg) { - return getText(msgKey, new Object[]{arg}); + return getText(msgKey, new Object[]{arg }); } - // /** - // * Convenience method for getting a i18n key's value with arguments. - // * @param msgKey - // * @param args - // * @return String - // */ - // public String getText(String msgKey, Object[] args) - // { - // String currentLocale = ThreadLocaleHolder.getLocale(); - // if (currentLocale != null) - // { - // return getMessageSourceAccessor().getMessage(msgKey, args, new Locale(currentLocale)); - // } - // - // return getMessageSourceAccessor().getMessage(msgKey, args); - // } - public void saveMessage(HttpServletRequest request, String message) { MessageUtils.saveMessage(request, message); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2007-02-05 21:44:06
|
Revision: 213 http://svn.sourceforge.net/openutils/?rev=213&view=rev Author: fgiust Date: 2007-02-05 13:44:02 -0800 (Mon, 05 Feb 2007) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-dbmigration/pom.xml Modified: trunk/openutils-dbmigration/pom.xml =================================================================== --- trunk/openutils-dbmigration/pom.xml 2007-02-05 21:43:56 UTC (rev 212) +++ trunk/openutils-dbmigration/pom.xml 2007-02-05 21:44:02 UTC (rev 213) @@ -8,7 +8,7 @@ </parent> <artifactId>openutils-dbmigration</artifactId> <name>openutils db migration framework</name> - <version>0.1</version> + <version>1.0-SNAPSHOT</version> <description /> <dependencies> <dependency> @@ -84,10 +84,4 @@ <scope>test</scope> </dependency> </dependencies> - - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-0.1</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-0.1</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-dbmigration-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...> - 2007-02-05 21:43:58
|
Revision: 212 http://svn.sourceforge.net/openutils/?rev=212&view=rev Author: fgiust Date: 2007-02-05 13:43:56 -0800 (Mon, 05 Feb 2007) Log Message: ----------- [maven-scm] copy for tag openutils-dbmigration-0.1 Added Paths: ----------- tags/openutils-dbmigration-0.1/ tags/openutils-dbmigration-0.1/pom.xml Removed Paths: ------------- tags/openutils-dbmigration-0.1/pom.xml Copied: tags/openutils-dbmigration-0.1 (from rev 208, trunk/openutils-dbmigration) Deleted: tags/openutils-dbmigration-0.1/pom.xml =================================================================== --- trunk/openutils-dbmigration/pom.xml 2007-02-05 21:37:30 UTC (rev 208) +++ tags/openutils-dbmigration-0.1/pom.xml 2007-02-05 21:43:56 UTC (rev 212) @@ -1,88 +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>3</version> - <relativePath>..</relativePath> - </parent> - <artifactId>openutils-dbmigration</artifactId> - <name>openutils db migration framework</name> - <version>1.0-SNAPSHOT</version> - <description /> - <dependencies> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.2</version> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>1.3</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-jdbc</artifactId> - <version>2.0.1</version> - <exclusions> - <exclusion> - <groupId>avalon-framework</groupId> - <artifactId>avalon-framework</artifactId> - </exclusion> - <exclusion> - <groupId>logkit</groupId> - <artifactId>logkit</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-beans</artifactId> - <version>2.0.1</version> - <exclusions> - <exclusion> - <groupId>avalon-framework</groupId> - <artifactId>avalon-framework</artifactId> - </exclusion> - <exclusion> - <groupId>logkit</groupId> - <artifactId>logkit</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - <version>2.0.1</version> - <exclusions> - <exclusion> - <groupId>avalon-framework</groupId> - <artifactId>avalon-framework</artifactId> - </exclusion> - <exclusion> - <groupId>logkit</groupId> - <artifactId>logkit</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>1.2</version> - </dependency> - <dependency> - <groupId>poi</groupId> - <artifactId>poi</artifactId> - <version>2.5.1-final-20040804</version> - <optional>true</optional> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.0</version> - <scope>test</scope> - </dependency> - </dependencies> -</project> \ No newline at end of file Copied: tags/openutils-dbmigration-0.1/pom.xml (from rev 211, trunk/openutils-dbmigration/pom.xml) =================================================================== --- tags/openutils-dbmigration-0.1/pom.xml (rev 0) +++ tags/openutils-dbmigration-0.1/pom.xml 2007-02-05 21:43:56 UTC (rev 212) @@ -0,0 +1,93 @@ +<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>3</version> + <relativePath>..</relativePath> + </parent> + <artifactId>openutils-dbmigration</artifactId> + <name>openutils db migration framework</name> + <version>0.1</version> + <description /> + <dependencies> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.2</version> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>1.3</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-jdbc</artifactId> + <version>2.0.1</version> + <exclusions> + <exclusion> + <groupId>avalon-framework</groupId> + <artifactId>avalon-framework</artifactId> + </exclusion> + <exclusion> + <groupId>logkit</groupId> + <artifactId>logkit</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-beans</artifactId> + <version>2.0.1</version> + <exclusions> + <exclusion> + <groupId>avalon-framework</groupId> + <artifactId>avalon-framework</artifactId> + </exclusion> + <exclusion> + <groupId>logkit</groupId> + <artifactId>logkit</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-core</artifactId> + <version>2.0.1</version> + <exclusions> + <exclusion> + <groupId>avalon-framework</groupId> + <artifactId>avalon-framework</artifactId> + </exclusion> + <exclusion> + <groupId>logkit</groupId> + <artifactId>logkit</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.2</version> + </dependency> + <dependency> + <groupId>poi</groupId> + <artifactId>poi</artifactId> + <version>2.5.1-final-20040804</version> + <optional>true</optional> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.0</version> + <scope>test</scope> + </dependency> + </dependencies> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-0.1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-0.1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-dbmigration-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...> - 2007-02-05 21:43:50
|
Revision: 211 http://svn.sourceforge.net/openutils/?rev=211&view=rev Author: fgiust Date: 2007-02-05 13:43:48 -0800 (Mon, 05 Feb 2007) Log Message: ----------- [maven-release-plugin] prepare release openutils-dbmigration-0.1 Modified Paths: -------------- trunk/openutils-dbmigration/pom.xml Modified: trunk/openutils-dbmigration/pom.xml =================================================================== --- trunk/openutils-dbmigration/pom.xml 2007-02-05 21:42:44 UTC (rev 210) +++ trunk/openutils-dbmigration/pom.xml 2007-02-05 21:43:48 UTC (rev 211) @@ -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 framework</name> - <version>1.0-SNAPSHOT</version> + <version>0.1</version> <description /> <dependencies> <dependency> @@ -85,4 +84,10 @@ <scope>test</scope> </dependency> </dependencies> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-0.1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-0.1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-dbmigration-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...> - 2007-02-05 21:42:55
|
Revision: 210 http://svn.sourceforge.net/openutils/?rev=210&view=rev Author: fgiust Date: 2007-02-05 13:42:44 -0800 (Mon, 05 Feb 2007) Log Message: ----------- cleanup deps Modified Paths: -------------- trunk/openutils-bshd5/pom.xml trunk/openutils-configuration-services/pom.xml Modified: trunk/openutils-bshd5/pom.xml =================================================================== --- trunk/openutils-bshd5/pom.xml 2007-02-05 21:38:50 UTC (rev 209) +++ trunk/openutils-bshd5/pom.xml 2007-02-05 21:42:44 UTC (rev 210) @@ -17,6 +17,11 @@ <version>2.0.1</version> </dependency> <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>2.0.1</version> + </dependency> + <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate</artifactId> <version>3.2.1.ga</version> Modified: trunk/openutils-configuration-services/pom.xml =================================================================== --- trunk/openutils-configuration-services/pom.xml 2007-02-05 21:38:50 UTC (rev 209) +++ trunk/openutils-configuration-services/pom.xml 2007-02-05 21:42:44 UTC (rev 210) @@ -28,18 +28,18 @@ <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-bshd5</artifactId> - <version>1.0.2</version> + <version>1.0.4</version> </dependency> <dependency> <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils-testing</artifactId> - <version>1.0</version> + <artifactId>openutils-testing-testng</artifactId> + <version>1.1</version> <scope>test</scope> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> - <version>1.0.1</version> + <version>1.2</version> </dependency> <dependency> <groupId>log4j</groupId> @@ -74,6 +74,12 @@ <version>2.2</version> </dependency> <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>2.0.1</version> + <scope>test</scope> + </dependency> + <dependency> <groupId>org.apache.derby</groupId> <artifactId>derby</artifactId> <version>10.1.2.1</version> @@ -85,12 +91,5 @@ <version>2.2</version> <scope>test</scope> </dependency> - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <version>5.1</version> - <classifier>jdk15</classifier> - <scope>test</scope> - </dependency> </dependencies> </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...> - 2007-02-05 21:38:50
|
Revision: 209 http://svn.sourceforge.net/openutils/?rev=209&view=rev Author: fgiust Date: 2007-02-05 13:38:50 -0800 (Mon, 05 Feb 2007) Log Message: ----------- cleanup dependencies Modified Paths: -------------- trunk/openutils-configuration-dataobjects/pom.xml Modified: trunk/openutils-configuration-dataobjects/pom.xml =================================================================== --- trunk/openutils-configuration-dataobjects/pom.xml 2007-02-05 21:37:30 UTC (rev 208) +++ trunk/openutils-configuration-dataobjects/pom.xml 2007-02-05 21:38:50 UTC (rev 209) @@ -16,7 +16,7 @@ <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-annotations</artifactId> - <version>3.2.0.ga</version> + <version>3.2.1.ga</version> <exclusions> <exclusion> <!-- not needed here, just load annotations --> @@ -30,44 +30,5 @@ <artifactId>commons-lang</artifactId> <version>2.2</version> </dependency> - <dependency> - <groupId>org.acegisecurity</groupId> - <artifactId>acegi-security</artifactId> - <version>1.0.3</version> - <exclusions> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-remoting</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-jdbc</artifactId> - </exclusion> - <exclusion> - <groupId>org.springframework</groupId> - <artifactId>spring-support</artifactId> - </exclusion> - <exclusion> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - </exclusion> - <exclusion> - <groupId>commons-collections</groupId> - <artifactId>commons-collections</artifactId> - </exclusion> - <exclusion> - <groupId>oro</groupId> - <artifactId>oro</artifactId> - </exclusion> - <exclusion> - <groupId>commons-codec</groupId> - <artifactId>commons-codec</artifactId> - </exclusion> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> </dependencies> </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...> - 2007-02-05 21:37:43
|
Revision: 208 http://svn.sourceforge.net/openutils/?rev=208&view=rev Author: fgiust Date: 2007-02-05 13:37:30 -0800 (Mon, 05 Feb 2007) Log Message: ----------- update hibernate annotations Modified Paths: -------------- trunk/openutils-configuration-services/pom.xml Modified: trunk/openutils-configuration-services/pom.xml =================================================================== --- trunk/openutils-configuration-services/pom.xml 2007-02-05 17:42:58 UTC (rev 207) +++ trunk/openutils-configuration-services/pom.xml 2007-02-05 21:37:30 UTC (rev 208) @@ -50,7 +50,7 @@ <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-annotations</artifactId> - <version>3.2.0.ga</version> + <version>3.2.1.ga</version> </dependency> <dependency> <groupId>commons-dbcp</groupId> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2007-02-05 17:43:05
|
Revision: 206 http://svn.sourceforge.net/openutils/?rev=206&view=rev Author: fgiust Date: 2007-02-05 09:42:52 -0800 (Mon, 05 Feb 2007) Log Message: ----------- [maven-scm] copy for tag openutils-testing-testng-1.1 Added Paths: ----------- tags/openutils-testing-testng-1.1/ tags/openutils-testing-testng-1.1/pom.xml tags/openutils-testing-testng-1.1/src/ tags/openutils-testing-testng-1.1/src/main/java/it/openutils/testing/testng/DbUnitTestCase.java Removed Paths: ------------- tags/openutils-testing-testng-1.1/pom.xml tags/openutils-testing-testng-1.1/src/ tags/openutils-testing-testng-1.1/src/main/java/it/openutils/testing/testng/DbUnitTestCase.java Copied: tags/openutils-testing-testng-1.1 (from rev 201, trunk/openutils-testing-testng) Deleted: tags/openutils-testing-testng-1.1/pom.xml =================================================================== --- trunk/openutils-testing-testng/pom.xml 2007-02-05 17:40:35 UTC (rev 201) +++ tags/openutils-testing-testng-1.1/pom.xml 2007-02-05 17:42:52 UTC (rev 206) @@ -1,61 +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>3</version> - <relativePath>..</relativePath> - </parent> - <artifactId>openutils-testing-testng</artifactId> - <name>openutils test utils (testng)</name> - <version>1.1-SNAPSHOT</version> - <description>openutils test utils</description> - <dependencies> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>1.0.1</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>2.0.1</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-context</artifactId> - <version>2.0.1</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-hibernate3</artifactId> - <version>2.0.1</version> - <optional>true</optional> - </dependency> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.2</version> - </dependency> - <dependency> - <groupId>org.dbunit</groupId> - <artifactId>dbunit</artifactId> - <version>2.2</version> - <optional>true</optional> - </dependency> - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <classifier>jdk15</classifier> - <version>5.1</version> - </dependency> - </dependencies> -</project> \ No newline at end of file Copied: tags/openutils-testing-testng-1.1/pom.xml (from rev 205, trunk/openutils-testing-testng/pom.xml) =================================================================== --- tags/openutils-testing-testng-1.1/pom.xml (rev 0) +++ tags/openutils-testing-testng-1.1/pom.xml 2007-02-05 17:42:52 UTC (rev 206) @@ -0,0 +1,65 @@ +<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>3</version> + <relativePath>..</relativePath> + </parent> + <artifactId>openutils-testing-testng</artifactId> + <name>openutils test utils (testng)</name> + <version>1.1</version> + <description>openutils test utils</description> + <dependencies> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.0.1</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>2.0.1</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>2.0.1</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-hibernate3</artifactId> + <version>2.0.1</version> + <optional>true</optional> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.2</version> + </dependency> + <dependency> + <groupId>org.dbunit</groupId> + <artifactId>dbunit</artifactId> + <version>2.2</version> + <optional>true</optional> + </dependency> + <dependency> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + <classifier>jdk15</classifier> + <version>5.1</version> + </dependency> + </dependencies> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-testng-1.1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-testng-1.1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-testing-testng-1.1</url> + </scm> +</project> \ No newline at end of file Copied: tags/openutils-testing-testng-1.1/src (from rev 198, trunk/openutils-testing-testng/src) Deleted: tags/openutils-testing-testng-1.1/src/main/java/it/openutils/testing/testng/DbUnitTestCase.java =================================================================== --- trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/DbUnitTestCase.java 2007-02-05 17:20:24 UTC (rev 198) +++ tags/openutils-testing-testng-1.1/src/main/java/it/openutils/testing/testng/DbUnitTestCase.java 2007-02-05 17:42:52 UTC (rev 206) @@ -1,248 +0,0 @@ -/* - * Copyright 2005 Fabrizio Giustina. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.testng; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.sql.SQLException; -import java.text.MessageFormat; - -import javax.sql.DataSource; - -import org.apache.commons.lang.ArrayUtils; -import org.apache.commons.lang.ClassUtils; -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.excel.XlsDataSet; -import org.dbunit.dataset.filter.AbstractTableFilter; -import org.dbunit.dataset.filter.ITableFilter; -import org.dbunit.dataset.filter.SequenceTableFilter; -import org.dbunit.dataset.xml.XmlDataSet; -import org.dbunit.operation.DatabaseOperation; -import org.testng.annotations.AfterMethod; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; - - -/** - * @author fgiust - * @version $Id$ - */ -@Test -public class DbUnitTestCase extends SpringTestCase -{ - - /** - * name for the dataSource bean in Spring context. - */ - private static final String DATASOURCE_BEAN_NAME = "dataSource"; - - /** - * Pattern for dbunit file loaded before a test. MessageFormat format with two placeholders: class name and - * extension. - */ - private static final String DATAFILE_PATTERN = "/{0}-load.{1}"; - - protected static IDataSet truncateDataSet; - - /** - * Optional schema (needed for ORACLE). - * @return <code>null</code> - */ - protected String getSchema() - { - return null; - } - - /** - * Setup the Database before running the test method. - * @throws Exception Any exception. - */ - @BeforeMethod - protected void setUpDbUnit() throws Exception - { - // check for xml - IDataSet dataSet = loadDataSet(getDataFileName("xml")); - - if (dataSet == null) - { - // check for excel - dataSet = loadDataSet(getDataFileName("xls")); - } - - if (dataSet != null) - { - importDataSet(dataSet); - } - else - { - log.debug("No test data found with name [{}]", getDataFileName("xml/xls")); - } - } - - /** - * Exports a database to an Excel file - * @param fileName The file name we save the Excel dump to. - * @throws IOException An IO Exception. - * @throws DataSetException A dataset exception. - * @throws SQLException A SQL Exception. - */ - protected void exportDbToXls(String fileName) throws IOException, DataSetException, SQLException - { - IDatabaseConnection connection = getDbUnitConnection(); - - IDataSet fullDataSet = connection.createDataSet(); - - File outFile = new File(fileName); - OutputStream fos = new FileOutputStream(outFile); - XlsDataSet.write(fullDataSet, fos); - fos.close(); - } - - /** - * Cleans the database after we run the tests. - * @throws Exception Any exception. - */ - @AfterMethod - protected void tearDownDbUnit() throws Exception - { - - // regenerate db initial state - String datesetFileName = "/initial-load.xml"; - InputStream testData = getClass().getResourceAsStream(datesetFileName); - - if (testData != null) - { - log.debug("Restoring db state"); - - IDataSet dataSet = new XmlDataSet(testData); - - IDatabaseConnection connection = getDbUnitConnection(); - - try - { - DatabaseOperation.CLEAN_INSERT.execute(connection, dataSet); - } - finally - { - connection.close(); - } - } - } - - private void importDataSet(IDataSet dataSet) throws SQLException, DataSetException, DatabaseUnitException - { - IDatabaseConnection connection = getDbUnitConnection(); - - if (truncateDataSet == null) - { - log.debug("Generating sorted dataset for initial cleanup"); - IDataSet unsortedTruncateDataSet = connection.createDataSet(); - - ITableFilter filter = new DatabaseSequenceFilter(connection); - truncateDataSet = new FilteredDataSet(filter, unsortedTruncateDataSet); - - truncateDataSet = new FilteredDataSet(new AbstractTableFilter() - { - - @Override - public boolean isValidName(String tableName) throws DataSetException - { - return !StringUtils.contains(tableName, "$"); - } - }, truncateDataSet); - - log.debug("Sorted dataset generated"); - } - - IDataSet orderedDataset = new FilteredDataSet(new AbstractTableFilter() - { - - @Override - public boolean isValidName(String tableName) throws DataSetException - { - return !StringUtils.contains(tableName, "$"); - } - }, dataSet); - - log.debug("Tables: {}", ArrayUtils.toString(orderedDataset.getTableNames())); - log.debug("Tables truncateDataSet: {}", ArrayUtils.toString(truncateDataSet.getTableNames())); - - // if a sorted dataset is available, use table sequence for sorting - if (truncateDataSet != null) - { - ITableFilter filter = new SequenceTableFilter(truncateDataSet.getTableNames()); - orderedDataset = new FilteredDataSet(filter, dataSet); - } - - try - { - - if (truncateDataSet != null) - { - DatabaseOperation.DELETE_ALL.execute(connection, truncateDataSet); - } - if (dataSet != null) - { - DatabaseOperation.INSERT.execute(connection, orderedDataset); - } - } - finally - { - connection.close(); - } - } - - /** - * @return - * @throws SQLException - */ - private IDatabaseConnection getDbUnitConnection() throws SQLException - { - DataSource dataSource = (DataSource) ctx.getBean(DATASOURCE_BEAN_NAME); - IDatabaseConnection connection = new DatabaseConnection(dataSource.getConnection(), getSchema()); - return connection; - } - - private String getDataFileName(String extension) - { - return MessageFormat.format(DATAFILE_PATTERN, ClassUtils.getShortClassName(getClass()), extension); - } - - private IDataSet loadDataSet(String datesetFile) throws IOException, DataSetException - { - InputStream is = getClass().getResourceAsStream(datesetFile); - IDataSet dataSet = null; - - if (is != null) - { - log.debug("loading dataset {}", datesetFile); - dataSet = datesetFile.endsWith(".xls") ? new XlsDataSet(is) : new XmlDataSet(is); - is.close(); - } - - return dataSet; - } -} Copied: tags/openutils-testing-testng-1.1/src/main/java/it/openutils/testing/testng/DbUnitTestCase.java (from rev 201, trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/DbUnitTestCase.java) =================================================================== --- tags/openutils-testing-testng-1.1/src/main/java/it/openutils/testing/testng/DbUnitTestCase.java (rev 0) +++ tags/openutils-testing-testng-1.1/src/main/java/it/openutils/testing/testng/DbUnitTestCase.java 2007-02-05 17:42:52 UTC (rev 206) @@ -0,0 +1,285 @@ +/* + * Copyright 2005 Fabrizio Giustina. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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.testng; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.sql.SQLException; +import java.text.MessageFormat; +import java.util.Map; + +import javax.sql.DataSource; + +import org.apache.commons.lang.ArrayUtils; +import org.apache.commons.lang.ClassUtils; +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.excel.XlsDataSet; +import org.dbunit.dataset.filter.AbstractTableFilter; +import org.dbunit.dataset.filter.ITableFilter; +import org.dbunit.dataset.filter.SequenceTableFilter; +import org.dbunit.dataset.xml.XmlDataSet; +import org.dbunit.operation.DatabaseOperation; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.SessionFactoryUtils; +import org.testng.Assert; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + + +/** + * @author fgiust + * @version $Id$ + */ +@Test +public class DbUnitTestCase extends SpringTestCase +{ + + /** + * name for the dataSource bean in Spring context. + */ + private static final String DATASOURCE_BEAN_NAME = "dataSource"; + + /** + * Pattern for dbunit file loaded before a test. MessageFormat format with two placeholders: class name and + * extension. + */ + private static final String DATAFILE_PATTERN = "/{0}-load.{1}"; + + protected static IDataSet truncateDataSet; + + /** + * Hibernate session factory. + */ + private SessionFactory sessionFactory; + + /** + * Optional schema (needed for ORACLE). + * @return <code>null</code> + */ + protected String getSchema() + { + return null; + } + + /** + * Should use deferred close emulating the spring OpenSessionInView filter? Default is <code>true</code> + * @return <code>true</code> if deferred close should be used + */ + protected boolean mimicSessionFilter() + { + return true; + } + + /** + * Setup the Database before running the test method. + * @throws Exception Any exception. + */ + @SuppressWarnings("unchecked") + @BeforeMethod + protected void setUpDbUnit() throws Exception + { + // mimic the Spring OpenSessionInViewFilter + if (mimicSessionFilter()) + { + Map<String, SessionFactory> sfbeans = ctx.getBeansOfType(SessionFactory.class); + if (sfbeans.isEmpty()) + { + Assert.fail("No bean of type org.hibernate.SessionFactory found in spring context"); + } + this.sessionFactory = sfbeans.get(sfbeans.keySet().iterator().next()); + + SessionFactoryUtils.initDeferredClose(this.sessionFactory); + } + + // check for xml + IDataSet dataSet = loadDataSet(getDataFileName("xml")); + + if (dataSet == null) + { + // check for excel + dataSet = loadDataSet(getDataFileName("xls")); + } + + if (dataSet != null) + { + importDataSet(dataSet); + } + else + { + log.debug("No test data found with name [{}]", getDataFileName("xml/xls")); + } + } + + /** + * Exports a database to an Excel file + * @param fileName The file name we save the Excel dump to. + * @throws IOException An IO Exception. + * @throws DataSetException A dataset exception. + * @throws SQLException A SQL Exception. + */ + protected void exportDbToXls(String fileName) throws IOException, DataSetException, SQLException + { + IDatabaseConnection connection = getDbUnitConnection(); + + IDataSet fullDataSet = connection.createDataSet(); + + File outFile = new File(fileName); + OutputStream fos = new FileOutputStream(outFile); + XlsDataSet.write(fullDataSet, fos); + fos.close(); + } + + /** + * Cleans the database after we run the tests. + * @throws Exception Any exception. + */ + @AfterMethod + protected void tearDownDbUnit() throws Exception + { + if (mimicSessionFilter()) + { + // close open hibernate sessions, mimic the OpenSessionInViewFilter + SessionFactoryUtils.processDeferredClose(this.sessionFactory); + } + + // regenerate db initial state + String datesetFileName = "/initial-load.xml"; + InputStream testData = getClass().getResourceAsStream(datesetFileName); + + if (testData != null) + { + log.debug("Restoring db state"); + + IDataSet dataSet = new XmlDataSet(testData); + + IDatabaseConnection connection = getDbUnitConnection(); + + try + { + DatabaseOperation.CLEAN_INSERT.execute(connection, dataSet); + } + finally + { + connection.close(); + } + } + } + + private void importDataSet(IDataSet dataSet) throws SQLException, DataSetException, DatabaseUnitException + { + IDatabaseConnection connection = getDbUnitConnection(); + + if (truncateDataSet == null) + { + log.debug("Generating sorted dataset for initial cleanup"); + IDataSet unsortedTruncateDataSet = connection.createDataSet(); + + ITableFilter filter = new DatabaseSequenceFilter(connection); + truncateDataSet = new FilteredDataSet(filter, unsortedTruncateDataSet); + + truncateDataSet = new FilteredDataSet(new AbstractTableFilter() + { + + @Override + public boolean isValidName(String tableName) throws DataSetException + { + return !StringUtils.contains(tableName, "$"); + } + }, truncateDataSet); + + log.debug("Sorted dataset generated"); + } + + IDataSet orderedDataset = new FilteredDataSet(new AbstractTableFilter() + { + + @Override + public boolean isValidName(String tableName) throws DataSetException + { + return !StringUtils.contains(tableName, "$"); + } + }, dataSet); + + log.debug("Tables: {}", ArrayUtils.toString(orderedDataset.getTableNames())); + log.debug("Tables truncateDataSet: {}", ArrayUtils.toString(truncateDataSet.getTableNames())); + + // if a sorted dataset is available, use table sequence for sorting + if (truncateDataSet != null) + { + ITableFilter filter = new SequenceTableFilter(truncateDataSet.getTableNames()); + orderedDataset = new FilteredDataSet(filter, dataSet); + } + + try + { + + if (truncateDataSet != null) + { + DatabaseOperation.DELETE_ALL.execute(connection, truncateDataSet); + } + if (dataSet != null) + { + DatabaseOperation.INSERT.execute(connection, orderedDataset); + } + } + finally + { + connection.close(); + } + } + + /** + * @return + * @throws SQLException + */ + private IDatabaseConnection getDbUnitConnection() throws SQLException + { + DataSource dataSource = (DataSource) ctx.getBean(DATASOURCE_BEAN_NAME); + IDatabaseConnection connection = new DatabaseConnection(dataSource.getConnection(), getSchema()); + return connection; + } + + private String getDataFileName(String extension) + { + return MessageFormat.format(DATAFILE_PATTERN, ClassUtils.getShortClassName(getClass()), extension); + } + + private IDataSet loadDataSet(String datesetFile) throws IOException, DataSetException + { + InputStream is = getClass().getResourceAsStream(datesetFile); + IDataSet dataSet = null; + + if (is != null) + { + log.debug("loading dataset {}", datesetFile); + dataSet = datesetFile.endsWith(".xls") ? new XlsDataSet(is) : new XmlDataSet(is); + is.close(); + } + + return dataSet; + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2007-02-05 17:42:58
|
Revision: 207 http://svn.sourceforge.net/openutils/?rev=207&view=rev Author: fgiust Date: 2007-02-05 09:42:58 -0800 (Mon, 05 Feb 2007) 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 2007-02-05 17:42:52 UTC (rev 206) +++ trunk/openutils-testing-testng/pom.xml 2007-02-05 17:42:58 UTC (rev 207) @@ -8,7 +8,7 @@ </parent> <artifactId>openutils-testing-testng</artifactId> <name>openutils test utils (testng)</name> - <version>1.1</version> + <version>1.1.1-SNAPSHOT</version> <description>openutils test utils</description> <dependencies> <dependency> @@ -56,10 +56,4 @@ <version>5.1</version> </dependency> </dependencies> - - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-testng-1.1</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-testng-1.1</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-testing-testng-1.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...> - 2007-02-05 17:42:42
|
Revision: 205 http://svn.sourceforge.net/openutils/?rev=205&view=rev Author: fgiust Date: 2007-02-05 09:42:37 -0800 (Mon, 05 Feb 2007) Log Message: ----------- [maven-release-plugin] prepare release openutils-testing-testng-1.1 Modified Paths: -------------- trunk/openutils-testing-testng/pom.xml Modified: trunk/openutils-testing-testng/pom.xml =================================================================== --- trunk/openutils-testing-testng/pom.xml 2007-02-05 17:42:00 UTC (rev 204) +++ trunk/openutils-testing-testng/pom.xml 2007-02-05 17:42:37 UTC (rev 205) @@ -1,6 +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> @@ -10,7 +8,7 @@ </parent> <artifactId>openutils-testing-testng</artifactId> <name>openutils test utils (testng)</name> - <version>1.1-SNAPSHOT</version> + <version>1.1</version> <description>openutils test utils</description> <dependencies> <dependency> @@ -58,4 +56,10 @@ <version>5.1</version> </dependency> </dependencies> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-testng-1.1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-testng-1.1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-testing-testng-1.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...> - 2007-02-05 17:42:11
|
Revision: 204 http://svn.sourceforge.net/openutils/?rev=204&view=rev Author: fgiust Date: 2007-02-05 09:42:00 -0800 (Mon, 05 Feb 2007) 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 2007-02-05 17:41:49 UTC (rev 203) +++ trunk/openutils-testing-junit/pom.xml 2007-02-05 17:42:00 UTC (rev 204) @@ -8,7 +8,7 @@ </parent> <artifactId>openutils-testing-junit</artifactId> <name>openutils test utils (junit)</name> - <version>1.1</version> + <version>1.1.1-SNAPSHOT</version> <description>openutils test utils</description> <dependencies> <dependency> @@ -55,10 +55,4 @@ <version>3.8.1</version> </dependency> </dependencies> - - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-junit-1.1</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-junit-1.1</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-testing-junit-1.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...> - 2007-02-05 17:41:51
|
Revision: 203 http://svn.sourceforge.net/openutils/?rev=203&view=rev Author: fgiust Date: 2007-02-05 09:41:49 -0800 (Mon, 05 Feb 2007) Log Message: ----------- [maven-scm] copy for tag openutils-testing-junit-1.1 Added Paths: ----------- tags/openutils-testing-junit-1.1/ tags/openutils-testing-junit-1.1/pom.xml tags/openutils-testing-junit-1.1/src/main/java/it/openutils/testing/junit/DbUnitTestCase.java Removed Paths: ------------- tags/openutils-testing-junit-1.1/pom.xml tags/openutils-testing-junit-1.1/src/main/java/it/openutils/testing/junit/DbUnitTestCase.java Copied: tags/openutils-testing-junit-1.1 (from rev 198, trunk/openutils-testing-junit) Deleted: tags/openutils-testing-junit-1.1/pom.xml =================================================================== --- trunk/openutils-testing-junit/pom.xml 2007-02-05 17:20:24 UTC (rev 198) +++ tags/openutils-testing-junit-1.1/pom.xml 2007-02-05 17:41:49 UTC (rev 203) @@ -1,60 +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>3</version> - <relativePath>..</relativePath> - </parent> - <artifactId>openutils-testing-junit</artifactId> - <name>openutils test utils (junit)</name> - <version>1.1-SNAPSHOT</version> - <description>openutils test utils</description> - <dependencies> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>1.0.1</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>2.0.1</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-context</artifactId> - <version>2.0.1</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-hibernate3</artifactId> - <version>2.0.1</version> - <optional>true</optional> - </dependency> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.2</version> - </dependency> - <dependency> - <groupId>org.dbunit</groupId> - <artifactId>dbunit</artifactId> - <version>2.2</version> - <optional>true</optional> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>3.8.1</version> - </dependency> - </dependencies> -</project> \ No newline at end of file Copied: tags/openutils-testing-junit-1.1/pom.xml (from rev 202, trunk/openutils-testing-junit/pom.xml) =================================================================== --- tags/openutils-testing-junit-1.1/pom.xml (rev 0) +++ tags/openutils-testing-junit-1.1/pom.xml 2007-02-05 17:41:49 UTC (rev 203) @@ -0,0 +1,64 @@ +<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>3</version> + <relativePath>..</relativePath> + </parent> + <artifactId>openutils-testing-junit</artifactId> + <name>openutils test utils (junit)</name> + <version>1.1</version> + <description>openutils test utils</description> + <dependencies> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.0.1</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>2.0.1</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>2.0.1</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-hibernate3</artifactId> + <version>2.0.1</version> + <optional>true</optional> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.2</version> + </dependency> + <dependency> + <groupId>org.dbunit</groupId> + <artifactId>dbunit</artifactId> + <version>2.2</version> + <optional>true</optional> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + </dependency> + </dependencies> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-junit-1.1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-junit-1.1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-testing-junit-1.1</url> + </scm> +</project> \ No newline at end of file Deleted: tags/openutils-testing-junit-1.1/src/main/java/it/openutils/testing/junit/DbUnitTestCase.java =================================================================== --- trunk/openutils-testing-junit/src/main/java/it/openutils/testing/junit/DbUnitTestCase.java 2007-02-05 17:20:24 UTC (rev 198) +++ tags/openutils-testing-junit-1.1/src/main/java/it/openutils/testing/junit/DbUnitTestCase.java 2007-02-05 17:41:49 UTC (rev 203) @@ -1,204 +0,0 @@ -/* - * Copyright 2005 Fabrizio Giustina. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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 java.io.InputStream; - -import javax.sql.DataSource; - -import org.apache.commons.lang.ClassUtils; -import org.dbunit.database.DatabaseConnection; -import org.dbunit.database.DatabaseSequenceFilter; -import org.dbunit.database.IDatabaseConnection; -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.filter.SequenceTableFilter; -import org.dbunit.dataset.xml.XmlDataSet; -import org.dbunit.ext.mssql.InsertIdentityOperation; -import org.dbunit.operation.DatabaseOperation; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.SessionFactoryUtils; - - -/** - * Base class for running DAO tests. - * @author fgiust - * @version $Revision $ ($Author $) - */ -public abstract class DbUnitTestCase extends SpringTestCase -{ - - /** - * Hibernate session factory. - */ - private SessionFactory sessionFactory; - - private static final String BASETEST_DELETE = "/_BaseDAOTest-delete.xml"; - - protected static IDataSet truncateDataSet; - - /** - * {@inheritDoc} - */ - @Override - protected void setUp() throws Exception - { - super.setUp(); - - // insert values - IDataSet dataSet = null; - - String datesetFileName = "/" + ClassUtils.getShortClassName(getClass()) + "-load.xml"; - InputStream testData = getClass().getResourceAsStream(datesetFileName); - - if (testData != null) - { - if (log.isDebugEnabled()) - { - log.debug("loading dataset {}", datesetFileName); - } - - dataSet = new XmlDataSet(testData); - } - else - { - // check for excel - datesetFileName = "/" + ClassUtils.getShortClassName(getClass()) + "-load.xls"; - testData = getClass().getResourceAsStream(datesetFileName); - - if (testData != null) - { - if (log.isDebugEnabled()) - { - log.debug("loading dataset {}", datesetFileName); - } - - dataSet = new XlsDataSet(testData); - } - } - - if (dataSet == null) - { - log.debug("No test data found with name [{}]", datesetFileName); - } - else - { - - DataSource dataSource = (DataSource) ctx.getBean("dataSource"); - IDatabaseConnection connection = new DatabaseConnection(dataSource.getConnection()); - - // truncate common tables - if (truncateDataSet == null) - { - log.debug("Generating sorted dataset for initial cleanup"); - IDataSet unsortedTruncateDataSet = connection.createDataSet(); - ITableFilter filter = new DatabaseSequenceFilter(connection); - truncateDataSet = new FilteredDataSet(filter, unsortedTruncateDataSet); - log.debug("Sorted dataset generated"); - } - - IDataSet orderedDataset = dataSet; - - // if a sorted dataset is available, use table sequence for sorting - if (truncateDataSet == null) - { - ITableFilter filter = new SequenceTableFilter(truncateDataSet.getTableNames()); - orderedDataset = new FilteredDataSet(filter, dataSet); - } - - try - { - if (truncateDataSet != null) - { - DatabaseOperation.DELETE_ALL.execute(connection, truncateDataSet); - } - if (dataSet != null) - { - InsertIdentityOperation.INSERT.execute(connection, orderedDataset); - } - } - finally - { - connection.close(); - } - } - - // mimic the Spring OpenSessionInViewFilter - this.sessionFactory = (SessionFactory) ctx.getBean("sessionFactory"); - - // SessionFactoryUtils.getSession(sessionFactory, true).setFlushMode(FlushMode.NEVER); - SessionFactoryUtils.initDeferredClose(this.sessionFactory); - - // @todo find a way to disable cache - // this.sessionFactory.openSession().setCacheMode(CacheMode.IGNORE); - } - - /** - * {@inheritDoc} - */ - @Override - protected void tearDown() throws Exception - { - // close open hibernate sessions, mimic the OpenSessionInViewFilter - SessionFactoryUtils.processDeferredClose(this.sessionFactory); - - // regenerate db initial state - String datesetFileName = "/initial-load.xml"; - InputStream testData = getClass().getResourceAsStream(datesetFileName); - - if (testData != null) - { - log.debug("Restoring db state"); - - IDataSet dataSet = new XmlDataSet(testData); - - DataSource dataSource = (DataSource) ctx.getBean("dataSource"); - IDatabaseConnection connection = new DatabaseConnection(dataSource.getConnection()); - - try - { - DatabaseOperation.CLEAN_INSERT.execute(connection, dataSet); - } - finally - { - connection.close(); - } - } - - super.tearDown(); - } - - /** - * Returns the full test name. - * @see junit.framework.TestCase#getName() - */ - @Override - public String getName() - { - return ClassUtils.getShortClassName(this.getClass()) + "::" + super.getName(); - } - - /** - * return the current Hibernate SessionFactory - * @return SessionFactory object - */ - public SessionFactory getSessionFactory() - { - return sessionFactory; - } -} \ No newline at end of file Copied: tags/openutils-testing-junit-1.1/src/main/java/it/openutils/testing/junit/DbUnitTestCase.java (from rev 201, trunk/openutils-testing-junit/src/main/java/it/openutils/testing/junit/DbUnitTestCase.java) =================================================================== --- tags/openutils-testing-junit-1.1/src/main/java/it/openutils/testing/junit/DbUnitTestCase.java (rev 0) +++ tags/openutils-testing-junit-1.1/src/main/java/it/openutils/testing/junit/DbUnitTestCase.java 2007-02-05 17:41:49 UTC (rev 203) @@ -0,0 +1,223 @@ +/* + * Copyright 2005 Fabrizio Giustina. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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 java.io.InputStream; +import java.util.Map; + +import javax.sql.DataSource; + +import org.apache.commons.lang.ClassUtils; +import org.dbunit.database.DatabaseConnection; +import org.dbunit.database.DatabaseSequenceFilter; +import org.dbunit.database.IDatabaseConnection; +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.filter.SequenceTableFilter; +import org.dbunit.dataset.xml.XmlDataSet; +import org.dbunit.ext.mssql.InsertIdentityOperation; +import org.dbunit.operation.DatabaseOperation; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.SessionFactoryUtils; + + +/** + * Base class for running DAO tests. + * @author fgiust + * @version $Revision $ ($Author $) + */ +public abstract class DbUnitTestCase extends SpringTestCase +{ + + /** + * Hibernate session factory. + */ + private SessionFactory sessionFactory; + + private static final String BASETEST_DELETE = "/_BaseDAOTest-delete.xml"; + + protected static IDataSet truncateDataSet; + + /** + * Should use deferred close emulating the spring OpenSessionInView filter? Default is <code>true</code> + * @return <code>true</code> if deferred close should be used + */ + protected boolean mimicSessionFilter() + { + return true; + } + + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + @Override + protected void setUp() throws Exception + { + super.setUp(); + + // insert values + IDataSet dataSet = null; + + String datesetFileName = "/" + ClassUtils.getShortClassName(getClass()) + "-load.xml"; + InputStream testData = getClass().getResourceAsStream(datesetFileName); + + if (testData != null) + { + if (log.isDebugEnabled()) + { + log.debug("loading dataset {}", datesetFileName); + } + + dataSet = new XmlDataSet(testData); + } + else + { + // check for excel + datesetFileName = "/" + ClassUtils.getShortClassName(getClass()) + "-load.xls"; + testData = getClass().getResourceAsStream(datesetFileName); + + if (testData != null) + { + if (log.isDebugEnabled()) + { + log.debug("loading dataset {}", datesetFileName); + } + + dataSet = new XlsDataSet(testData); + } + } + + if (dataSet == null) + { + log.debug("No test data found with name [{}]", datesetFileName); + } + else + { + + DataSource dataSource = (DataSource) ctx.getBean("dataSource"); + IDatabaseConnection connection = new DatabaseConnection(dataSource.getConnection()); + + // truncate common tables + if (truncateDataSet == null) + { + log.debug("Generating sorted dataset for initial cleanup"); + IDataSet unsortedTruncateDataSet = connection.createDataSet(); + ITableFilter filter = new DatabaseSequenceFilter(connection); + truncateDataSet = new FilteredDataSet(filter, unsortedTruncateDataSet); + log.debug("Sorted dataset generated"); + } + + IDataSet orderedDataset = dataSet; + + // if a sorted dataset is available, use table sequence for sorting + if (truncateDataSet == null) + { + ITableFilter filter = new SequenceTableFilter(truncateDataSet.getTableNames()); + orderedDataset = new FilteredDataSet(filter, dataSet); + } + + try + { + if (truncateDataSet != null) + { + DatabaseOperation.DELETE_ALL.execute(connection, truncateDataSet); + } + if (dataSet != null) + { + InsertIdentityOperation.INSERT.execute(connection, orderedDataset); + } + } + finally + { + connection.close(); + } + } + + // mimic the Spring OpenSessionInViewFilter + if (mimicSessionFilter()) + { + Map<String, SessionFactory> sfbeans = ctx.getBeansOfType(SessionFactory.class); + if (sfbeans.isEmpty()) + { + fail("No bean of type org.hibernate.SessionFactory found in spring context"); + } + this.sessionFactory = sfbeans.get(sfbeans.keySet().iterator().next()); + + SessionFactoryUtils.initDeferredClose(this.sessionFactory); + } + + } + + /** + * {@inheritDoc} + */ + @Override + protected void tearDown() throws Exception + { + if (mimicSessionFilter()) + { + // close open hibernate sessions, mimic the OpenSessionInViewFilter + SessionFactoryUtils.processDeferredClose(this.sessionFactory); + } + + // regenerate db initial state + String datesetFileName = "/initial-load.xml"; + InputStream testData = getClass().getResourceAsStream(datesetFileName); + + if (testData != null) + { + log.debug("Restoring db state"); + + IDataSet dataSet = new XmlDataSet(testData); + + DataSource dataSource = (DataSource) ctx.getBean("dataSource"); + IDatabaseConnection connection = new DatabaseConnection(dataSource.getConnection()); + + try + { + DatabaseOperation.CLEAN_INSERT.execute(connection, dataSet); + } + finally + { + connection.close(); + } + } + + super.tearDown(); + } + + /** + * Returns the full test name. + * @see junit.framework.TestCase#getName() + */ + @Override + public String getName() + { + return ClassUtils.getShortClassName(this.getClass()) + "::" + super.getName(); + } + + /** + * return the current Hibernate SessionFactory + * @return SessionFactory object + */ + protected SessionFactory getSessionFactory() + { + return sessionFactory; + } +} \ 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...> - 2007-02-05 17:41:29
|
Revision: 202 http://svn.sourceforge.net/openutils/?rev=202&view=rev Author: fgiust Date: 2007-02-05 09:41:28 -0800 (Mon, 05 Feb 2007) Log Message: ----------- [maven-release-plugin] prepare release openutils-testing-junit-1.1 Modified Paths: -------------- trunk/openutils-testing-junit/pom.xml Modified: trunk/openutils-testing-junit/pom.xml =================================================================== --- trunk/openutils-testing-junit/pom.xml 2007-02-05 17:40:35 UTC (rev 201) +++ trunk/openutils-testing-junit/pom.xml 2007-02-05 17:41:28 UTC (rev 202) @@ -1,6 +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> @@ -10,7 +8,7 @@ </parent> <artifactId>openutils-testing-junit</artifactId> <name>openutils test utils (junit)</name> - <version>1.1-SNAPSHOT</version> + <version>1.1</version> <description>openutils test utils</description> <dependencies> <dependency> @@ -57,4 +55,10 @@ <version>3.8.1</version> </dependency> </dependencies> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-junit-1.1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-testing-junit-1.1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-testing-junit-1.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...> - 2007-02-05 17:40:46
|
Revision: 201 http://svn.sourceforge.net/openutils/?rev=201&view=rev Author: fgiust Date: 2007-02-05 09:40:35 -0800 (Mon, 05 Feb 2007) Log Message: ----------- configurable deferred close Modified Paths: -------------- trunk/openutils-testing-junit/src/main/java/it/openutils/testing/junit/DbUnitTestCase.java trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/DbUnitTestCase.java Property Changed: ---------------- trunk/openutils-testing-testng/ Modified: trunk/openutils-testing-junit/src/main/java/it/openutils/testing/junit/DbUnitTestCase.java =================================================================== --- trunk/openutils-testing-junit/src/main/java/it/openutils/testing/junit/DbUnitTestCase.java 2007-02-05 17:23:33 UTC (rev 200) +++ trunk/openutils-testing-junit/src/main/java/it/openutils/testing/junit/DbUnitTestCase.java 2007-02-05 17:40:35 UTC (rev 201) @@ -16,6 +16,7 @@ package it.openutils.testing.junit; import java.io.InputStream; +import java.util.Map; import javax.sql.DataSource; @@ -53,8 +54,18 @@ protected static IDataSet truncateDataSet; /** + * Should use deferred close emulating the spring OpenSessionInView filter? Default is <code>true</code> + * @return <code>true</code> if deferred close should be used + */ + protected boolean mimicSessionFilter() + { + return true; + } + + /** * {@inheritDoc} */ + @SuppressWarnings("unchecked") @Override protected void setUp() throws Exception { @@ -139,13 +150,18 @@ } // mimic the Spring OpenSessionInViewFilter - this.sessionFactory = (SessionFactory) ctx.getBean("sessionFactory"); + if (mimicSessionFilter()) + { + Map<String, SessionFactory> sfbeans = ctx.getBeansOfType(SessionFactory.class); + if (sfbeans.isEmpty()) + { + fail("No bean of type org.hibernate.SessionFactory found in spring context"); + } + this.sessionFactory = sfbeans.get(sfbeans.keySet().iterator().next()); - // SessionFactoryUtils.getSession(sessionFactory, true).setFlushMode(FlushMode.NEVER); - SessionFactoryUtils.initDeferredClose(this.sessionFactory); + SessionFactoryUtils.initDeferredClose(this.sessionFactory); + } - // @todo find a way to disable cache - // this.sessionFactory.openSession().setCacheMode(CacheMode.IGNORE); } /** @@ -154,8 +170,11 @@ @Override protected void tearDown() throws Exception { - // close open hibernate sessions, mimic the OpenSessionInViewFilter - SessionFactoryUtils.processDeferredClose(this.sessionFactory); + if (mimicSessionFilter()) + { + // close open hibernate sessions, mimic the OpenSessionInViewFilter + SessionFactoryUtils.processDeferredClose(this.sessionFactory); + } // regenerate db initial state String datesetFileName = "/initial-load.xml"; @@ -197,7 +216,7 @@ * return the current Hibernate SessionFactory * @return SessionFactory object */ - public SessionFactory getSessionFactory() + protected SessionFactory getSessionFactory() { return sessionFactory; } Property changes on: trunk/openutils-testing-testng ___________________________________________________________________ Name: svn:ignore - .checkstyle + .checkstyle target Modified: trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/DbUnitTestCase.java =================================================================== --- trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/DbUnitTestCase.java 2007-02-05 17:23:33 UTC (rev 200) +++ trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/DbUnitTestCase.java 2007-02-05 17:40:35 UTC (rev 201) @@ -22,6 +22,7 @@ import java.io.OutputStream; import java.sql.SQLException; import java.text.MessageFormat; +import java.util.Map; import javax.sql.DataSource; @@ -41,6 +42,9 @@ import org.dbunit.dataset.filter.SequenceTableFilter; import org.dbunit.dataset.xml.XmlDataSet; import org.dbunit.operation.DatabaseOperation; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.SessionFactoryUtils; +import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -68,6 +72,11 @@ protected static IDataSet truncateDataSet; /** + * Hibernate session factory. + */ + private SessionFactory sessionFactory; + + /** * Optional schema (needed for ORACLE). * @return <code>null</code> */ @@ -77,12 +86,35 @@ } /** + * Should use deferred close emulating the spring OpenSessionInView filter? Default is <code>true</code> + * @return <code>true</code> if deferred close should be used + */ + protected boolean mimicSessionFilter() + { + return true; + } + + /** * Setup the Database before running the test method. * @throws Exception Any exception. */ + @SuppressWarnings("unchecked") @BeforeMethod protected void setUpDbUnit() throws Exception { + // mimic the Spring OpenSessionInViewFilter + if (mimicSessionFilter()) + { + Map<String, SessionFactory> sfbeans = ctx.getBeansOfType(SessionFactory.class); + if (sfbeans.isEmpty()) + { + Assert.fail("No bean of type org.hibernate.SessionFactory found in spring context"); + } + this.sessionFactory = sfbeans.get(sfbeans.keySet().iterator().next()); + + SessionFactoryUtils.initDeferredClose(this.sessionFactory); + } + // check for xml IDataSet dataSet = loadDataSet(getDataFileName("xml")); @@ -128,6 +160,11 @@ @AfterMethod protected void tearDownDbUnit() throws Exception { + if (mimicSessionFilter()) + { + // close open hibernate sessions, mimic the OpenSessionInViewFilter + SessionFactoryUtils.processDeferredClose(this.sessionFactory); + } // regenerate db initial state String datesetFileName = "/initial-load.xml"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2007-02-05 17:23:32
|
Revision: 200 http://svn.sourceforge.net/openutils/?rev=200&view=rev Author: fgiust Date: 2007-02-05 09:23:33 -0800 (Mon, 05 Feb 2007) Log Message: ----------- rename configuration module to configuration-services Modified Paths: -------------- trunk/openutils-configuration-services/pom.xml trunk/pom.xml Added Paths: ----------- trunk/openutils-configuration-services/ Removed Paths: ------------- trunk/openutils-configuration/ Property Changed: ---------------- trunk/openutils-testing-testng/ Copied: trunk/openutils-configuration-services (from rev 198, trunk/openutils-configuration) Modified: trunk/openutils-configuration-services/pom.xml =================================================================== --- trunk/openutils-configuration/pom.xml 2007-02-05 17:20:24 UTC (rev 198) +++ trunk/openutils-configuration-services/pom.xml 2007-02-05 17:23:33 UTC (rev 200) @@ -8,11 +8,11 @@ <relativePath>..</relativePath> </parent> <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils-configuration</artifactId> + <artifactId>openutils-configuration-services</artifactId> <packaging>jar</packaging> <name>openutils-configuration</name> <version>1.0-SNAPSHOT</version> - <description>Configuration classes</description> + <description>Configuration services</description> <dependencies> <dependency> <groupId>net.sourceforge.openutils</groupId> @@ -80,9 +80,9 @@ <scope>test</scope> </dependency> <dependency> - <groupId>dbunit</groupId> + <groupId>org.dbunit</groupId> <artifactId>dbunit</artifactId> - <version>2.1</version> + <version>2.2</version> <scope>test</scope> </dependency> <dependency> Property changes on: trunk/openutils-testing-testng ___________________________________________________________________ Name: svn:ignore + .checkstyle Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2007-02-05 17:22:02 UTC (rev 199) +++ trunk/pom.xml 2007-02-05 17:23:33 UTC (rev 200) @@ -157,6 +157,6 @@ <module>openutils-dbmigration</module> <module>openutils-backup</module> <module>openutils-configuration-dataobjects</module> - <module>openutils-configuration</module> + <module>openutils-configuration-services</module> </modules> </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fc...@us...> - 2007-02-05 17:22:18
|
Revision: 199 http://svn.sourceforge.net/openutils/?rev=199&view=rev Author: fcarone Date: 2007-02-05 09:22:02 -0800 (Mon, 05 Feb 2007) Log Message: ----------- Handle integer values and empty cells correctly Modified Paths: -------------- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/ExcelConfigurationTask.java Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/ExcelConfigurationTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/ExcelConfigurationTask.java 2007-02-05 17:20:24 UTC (rev 198) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/ExcelConfigurationTask.java 2007-02-05 17:22:02 UTC (rev 199) @@ -3,7 +3,6 @@ */ package it.openutils.migration.task.setup; - import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; @@ -163,30 +162,46 @@ for (short k = 0; k < columns.size() && k <= row.getLastCellNum(); k++) { HSSFCell cell = row.getCell(k); + String value = null; + if (cell == null) { - return; + value = StringUtils.EMPTY; } - - String value = null; - if (cell.getCellType() == HSSFCell.CELL_TYPE_STRING) + else if (cell.getCellType() == HSSFCell.CELL_TYPE_STRING) { value = cell.getStringCellValue(); } else if (cell.getCellType() == HSSFCell.CELL_TYPE_NUMERIC) { double valueDouble = cell.getNumericCellValue(); - value = Double.toString(valueDouble); + // when need to really check if it is a double or an int + double fraction = valueDouble % 1; + if (fraction == 0) + { + value = Integer.toString((int) valueDouble); + } + else + { + value = Double.toString(valueDouble); + } } if (StringUtils.isEmpty(value)) { - return; + value = StringUtils.EMPTY; } values.add(value); } Object[] checkParams = ArrayUtils.subarray(values.toArray(), 0, checkNum); + for (int i = 0; i < checkParams.length; i++) + { + if (StringUtils.isEmpty((String) checkParams[i])) + { + return; + } + } int existing; try This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2007-02-05 17:20:29
|
Revision: 198 http://svn.sourceforge.net/openutils/?rev=198&view=rev Author: fgiust Date: 2007-02-05 09:20:24 -0800 (Mon, 05 Feb 2007) Log Message: ----------- move testng implementation Added Paths: ----------- trunk/openutils-testing-testng/src/main/java/it/ trunk/openutils-testing-testng/src/main/java/it/openutils/ trunk/openutils-testing-testng/src/main/java/it/openutils/testing/ trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng/ Removed Paths: ------------- trunk/openutils-testing-junit/src/main/java/it/openutils/testing/testng/ Copied: trunk/openutils-testing-testng/src/main/java/it/openutils/testing/testng (from rev 197, trunk/openutils-testing-junit/src/main/java/it/openutils/testing/testng) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2007-02-05 17:19:17
|
Revision: 197 http://svn.sourceforge.net/openutils/?rev=197&view=rev Author: fgiust Date: 2007-02-05 09:18:55 -0800 (Mon, 05 Feb 2007) Log Message: ----------- testing module splitted Modified Paths: -------------- trunk/openutils-testing-junit/pom.xml trunk/pom.xml Added Paths: ----------- trunk/openutils-testing-junit/ trunk/openutils-testing-testng/ trunk/openutils-testing-testng/pom.xml trunk/openutils-testing-testng/src/ trunk/openutils-testing-testng/src/main/ trunk/openutils-testing-testng/src/main/java/ Removed Paths: ------------- trunk/openutils-testing/ Property Changed: ---------------- trunk/openutils-configuration/ Property changes on: trunk/openutils-configuration ___________________________________________________________________ Name: svn:ignore - .settings target .checkstyle .classpath .project + .settings target .checkstyle .classpath .project derby.log Copied: trunk/openutils-testing-junit (from rev 195, trunk/openutils-testing) Modified: trunk/openutils-testing-junit/pom.xml =================================================================== --- trunk/openutils-testing/pom.xml 2007-02-05 08:27:20 UTC (rev 195) +++ trunk/openutils-testing-junit/pom.xml 2007-02-05 17:18:55 UTC (rev 197) @@ -8,8 +8,8 @@ <version>3</version> <relativePath>..</relativePath> </parent> - <artifactId>openutils-testing</artifactId> - <name>openutils test utils</name> + <artifactId>openutils-testing-junit</artifactId> + <name>openutils test utils (junit)</name> <version>1.1-SNAPSHOT</version> <description>openutils test utils</description> <dependencies> @@ -46,23 +46,15 @@ <version>2.2</version> </dependency> <dependency> - <groupId>dbunit</groupId> + <groupId>org.dbunit</groupId> <artifactId>dbunit</artifactId> - <version>2.1</version> + <version>2.2</version> <optional>true</optional> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> - <optional>true</optional> </dependency> - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <classifier>jdk15</classifier> - <version>5.1</version> - <optional>true</optional> - </dependency> </dependencies> </project> \ No newline at end of file Added: trunk/openutils-testing-testng/pom.xml =================================================================== --- trunk/openutils-testing-testng/pom.xml (rev 0) +++ trunk/openutils-testing-testng/pom.xml 2007-02-05 17:18:55 UTC (rev 197) @@ -0,0 +1,61 @@ +<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>3</version> + <relativePath>..</relativePath> + </parent> + <artifactId>openutils-testing-testng</artifactId> + <name>openutils test utils (testng)</name> + <version>1.1-SNAPSHOT</version> + <description>openutils test utils</description> + <dependencies> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.0.1</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>2.0.1</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>2.0.1</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-hibernate3</artifactId> + <version>2.0.1</version> + <optional>true</optional> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.2</version> + </dependency> + <dependency> + <groupId>org.dbunit</groupId> + <artifactId>dbunit</artifactId> + <version>2.2</version> + <optional>true</optional> + </dependency> + <dependency> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + <classifier>jdk15</classifier> + <version>5.1</version> + </dependency> + </dependencies> +</project> \ No newline at end of file Property changes on: trunk/openutils-testing-testng/pom.xml ___________________________________________________________________ Name: svn:mime-type + text/xml Name: svn:eol-style + native Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2007-02-05 15:10:48 UTC (rev 196) +++ trunk/pom.xml 2007-02-05 17:18:55 UTC (rev 197) @@ -150,7 +150,8 @@ <module>openutils-spring</module> <module>openutils-usermanagement-dataobjects</module> <module>openutils-usermanagement</module> - <module>openutils-testing</module> + <module>openutils-testing-testng</module> + <module>openutils-testing-junit</module> <module>openutils-web</module> <module>openutils-tags-spring</module> <module>openutils-dbmigration</module> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fc...@us...> - 2007-02-05 15:10:49
|
Revision: 196 http://svn.sourceforge.net/openutils/?rev=196&view=rev Author: fcarone Date: 2007-02-05 07:10:48 -0800 (Mon, 05 Feb 2007) Log Message: ----------- dao uri fixed. Modified Paths: -------------- trunk/openutils-tags-spring/src/main/resources/META-INF/tags/ou/select.tag Modified: trunk/openutils-tags-spring/src/main/resources/META-INF/tags/ou/select.tag =================================================================== --- trunk/openutils-tags-spring/src/main/resources/META-INF/tags/ou/select.tag 2007-02-05 08:27:20 UTC (rev 195) +++ trunk/openutils-tags-spring/src/main/resources/META-INF/tags/ou/select.tag 2007-02-05 15:10:48 UTC (rev 196) @@ -1,7 +1,7 @@ <jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:spring="http://www.springframework.org/tags" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fmt="http://java.sun.com/jsp/jstl/fmt" xmlns:su="http://openutils.sourceforge.net/openutils-tags-commonslang" xmlns:elx="http://openutils.sourceforge.net/openutils-tags-elx" - xmlns:ou="http://openutils.sourceforge.net/openutils-tags-spring" xmlns:dao="urn:jsptld:dao"> + xmlns:ou="http://openutils.sourceforge.net/openutils-tags-spring" xmlns:dao="http://openutils.sourceforge.net/openutils-tags-dao"> <jsp:directive.attribute name="path" required="true" /> <jsp:directive.attribute name="name" required="false" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fc...@us...> - 2007-02-05 08:27:28
|
Revision: 195 http://svn.sourceforge.net/openutils/?rev=195&view=rev Author: fcarone Date: 2007-02-05 00:27:20 -0800 (Mon, 05 Feb 2007) Log Message: ----------- DateAssert added to testng.utils Added Paths: ----------- trunk/openutils-testing/src/main/java/it/openutils/testing/testng/utils/ trunk/openutils-testing/src/main/java/it/openutils/testing/testng/utils/DateAssert.java Added: trunk/openutils-testing/src/main/java/it/openutils/testing/testng/utils/DateAssert.java =================================================================== --- trunk/openutils-testing/src/main/java/it/openutils/testing/testng/utils/DateAssert.java (rev 0) +++ trunk/openutils-testing/src/main/java/it/openutils/testing/testng/utils/DateAssert.java 2007-02-05 08:27:20 UTC (rev 195) @@ -0,0 +1,103 @@ +/* + * Copyright (c) Openmind. All rights reserved. http://www.openmindonline.it + */ +package it.openutils.testing.testng.utils; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; + +import org.testng.Assert; + + +/** + * Utility methods for checking dates in unit tests. + * @author fgiust + * @version $Id$ + */ +public final class DateAssert +{ + + private static DateFormat df = new SimpleDateFormat("yyyyMMdd"); + + private static DateFormat dtf = new SimpleDateFormat("yyyyMMdd HH:mm"); + + /** + * Don't instantiate. + */ + private DateAssert() + { + // unused + } + + /** + * Asserts that two dates are equal. + * @param expectedDateAsString date formatted as "YYYYMMDD" + * @param date actual date + * @throws IllegalArgumentException if <code>expectedDateAsString</code> is not a valid date format + */ + public static void dateEqual(String expectedDateAsString, Calendar date) throws IllegalArgumentException + { + Date expected; + + try + { + expected = df.parse(expectedDateAsString); + } + catch (ParseException e) + { + throw new IllegalArgumentException("Unparseable date String: [" + expectedDateAsString + "]"); + } + + if (date == null) + { + throw new AssertionError("Date is null"); + } + + Assert.assertEquals(date.getTime(), expected); + } + + /** + * Asserts that two dates are equal. + * @param expectedDateAsString date formatted as "yyyyMMdd HH:mm" + * @param date actual date + * @throws IllegalArgumentException if <code>expectedDateAsString</code> is not a valid date format + */ + public static void dateTimeEqual(String expectedDateAsString, Date date) throws IllegalArgumentException + { + Date expected; + + try + { + expected = dtf.parse(expectedDateAsString); + } + catch (ParseException e) + { + throw new IllegalArgumentException("Unparseable date String: [" + expectedDateAsString + "]"); + } + + if (date == null) + { + throw new AssertionError("Date is null"); + } + + if (date.getTime() != expected.getTime()) + { + throw new AssertionError("Expected <" + expected + ">, actual <" + date + ">"); + } + } + + /** + * Asserts that two dates are equal. + * @param expectedDateAsString date formatted as "yyyyMMdd HH:mm" + * @param date actual date + * @throws IllegalArgumentException if <code>expectedDateAsString</code> is not a valid date format + */ + public static void dateTimeEqual(String expectedDateAsString, Calendar date) throws IllegalArgumentException + { + dateTimeEqual(expectedDateAsString, date.getTime()); + } + +} Property changes on: trunk/openutils-testing/src/main/java/it/openutils/testing/testng/utils/DateAssert.java ___________________________________________________________________ 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...> - 2007-02-02 09:48:18
|
Revision: 194 http://svn.sourceforge.net/openutils/?rev=194&view=rev Author: fcarone Date: 2007-02-02 01:48:16 -0800 (Fri, 02 Feb 2007) Log Message: ----------- id svn:keyword. Modified Paths: -------------- trunk/openutils-spring/src/main/java/it/openutils/spring/editors/GenericSetPropertyEditor.java trunk/openutils-spring/src/main/java/it/openutils/spring/editors/GenericSinglePropertyEditor.java Property Changed: ---------------- trunk/openutils-spring/src/main/java/it/openutils/spring/editors/GenericSetPropertyEditor.java trunk/openutils-spring/src/main/java/it/openutils/spring/editors/GenericSinglePropertyEditor.java Modified: trunk/openutils-spring/src/main/java/it/openutils/spring/editors/GenericSetPropertyEditor.java =================================================================== --- trunk/openutils-spring/src/main/java/it/openutils/spring/editors/GenericSetPropertyEditor.java 2007-02-02 09:26:44 UTC (rev 193) +++ trunk/openutils-spring/src/main/java/it/openutils/spring/editors/GenericSetPropertyEditor.java 2007-02-02 09:48:16 UTC (rev 194) @@ -14,7 +14,7 @@ /** * @author fgiust - * @version $Id: $ + * @version $Id$ */ public class GenericSetPropertyEditor<T> extends PropertyEditorSupport { Property changes on: trunk/openutils-spring/src/main/java/it/openutils/spring/editors/GenericSetPropertyEditor.java ___________________________________________________________________ Name: svn:keywords + Id Modified: trunk/openutils-spring/src/main/java/it/openutils/spring/editors/GenericSinglePropertyEditor.java =================================================================== --- trunk/openutils-spring/src/main/java/it/openutils/spring/editors/GenericSinglePropertyEditor.java 2007-02-02 09:26:44 UTC (rev 193) +++ trunk/openutils-spring/src/main/java/it/openutils/spring/editors/GenericSinglePropertyEditor.java 2007-02-02 09:48:16 UTC (rev 194) @@ -11,7 +11,7 @@ /** * @author fgiust - * @version $Revision$ ($Author$) + * @version $Id$ */ public class GenericSinglePropertyEditor<T> extends PropertyEditorSupport { Property changes on: trunk/openutils-spring/src/main/java/it/openutils/spring/editors/GenericSinglePropertyEditor.java ___________________________________________________________________ Name: svn:keywords + Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fc...@us...> - 2007-02-02 09:26:47
|
Revision: 193 http://svn.sourceforge.net/openutils/?rev=193&view=rev Author: fcarone Date: 2007-02-02 01:26:44 -0800 (Fri, 02 Feb 2007) Log Message: ----------- id svn:keyword. Property Changed: ---------------- trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAO.java Property changes on: trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAO.java ___________________________________________________________________ Name: svn:keywords + Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fc...@us...> - 2007-02-02 09:23:35
|
Revision: 192 http://svn.sourceforge.net/openutils/?rev=192&view=rev Author: fcarone Date: 2007-02-02 01:23:36 -0800 (Fri, 02 Feb 2007) Log Message: ----------- More javadocs. Modified Paths: -------------- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/GenericScriptBasedConditionalTask.java Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/GenericScriptBasedConditionalTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/GenericScriptBasedConditionalTask.java 2007-02-02 09:19:59 UTC (rev 191) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/GenericScriptBasedConditionalTask.java 2007-02-02 09:23:36 UTC (rev 192) @@ -29,6 +29,9 @@ */ private static Logger log = LoggerFactory.getLogger(GenericScriptBasedConditionalTask.class); + /** + * Script list to execute + */ protected List<Resource> scripts; private String check; @@ -51,6 +54,10 @@ this.check = check; } + /** + * @param script The script resource + * @return The script name + */ protected String objectNameFromFileName(Resource script) { return StringUtils.substringBeforeLast(script.getFilename(), "."); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fc...@us...> - 2007-02-02 09:20:12
|
Revision: 191 http://svn.sourceforge.net/openutils/?rev=191&view=rev Author: fcarone Date: 2007-02-02 01:19:59 -0800 (Fri, 02 Feb 2007) Log Message: ----------- Comments and refactoring. Modified Paths: -------------- trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAO.java trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java Property Changed: ---------------- trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java Modified: trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAO.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAO.java 2007-02-02 09:14:00 UTC (rev 190) +++ trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAO.java 2007-02-02 09:19:59 UTC (rev 191) @@ -13,6 +13,8 @@ /** * @author Fabrizio Giustina * @version $Id$ + * @param <T> Persistence class + * @param <K> Object Key */ public interface HibernateDAO<T extends Object, K extends Serializable> { @@ -91,8 +93,9 @@ List<T> findFiltered(final T filter, final int maxResults, final int page); /** - * Return all objects related to the implementation of this DAO filtered using properties of the provided instance. + * Return all objects related to the implementation of this DAO filtered using properties of the provided instance. * @param filter an instance of the object with the properties you whish to filter on. + * @param metadata filter metadata * @param maxResults maximum number of results * @param page result page (first result is maxResults * page) * @return list of objects @@ -102,6 +105,8 @@ /** * Return all objects related to the implementation of this DAO filtered using properties of the provided instance. * @param filter an instance of the object with the properties you whish to filter on. + * @param customOrder order criterias + * @param metadata filter metadata * @param maxResults maximum number of results * @param page result page (first result is maxResults * page) * @return list of objects @@ -127,6 +132,7 @@ /** * Return all objects related to the implementation of this DAO filtered using properties of the provided instance. * @param filter an instance of the object with the properties you whish to filter on. + * @param metadata filter metadata * @return list of objects */ List<T> findFiltered(final T filter, Map<String, FilterMetadata> metadata); @@ -144,6 +150,7 @@ * argument may be an instance associated with the receiving Session or a transient instance with an identifier * associated with existing persistent state. * @param key key + * @return true if the object was successfully deleted, false otherwise */ boolean delete(final K key); Modified: trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java 2007-02-02 09:14:00 UTC (rev 190) +++ trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java 2007-02-02 09:19:59 UTC (rev 191) @@ -26,7 +26,7 @@ /** * Base Hibernate DAO. * @author Fabrizio Giustina - * @version $Id: $ + * @version $Id$ * @param <T> Persistence class * @param <K> Object Key */ @@ -36,6 +36,81 @@ { /** + * @author carone + * @version $Id$ + */ + private final class HibernateCallbackForExecution implements HibernateCallback + { + + /** + * + */ + private final T filter; + + /** + * + */ + private final int page; + + /** + * + */ + private final int maxResults; + + /** + * + */ + private final Map<String, FilterMetadata> metadata; + + /** + * + */ + private final Order[] orderProperties; + + /** + * @param filter + * @param page + * @param maxResults + * @param metadata + * @param orderProperties + */ + private HibernateCallbackForExecution( + T filter, + int page, + int maxResults, + Map<String, FilterMetadata> metadata, + Order[] orderProperties) + { + this.filter = filter; + this.page = page; + this.maxResults = maxResults; + this.metadata = metadata; + this.orderProperties = orderProperties; + } + + public Object doInHibernate(Session ses) throws HibernateException + { + Criteria crit = ses.createCriteria(filter.getClass()); + crit.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); + crit.setMaxResults(maxResults); + crit.setFirstResult(maxResults * page); + + if (orderProperties != null && orderProperties.length > 0) + { + for (Order order : orderProperties) + { + if (order != null) + { + crit.addOrder(order); + } + } + } + EnhancedExample.create(crit, filter, metadata); + return crit.list(); + } + } + + /** * {@inheritDoc} */ @SuppressWarnings("unchecked") @@ -270,30 +345,8 @@ final Order[] orderProperties = customOrder != null && customOrder.length > 0 ? customOrder : this .getDefaultOrder(); - return (List<T>) getHibernateTemplate().execute(new HibernateCallback() - { - - public Object doInHibernate(Session ses) throws HibernateException - { - Criteria crit = ses.createCriteria(filter.getClass()); - crit.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); - crit.setMaxResults(maxResults); - crit.setFirstResult(maxResults * page); - - if (orderProperties != null && orderProperties.length > 0) - { - for (Order order : orderProperties) - { - if (order != null) - { - crit.addOrder(order); - } - } - } - EnhancedExample.create(crit, filter, metadata); - return crit.list(); - } - }); + return (List<T>) getHibernateTemplate().execute( + new HibernateCallbackForExecution(filter, page, maxResults, metadata, orderProperties)); } /** Property changes on: trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java ___________________________________________________________________ Name: svn:keywords + Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fc...@us...> - 2007-02-02 09:13:59
|
Revision: 190 http://svn.sourceforge.net/openutils/?rev=190&view=rev Author: fcarone Date: 2007-02-02 01:14:00 -0800 (Fri, 02 Feb 2007) Log Message: ----------- Removed unused variable Modified Paths: -------------- trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java Modified: trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java =================================================================== --- trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java 2007-02-02 08:58:20 UTC (rev 189) +++ trunk/openutils-bshd5/src/main/java/it/openutils/dao/hibernate/HibernateDAOImpl.java 2007-02-02 09:14:00 UTC (rev 190) @@ -18,8 +18,6 @@ import org.hibernate.criterion.CriteriaSpecification; import org.hibernate.criterion.Order; import org.hibernate.type.Type; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.orm.hibernate3.HibernateCallback; import org.springframework.orm.hibernate3.HibernateObjectRetrievalFailureException; import org.springframework.orm.hibernate3.support.HibernateDaoSupport; @@ -38,11 +36,6 @@ { /** - * Logger. - */ - private static Logger log = LoggerFactory.getLogger(HibernateDAOImpl.class); - - /** * {@inheritDoc} */ @SuppressWarnings("unchecked") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |