You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
(387) |
May
(1066) |
Jun
(689) |
Jul
(504) |
Aug
(697) |
Sep
(660) |
Oct
(591) |
Nov
(393) |
Dec
(324) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(567) |
Feb
(448) |
Mar
(461) |
Apr
(368) |
May
(887) |
Jun
(243) |
Jul
(429) |
Aug
(670) |
Sep
(648) |
Oct
(684) |
Nov
(599) |
Dec
(317) |
2008 |
Jan
(388) |
Feb
(400) |
Mar
(323) |
Apr
(214) |
May
(228) |
Jun
(120) |
Jul
(168) |
Aug
(64) |
Sep
(78) |
Oct
(127) |
Nov
(28) |
Dec
|
2009 |
Jan
|
Feb
(1) |
Mar
(22) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Juergen H. <jho...@us...> - 2008-09-17 10:21:07
|
Update of /cvsroot/springframework/spring/lib In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv32533/lib Modified Files: readme.txt Log Message: updated to TestNG 5.8 and Tiles 2.0.6 Index: readme.txt =================================================================== RCS file: /cvsroot/springframework/spring/lib/readme.txt,v retrieving revision 1.212 retrieving revision 1.213 diff -C2 -d -r1.212 -r1.213 *** readme.txt 17 Sep 2008 16:36:31 -0000 1.212 --- readme.txt 17 Sep 2008 17:21:02 -0000 1.213 *************** *** 374,383 **** - required for running JPetStore's Struts web tier ! * testng/testng-5.7-jdk15.jar ! - TestNG 5.7 (http://testng.org) - required for building and running the framework's test suite ! * tiles/tiles-api-2.0.5.jar, tiles/tiles-core-2.0.5.jar, tiles/tiles-jsp-2.0.5.jar ! - Apache Tiles 2.0.5 (http://tiles.apache.org) - required for building the framework - required at runtime when using the Tiles2 TilesView --- 374,383 ---- - required for running JPetStore's Struts web tier ! * testng/testng-5.8-jdk15.jar ! - TestNG 5.8 (http://testng.org) - required for building and running the framework's test suite ! * tiles/tiles-api-2.0.6.jar, tiles/tiles-core-2.0.6.jar, tiles/tiles-jsp-2.0.6.jar ! - Apache Tiles 2.0.6 (http://tiles.apache.org) - required for building the framework - required at runtime when using the Tiles2 TilesView |
From: Juergen H. <jho...@us...> - 2008-09-17 10:21:07
|
Update of /cvsroot/springframework/spring/lib/testng In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv32533/lib/testng Added Files: testng-5.8-jdk15.jar Removed Files: testng-5.7-jdk15.jar Log Message: updated to TestNG 5.8 and Tiles 2.0.6 --- NEW FILE: testng-5.8-jdk15.jar --- (This appears to be a binary file; contents omitted.) --- testng-5.7-jdk15.jar DELETED --- |
From: Juergen H. <jho...@us...> - 2008-09-17 10:21:06
|
Update of /cvsroot/springframework/spring In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv32533 Modified Files: .classpath project.properties Log Message: updated to TestNG 5.8 and Tiles 2.0.6 Index: .classpath =================================================================== RCS file: /cvsroot/springframework/spring/.classpath,v retrieving revision 1.229 retrieving revision 1.230 diff -C2 -d -r1.229 -r1.230 *** .classpath 17 Sep 2008 16:36:31 -0000 1.229 --- .classpath 17 Sep 2008 17:21:02 -0000 1.230 *************** *** 30,34 **** <classpathentry exported="true" kind="lib" path="lib/jakarta-commons/commons-logging.jar"/> <classpathentry exported="true" kind="lib" path="lib/junit/junit-4.4.jar"/> ! <classpathentry exported="true" kind="lib" path="lib/testng/testng-5.7-jdk15.jar"/> <classpathentry exported="true" kind="lib" path="lib/toplink/toplink-essentials.jar"/> <classpathentry exported="true" kind="lib" path="lib/xerces/xercesImpl.jar"/> --- 30,34 ---- <classpathentry exported="true" kind="lib" path="lib/jakarta-commons/commons-logging.jar"/> <classpathentry exported="true" kind="lib" path="lib/junit/junit-4.4.jar"/> ! <classpathentry exported="true" kind="lib" path="lib/testng/testng-5.8-jdk15.jar"/> <classpathentry exported="true" kind="lib" path="lib/toplink/toplink-essentials.jar"/> <classpathentry exported="true" kind="lib" path="lib/xerces/xercesImpl.jar"/> *************** *** 106,112 **** <classpathentry kind="lib" path="lib/serp/serp-1.13.1.jar"/> <classpathentry kind="lib" path="lib/struts/struts.jar"/> ! <classpathentry kind="lib" path="lib/tiles/tiles-api-2.0.5.jar"/> ! <classpathentry kind="lib" path="lib/tiles/tiles-core-2.0.5.jar"/> ! <classpathentry kind="lib" path="lib/tiles/tiles-jsp-2.0.5.jar"/> <classpathentry kind="lib" path="lib/tomcat/catalina.jar"/> <classpathentry kind="lib" path="lib/tomcat/naming-resources.jar"/> --- 106,112 ---- <classpathentry kind="lib" path="lib/serp/serp-1.13.1.jar"/> <classpathentry kind="lib" path="lib/struts/struts.jar"/> ! <classpathentry kind="lib" path="lib/tiles/tiles-api-2.0.6.jar"/> ! <classpathentry kind="lib" path="lib/tiles/tiles-core-2.0.6.jar"/> ! <classpathentry kind="lib" path="lib/tiles/tiles-jsp-2.0.6.jar"/> <classpathentry kind="lib" path="lib/tomcat/catalina.jar"/> <classpathentry kind="lib" path="lib/tomcat/naming-resources.jar"/> Index: project.properties =================================================================== RCS file: /cvsroot/springframework/spring/project.properties,v retrieving revision 1.158 retrieving revision 1.159 diff -C2 -d -r1.158 -r1.159 *** project.properties 6 Aug 2008 22:01:27 -0000 1.158 --- project.properties 17 Sep 2008 17:21:03 -0000 1.159 *************** *** 98,102 **** junit38.jar=${lib.dir}/junit/junit-3.8.2.jar junit4.jar=${lib.dir}/junit/junit-4.4.jar ! testng.jar=${lib.dir}/testng/testng-5.7-jdk15.jar # Wildcards to be matched by JUnit and TestNG tests. --- 98,102 ---- junit38.jar=${lib.dir}/junit/junit-3.8.2.jar junit4.jar=${lib.dir}/junit/junit-4.4.jar ! testng.jar=${lib.dir}/testng/testng-5.8-jdk15.jar # Wildcards to be matched by JUnit and TestNG tests. |
Update of /cvsroot/springframework/spring/lib/tiles In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv32533/lib/tiles Added Files: tiles-api-2.0.6.jar tiles-jsp-2.0.6.jar tiles-core-2.0.6.jar Removed Files: tiles-api-2.0.5.jar tiles-jsp-2.0.5.jar tiles-core-2.0.5.jar Log Message: updated to TestNG 5.8 and Tiles 2.0.6 --- tiles-core-2.0.5.jar DELETED --- --- NEW FILE: tiles-api-2.0.6.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tiles-jsp-2.0.6.jar --- (This appears to be a binary file; contents omitted.) --- tiles-jsp-2.0.5.jar DELETED --- --- tiles-api-2.0.5.jar DELETED --- --- NEW FILE: tiles-core-2.0.6.jar --- (This appears to be a binary file; contents omitted.) |
From: Juergen H. <jho...@us...> - 2008-09-17 09:37:08
|
Update of /cvsroot/springframework/spring/lib/eclipselink In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17566/lib/eclipselink Modified Files: eclipselink.jar Log Message: updated to EclipseLink 1.0.1 and Quartz 1.6.1 RC3 Index: eclipselink.jar =================================================================== RCS file: /cvsroot/springframework/spring/lib/eclipselink/eclipselink.jar,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 Binary files /tmp/cvsYaFmfu and /tmp/cvsa5cvuS differ |
From: Juergen H. <jho...@us...> - 2008-09-17 09:37:07
|
Update of /cvsroot/springframework/spring In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17566 Modified Files: .classpath Log Message: updated to EclipseLink 1.0.1 and Quartz 1.6.1 RC3 Index: .classpath =================================================================== RCS file: /cvsroot/springframework/spring/.classpath,v retrieving revision 1.228 retrieving revision 1.229 diff -C2 -d -r1.228 -r1.229 *** .classpath 7 Sep 2008 19:50:36 -0000 1.228 --- .classpath 17 Sep 2008 16:36:31 -0000 1.229 *************** *** 103,107 **** <classpathentry kind="lib" path="lib/portlet/portlet-api.jar"/> <classpathentry kind="lib" path="lib/qdox/qdox-1.5.jar"/> ! <classpathentry kind="lib" path="lib/quartz/quartz-all-1.6.1-RC1.jar"/> <classpathentry kind="lib" path="lib/serp/serp-1.13.1.jar"/> <classpathentry kind="lib" path="lib/struts/struts.jar"/> --- 103,107 ---- <classpathentry kind="lib" path="lib/portlet/portlet-api.jar"/> <classpathentry kind="lib" path="lib/qdox/qdox-1.5.jar"/> ! <classpathentry kind="lib" path="lib/quartz/quartz-all-1.6.1-RC3.jar"/> <classpathentry kind="lib" path="lib/serp/serp-1.13.1.jar"/> <classpathentry kind="lib" path="lib/struts/struts.jar"/> |
From: Juergen H. <jho...@us...> - 2008-09-17 09:37:07
|
Update of /cvsroot/springframework/spring/lib In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17566/lib Modified Files: readme.txt Log Message: updated to EclipseLink 1.0.1 and Quartz 1.6.1 RC3 Index: readme.txt =================================================================== RCS file: /cvsroot/springframework/spring/lib/readme.txt,v retrieving revision 1.211 retrieving revision 1.212 diff -C2 -d -r1.211 -r1.212 *** readme.txt 15 Sep 2008 15:44:14 -0000 1.211 --- readme.txt 17 Sep 2008 16:36:31 -0000 1.212 *************** *** 75,79 **** * eclipselink/eclipselink.jar ! - Eclipse Persistence Services 1.0 (http://www.eclipse.org/eclipselink) - required for building the framework - required at runtime when using Spring's JPA support with EclipseLink as provider --- 75,79 ---- * eclipselink/eclipselink.jar ! - Eclipse Persistence Services 1.0.1 (http://www.eclipse.org/eclipselink) - required for building the framework - required at runtime when using Spring's JPA support with EclipseLink as provider *************** *** 355,360 **** - required for building the framework and the attributes version of JPetStore ! * quartz/quartz-all-1.6.1-RC1.jar ! - Quartz 1.6.1 RC1 (http://www.opensymphony.com/quartz) - required for building the framework - required at runtime when using Spring's Quartz scheduling support --- 355,360 ---- - required for building the framework and the attributes version of JPetStore ! * quartz/quartz-all-1.6.1-RC3.jar ! - Quartz 1.6.1 RC3 (http://www.opensymphony.com/quartz) - required for building the framework - required at runtime when using Spring's Quartz scheduling support |
From: Juergen H. <jho...@us...> - 2008-09-17 09:36:40
|
Update of /cvsroot/springframework/spring/lib/quartz In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17566/lib/quartz Added Files: quartz-all-1.6.1-RC3.jar Removed Files: quartz-all-1.6.1-RC1.jar Log Message: updated to EclipseLink 1.0.1 and Quartz 1.6.1 RC3 --- NEW FILE: quartz-all-1.6.1-RC3.jar --- (This appears to be a binary file; contents omitted.) --- quartz-all-1.6.1-RC1.jar DELETED --- |
From: Juergen H. <jho...@us...> - 2008-09-17 08:25:34
|
Update of /cvsroot/springframework/spring/test/org/springframework/jdbc/core/support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv22165/test/org/springframework/jdbc/core/support Modified Files: JdbcBeanDefinitionReaderTests.java Log Message: JdbcTemplate does not call the costly "Statement.getWarnings()" unless ignoreWarnings=false or debug logging is on Index: JdbcBeanDefinitionReaderTests.java =================================================================== RCS file: /cvsroot/springframework/spring/test/org/springframework/jdbc/core/support/JdbcBeanDefinitionReaderTests.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** JdbcBeanDefinitionReaderTests.java 5 Jan 2006 18:42:01 -0000 1.6 --- JdbcBeanDefinitionReaderTests.java 17 Sep 2008 15:25:26 -0000 1.7 *************** *** 1,11 **** /* ! * Copyright 2002-2005 the original author or authors. ! * * 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, --- 1,11 ---- /* ! * Copyright 2002-2008 the original author or authors. ! * * 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, *************** *** 21,28 **** --- 21,30 ---- import org.easymock.MockControl; + import org.apache.commons.logging.LogFactory; import org.springframework.beans.TestBean; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.jdbc.AbstractJdbcTests; + import org.springframework.jdbc.core.JdbcTemplate; /** *************** *** 31,34 **** --- 33,39 ---- public class JdbcBeanDefinitionReaderTests extends AbstractJdbcTests { + private final boolean debugEnabled = LogFactory.getLog(JdbcTemplate.class).isDebugEnabled(); + + public void testValid() throws Exception { String sql = "SELECT NAME AS NAME, PROPERTY AS PROPERTY, VALUE AS VALUE FROM T"; *************** *** 55,59 **** Statement mockStatement = (Statement) ctrlStatement.getMock(); ctrlStatement.expectAndReturn(mockStatement.executeQuery(sql), mockResultSet); ! ctrlStatement.expectAndReturn(mockStatement.getWarnings(), null); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 60,66 ---- Statement mockStatement = (Statement) ctrlStatement.getMock(); ctrlStatement.expectAndReturn(mockStatement.executeQuery(sql), mockResultSet); ! if (debugEnabled) { ! ctrlStatement.expectAndReturn(mockStatement.getWarnings(), null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); |
From: Juergen H. <jho...@us...> - 2008-09-17 08:25:34
|
Update of /cvsroot/springframework/spring/test/org/springframework/jdbc/core In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv22165/test/org/springframework/jdbc/core Modified Files: JdbcTemplateTests.java AbstractRowMapperTests.java RowMapperTests.java JdbcTemplateQueryTests.java Log Message: JdbcTemplate does not call the costly "Statement.getWarnings()" unless ignoreWarnings=false or debug logging is on Index: JdbcTemplateQueryTests.java =================================================================== RCS file: /cvsroot/springframework/spring/test/org/springframework/jdbc/core/JdbcTemplateQueryTests.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** JdbcTemplateQueryTests.java 2 Jun 2007 15:28:52 -0000 1.16 --- JdbcTemplateQueryTests.java 17 Sep 2008 15:25:26 -0000 1.17 *************** *** 1,4 **** /* ! * Copyright 2002-2007 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2008 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 28,31 **** --- 28,32 ---- import org.easymock.MockControl; + import org.apache.commons.logging.LogFactory; import org.springframework.dao.IncorrectResultSizeDataAccessException; *************** *** 38,41 **** --- 39,44 ---- public class JdbcTemplateQueryTests extends AbstractJdbcTests { + private final boolean debugEnabled = LogFactory.getLog(JdbcTemplate.class).isDebugEnabled(); + private MockControl ctrlStatement; private Statement mockStatement; *************** *** 103,108 **** mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 106,113 ---- mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); *************** *** 131,136 **** mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 136,143 ---- mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); *************** *** 167,172 **** mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 174,181 ---- mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); *************** *** 205,210 **** mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 214,221 ---- mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); *************** *** 243,248 **** mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 254,261 ---- mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); *************** *** 286,291 **** mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 299,306 ---- mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); *************** *** 320,325 **** mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 335,342 ---- mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); *************** *** 359,364 **** mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 376,383 ---- mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); *************** *** 392,397 **** mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 411,418 ---- mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); *************** *** 425,430 **** mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 446,453 ---- mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); *************** *** 460,465 **** mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 483,490 ---- mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); *************** *** 495,500 **** mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 520,527 ---- mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); *************** *** 530,535 **** mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 557,564 ---- mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); *************** *** 566,571 **** mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 595,602 ---- mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); *************** *** 614,619 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 645,652 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 646,651 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 679,686 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 685,690 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 720,727 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 725,730 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 762,769 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 765,770 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 804,811 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 797,802 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 838,845 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 840,845 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 883,890 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 879,884 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 924,931 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 917,922 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 964,971 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); Index: AbstractRowMapperTests.java =================================================================== RCS file: /cvsroot/springframework/spring/test/org/springframework/jdbc/core/AbstractRowMapperTests.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** AbstractRowMapperTests.java 22 Jan 2008 15:25:41 -0000 1.6 --- AbstractRowMapperTests.java 17 Sep 2008 15:25:26 -0000 1.7 *************** *** 28,31 **** --- 28,32 ---- import junit.framework.TestCase; import org.easymock.MockControl; + import org.apache.commons.logging.LogFactory; import org.springframework.jdbc.core.test.ConcretePerson; *************** *** 42,61 **** public abstract class AbstractRowMapperTests extends TestCase { ! protected MockControl conControl; protected Connection con; - protected MockControl rsmdControl; - protected ResultSetMetaData rsmd; - protected MockControl rsControl; - protected ResultSet rs; - protected MockControl stmtControl; - protected Statement stmt; - protected JdbcTemplate jdbcTemplate; --- 43,56 ---- public abstract class AbstractRowMapperTests extends TestCase { ! private final boolean debugEnabled = LogFactory.getLog(JdbcTemplate.class).isDebugEnabled(); + protected MockControl conControl; protected Connection con; protected MockControl rsmdControl; protected ResultSetMetaData rsmd; protected MockControl rsControl; protected ResultSet rs; protected MockControl stmtControl; protected Statement stmt; protected JdbcTemplate jdbcTemplate; *************** *** 109,114 **** stmt.executeQuery("select name, age, birth_date, balance from people"); stmtControl.setReturnValue(rs, 1); ! stmt.getWarnings(); ! stmtControl.setReturnValue(null, 1); stmt.close(); stmtControl.setVoidCallable(1); --- 104,111 ---- stmt.executeQuery("select name, age, birth_date, balance from people"); stmtControl.setReturnValue(rs, 1); ! if (debugEnabled) { ! stmt.getWarnings(); ! stmtControl.setReturnValue(null, 1); ! } stmt.close(); stmtControl.setVoidCallable(1); Index: RowMapperTests.java =================================================================== RCS file: /cvsroot/springframework/spring/test/org/springframework/jdbc/core/RowMapperTests.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RowMapperTests.java 16 Dec 2006 18:41:09 -0000 1.3 --- RowMapperTests.java 17 Sep 2008 15:25:26 -0000 1.4 *************** *** 1,4 **** /* ! * Copyright 2002-2006 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2008 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 27,30 **** --- 27,31 ---- import junit.framework.TestCase; import org.easymock.MockControl; + import org.apache.commons.logging.LogFactory; import org.springframework.beans.TestBean; *************** *** 38,51 **** public class RowMapperTests extends TestCase { ! private MockControl conControl; private Connection con; - private MockControl rsControl; - private ResultSet rs; - private JdbcTemplate jdbcTemplate; - private List result; --- 39,49 ---- public class RowMapperTests extends TestCase { ! private final boolean debugEnabled = LogFactory.getLog(JdbcTemplate.class).isDebugEnabled(); + private MockControl conControl; private Connection con; private MockControl rsControl; private ResultSet rs; private JdbcTemplate jdbcTemplate; private List result; *************** *** 90,95 **** stmt.executeQuery("some SQL"); stmtControl.setReturnValue(rs, 1); ! stmt.getWarnings(); ! stmtControl.setReturnValue(null, 1); stmt.close(); stmtControl.setVoidCallable(1); --- 88,95 ---- stmt.executeQuery("some SQL"); stmtControl.setReturnValue(rs, 1); ! if (debugEnabled) { ! stmt.getWarnings(); ! stmtControl.setReturnValue(null, 1); ! } stmt.close(); stmtControl.setVoidCallable(1); *************** *** 110,115 **** ps.executeQuery(); psControl.setReturnValue(rs, 1); ! ps.getWarnings(); ! psControl.setReturnValue(null, 1); ps.close(); psControl.setVoidCallable(1); --- 110,117 ---- ps.executeQuery(); psControl.setReturnValue(rs, 1); ! if (debugEnabled) { ! ps.getWarnings(); ! psControl.setReturnValue(null, 1); ! } ps.close(); psControl.setVoidCallable(1); *************** *** 139,144 **** ps.executeQuery(); psControl.setReturnValue(rs, 1); ! ps.getWarnings(); ! psControl.setReturnValue(null, 1); ps.close(); psControl.setVoidCallable(1); --- 141,148 ---- ps.executeQuery(); psControl.setReturnValue(rs, 1); ! if (debugEnabled) { ! ps.getWarnings(); ! psControl.setReturnValue(null, 1); ! } ps.close(); psControl.setVoidCallable(1); *************** *** 170,175 **** ps.executeQuery(); psControl.setReturnValue(rs, 1); ! ps.getWarnings(); ! psControl.setReturnValue(null, 1); ps.close(); psControl.setVoidCallable(1); --- 174,181 ---- ps.executeQuery(); psControl.setReturnValue(rs, 1); ! if (debugEnabled) { ! ps.getWarnings(); ! psControl.setReturnValue(null, 1); ! } ps.close(); psControl.setVoidCallable(1); *************** *** 198,203 **** ps.executeQuery(); psControl.setReturnValue(rs, 1); ! ps.getWarnings(); ! psControl.setReturnValue(null, 1); ps.close(); psControl.setVoidCallable(1); --- 204,211 ---- ps.executeQuery(); psControl.setReturnValue(rs, 1); ! if (debugEnabled) { ! ps.getWarnings(); ! psControl.setReturnValue(null, 1); ! } ps.close(); psControl.setVoidCallable(1); Index: JdbcTemplateTests.java =================================================================== RCS file: /cvsroot/springframework/spring/test/org/springframework/jdbc/core/JdbcTemplateTests.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** JdbcTemplateTests.java 3 Aug 2007 03:21:23 -0000 1.23 --- JdbcTemplateTests.java 17 Sep 2008 15:25:26 -0000 1.24 *************** *** 1,4 **** /* ! * Copyright 2002-2007 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2008 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 34,37 **** --- 34,38 ---- import org.easymock.MockControl; + import org.apache.commons.logging.LogFactory; import org.springframework.dao.DataAccessException; *************** *** 59,62 **** --- 60,66 ---- public class JdbcTemplateTests extends AbstractJdbcTests { + private final boolean debugEnabled = LogFactory.getLog(JdbcTemplate.class).isDebugEnabled(); + + public void testBeanProperties() throws Exception { replay(); *************** *** 82,87 **** mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(1); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 86,93 ---- mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(1); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 264,269 **** } ctrlStatement.setReturnValue(mockResultSet); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 270,277 ---- } ctrlStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); *************** *** 324,329 **** mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 332,339 ---- mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); *************** *** 405,410 **** mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 415,422 ---- mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); *************** *** 443,448 **** mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 455,462 ---- mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); *************** *** 480,485 **** mockStatement.executeUpdate(sql); ctrlStatement.setReturnValue(rowsAffected); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 494,501 ---- mockStatement.executeUpdate(sql); ctrlStatement.setReturnValue(rowsAffected); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); *************** *** 511,516 **** mockStatement.executeUpdate(); ctrlStatement.setReturnValue(33); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 527,534 ---- mockStatement.executeUpdate(); ctrlStatement.setReturnValue(33); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); *************** *** 564,569 **** mockStatement.executeUpdate(sql); ctrlStatement.setReturnValue(rowsAffected); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 582,589 ---- mockStatement.executeUpdate(sql); ctrlStatement.setReturnValue(rowsAffected); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); *************** *** 599,604 **** mockStatement.executeBatch(); ctrlStatement.setReturnValue(new int[] {1, 1}); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 619,626 ---- mockStatement.executeBatch(); ctrlStatement.setReturnValue(new int[] {1, 1}); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); *************** *** 645,650 **** mockStatement.getUpdateCount(); ctrlStatement.setReturnValue(1); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 667,674 ---- mockStatement.getUpdateCount(); ctrlStatement.setReturnValue(1); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); *************** *** 742,747 **** mockPreparedStatement.executeBatch(); ctrlPreparedStatement.setReturnValue(rowsAffected); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 766,773 ---- mockPreparedStatement.executeBatch(); ctrlPreparedStatement.setReturnValue(rowsAffected); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 804,809 **** mockPreparedStatement.executeBatch(); ctrlPreparedStatement.setReturnValue(rowsAffected); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 830,837 ---- mockPreparedStatement.executeBatch(); ctrlPreparedStatement.setReturnValue(rowsAffected); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 870,875 **** mockPreparedStatement.executeBatch(); ctrlPreparedStatement.setReturnValue(rowsAffected); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 898,905 ---- mockPreparedStatement.executeBatch(); ctrlPreparedStatement.setReturnValue(rowsAffected); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 932,937 **** mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(rowsAffected[1]); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 962,969 ---- mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(rowsAffected[1]); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 994,999 **** mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(rowsAffected[1]); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 1026,1033 ---- mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(rowsAffected[1]); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 1284,1289 **** mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(expectedRowsUpdated); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 1318,1325 ---- mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(expectedRowsUpdated); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 1362,1367 **** mockResultSet.close(); ctrlResultSet.setThrowable(sex); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); mockStatement.close(); ctrlStatement.setThrowable(sex); --- 1398,1405 ---- mockResultSet.close(); ctrlResultSet.setThrowable(sex); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setThrowable(sex); *************** *** 1449,1454 **** mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(warnings); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 1487,1494 ---- mockStatement.executeQuery(sql); ctrlStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); *************** *** 1656,1661 **** MockControl ctrlStatement = MockControl.createControl(Statement.class); final Statement mockStatement = (Statement) ctrlStatement.getMock(); ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); mockStatement.close(); ctrlStatement.setVoidCallable(); --- 1696,1703 ---- MockControl ctrlStatement = MockControl.createControl(Statement.class); final Statement mockStatement = (Statement) ctrlStatement.getMock(); ! if (debugEnabled) { ! mockStatement.getWarnings(); ! ctrlStatement.setReturnValue(null); ! } mockStatement.close(); ctrlStatement.setVoidCallable(); *************** *** 1667,1672 **** MockControl ctrlPreparedStatement = MockControl.createControl(PreparedStatement.class); final PreparedStatement mockPreparedStatement = (PreparedStatement) ctrlPreparedStatement.getMock(); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 1709,1716 ---- MockControl ctrlPreparedStatement = MockControl.createControl(PreparedStatement.class); final PreparedStatement mockPreparedStatement = (PreparedStatement) ctrlPreparedStatement.getMock(); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 1685,1690 **** MockControl ctrlCallableStatement = MockControl.createControl(CallableStatement.class); final CallableStatement mockCallableStatement = (CallableStatement) ctrlCallableStatement.getMock(); ! mockCallableStatement.getWarnings(); ! ctrlCallableStatement.setReturnValue(null); mockCallableStatement.close(); ctrlCallableStatement.setVoidCallable(); --- 1729,1736 ---- MockControl ctrlCallableStatement = MockControl.createControl(CallableStatement.class); final CallableStatement mockCallableStatement = (CallableStatement) ctrlCallableStatement.getMock(); ! if (debugEnabled) { ! mockCallableStatement.getWarnings(); ! ctrlCallableStatement.setReturnValue(null); ! } mockCallableStatement.close(); ctrlCallableStatement.setVoidCallable(); *************** *** 1937,1942 **** mockCallable.getObject(1); ctrlCallable.setReturnValue("X"); ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); mockCallable.close(); ctrlCallable.setVoidCallable(); --- 1983,1990 ---- mockCallable.getObject(1); ctrlCallable.setReturnValue("X"); ! if (debugEnabled) { ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); ! } mockCallable.close(); ctrlCallable.setVoidCallable(); |
From: Juergen H. <jho...@us...> - 2008-09-17 08:25:34
|
Update of /cvsroot/springframework/spring/test/org/springframework/jdbc/core/namedparam In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv22165/test/org/springframework/jdbc/core/namedparam Modified Files: NamedParameterJdbcTemplateTests.java Log Message: JdbcTemplate does not call the costly "Statement.getWarnings()" unless ignoreWarnings=false or debug logging is on Index: NamedParameterJdbcTemplateTests.java =================================================================== RCS file: /cvsroot/springframework/spring/test/org/springframework/jdbc/core/namedparam/NamedParameterJdbcTemplateTests.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NamedParameterJdbcTemplateTests.java 15 Apr 2007 18:07:11 -0000 1.3 --- NamedParameterJdbcTemplateTests.java 17 Sep 2008 15:25:26 -0000 1.4 *************** *** 1,4 **** /* ! * Copyright 2002-2007 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2008 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 29,32 **** --- 29,33 ---- import org.easymock.MockControl; + import org.apache.commons.logging.LogFactory; import org.springframework.dao.DataAccessException; *************** *** 39,42 **** --- 40,44 ---- import org.springframework.jdbc.core.RowMapper; import org.springframework.jdbc.core.SqlParameterValue; + import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.test.AssertThrows; *************** *** 59,62 **** --- 61,66 ---- private static final String[] COLUMN_NAMES = new String[] {"id", "forename"}; + private final boolean debugEnabled = LogFactory.getLog(JdbcTemplate.class).isDebugEnabled(); + private MockControl ctrlPreparedStatement; private PreparedStatement mockPreparedStatement; *************** *** 110,115 **** mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(1); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 114,121 ---- mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(1); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 140,145 **** mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(1); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 146,153 ---- mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(1); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 170,175 **** mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(1); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 178,185 ---- mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(1); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 195,200 **** mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(1); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 205,212 ---- mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(1); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 229,234 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 241,248 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 274,279 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 288,295 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 321,326 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 337,344 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 367,372 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 385,392 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); |
Update of /cvsroot/springframework/spring/test/org/springframework/jdbc/object In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv22165/test/org/springframework/jdbc/object Modified Files: SqlQueryTests.java StoredProcedureTests.java SqlFunctionTests.java BatchSqlUpdateTests.java SqlUpdateTests.java Log Message: JdbcTemplate does not call the costly "Statement.getWarnings()" unless ignoreWarnings=false or debug logging is on Index: SqlQueryTests.java =================================================================== RCS file: /cvsroot/springframework/spring/test/org/springframework/jdbc/object/SqlQueryTests.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** SqlQueryTests.java 3 Apr 2008 18:44:07 -0000 1.18 --- SqlQueryTests.java 17 Sep 2008 15:25:26 -0000 1.19 *************** *** 1,4 **** /* ! * Copyright 2002-2007 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2008 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 31,34 **** --- 31,35 ---- import org.easymock.MockControl; + import org.apache.commons.logging.LogFactory; import org.springframework.dao.IncorrectResultSizeDataAccessException; *************** *** 72,75 **** --- 73,78 ---- private static final int[] COLUMN_TYPES = new int[] {Types.INTEGER, Types.VARCHAR}; + private final boolean debugEnabled = LogFactory.getLog(JdbcTemplate.class).isDebugEnabled(); + private MockControl ctrlPreparedStatement; private PreparedStatement mockPreparedStatement; *************** *** 77,80 **** --- 80,84 ---- private ResultSet mockResultSet; + protected void setUp() throws Exception { super.setUp(); *************** *** 112,117 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 116,123 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 225,230 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 231,238 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 258,263 **** mockCountPreparedStatement[i].executeQuery(); ctrlCountPreparedStatement[i].setReturnValue(mockCountResultSet[i]); ! mockCountPreparedStatement[i].getWarnings(); ! ctrlCountPreparedStatement[i].setReturnValue(null); mockCountPreparedStatement[i].close(); ctrlCountPreparedStatement[i].setVoidCallable(); --- 266,273 ---- mockCountPreparedStatement[i].executeQuery(); ctrlCountPreparedStatement[i].setReturnValue(mockCountResultSet[i]); ! if (debugEnabled) { ! mockCountPreparedStatement[i].getWarnings(); ! ctrlCountPreparedStatement[i].setReturnValue(null); ! } mockCountPreparedStatement[i].close(); ctrlCountPreparedStatement[i].setVoidCallable(); *************** *** 306,311 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 316,323 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 340,345 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 352,359 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 396,401 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 410,417 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 456,461 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 472,479 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 476,481 **** mockPreparedStatement2.executeQuery(); ctrlPreparedStatement2.setReturnValue(mockResultSet2); ! mockPreparedStatement2.getWarnings(); ! ctrlPreparedStatement2.setReturnValue(null); mockPreparedStatement2.close(); ctrlPreparedStatement2.setVoidCallable(); --- 494,501 ---- mockPreparedStatement2.executeQuery(); ctrlPreparedStatement2.setReturnValue(mockResultSet2); ! if (debugEnabled) { ! mockPreparedStatement2.getWarnings(); ! ctrlPreparedStatement2.setReturnValue(null); ! } mockPreparedStatement2.close(); ctrlPreparedStatement2.setVoidCallable(); *************** *** 546,551 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 566,573 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 610,615 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 632,639 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 667,672 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 691,698 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 718,723 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 744,751 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 818,823 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 846,853 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 890,895 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 920,927 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 961,966 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 993,1000 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 1072,1077 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 1106,1113 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); Index: SqlFunctionTests.java =================================================================== RCS file: /cvsroot/springframework/spring/test/org/springframework/jdbc/object/SqlFunctionTests.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SqlFunctionTests.java 12 Nov 2005 22:46:34 -0000 1.5 --- SqlFunctionTests.java 17 Sep 2008 15:25:26 -0000 1.6 *************** *** 1,11 **** /* ! * Copyright 2002-2005 the original author or authors. ! * * 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, --- 1,11 ---- /* ! * Copyright 2002-2008 the original author or authors. ! * * 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, *************** *** 23,30 **** --- 23,32 ---- import java.sql.Types; + import org.apache.commons.logging.LogFactory; import org.easymock.MockControl; import org.springframework.dao.IncorrectResultSizeDataAccessException; import org.springframework.jdbc.AbstractJdbcTests; + import org.springframework.jdbc.core.JdbcTemplate; /** *************** *** 39,42 **** --- 41,46 ---- "select count(id) from mytable where myparam = ? and mystring = ?"; + private final boolean debugEnabled = LogFactory.getLog(JdbcTemplate.class).isDebugEnabled(); + private MockControl ctrlPreparedStatement; private PreparedStatement mockPreparedStatement; *************** *** 46,49 **** --- 50,54 ---- private ResultSetMetaData mockResultSetMetaData; + protected void setUp() throws Exception { super.setUp(); *************** *** 57,67 **** } - protected void replay() { - super.replay(); - ctrlPreparedStatement.replay(); - ctrlResultSet.replay(); - ctrlResultSetMetaData.replay(); - } - protected void tearDown() throws Exception { super.tearDown(); --- 62,65 ---- *************** *** 73,76 **** --- 71,82 ---- } + protected void replay() { + super.replay(); + ctrlPreparedStatement.replay(); + ctrlResultSet.replay(); + ctrlResultSetMetaData.replay(); + } + + public void testFunction() throws SQLException { ctrlResultSetMetaData = MockControl.createControl(ResultSetMetaData.class); *************** *** 92,97 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 98,105 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 134,139 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 142,149 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 177,182 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 187,194 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 218,223 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 230,237 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 259,264 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 273,280 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 300,305 **** mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 316,323 ---- mockPreparedStatement.executeQuery(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); Index: BatchSqlUpdateTests.java =================================================================== RCS file: /cvsroot/springframework/spring/test/org/springframework/jdbc/object/BatchSqlUpdateTests.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BatchSqlUpdateTests.java 16 Apr 2005 17:33:31 -0000 1.3 --- BatchSqlUpdateTests.java 17 Sep 2008 15:25:26 -0000 1.4 *************** *** 1,4 **** /* ! * Copyright 2002-2005 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not --- 1,4 ---- /* ! * Copyright 2002-2008 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not *************** *** 6,10 **** * the License at * ! * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software --- 6,10 ---- * the License at * ! * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software *************** *** 22,28 **** --- 22,30 ---- import org.easymock.MockControl; + import org.apache.commons.logging.LogFactory; import org.springframework.jdbc.AbstractJdbcTests; import org.springframework.jdbc.core.SqlParameter; + import org.springframework.jdbc.core.JdbcTemplate; /** *************** *** 32,35 **** --- 34,40 ---- public class BatchSqlUpdateTests extends AbstractJdbcTests { + private final boolean debugEnabled = LogFactory.getLog(JdbcTemplate.class).isDebugEnabled(); + + public void testBatchUpdateWithExplicitFlush() throws Exception { doTestBatchUpdate(false); *************** *** 59,64 **** mockPreparedStatement.executeBatch(); ctrlPreparedStatement.setReturnValue(rowsAffected); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 64,71 ---- mockPreparedStatement.executeBatch(); ctrlPreparedStatement.setReturnValue(rowsAffected); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); Index: StoredProcedureTests.java =================================================================== RCS file: /cvsroot/springframework/spring/test/org/springframework/jdbc/object/StoredProcedureTests.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** StoredProcedureTests.java 10 Jan 2008 21:08:40 -0000 1.6 --- StoredProcedureTests.java 17 Sep 2008 15:25:26 -0000 1.7 *************** *** 1,4 **** /* ! * Copyright 2002-2007 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2008 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 31,34 **** --- 31,35 ---- import org.easymock.MockControl; + import org.apache.commons.logging.LogFactory; import org.springframework.dao.DataAccessException; *************** *** 57,60 **** --- 58,63 ---- public class StoredProcedureTests extends AbstractJdbcTests { + private final boolean debugEnabled = LogFactory.getLog(JdbcTemplate.class).isDebugEnabled(); + private MockControl ctrlCallable; private CallableStatement mockCallable; *************** *** 124,129 **** mockCallable.getObject(3); ctrlCallable.setReturnValue(new Integer(4)); ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); mockCallable.close(); ctrlCallable.setVoidCallable(); --- 127,134 ---- mockCallable.getObject(3); ctrlCallable.setReturnValue(new Integer(4)); ! if (debugEnabled) { ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); ! } mockCallable.close(); ctrlCallable.setVoidCallable(); *************** *** 150,155 **** mockCallable.getObject(3); ctrlCallable.setReturnValue(new Integer(4)); ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); mockCallable.close(); ctrlCallable.setVoidCallable(); --- 155,162 ---- mockCallable.getObject(3); ctrlCallable.setReturnValue(new Integer(4)); ! if (debugEnabled) { ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); ! } mockCallable.close(); ctrlCallable.setVoidCallable(); *************** *** 189,194 **** mockCallable.getObject(2); ctrlCallable.setReturnValue(new Integer(5), 1); ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); mockCallable.close(); ctrlCallable.setVoidCallable(1); --- 196,203 ---- mockCallable.getObject(2); ctrlCallable.setReturnValue(new Integer(5), 1); ! if (debugEnabled) { ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); ! } mockCallable.close(); ctrlCallable.setVoidCallable(1); *************** *** 248,253 **** mockCallable.getObject(2); ctrlCallable.setReturnValue(new Integer(4)); ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); mockCallable.close(); ctrlCallable.setVoidCallable(); --- 257,264 ---- mockCallable.getObject(2); ctrlCallable.setReturnValue(new Integer(4)); ! if (debugEnabled) { ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); ! } mockCallable.close(); ctrlCallable.setVoidCallable(); *************** *** 276,281 **** mockCallable.getUpdateCount(); ctrlCallable.setReturnValue(-1); ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); mockCallable.close(); ctrlCallable.setVoidCallable(); --- 287,294 ---- mockCallable.getUpdateCount(); ctrlCallable.setReturnValue(-1); ! if (debugEnabled) { ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); ! } mockCallable.close(); ctrlCallable.setVoidCallable(); *************** *** 350,355 **** mockResultSet.next(); ctrlResultSet.setReturnValue(false); ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); mockResultSet.close(); ctrlResultSet.setVoidCallable(); --- 363,370 ---- mockResultSet.next(); ctrlResultSet.setReturnValue(false); ! if (debugEnabled) { ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); ! } mockResultSet.close(); ctrlResultSet.setVoidCallable(); *************** *** 407,412 **** mockCallable.getUpdateCount(); ctrlCallable.setReturnValue(-1); ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); mockCallable.close(); ctrlCallable.setVoidCallable(); --- 422,429 ---- mockCallable.getUpdateCount(); ctrlCallable.setReturnValue(-1); ! if (debugEnabled) { ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); ! } mockCallable.close(); ctrlCallable.setVoidCallable(); *************** *** 490,495 **** mockCallable.getUpdateCount(); ctrlCallable.setReturnValue(-1); ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); mockCallable.close(); ctrlCallable.setVoidCallable(); --- 507,514 ---- mockCallable.getUpdateCount(); ctrlCallable.setReturnValue(-1); ! if (debugEnabled) { ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); ! } mockCallable.close(); ctrlCallable.setVoidCallable(); *************** *** 526,540 **** Number n = (Number) res.get("#update-count-1"); assertEquals("wrong update count", 0, n.intValue()); - } public void testStoredProcedureSkippingResultsProcessing() throws Exception { - mockCallable.execute(); ctrlCallable.setReturnValue(true); mockCallable.getUpdateCount(); ctrlCallable.setReturnValue(-1); ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); mockCallable.close(); ctrlCallable.setVoidCallable(); --- 545,559 ---- Number n = (Number) res.get("#update-count-1"); assertEquals("wrong update count", 0, n.intValue()); } public void testStoredProcedureSkippingResultsProcessing() throws Exception { mockCallable.execute(); ctrlCallable.setReturnValue(true); mockCallable.getUpdateCount(); ctrlCallable.setReturnValue(-1); ! if (debugEnabled) { ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); ! } mockCallable.close(); ctrlCallable.setVoidCallable(); *************** *** 551,555 **** assertEquals("incorrect number of returns", 0, res.size()); - } --- 570,573 ---- *************** *** 584,589 **** mockCallable.getUpdateCount(); ctrlCallable.setReturnValue(-1); ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); mockCallable.close(); ctrlCallable.setVoidCallable(); --- 602,609 ---- mockCallable.getUpdateCount(); ctrlCallable.setReturnValue(-1); ! if (debugEnabled) { ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); ! } mockCallable.close(); ctrlCallable.setVoidCallable(); *************** *** 608,612 **** assertEquals("Foo", rs1.get(0)); assertEquals("Bar", rs1.get(1)); - } --- 628,631 ---- *************** *** 622,627 **** mockCallable.getObject(2); ctrlCallable.setReturnValue("OK"); ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); mockCallable.close(); ctrlCallable.setVoidCallable(); --- 641,648 ---- mockCallable.getObject(2); ctrlCallable.setReturnValue("OK"); ! if (debugEnabled) { ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); ! } mockCallable.close(); ctrlCallable.setVoidCallable(); *************** *** 651,656 **** mockCallable.getObject(2); ctrlCallable.setReturnValue("OK"); ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); mockCallable.close(); ctrlCallable.setVoidCallable(); --- 672,679 ---- mockCallable.getObject(2); ctrlCallable.setReturnValue("OK"); ! if (debugEnabled) { ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); ! } mockCallable.close(); ctrlCallable.setVoidCallable(); *************** *** 677,682 **** mockCallable.getObject(1); ctrlCallable.setReturnValue(new BigDecimal("12345.6789")); ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); mockCallable.close(); ctrlCallable.setVoidCallable(); --- 700,707 ---- mockCallable.getObject(1); ctrlCallable.setReturnValue(new BigDecimal("12345.6789")); ! if (debugEnabled) { ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); ! } mockCallable.close(); ctrlCallable.setVoidCallable(); Index: SqlUpdateTests.java =================================================================== RCS file: /cvsroot/springframework/spring/test/org/springframework/jdbc/object/SqlUpdateTests.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SqlUpdateTests.java 2 Jun 2007 15:28:52 -0000 1.8 --- SqlUpdateTests.java 17 Sep 2008 15:25:26 -0000 1.9 *************** *** 1,4 **** /* ! * Copyright 2002-2007 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2008 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 26,29 **** --- 26,30 ---- import org.easymock.MockControl; + import org.apache.commons.logging.LogFactory; import org.springframework.core.JdkVersion; *************** *** 31,34 **** --- 32,36 ---- import org.springframework.jdbc.JdbcUpdateAffectedIncorrectNumberOfRowsException; import org.springframework.jdbc.core.SqlParameter; + import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.support.GeneratedKeyHolder; import org.springframework.jdbc.support.KeyHolder; *************** *** 56,59 **** --- 58,63 ---- "insert into show (name) values(?)"; + private final boolean debugEnabled = LogFactory.getLog(JdbcTemplate.class).isDebugEnabled(); + private MockControl ctrlPreparedStatement; private PreparedStatement mockPreparedStatement; *************** *** 63,66 **** --- 67,71 ---- private ResultSetMetaData mockResultSetMetaData; + protected void setUp() throws Exception { super.setUp(); *************** *** 85,90 **** mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(1); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 90,97 ---- mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(1); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 105,110 **** mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(1); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 112,119 ---- mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(1); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 126,131 **** mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(1); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 135,142 ---- mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(1); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 155,160 **** mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(1); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 166,173 ---- mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(1); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 199,204 **** mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(1); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 212,219 ---- mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(1); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 222,227 **** mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(1); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 237,244 ---- mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(1); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 264,269 **** mockPreparedStatement.getGeneratedKeys(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 281,288 ---- mockPreparedStatement.getGeneratedKeys(); ctrlPreparedStatement.setReturnValue(mockResultSet); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 292,297 **** mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(1); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 311,318 ---- mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(1); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 310,315 **** mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(3); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 331,338 ---- mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(3); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 328,333 **** mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(5); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 351,358 ---- mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(5); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 346,351 **** mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(8); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 371,378 ---- mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(8); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 369,374 **** mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(3); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 396,403 ---- mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(3); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 387,392 **** mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(2); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 416,423 ---- mockPreparedStatement.executeUpdate(); ctrlPreparedStatement.setReturnValue(2); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); |
From: Juergen H. <jho...@us...> - 2008-09-17 08:25:31
|
Update of /cvsroot/springframework/spring/src/org/springframework/jdbc/core In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv22165/src/org/springframework/jdbc/core Modified Files: JdbcTemplate.java Log Message: JdbcTemplate does not call the costly "Statement.getWarnings()" unless ignoreWarnings=false or debug logging is on Index: JdbcTemplate.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/jdbc/core/JdbcTemplate.java,v retrieving revision 1.147 retrieving revision 1.148 diff -C2 -d -r1.147 -r1.148 *** JdbcTemplate.java 21 Apr 2008 13:15:17 -0000 1.147 --- JdbcTemplate.java 17 Sep 2008 15:25:26 -0000 1.148 *************** *** 395,399 **** } Object result = action.doInStatement(stmtToUse); ! handleWarnings(stmt.getWarnings()); return result; } --- 395,399 ---- } Object result = action.doInStatement(stmtToUse); ! handleWarnings(stmt); return result; } *************** *** 590,594 **** } Object result = action.doInPreparedStatement(psToUse); ! handleWarnings(ps.getWarnings()); return result; } --- 590,594 ---- } Object result = action.doInPreparedStatement(psToUse); ! handleWarnings(ps); return result; } *************** *** 935,939 **** } Object result = action.doInCallableStatement(csToUse); ! handleWarnings(cs.getWarnings()); return result; } --- 935,939 ---- } Object result = action.doInCallableStatement(csToUse); ! handleWarnings(cs); return result; } *************** *** 1207,1230 **** * Throw an SQLWarningException if we're not ignoring warnings, * else log the warnings (at debug level). ! * @param warning the warnings object from the current statement. ! * May be <code>null</code>, in which case this method does nothing. * @throws SQLWarningException if not ignoring warnings * @see org.springframework.jdbc.SQLWarningException */ ! protected void handleWarnings(SQLWarning warning) throws SQLWarningException { ! if (warning != null) { ! if (isIgnoreWarnings()) { ! if (logger.isDebugEnabled()) { ! SQLWarning warningToLog = warning; ! while (warningToLog != null) { ! logger.debug("SQLWarning ignored: SQL state '" + warningToLog.getSQLState() + "', error code '" + ! warningToLog.getErrorCode() + "', message [" + warningToLog.getMessage() + "]"); ! warningToLog = warningToLog.getNextWarning(); ! } } } ! else { ! throw new SQLWarningException("Warning not ignored", warning); ! } } } --- 1207,1239 ---- * Throw an SQLWarningException if we're not ignoring warnings, * else log the warnings (at debug level). ! * @param stmt the current JDBC statement * @throws SQLWarningException if not ignoring warnings * @see org.springframework.jdbc.SQLWarningException */ ! protected void handleWarnings(Statement stmt) throws SQLException { ! if (isIgnoreWarnings()) { ! if (logger.isDebugEnabled()) { ! SQLWarning warningToLog = stmt.getWarnings(); ! while (warningToLog != null) { ! logger.debug("SQLWarning ignored: SQL state '" + warningToLog.getSQLState() + "', error code '" + ! warningToLog.getErrorCode() + "', message [" + warningToLog.getMessage() + "]"); ! warningToLog = warningToLog.getNextWarning(); } } ! } ! else { ! handleWarnings(stmt.getWarnings()); ! } ! } ! ! /** ! * Throw an SQLWarningException if encountering an actual warning. ! * @param warning the warnings object from the current statement. ! * May be <code>null</code>, in which case this method does nothing. ! * @throws SQLWarningException in case of an actual warning to be raised ! */ ! protected void handleWarnings(SQLWarning warning) throws SQLWarningException { ! if (warning != null) { ! throw new SQLWarningException("Warning not ignored", warning); } } |
From: Juergen H. <jho...@us...> - 2008-09-17 08:25:30
|
Update of /cvsroot/springframework/spring/tiger/test/org/springframework/jdbc/core/simple In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv22165/tiger/test/org/springframework/jdbc/core/simple Modified Files: SimpleJdbcCallTests.java SimpleJdbcTemplateTests.java Log Message: JdbcTemplate does not call the costly "Statement.getWarnings()" unless ignoreWarnings=false or debug logging is on Index: SimpleJdbcCallTests.java =================================================================== RCS file: /cvsroot/springframework/spring/tiger/test/org/springframework/jdbc/core/simple/SimpleJdbcCallTests.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SimpleJdbcCallTests.java 28 May 2008 00:24:03 -0000 1.3 --- SimpleJdbcCallTests.java 17 Sep 2008 15:25:26 -0000 1.4 *************** *** 1,4 **** /* ! * Copyright 2002-2007 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2008 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 19,25 **** --- 19,28 ---- import junit.framework.TestCase; import org.easymock.MockControl; + import org.apache.commons.logging.LogFactory; + import org.springframework.jdbc.BadSqlGrammarException; import org.springframework.jdbc.core.SqlOutParameter; import org.springframework.jdbc.core.SqlParameter; + import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; import org.springframework.jdbc.core.simple.SimpleJdbcCall; *************** *** 36,39 **** --- 39,44 ---- public class SimpleJdbcCallTests extends TestCase { + private final boolean debugEnabled = LogFactory.getLog(JdbcTemplate.class).isDebugEnabled(); + private MockControl ctrlDataSource; private DataSource mockDataSource; *************** *** 46,51 **** protected void setUp() throws Exception { - super.setUp(); - ctrlDatabaseMetaData = MockControl.createControl(DatabaseMetaData.class); mockDatabaseMetaData = (DatabaseMetaData) ctrlDatabaseMetaData.getMock(); --- 51,54 ---- *************** *** 65,73 **** ctrlCallable = MockControl.createControl(CallableStatement.class); mockCallable = (CallableStatement) ctrlCallable.getMock(); - } protected void tearDown() throws Exception { - super.tearDown(); ctrlDatabaseMetaData.verify(); ctrlDataSource.verify(); --- 68,74 ---- *************** *** 167,172 **** mockCallable.getObject(3); ctrlCallable.setReturnValue(new Long(4)); ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); mockCallable.close(); ctrlCallable.setVoidCallable(); --- 168,175 ---- mockCallable.getObject(3); ctrlCallable.setReturnValue(new Long(4)); ! if (debugEnabled) { ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); ! } mockCallable.close(); ctrlCallable.setVoidCallable(); *************** *** 277,282 **** mockCallable.getObject(3); ctrlCallable.setReturnValue(new Long(4)); ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); mockCallable.close(); ctrlCallable.setVoidCallable(); --- 280,287 ---- mockCallable.getObject(3); ctrlCallable.setReturnValue(new Long(4)); ! if (debugEnabled) { ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); ! } mockCallable.close(); ctrlCallable.setVoidCallable(); *************** *** 327,332 **** mockCallable.getObject(1); ctrlCallable.setReturnValue(new Long(4)); ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); mockCallable.close(); ctrlCallable.setVoidCallable(); --- 332,339 ---- mockCallable.getObject(1); ctrlCallable.setReturnValue(new Long(4)); ! if (debugEnabled) { ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); ! } mockCallable.close(); ctrlCallable.setVoidCallable(); *************** *** 437,442 **** mockCallable.getObject(1); ctrlCallable.setReturnValue(new Long(4)); ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); mockCallable.close(); ctrlCallable.setVoidCallable(); --- 444,451 ---- mockCallable.getObject(1); ctrlCallable.setReturnValue(new Long(4)); ! if (debugEnabled) { ! mockCallable.getWarnings(); ! ctrlCallable.setReturnValue(null); ! } mockCallable.close(); ctrlCallable.setVoidCallable(); *************** *** 457,459 **** --- 466,469 ---- ctrlResultSet.verify(); } + } Index: SimpleJdbcTemplateTests.java =================================================================== RCS file: /cvsroot/springframework/spring/tiger/test/org/springframework/jdbc/core/simple/SimpleJdbcTemplateTests.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SimpleJdbcTemplateTests.java 1 Oct 2007 12:47:42 -0000 1.5 --- SimpleJdbcTemplateTests.java 17 Sep 2008 15:25:26 -0000 1.6 *************** *** 1,4 **** /* ! * Copyright 2002-2007 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2008 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 35,38 **** --- 35,39 ---- import org.easymock.MockControl; import org.easymock.internal.ArrayMatcher; + import org.apache.commons.logging.LogFactory; import org.springframework.jdbc.core.JdbcOperations; *************** *** 50,53 **** --- 51,57 ---- public class SimpleJdbcTemplateTests extends TestCase { + private final boolean debugEnabled = LogFactory.getLog(JdbcTemplate.class).isDebugEnabled(); + + public void testQueryForIntWithoutArgs() { String sql = "SELECT COUNT(0) FROM BAR"; *************** *** 558,563 **** mockPreparedStatement.executeBatch(); ctrlPreparedStatement.setReturnValue(rowsAffected); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 562,569 ---- mockPreparedStatement.executeBatch(); ctrlPreparedStatement.setReturnValue(rowsAffected); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); *************** *** 632,637 **** mockPreparedStatement.executeBatch(); ctrlPreparedStatement.setReturnValue(rowsAffected); ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); --- 638,645 ---- mockPreparedStatement.executeBatch(); ctrlPreparedStatement.setReturnValue(rowsAffected); ! if (debugEnabled) { ! mockPreparedStatement.getWarnings(); ! ctrlPreparedStatement.setReturnValue(null); ! } mockPreparedStatement.close(); ctrlPreparedStatement.setVoidCallable(); |
From: Juergen H. <jho...@us...> - 2008-09-17 07:24:49
|
Update of /cvsroot/springframework/spring/mock/org/springframework/mock/jndi In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27015/mock/org/springframework/mock/jndi Modified Files: SimpleNamingContextBuilder.java Log Message: SimpleNamingContextBuilder supports "deactivate()"+"activate()", with the standard JNDI provider exposed inbetween Index: SimpleNamingContextBuilder.java =================================================================== RCS file: /cvsroot/springframework/spring/mock/org/springframework/mock/jndi/SimpleNamingContextBuilder.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SimpleNamingContextBuilder.java 14 Nov 2005 18:12:33 -0000 1.7 --- SimpleNamingContextBuilder.java 17 Sep 2008 14:24:46 -0000 1.8 *************** *** 1,11 **** /* ! * Copyright 2002-2005 the original author or authors. ! * * 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, --- 1,11 ---- /* ! * Copyright 2002-2008 the original author or authors. ! * * 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, *************** *** 28,31 **** --- 28,33 ---- import org.apache.commons.logging.LogFactory; + import org.springframework.util.ClassUtils; + /** * Simple implementation of a JNDI naming context builder. *************** *** 46,50 **** * <p>Typical usage in bootstrap code: * ! * <pre> * SimpleNamingContextBuilder builder = new SimpleNamingContextBuilder(); * DataSource ds = new DriverManagerDataSource(...); --- 48,52 ---- * <p>Typical usage in bootstrap code: * ! * <pre class="code"> * SimpleNamingContextBuilder builder = new SimpleNamingContextBuilder(); * DataSource ds = new DriverManagerDataSource(...); *************** *** 57,67 **** * or a newly activated one: * ! * <pre> * SimpleNamingContextBuilder builder = SimpleNamingContextBuilder.emptyActivatedContextBuilder(); * DataSource ds = new DriverManagerDataSource(...); * builder.bind("java:comp/env/jdbc/myds", ds);</pre> * ! * Note that you <i>should not</i> call activate() on a builder from this ! * factory method, as there will already be an activated one in any case. * * <p>An instance of this class is only necessary at setup time. --- 59,69 ---- * or a newly activated one: * ! * <pre class="code"> * SimpleNamingContextBuilder builder = SimpleNamingContextBuilder.emptyActivatedContextBuilder(); * DataSource ds = new DriverManagerDataSource(...); * builder.bind("java:comp/env/jdbc/myds", ds);</pre> * ! * Note that you <i>should not</i> call <code>activate()</code> on a builder from ! * this factory method, as there will already be an activated one in any case. * * <p>An instance of this class is only necessary at setup time. *************** *** 79,85 **** */ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder { ! /** An instance of this class bound to JNDI */ ! private static SimpleNamingContextBuilder activated; --- 81,91 ---- */ public class SimpleNamingContextBuilder implements InitialContextFactoryBuilder { ! /** An instance of this class bound to JNDI */ ! private static volatile SimpleNamingContextBuilder activated; ! ! private static boolean initialized = false; ! ! private static final Object initializationLock = new Object(); *************** *** 132,147 **** public void activate() throws IllegalStateException, NamingException { logger.info("Activating simple JNDI environment"); ! if (NamingManager.hasInitialContextFactoryBuilder()) { ! throw new IllegalStateException( ! "Cannot activate SimpleNamingContextBuilder: there is already a JNDI provider registered. " + ! "Note that JNDI is a JVM-wide service, shared at the JVM system class loader level, " + ! "with no reset option. As a consequence, a JNDI provider must only be registered once per JVM."); } - NamingManager.setInitialContextFactoryBuilder(this); activated = this; } /** ! * Clear all bindings in this context builder. */ public void clear() { --- 138,172 ---- public void activate() throws IllegalStateException, NamingException { logger.info("Activating simple JNDI environment"); ! synchronized (initializationLock) { ! if (!initialized) { ! if (NamingManager.hasInitialContextFactoryBuilder()) { ! throw new IllegalStateException( ! "Cannot activate SimpleNamingContextBuilder: there is already a JNDI provider registered. " + ! "Note that JNDI is a JVM-wide service, shared at the JVM system class loader level, " + ! "with no reset option. As a consequence, a JNDI provider must only be registered once per JVM."); ! } ! NamingManager.setInitialContextFactoryBuilder(this); ! initialized = true; ! } } activated = this; } /** ! * Temporarily deactivate this context builder. It will remain registered with ! * the JNDI NamingManager but will delegate to the standard JNDI InitialContextFactory ! * (if configured) instead of exposing its own bound objects. ! * <p>Call <code>activate()</code> again in order to expose this contexz builder's own ! * bound objects again. Such activate/deactivate sequences can be applied any number ! * of times (e.g. within a larger integration test suite running in the same VM). ! * @see #activate() ! */ ! public void deactivate() { ! logger.info("Deactivating simple JNDI environment"); ! activated = null; ! } ! ! /** ! * Clear all bindings in this context builder, while keeping it active. */ public void clear() { *************** *** 162,165 **** --- 187,191 ---- } + /** * Simple InitialContextFactoryBuilder implementation, *************** *** 168,171 **** --- 194,228 ---- */ public InitialContextFactory createInitialContextFactory(Hashtable environment) { + if (activated == null && environment != null) { + Object icf = environment.get(Context.INITIAL_CONTEXT_FACTORY); + if (icf != null) { + Class icfClass = null; + if (icf instanceof Class) { + icfClass = (Class) icf; + } + else if (icf instanceof String) { + icfClass = ClassUtils.resolveClassName((String) icf, getClass().getClassLoader()); + } + else { + throw new IllegalArgumentException("Invalid value type for environment key [" + + Context.INITIAL_CONTEXT_FACTORY + "]: " + icf.getClass().getName()); + } + if (!InitialContextFactory.class.isAssignableFrom(icfClass)) { + throw new IllegalArgumentException( + "Specified class does not implement [" + InitialContextFactory.class.getName() + "]: " + icf); + } + try { + return (InitialContextFactory) icfClass.newInstance(); + } + catch (Throwable ex) { + IllegalStateException ise = + new IllegalStateException("Cannot instantiate specified InitialContextFactory: " + icf); + ise.initCause(ex); + throw ise; + } + } + } + + // Default case... return new InitialContextFactory() { public Context getInitialContext(Hashtable environment) { |
From: Juergen H. <jho...@us...> - 2008-09-17 05:04:14
|
Update of /cvsroot/springframework/spring/mock/org/springframework/mock/jndi In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7177/mock/org/springframework/mock/jndi Modified Files: ExpectedLookupTemplate.java Log Message: polishing Index: ExpectedLookupTemplate.java =================================================================== RCS file: /cvsroot/springframework/spring/mock/org/springframework/mock/jndi/ExpectedLookupTemplate.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ExpectedLookupTemplate.java 6 Aug 2005 10:52:35 -0000 1.5 --- ExpectedLookupTemplate.java 17 Sep 2008 12:04:09 -0000 1.6 *************** *** 1,11 **** /* ! * Copyright 2002-2005 the original author or authors. ! * * 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, --- 1,11 ---- /* ! * Copyright 2002-2008 the original author or authors. ! * * 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, *************** *** 17,30 **** package org.springframework.mock.jndi; - import java.util.Collections; - import java.util.HashMap; import java.util.Map; import javax.naming.NamingException; import org.springframework.jndi.JndiTemplate; /** ! * Simple implementation of JndiTemplate interface that always returns * a given object. Very useful for testing. Effectively a mock object. * --- 17,29 ---- package org.springframework.mock.jndi; import java.util.Map; import javax.naming.NamingException; + import org.springframework.core.CollectionFactory; import org.springframework.jndi.JndiTemplate; /** ! * Simple extension of the JndiTemplate class that always returns * a given object. Very useful for testing. Effectively a mock object. * *************** *** 34,38 **** public class ExpectedLookupTemplate extends JndiTemplate { ! private final Map jndiObjects = Collections.synchronizedMap(new HashMap()); --- 33,37 ---- public class ExpectedLookupTemplate extends JndiTemplate { ! private final Map jndiObjects = CollectionFactory.createConcurrentMapIfPossible(16); *************** *** 55,58 **** --- 54,58 ---- } + /** * Add the given object to the list of JNDI objects that this |
From: Juergen H. <jho...@us...> - 2008-09-16 13:11:26
|
Update of /cvsroot/springframework/spring/src/org/springframework/web/context/request In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv3920/src/org/springframework/web/context/request Modified Files: RequestContextHolder.java Log Message: always use local ClassLoader for class presence check Index: RequestContextHolder.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/web/context/request/RequestContextHolder.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** RequestContextHolder.java 20 Feb 2008 12:38:19 -0000 1.8 --- RequestContextHolder.java 16 Sep 2008 20:11:23 -0000 1.9 *************** *** 44,48 **** public abstract class RequestContextHolder { ! private static final boolean jsfPresent = ClassUtils.isPresent("javax.faces.context.FacesContext"); private static final ThreadLocal requestAttributesHolder = new NamedThreadLocal("Request attributes"); --- 44,49 ---- public abstract class RequestContextHolder { ! private static final boolean jsfPresent = ! ClassUtils.isPresent("javax.faces.context.FacesContext", RequestContextHolder.class.getClassLoader()); private static final ThreadLocal requestAttributesHolder = new NamedThreadLocal("Request attributes"); |
From: Juergen H. <jho...@us...> - 2008-09-16 13:09:24
|
Update of /cvsroot/springframework/spring/src/org/springframework/context/config In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv3043/src/org/springframework/context/config Modified Files: MBeanServerBeanDefinitionParser.java Log Message: always use local ClassLoader for class presence check Index: MBeanServerBeanDefinitionParser.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/context/config/MBeanServerBeanDefinitionParser.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MBeanServerBeanDefinitionParser.java 14 May 2008 21:23:19 -0000 1.2 --- MBeanServerBeanDefinitionParser.java 16 Sep 2008 20:09:21 -0000 1.3 *************** *** 32,36 **** /** * Parser for the <context:mbean-server/> element. ! * <p>Registers an instance of {@link org.springframework.jmx.export.annotation.AnnotationMBeanExporter} within the context. * * @author Mark Fisher --- 32,39 ---- /** * Parser for the <context:mbean-server/> element. ! * ! * <p>Registers an instance of ! * {@link org.springframework.jmx.export.annotation.AnnotationMBeanExporter} ! * within the context. * * @author Mark Fisher *************** *** 46,54 **** ! private static final boolean weblogicPresent = ! ClassUtils.isPresent("weblogic.management.Helper"); ! private static final boolean webspherePresent = ! ClassUtils.isPresent("com.ibm.websphere.management.AdminServiceFactory"); --- 49,57 ---- ! private static final boolean weblogicPresent = ClassUtils.isPresent( ! "weblogic.management.Helper", MBeanServerBeanDefinitionParser.class.getClassLoader()); ! private static final boolean webspherePresent = ClassUtils.isPresent( ! "com.ibm.websphere.management.AdminServiceFactory", MBeanServerBeanDefinitionParser.class.getClassLoader()); |
From: Juergen H. <jho...@us...> - 2008-09-16 13:09:24
|
Update of /cvsroot/springframework/spring/src/org/springframework/transaction/config In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv3043/src/org/springframework/transaction/config Modified Files: JtaTransactionManagerBeanDefinitionParser.java Log Message: always use local ClassLoader for class presence check Index: JtaTransactionManagerBeanDefinitionParser.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/transaction/config/JtaTransactionManagerBeanDefinitionParser.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** JtaTransactionManagerBeanDefinitionParser.java 25 Feb 2008 20:25:38 -0000 1.4 --- JtaTransactionManagerBeanDefinitionParser.java 16 Sep 2008 20:09:21 -0000 1.5 *************** *** 50,58 **** ! private static final boolean weblogicPresent = ClassUtils.isPresent("weblogic.transaction.UserTransaction"); ! private static final boolean webspherePresent = ClassUtils.isPresent("com.ibm.wsspi.uow.UOWManager"); ! private static final boolean oc4jPresent = ClassUtils.isPresent("oracle.j2ee.transaction.OC4JTransactionManager"); --- 50,61 ---- ! private static final boolean weblogicPresent = ClassUtils.isPresent( ! "weblogic.transaction.UserTransaction", JtaTransactionManagerBeanDefinitionParser.class.getClassLoader()); ! private static final boolean webspherePresent = ClassUtils.isPresent( ! "com.ibm.wsspi.uow.UOWManager", JtaTransactionManagerBeanDefinitionParser.class.getClassLoader()); ! private static final boolean oc4jPresent = ClassUtils.isPresent( ! "oracle.j2ee.transaction.OC4JTransactionManager", JtaTransactionManagerBeanDefinitionParser.class.getClassLoader()); |
From: Juergen H. <jho...@us...> - 2008-09-16 13:09:24
|
Update of /cvsroot/springframework/spring/src/org/springframework/util In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv3043/src/org/springframework/util Modified Files: ClassUtils.java Log Message: always use local ClassLoader for class presence check Index: ClassUtils.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/util/ClassUtils.java,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** ClassUtils.java 4 Jun 2008 08:42:13 -0000 1.76 --- ClassUtils.java 16 Sep 2008 20:09:21 -0000 1.77 *************** *** 150,184 **** /** - * Determine whether the {@link Class} identified by the supplied name is present - * and can be loaded. Will return <code>false</code> if either the class or - * one of its dependencies is not present or cannot be loaded. - * @param className the name of the class to check - * @return whether the specified class is present - */ - public static boolean isPresent(String className) { - return isPresent(className, getDefaultClassLoader()); - } - - /** - * Determine whether the {@link Class} identified by the supplied name is present - * and can be loaded. Will return <code>false</code> if either the class or - * one of its dependencies is not present or cannot be loaded. - * @param className the name of the class to check - * @param classLoader the class loader to use - * (may be <code>null</code>, which indicates the default class loader) - * @return whether the specified class is present - */ - public static boolean isPresent(String className, ClassLoader classLoader) { - try { - forName(className, classLoader); - return true; - } - catch (Throwable ex) { - // Class or one of its dependencies is not present... - return false; - } - } - - /** * Replacement for <code>Class.forName()</code> that also returns Class instances * for primitives (like "int") and array class names (like "String[]"). --- 150,153 ---- *************** *** 296,299 **** --- 265,300 ---- /** + * Determine whether the {@link Class} identified by the supplied name is present + * and can be loaded. Will return <code>false</code> if either the class or + * one of its dependencies is not present or cannot be loaded. + * @param className the name of the class to check + * @return whether the specified class is present + * @deprecated as of Spring 2.5, in favor of {@link #isPresent(String, ClassLoader)} + */ + public static boolean isPresent(String className) { + return isPresent(className, getDefaultClassLoader()); + } + + /** + * Determine whether the {@link Class} identified by the supplied name is present + * and can be loaded. Will return <code>false</code> if either the class or + * one of its dependencies is not present or cannot be loaded. + * @param className the name of the class to check + * @param classLoader the class loader to use + * (may be <code>null</code>, which indicates the default class loader) + * @return whether the specified class is present + */ + public static boolean isPresent(String className, ClassLoader classLoader) { + try { + forName(className, classLoader); + return true; + } + catch (Throwable ex) { + // Class or one of its dependencies is not present... + return false; + } + } + + /** * Return the user-defined class for the given instance: usually simply * the class of the given instance, but the original class in case of a |
From: Juergen H. <jho...@us...> - 2008-09-16 12:59:35
|
Update of /cvsroot/springframework/spring/src/org/springframework/beans/factory/support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv31310/src/org/springframework/beans/factory/support Modified Files: BeanDefinitionValueResolver.java DefaultSingletonBeanRegistry.java Log Message: DefaultSingletonBeanRegistry eagerly cleans up cached dependency information when destroying a bean Index: BeanDefinitionValueResolver.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/beans/factory/support/BeanDefinitionValueResolver.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** BeanDefinitionValueResolver.java 8 Dec 2007 23:36:01 -0000 1.32 --- BeanDefinitionValueResolver.java 16 Sep 2008 19:59:32 -0000 1.33 *************** *** 1,4 **** /* ! * Copyright 2002-2007 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2008 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 218,222 **** } Object innerBean = this.beanFactory.createBean(actualInnerBeanName, mbd, null); ! this.beanFactory.registerDependentBean(actualInnerBeanName, this.beanName); if (innerBean instanceof FactoryBean) { boolean synthetic = (mbd != null && mbd.isSynthetic()); --- 218,222 ---- } Object innerBean = this.beanFactory.createBean(actualInnerBeanName, mbd, null); ! this.beanFactory.registerContainedBean(actualInnerBeanName, this.beanName); if (innerBean instanceof FactoryBean) { boolean synthetic = (mbd != null && mbd.isSynthetic()); Index: DefaultSingletonBeanRegistry.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** DefaultSingletonBeanRegistry.java 7 Jun 2008 13:28:52 -0000 1.25 --- DefaultSingletonBeanRegistry.java 16 Sep 2008 19:59:32 -0000 1.26 *************** *** 23,28 **** import java.util.LinkedHashMap; import java.util.LinkedHashSet; - import java.util.LinkedList; - import java.util.List; import java.util.Map; import java.util.Set; --- 23,26 ---- *************** *** 109,112 **** --- 107,113 ---- private final Map disposableBeans = new LinkedHashMap(16); + /** Map between containing bean names: bean name --> Set of bean names that the bean contains */ + private final Map containedBeanMap = CollectionFactory.createConcurrentMapIfPossible(16); + /** Map between dependent bean names: bean name --> Set of dependent bean names */ private final Map dependentBeanMap = CollectionFactory.createConcurrentMapIfPossible(16); *************** *** 336,339 **** --- 337,361 ---- /** + * Register a containment relationship between two beans, + * e.g. between an inner bean and its containing outer bean. + * <p>Also registers the containing bean as dependent on the contained bean + * in terms of destruction order. + * @param containedBeanName the name of the contained (inner) bean + * @param containingBeanName the name of the containing (outer) bean + * @see #registerDependentBean + */ + public void registerContainedBean(String containedBeanName, String containingBeanName) { + synchronized (this.containedBeanMap) { + Set containedBeans = (Set) this.containedBeanMap.get(containingBeanName); + if (containedBeans == null) { + containedBeans = new LinkedHashSet(8); + this.containedBeanMap.put(containingBeanName, containedBeans); + } + containedBeans.add(containedBeanName); + } + registerDependentBean(containedBeanName, containingBeanName); + } + + /** * Register a dependent bean for the given bean, * to be destroyed before the given bean is destroyed. *************** *** 361,366 **** /** ! * Determine whether a dependent bean has been registered under the given name. ! * @param beanName the name of the bean */ protected boolean hasDependentBean(String beanName) { --- 383,388 ---- /** ! * Determine whether a dependent bean has been registered for the given name. ! * @param beanName the name of the bean to check */ protected boolean hasDependentBean(String beanName) { *************** *** 402,405 **** --- 424,428 ---- this.singletonsCurrentlyInDestruction = true; } + synchronized (this.disposableBeans) { String[] disposableBeanNames = StringUtils.toStringArray(this.disposableBeans.keySet()); *************** *** 408,411 **** --- 431,439 ---- } } + + this.containedBeanMap.clear(); + this.dependentBeanMap.clear(); + this.dependenciesForBeanMap.clear(); + synchronized (this.singletonObjects) { this.singletonObjects.clear(); *************** *** 442,445 **** --- 470,474 ---- */ protected void destroyBean(String beanName, DisposableBean bean) { + // Trigger destruction of dependent beans first... Set dependencies = (Set) this.dependentBeanMap.remove(beanName); if (dependencies != null) { *************** *** 452,455 **** --- 481,486 ---- } } + + // Actually destroy the bean now... if (bean != null) { try { *************** *** 460,463 **** --- 491,518 ---- } } + + // Trigger destruction of contained beans... + Set containedBeans = (Set) this.containedBeanMap.remove(beanName); + if (containedBeans != null) { + for (Iterator it = containedBeans.iterator(); it.hasNext();) { + String containedBeanName = (String) it.next(); + destroySingleton(containedBeanName); + } + } + + // Remove destroyed bean from other beans' dependencies. + synchronized (this.dependentBeanMap) { + for (Iterator it = this.dependentBeanMap.entrySet().iterator(); it.hasNext();) { + Map.Entry entry = (Map.Entry) it.next(); + Set dependenciesToClean = (Set) entry.getValue(); + dependenciesToClean.remove(beanName); + if (dependenciesToClean.isEmpty()) { + it.remove(); + } + } + } + + // Remove destroyed bean's prepared dependency information. + this.dependenciesForBeanMap.remove(beanName); } |
From: Juergen H. <jho...@us...> - 2008-09-16 12:38:53
|
Update of /cvsroot/springframework/spring/tiger/test/org/springframework/beans/factory/support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv22837/tiger/test/org/springframework/beans/factory/support Modified Files: BeanFactoryGenericsTests.java genericBeanTests.xml Log Message: correctly resolve collection element type even when target bean is a collection itself Index: genericBeanTests.xml =================================================================== RCS file: /cvsroot/springframework/spring/tiger/test/org/springframework/beans/factory/support/genericBeanTests.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** genericBeanTests.xml 19 Jan 2008 00:47:02 -0000 1.4 --- genericBeanTests.xml 16 Sep 2008 19:38:48 -0000 1.5 *************** *** 64,66 **** --- 64,70 ---- </bean> + <bean id="setBean" class="org.springframework.beans.factory.support.BeanFactoryGenericsTests$UrlSet"> + <property name="urlNames" value="http://www.springframework.org"/> + </bean> + </beans> Index: BeanFactoryGenericsTests.java =================================================================== RCS file: /cvsroot/springframework/spring/tiger/test/org/springframework/beans/factory/support/BeanFactoryGenericsTests.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** BeanFactoryGenericsTests.java 19 Jan 2008 00:47:02 -0000 1.9 --- BeanFactoryGenericsTests.java 16 Sep 2008 19:38:48 -0000 1.10 *************** *** 18,21 **** --- 18,22 ---- import java.net.MalformedURLException; + import java.net.URI; import java.net.URL; import java.util.ArrayList; *************** *** 545,548 **** --- 546,556 ---- } + public void testSetBean() throws Exception { + XmlBeanFactory bf = new XmlBeanFactory(new ClassPathResource("genericBeanTests.xml", getClass())); + UrlSet us = (UrlSet) bf.getBean("setBean"); + assertEquals(1, us.size()); + assertEquals(new URL("http://www.springframework.org"), us.iterator().next()); + } + public static class NamedUrlList extends LinkedList<URL> { *************** *** 567,569 **** --- 575,595 ---- } + + public static class UrlSet extends HashSet<URL> { + + public UrlSet() { + super(); + } + + public UrlSet(Set<? extends URL> urls) { + super(); + } + + public void setUrlNames(Set<URI> urlNames) throws MalformedURLException { + for (URI urlName : urlNames) { + add(urlName.toURL()); + } + } + } + } |
From: Juergen H. <jho...@us...> - 2008-09-16 12:38:52
|
Update of /cvsroot/springframework/spring/src/org/springframework/core In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv22837/src/org/springframework/core Modified Files: GenericCollectionTypeResolver.java Log Message: correctly resolve collection element type even when target bean is a collection itself Index: GenericCollectionTypeResolver.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/core/GenericCollectionTypeResolver.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** GenericCollectionTypeResolver.java 19 Jan 2008 00:47:02 -0000 1.14 --- GenericCollectionTypeResolver.java 16 Sep 2008 19:38:48 -0000 1.15 *************** *** 35,45 **** * (to be able to attempt type conversion if appropriate). * ! * <p>Only usable on Java 5. Use an appropriate JdkVersion check before ! * calling this class, if a fallback for JDK 1.4 is desirable. * * @author Juergen Hoeller * @since 2.0 ! * @see org.springframework.beans.BeanWrapperImpl ! * @see JdkVersion */ public abstract class GenericCollectionTypeResolver { --- 35,44 ---- * (to be able to attempt type conversion if appropriate). * ! * <p>Only usable on Java 5. Use an appropriate {@link JdkVersion} check ! * before calling this class, if a fallback for JDK 1.4 is desirable. * * @author Juergen Hoeller * @since 2.0 ! * @see org.springframework.beans.BeanWrapper */ public abstract class GenericCollectionTypeResolver { *************** *** 393,396 **** --- 392,398 ---- MethodParameter methodParam, Class clazz, Class source, int typeIndex, int nestingLevel, int currentLevel) { + if (clazz.getName().startsWith("java.util.")) { + return null; + } if (clazz.getSuperclass() != null && isIntrospectionCandidate(clazz.getSuperclass())) { return extractType(methodParam, clazz.getGenericSuperclass(), source, typeIndex, nestingLevel, currentLevel); *************** *** 416,420 **** * that defines generic collection or map types. * @param clazz the class to check ! * @return whethe the given class is assignable to Collection or Map */ private static boolean isIntrospectionCandidate(Class clazz) { --- 418,422 ---- * that defines generic collection or map types. * @param clazz the class to check ! * @return whether the given class is assignable to Collection or Map */ private static boolean isIntrospectionCandidate(Class clazz) { |
From: Juergen H. <jho...@us...> - 2008-09-15 15:44:52
|
Update of /cvsroot/springframework/spring/lib In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27652/lib Modified Files: readme.txt Log Message: updated to Hibernate 3.3.1 GA Index: readme.txt =================================================================== RCS file: /cvsroot/springframework/spring/lib/readme.txt,v retrieving revision 1.210 retrieving revision 1.211 diff -C2 -d -r1.210 -r1.211 *** readme.txt 25 Aug 2008 22:12:20 -0000 1.210 --- readme.txt 15 Sep 2008 15:44:14 -0000 1.211 *************** *** 100,104 **** * hibernate/hibernate3.jar ! - Hibernate 3.3.0 SP1 (http://www.hibernate.org) - required for building the framework - required at runtime when using Spring's Hibernate support --- 100,104 ---- * hibernate/hibernate3.jar ! - Hibernate 3.3.1 GA (http://www.hibernate.org) - required for building the framework - required at runtime when using Spring's Hibernate support |
From: Juergen H. <jho...@us...> - 2008-09-15 15:44:29
|
Update of /cvsroot/springframework/spring/lib/hibernate In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27652/lib/hibernate Modified Files: hibernate3.jar Log Message: updated to Hibernate 3.3.1 GA Index: hibernate3.jar =================================================================== RCS file: /cvsroot/springframework/spring/lib/hibernate/hibernate3.jar,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 Binary files /tmp/cvs1NNx7o and /tmp/cvsZqh2Of differ |