From: Juergen H. <jho...@us...> - 2006-04-21 00:13:58
|
Update of /cvsroot/springframework/spring/test/org/springframework/jdbc/datasource In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19629/test/org/springframework/jdbc/datasource Modified Files: Tag: mbranch-1-2 DataSourceTransactionManagerTests.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: DataSourceTransactionManagerTests.java =================================================================== RCS file: /cvsroot/springframework/spring/test/org/springframework/jdbc/datasource/DataSourceTransactionManagerTests.java,v retrieving revision 1.30 retrieving revision 1.30.2.1 diff -C2 -d -r1.30 -r1.30.2.1 *** DataSourceTransactionManagerTests.java 14 Nov 2005 22:10:13 -0000 1.30 --- DataSourceTransactionManagerTests.java 21 Apr 2006 00:13:51 -0000 1.30.2.1 *************** *** 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-2006 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, *************** *** 31,35 **** import org.springframework.dao.DataAccessResourceFailureException; import org.springframework.jdbc.UncategorizedSQLException; ! import org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor; import org.springframework.transaction.CannotCreateTransactionException; import org.springframework.transaction.IllegalTransactionStateException; --- 31,35 ---- import org.springframework.dao.DataAccessResourceFailureException; import org.springframework.jdbc.UncategorizedSQLException; ! import org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor; import org.springframework.transaction.CannotCreateTransactionException; import org.springframework.transaction.IllegalTransactionStateException; *************** *** 86,89 **** --- 86,93 ---- ds.getConnection(); dsControl.setReturnValue(con, 1); + if (createStatement) { + con.getMetaData(); + conControl.setReturnValue(null, 1); + } con.getAutoCommit(); conControl.setReturnValue(autoCommit, 1); *************** *** 141,145 **** if (createStatement) { tCon.createStatement(); ! assertEquals(con, new CommonsDbcpNativeJdbcExtractor().getNativeConnection(tCon)); } } --- 145,149 ---- if (createStatement) { tCon.createStatement(); ! assertEquals(con, new SimpleNativeJdbcExtractor().getNativeConnection(tCon)); } } *************** *** 708,711 **** --- 712,717 ---- ds.getConnection(); dsControl.setReturnValue(con, 1); + con.getMetaData(); + conControl.setReturnValue(null, 1); con.getAutoCommit(); conControl.setReturnValue(true, 1); *************** *** 734,738 **** try { assertEquals(con, ((ConnectionProxy) dsProxy.getConnection()).getTargetConnection()); ! assertEquals(con, new CommonsDbcpNativeJdbcExtractor().getNativeConnection(dsProxy.getConnection())); // should be ignored dsProxy.getConnection().close(); --- 740,744 ---- try { assertEquals(con, ((ConnectionProxy) dsProxy.getConnection()).getTargetConnection()); ! assertEquals(con, new SimpleNativeJdbcExtractor().getNativeConnection(dsProxy.getConnection())); // should be ignored dsProxy.getConnection().close(); |