From 620c9b1f96104f391159fb88715c0c901002f20c Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 3 Jul 2009 09:32:15 +0000 Subject: [PATCH] [SPR-5895] Upgraded to EasyMock 2.5.1. --- org.springframework.aop/.classpath | 2 +- org.springframework.aop/aop.iml | 4 +- org.springframework.aop/ivy.xml | 2 +- org.springframework.beans/.classpath | 2 +- org.springframework.beans/beans.iml | 4 +- org.springframework.beans/ivy.xml | 2 +- .../.classpath | 2 +- .../context-support.iml | 4 +- org.springframework.context.support/ivy.xml | 2 +- org.springframework.context/.classpath | 2 +- org.springframework.context/context.iml | 4 +- org.springframework.context/ivy.xml | 2 +- org.springframework.core/.classpath | 2 +- org.springframework.core/core.iml | 4 +- org.springframework.core/ivy.xml | 2 +- .../.classpath | 2 +- .../integration-tests.iml | 4 +- org.springframework.integration-tests/ivy.xml | 5 +- org.springframework.jdbc/.classpath | 2 +- org.springframework.jdbc/ivy.xml | 2 +- org.springframework.jdbc/jdbc.iml | 4 +- org.springframework.jms/.classpath | 2 +- org.springframework.jms/ivy.xml | 2 +- org.springframework.jms/jms.iml | 4 +- org.springframework.orm/.classpath | 2 +- org.springframework.orm/ivy.xml | 2 +- org.springframework.orm/orm.iml | 4 +- org.springframework.oxm/.classpath | 2 +- org.springframework.oxm/ivy.xml | 2 +- org.springframework.oxm/oxm.iml | 4 +- org.springframework.transaction/.classpath | 2 +- org.springframework.transaction/ivy.xml | 2 +- .../jca/cci/CciTemplateTests.java | 167 ++++++++++++------ ...aTransactionManagerSerializationTests.java | 34 ++-- .../transaction.iml | 4 +- org.springframework.web.portlet/.classpath | 2 +- org.springframework.web.portlet/ivy.xml | 2 +- .../web-portlet.iml | 4 +- org.springframework.web.servlet/.classpath | 2 +- org.springframework.web.servlet/ivy.xml | 2 +- .../web-servlet.iml | 4 +- org.springframework.web/.classpath | 2 +- org.springframework.web/ivy.xml | 2 +- org.springframework.web/web.iml | 4 +- 44 files changed, 185 insertions(+), 131 deletions(-) diff --git a/org.springframework.aop/.classpath b/org.springframework.aop/.classpath index 512a59cf5f..af8be6e1b2 100644 --- a/org.springframework.aop/.classpath +++ b/org.springframework.aop/.classpath @@ -7,7 +7,7 @@ - + diff --git a/org.springframework.aop/aop.iml b/org.springframework.aop/aop.iml index 18ccbe2688..c4e766846b 100644 --- a/org.springframework.aop/aop.iml +++ b/org.springframework.aop/aop.iml @@ -104,11 +104,11 @@ - + - + diff --git a/org.springframework.aop/ivy.xml b/org.springframework.aop/ivy.xml index ad3a779f6a..adcf481435 100644 --- a/org.springframework.aop/ivy.xml +++ b/org.springframework.aop/ivy.xml @@ -33,7 +33,7 @@ - + diff --git a/org.springframework.beans/.classpath b/org.springframework.beans/.classpath index d76169022a..46d24dab23 100644 --- a/org.springframework.beans/.classpath +++ b/org.springframework.beans/.classpath @@ -11,6 +11,6 @@ - + diff --git a/org.springframework.beans/beans.iml b/org.springframework.beans/beans.iml index 362fbff8ed..88f7c20d75 100644 --- a/org.springframework.beans/beans.iml +++ b/org.springframework.beans/beans.iml @@ -81,11 +81,11 @@ - + - + diff --git a/org.springframework.beans/ivy.xml b/org.springframework.beans/ivy.xml index 35e406b6e7..3205b8568a 100644 --- a/org.springframework.beans/ivy.xml +++ b/org.springframework.beans/ivy.xml @@ -27,7 +27,7 @@ - + diff --git a/org.springframework.context.support/.classpath b/org.springframework.context.support/.classpath index 203c72781b..0306cb0eb9 100644 --- a/org.springframework.context.support/.classpath +++ b/org.springframework.context.support/.classpath @@ -22,7 +22,7 @@ - + diff --git a/org.springframework.context.support/context-support.iml b/org.springframework.context.support/context-support.iml index 89581ee4b1..5aafbba9de 100644 --- a/org.springframework.context.support/context-support.iml +++ b/org.springframework.context.support/context-support.iml @@ -151,11 +151,11 @@ - + - + diff --git a/org.springframework.context.support/ivy.xml b/org.springframework.context.support/ivy.xml index 5edcf56890..cb8dfb61f7 100644 --- a/org.springframework.context.support/ivy.xml +++ b/org.springframework.context.support/ivy.xml @@ -47,7 +47,7 @@ - + diff --git a/org.springframework.context/.classpath b/org.springframework.context/.classpath index 2db63a760a..e334a6e36c 100644 --- a/org.springframework.context/.classpath +++ b/org.springframework.context/.classpath @@ -29,7 +29,7 @@ - + diff --git a/org.springframework.context/context.iml b/org.springframework.context/context.iml index 2ee940df9a..16f094b9ae 100644 --- a/org.springframework.context/context.iml +++ b/org.springframework.context/context.iml @@ -176,11 +176,11 @@ - + - + diff --git a/org.springframework.context/ivy.xml b/org.springframework.context/ivy.xml index 793f9938e7..bb4f7b35f4 100644 --- a/org.springframework.context/ivy.xml +++ b/org.springframework.context/ivy.xml @@ -58,7 +58,7 @@ - + diff --git a/org.springframework.core/.classpath b/org.springframework.core/.classpath index fbc9daafab..6271b5f4e5 100644 --- a/org.springframework.core/.classpath +++ b/org.springframework.core/.classpath @@ -11,7 +11,7 @@ - + diff --git a/org.springframework.core/core.iml b/org.springframework.core/core.iml index 83229123d0..62343b6a1c 100644 --- a/org.springframework.core/core.iml +++ b/org.springframework.core/core.iml @@ -91,11 +91,11 @@ - + - + diff --git a/org.springframework.core/ivy.xml b/org.springframework.core/ivy.xml index 3465fd8d15..a27ee7461e 100644 --- a/org.springframework.core/ivy.xml +++ b/org.springframework.core/ivy.xml @@ -33,7 +33,7 @@ - + diff --git a/org.springframework.integration-tests/.classpath b/org.springframework.integration-tests/.classpath index 67233bbe81..50f068b74b 100644 --- a/org.springframework.integration-tests/.classpath +++ b/org.springframework.integration-tests/.classpath @@ -52,7 +52,7 @@ - + diff --git a/org.springframework.integration-tests/integration-tests.iml b/org.springframework.integration-tests/integration-tests.iml index 1f06973719..929dba9a2a 100644 --- a/org.springframework.integration-tests/integration-tests.iml +++ b/org.springframework.integration-tests/integration-tests.iml @@ -35,11 +35,11 @@ - + - + diff --git a/org.springframework.integration-tests/ivy.xml b/org.springframework.integration-tests/ivy.xml index 2fdf9e5e7b..a0a27a4257 100644 --- a/org.springframework.integration-tests/ivy.xml +++ b/org.springframework.integration-tests/ivy.xml @@ -65,8 +65,6 @@ - - @@ -93,7 +91,8 @@ - + + diff --git a/org.springframework.jdbc/.classpath b/org.springframework.jdbc/.classpath index 0f2cdefa67..fd85218782 100644 --- a/org.springframework.jdbc/.classpath +++ b/org.springframework.jdbc/.classpath @@ -14,7 +14,7 @@ - + diff --git a/org.springframework.jdbc/ivy.xml b/org.springframework.jdbc/ivy.xml index 0b388d0c1b..f43d516931 100644 --- a/org.springframework.jdbc/ivy.xml +++ b/org.springframework.jdbc/ivy.xml @@ -35,7 +35,7 @@ - + diff --git a/org.springframework.jdbc/jdbc.iml b/org.springframework.jdbc/jdbc.iml index 38e90218bc..fffe32d682 100644 --- a/org.springframework.jdbc/jdbc.iml +++ b/org.springframework.jdbc/jdbc.iml @@ -85,11 +85,11 @@ - + - + diff --git a/org.springframework.jms/.classpath b/org.springframework.jms/.classpath index c2e5e13575..61ba52f582 100644 --- a/org.springframework.jms/.classpath +++ b/org.springframework.jms/.classpath @@ -11,7 +11,7 @@ - + diff --git a/org.springframework.jms/ivy.xml b/org.springframework.jms/ivy.xml index f0c6ce14f8..4184657479 100644 --- a/org.springframework.jms/ivy.xml +++ b/org.springframework.jms/ivy.xml @@ -30,7 +30,7 @@ conf="compile->compile"/> - + diff --git a/org.springframework.jms/jms.iml b/org.springframework.jms/jms.iml index 83e52fde9f..ca4c097e52 100644 --- a/org.springframework.jms/jms.iml +++ b/org.springframework.jms/jms.iml @@ -96,11 +96,11 @@ - + - + diff --git a/org.springframework.orm/.classpath b/org.springframework.orm/.classpath index f74ef944b7..a6f2aecc33 100644 --- a/org.springframework.orm/.classpath +++ b/org.springframework.orm/.classpath @@ -28,7 +28,7 @@ - + diff --git a/org.springframework.orm/ivy.xml b/org.springframework.orm/ivy.xml index 93e0a9673e..92c09f0143 100644 --- a/org.springframework.orm/ivy.xml +++ b/org.springframework.orm/ivy.xml @@ -55,7 +55,7 @@ - + diff --git a/org.springframework.orm/orm.iml b/org.springframework.orm/orm.iml index 5d1a290e8b..60330185f3 100644 --- a/org.springframework.orm/orm.iml +++ b/org.springframework.orm/orm.iml @@ -206,11 +206,11 @@ - + - + diff --git a/org.springframework.oxm/.classpath b/org.springframework.oxm/.classpath index 6fe1af5a16..97942cdf54 100644 --- a/org.springframework.oxm/.classpath +++ b/org.springframework.oxm/.classpath @@ -17,7 +17,7 @@ - + diff --git a/org.springframework.oxm/ivy.xml b/org.springframework.oxm/ivy.xml index 2ea678b469..16d2cd3bb1 100644 --- a/org.springframework.oxm/ivy.xml +++ b/org.springframework.oxm/ivy.xml @@ -48,7 +48,7 @@ conf="compile->compile"/> - + - + - + diff --git a/org.springframework.transaction/.classpath b/org.springframework.transaction/.classpath index 8e28caf3de..b519b30f2c 100644 --- a/org.springframework.transaction/.classpath +++ b/org.springframework.transaction/.classpath @@ -14,7 +14,7 @@ - + diff --git a/org.springframework.transaction/ivy.xml b/org.springframework.transaction/ivy.xml index 5cd249a66e..4633763786 100644 --- a/org.springframework.transaction/ivy.xml +++ b/org.springframework.transaction/ivy.xml @@ -35,7 +35,7 @@ - + diff --git a/org.springframework.transaction/src/test/java/org/springframework/jca/cci/CciTemplateTests.java b/org.springframework.transaction/src/test/java/org/springframework/jca/cci/CciTemplateTests.java index 4ab9857902..d724b77190 100644 --- a/org.springframework.transaction/src/test/java/org/springframework/jca/cci/CciTemplateTests.java +++ b/org.springframework.transaction/src/test/java/org/springframework/jca/cci/CciTemplateTests.java @@ -16,8 +16,13 @@ package org.springframework.jca.cci; -import static org.easymock.EasyMock.*; -import static org.junit.Assert.*; +import static org.easymock.EasyMock.createMock; +import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.replay; +import static org.easymock.EasyMock.verify; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; import java.sql.SQLException; @@ -58,7 +63,8 @@ public class CciTemplateTests { expect(connectionFactory.getRecordFactory()).andReturn(recordFactory); - expect(recordFactory.createIndexedRecord("name")).andReturn(indexedRecord); + expect(recordFactory.createIndexedRecord("name")).andReturn( + indexedRecord); replay(connectionFactory, recordFactory); @@ -76,7 +82,8 @@ public class CciTemplateTests { expect(connectionFactory.getRecordFactory()).andReturn(recordFactory); - expect(recordFactory.createMappedRecord("name")).andReturn(mappedRecord); + expect(recordFactory.createMappedRecord("name")) + .andReturn(mappedRecord); replay(connectionFactory, recordFactory); @@ -101,7 +108,8 @@ public class CciTemplateTests { expect(connection.createInteraction()).andReturn(interaction); - expect(interaction.execute(interactionSpec, inputRecord, outputRecord)).andReturn(true); + expect(interaction.execute(interactionSpec, inputRecord, outputRecord)) + .andReturn(true); interaction.close(); @@ -116,7 +124,8 @@ public class CciTemplateTests { } @Test - public void testTemplateExecuteWithCreatorAndRecordFactoryNotSupported() throws ResourceException { + public void testTemplateExecuteWithCreatorAndRecordFactoryNotSupported() + throws ResourceException { ConnectionFactory connectionFactory = createMock(ConnectionFactory.class); Connection connection = createMock(Connection.class); Interaction interaction = createMock(Interaction.class); @@ -128,11 +137,13 @@ public class CciTemplateTests { expect(connectionFactory.getConnection()).andReturn(connection); - expect(connectionFactory.getRecordFactory()).andThrow(new NotSupportedException("not supported")); + expect(connectionFactory.getRecordFactory()).andThrow( + new NotSupportedException("not supported")); expect(connection.createInteraction()).andReturn(interaction); - expect(interaction.execute(interactionSpec, inputRecord, outputRecord)).andReturn(true); + expect(interaction.execute(interactionSpec, inputRecord, outputRecord)) + .andReturn(true); interaction.close(); @@ -151,9 +162,10 @@ public class CciTemplateTests { verify(connectionFactory, connection, interaction); } - + @Test - public void testTemplateExecuteInputTrueWithCreator2() throws ResourceException { + public void testTemplateExecuteInputTrueWithCreator2() + throws ResourceException { ConnectionFactory connectionFactory = createMock(ConnectionFactory.class); RecordFactory recordFactory = createMock(RecordFactory.class); Connection connection = createMock(Connection.class); @@ -173,7 +185,8 @@ public class CciTemplateTests { expect(creator.createRecord(recordFactory)).andReturn(outputRecord); - expect(interaction.execute(interactionSpec, inputRecord, outputRecord)).andReturn(true); + expect(interaction.execute(interactionSpec, inputRecord, outputRecord)) + .andReturn(true); interaction.close(); @@ -203,7 +216,8 @@ public class CciTemplateTests { expect(connection.createInteraction()).andReturn(interaction); - expect(interaction.execute(interactionSpec, inputRecord)).andReturn(outputRecord); + expect(interaction.execute(interactionSpec, inputRecord)).andReturn( + outputRecord); interaction.close(); @@ -217,13 +231,15 @@ public class CciTemplateTests { verify(connectionFactory, connection, interaction); } + @SuppressWarnings("unchecked") @Test - public void testTemplateExecuteInputExtractorTrueWithCreator() throws ResourceException, SQLException { + public void testTemplateExecuteInputExtractorTrueWithCreator() + throws ResourceException, SQLException { ConnectionFactory connectionFactory = createMock(ConnectionFactory.class); RecordFactory recordFactory = createMock(RecordFactory.class); Connection connection = createMock(Connection.class); Interaction interaction = createMock(Interaction.class); - RecordExtractor extractor = createMock(RecordExtractor.class); + RecordExtractor extractor = createMock(RecordExtractor.class); RecordCreator creator = createMock(RecordCreator.class); Record inputRecord = createMock(Record.class); @@ -239,7 +255,8 @@ public class CciTemplateTests { expect(creator.createRecord(recordFactory)).andReturn(outputRecord); - expect(interaction.execute(interactionSpec, inputRecord, outputRecord)).andReturn(true); + expect(interaction.execute(interactionSpec, inputRecord, outputRecord)) + .andReturn(true); expect(extractor.extractData(outputRecord)).andStubReturn(new Object()); @@ -256,12 +273,14 @@ public class CciTemplateTests { verify(connectionFactory, connection, interaction, extractor, creator); } + @SuppressWarnings("unchecked") @Test - public void testTemplateExecuteInputExtractorFalse() throws ResourceException, SQLException { + public void testTemplateExecuteInputExtractorFalse() + throws ResourceException, SQLException { ConnectionFactory connectionFactory = createMock(ConnectionFactory.class); Connection connection = createMock(Connection.class); Interaction interaction = createMock(Interaction.class); - RecordExtractor extractor = createMock(RecordExtractor.class); + RecordExtractor extractor = createMock(RecordExtractor.class); Record inputRecord = createMock(Record.class); Record outputRecord = createMock(Record.class); @@ -272,7 +291,8 @@ public class CciTemplateTests { expect(connection.createInteraction()).andReturn(interaction); - expect(interaction.execute(interactionSpec, inputRecord)).andReturn(outputRecord); + expect(interaction.execute(interactionSpec, inputRecord)).andReturn( + outputRecord); expect(extractor.extractData(outputRecord)).andStubReturn(new Object()); @@ -289,7 +309,8 @@ public class CciTemplateTests { } @Test - public void testTemplateExecuteInputGeneratorTrueWithCreator() throws ResourceException { + public void testTemplateExecuteInputGeneratorTrueWithCreator() + throws ResourceException { ConnectionFactory connectionFactory = createMock(ConnectionFactory.class); RecordFactory recordFactory = createMock(RecordFactory.class); Connection connection = createMock(Connection.class); @@ -314,7 +335,8 @@ public class CciTemplateTests { expect(connectionFactory.getRecordFactory()).andReturn(recordFactory); - expect(interaction.execute(interactionSpec, inputRecord, outputRecord)).andReturn(true); + expect(interaction.execute(interactionSpec, inputRecord, outputRecord)) + .andReturn(true); interaction.close(); @@ -328,9 +350,10 @@ public class CciTemplateTests { verify(connectionFactory, connection, interaction, generator, creator); } - + @Test - public void testTemplateExecuteInputGeneratorFalse() throws ResourceException { + public void testTemplateExecuteInputGeneratorFalse() + throws ResourceException { ConnectionFactory connectionFactory = createMock(ConnectionFactory.class); RecordFactory recordFactory = createMock(RecordFactory.class); Connection connection = createMock(Connection.class); @@ -343,14 +366,15 @@ public class CciTemplateTests { InteractionSpec interactionSpec = createMock(InteractionSpec.class); expect(connectionFactory.getRecordFactory()).andReturn(recordFactory); - + expect(connectionFactory.getConnection()).andReturn(connection); expect(connection.createInteraction()).andReturn(interaction); expect(generator.createRecord(recordFactory)).andReturn(inputRecord); - expect(interaction.execute(interactionSpec, inputRecord)).andReturn(outputRecord); + expect(interaction.execute(interactionSpec, inputRecord)).andReturn( + outputRecord); interaction.close(); @@ -364,21 +388,23 @@ public class CciTemplateTests { verify(connectionFactory, connection, interaction, generator); } + @SuppressWarnings("unchecked") @Test - public void testTemplateExecuteInputGeneratorExtractorTrueWithCreator() throws ResourceException, SQLException { + public void testTemplateExecuteInputGeneratorExtractorTrueWithCreator() + throws ResourceException, SQLException { ConnectionFactory connectionFactory = createMock(ConnectionFactory.class); RecordFactory recordFactory = createMock(RecordFactory.class); Connection connection = createMock(Connection.class); Interaction interaction = createMock(Interaction.class); RecordCreator generator = createMock(RecordCreator.class); - RecordExtractor extractor = createMock(RecordExtractor.class); + RecordExtractor extractor = createMock(RecordExtractor.class); RecordCreator creator = createMock(RecordCreator.class); Record inputRecord = createMock(Record.class); Record outputRecord = createMock(Record.class); - + Object obj = new Object(); - + InteractionSpec interactionSpec = createMock(InteractionSpec.class); expect(connectionFactory.getRecordFactory()).andReturn(recordFactory); @@ -393,7 +419,8 @@ public class CciTemplateTests { expect(generator.createRecord(recordFactory)).andReturn(inputRecord); - expect(interaction.execute(interactionSpec, inputRecord, outputRecord)).andReturn(true); + expect(interaction.execute(interactionSpec, inputRecord, outputRecord)) + .andReturn(true); expect(extractor.extractData(outputRecord)).andStubReturn(obj); @@ -401,27 +428,31 @@ public class CciTemplateTests { connection.close(); - replay(connectionFactory, connection, interaction, generator, creator, extractor); + replay(connectionFactory, connection, interaction, generator, creator, + extractor); CciTemplate ct = new CciTemplate(connectionFactory); ct.setOutputRecordCreator(creator); assertEquals(obj, ct.execute(interactionSpec, generator, extractor)); - verify(connectionFactory, connection, interaction, generator, creator, extractor); + verify(connectionFactory, connection, interaction, generator, creator, + extractor); } + @SuppressWarnings("unchecked") @Test - public void testTemplateExecuteInputGeneratorExtractorFalse() throws ResourceException, SQLException { + public void testTemplateExecuteInputGeneratorExtractorFalse() + throws ResourceException, SQLException { ConnectionFactory connectionFactory = createMock(ConnectionFactory.class); RecordFactory recordFactory = createMock(RecordFactory.class); Connection connection = createMock(Connection.class); Interaction interaction = createMock(Interaction.class); RecordCreator generator = createMock(RecordCreator.class); - RecordExtractor extractor = createMock(RecordExtractor.class); + RecordExtractor extractor = createMock(RecordExtractor.class); Record inputRecord = createMock(Record.class); Record outputRecord = createMock(Record.class); - + InteractionSpec interactionSpec = createMock(InteractionSpec.class); expect(connectionFactory.getRecordFactory()).andReturn(recordFactory); @@ -432,7 +463,8 @@ public class CciTemplateTests { expect(generator.createRecord(recordFactory)).andReturn(inputRecord); - expect(interaction.execute(interactionSpec, inputRecord)).andReturn(outputRecord); + expect(interaction.execute(interactionSpec, inputRecord)).andReturn( + outputRecord); expect(extractor.extractData(outputRecord)).andStubReturn(new Object()); @@ -449,7 +481,8 @@ public class CciTemplateTests { } @Test - public void testTemplateExecuteInputOutputConnectionSpec() throws ResourceException { + public void testTemplateExecuteInputOutputConnectionSpec() + throws ResourceException { ConnectionFactory connectionFactory = createMock(ConnectionFactory.class); ConnectionSpec connectionSpec = createMock(ConnectionSpec.class); Connection connection = createMock(Connection.class); @@ -457,15 +490,16 @@ public class CciTemplateTests { Record inputRecord = createMock(Record.class); Record outputRecord = createMock(Record.class); - + InteractionSpec interactionSpec = createMock(InteractionSpec.class); - - expect(connectionFactory.getConnection(connectionSpec)).andReturn(connection); + expect(connectionFactory.getConnection(connectionSpec)).andReturn( + connection); expect(connection.createInteraction()).andReturn(interaction); - expect(interaction.execute(interactionSpec, inputRecord, outputRecord)).andReturn(true); + expect(interaction.execute(interactionSpec, inputRecord, outputRecord)) + .andReturn(true); interaction.close(); @@ -482,8 +516,10 @@ public class CciTemplateTests { verify(connectionFactory, connection, interaction); } + @SuppressWarnings("unchecked") @Test - public void testTemplateExecuteInputOutputResultsSetFalse() throws ResourceException, SQLException { + public void testTemplateExecuteInputOutputResultsSetFalse() + throws ResourceException, SQLException { ConnectionFactory connectionFactory = createMock(ConnectionFactory.class); RecordFactory recordFactory = createMock(RecordFactory.class); Connection connection = createMock(Connection.class); @@ -491,7 +527,7 @@ public class CciTemplateTests { Record record = createMock(Record.class); ResultSet resultset = createMock(ResultSet.class); RecordCreator generator = createMock(RecordCreator.class); - RecordExtractor extractor = createMock(RecordExtractor.class); + RecordExtractor extractor = createMock(RecordExtractor.class); InteractionSpec interactionSpec = createMock(InteractionSpec.class); @@ -503,7 +539,8 @@ public class CciTemplateTests { expect(generator.createRecord(recordFactory)).andReturn(record); - expect(interaction.execute(interactionSpec, record)).andReturn(resultset); + expect(interaction.execute(interactionSpec, record)).andReturn( + resultset); expect(extractor.extractData(resultset)).andStubReturn(new Object()); @@ -513,23 +550,28 @@ public class CciTemplateTests { connection.close(); - replay(connectionFactory, connection, interaction, generator, extractor, resultset); + replay(connectionFactory, connection, interaction, generator, + extractor, resultset); CciTemplate ct = new CciTemplate(connectionFactory); ct.execute(interactionSpec, generator, extractor); - verify(connectionFactory, connection, interaction, generator, extractor, resultset); + verify(connectionFactory, connection, interaction, generator, + extractor, resultset); } + @SuppressWarnings("unchecked") @Test - public void testTemplateExecuteConnectionCallback() throws ResourceException, SQLException { + public void testTemplateExecuteConnectionCallback() + throws ResourceException, SQLException { ConnectionFactory connectionFactory = createMock(ConnectionFactory.class); Connection connection = createMock(Connection.class); - ConnectionCallback connectionCallback = createMock(ConnectionCallback.class); + ConnectionCallback connectionCallback = createMock(ConnectionCallback.class); expect(connectionFactory.getConnection()).andReturn(connection); - expect(connectionCallback.doInConnection(connection, connectionFactory)).andStubReturn(new Object()); + expect(connectionCallback.doInConnection(connection, connectionFactory)) + .andStubReturn(new Object()); connection.close(); @@ -541,18 +583,22 @@ public class CciTemplateTests { verify(connectionFactory, connection, connectionCallback); } + @SuppressWarnings("unchecked") @Test - public void testTemplateExecuteInteractionCallback() throws ResourceException, SQLException { + public void testTemplateExecuteInteractionCallback() + throws ResourceException, SQLException { ConnectionFactory connectionFactory = createMock(ConnectionFactory.class); Connection connection = createMock(Connection.class); Interaction interaction = createMock(Interaction.class); - InteractionCallback interactionCallback = createMock(InteractionCallback.class); + InteractionCallback interactionCallback = createMock(InteractionCallback.class); expect(connectionFactory.getConnection()).andReturn(connection); expect(connection.createInteraction()).andReturn(interaction); - expect(interactionCallback.doInInteraction(interaction, connectionFactory)).andStubReturn(new Object()); + expect( + interactionCallback.doInInteraction(interaction, + connectionFactory)).andStubReturn(new Object()); interaction.close(); @@ -567,7 +613,8 @@ public class CciTemplateTests { } @Test - public void testTemplateExecuteInputTrueTrueWithCreator() throws ResourceException { + public void testTemplateExecuteInputTrueTrueWithCreator() + throws ResourceException { ConnectionFactory connectionFactory = createMock(ConnectionFactory.class); Connection connection = createMock(Connection.class); Interaction interaction = createMock(Interaction.class); @@ -581,7 +628,9 @@ public class CciTemplateTests { expect(connection.createInteraction()).andReturn(interaction); - expect(interaction.execute(interactionSpec, inputOutputRecord, inputOutputRecord)).andReturn(true); + expect( + interaction.execute(interactionSpec, inputOutputRecord, + inputOutputRecord)).andReturn(true); interaction.close(); @@ -610,10 +659,12 @@ public class CciTemplateTests { expect(connection.createInteraction()).andReturn(interaction); - expect(interaction.execute(interactionSpec, inputOutputRecord, inputOutputRecord)).andReturn(true); + expect( + interaction.execute(interactionSpec, inputOutputRecord, + inputOutputRecord)).andReturn(true); interaction.close(); - + connection.close(); replay(connectionFactory, connection, interaction); @@ -638,7 +689,8 @@ public class CciTemplateTests { expect(connection.createInteraction()).andReturn(interaction); - expect(interaction.execute(interactionSpec, inputOutputRecord)).andReturn(null); + expect(interaction.execute(interactionSpec, inputOutputRecord)) + .andReturn(null); interaction.close(); @@ -647,7 +699,8 @@ public class CciTemplateTests { replay(connectionFactory, connection, interaction); CciTemplate ct = new CciTemplate(connectionFactory); - Record tmpOutputRecord = (Record) ct.execute(interactionSpec, inputOutputRecord); + Record tmpOutputRecord = (Record) ct.execute(interactionSpec, + inputOutputRecord); assertNull(tmpOutputRecord); verify(connectionFactory, connection, interaction); diff --git a/org.springframework.transaction/src/test/java/org/springframework/transaction/support/JtaTransactionManagerSerializationTests.java b/org.springframework.transaction/src/test/java/org/springframework/transaction/support/JtaTransactionManagerSerializationTests.java index 19513be7ee..cce8a85764 100644 --- a/org.springframework.transaction/src/test/java/org/springframework/transaction/support/JtaTransactionManagerSerializationTests.java +++ b/org.springframework.transaction/src/test/java/org/springframework/transaction/support/JtaTransactionManagerSerializationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2009 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. @@ -16,11 +16,12 @@ package org.springframework.transaction.support; +import static org.easymock.EasyMock.createMock; + import javax.transaction.TransactionManager; import javax.transaction.UserTransaction; import junit.framework.TestCase; -import org.easymock.MockControl; import org.springframework.mock.jndi.SimpleNamingContextBuilder; import org.springframework.transaction.jta.JtaTransactionManager; @@ -32,28 +33,29 @@ import org.springframework.util.SerializationTestUtils; public class JtaTransactionManagerSerializationTests extends TestCase { public void testSerializable() throws Exception { - MockControl utMock = MockControl.createControl(UserTransaction.class); - UserTransaction ut = (UserTransaction) utMock.getMock(); - MockControl ut2Mock = MockControl.createControl(UserTransaction.class); - UserTransaction ut2 = (UserTransaction) ut2Mock.getMock(); - MockControl tmMock = MockControl.createControl(TransactionManager.class); - TransactionManager tm = (TransactionManager) tmMock.getMock(); + UserTransaction ut1 = createMock(UserTransaction.class); + UserTransaction ut2 = createMock(UserTransaction.class); + TransactionManager tm = createMock(TransactionManager.class); JtaTransactionManager jtam = new JtaTransactionManager(); - jtam.setUserTransaction(ut); + jtam.setUserTransaction(ut1); jtam.setTransactionManager(tm); jtam.setRollbackOnCommitFailure(true); jtam.afterPropertiesSet(); - SimpleNamingContextBuilder jndiEnv = SimpleNamingContextBuilder.emptyActivatedContextBuilder(); + SimpleNamingContextBuilder jndiEnv = SimpleNamingContextBuilder + .emptyActivatedContextBuilder(); jndiEnv.bind(JtaTransactionManager.DEFAULT_USER_TRANSACTION_NAME, ut2); - JtaTransactionManager serializedJtatm = - (JtaTransactionManager) SerializationTestUtils.serializeAndDeserialize(jtam); - + JtaTransactionManager serializedJtatm = (JtaTransactionManager) SerializationTestUtils + .serializeAndDeserialize(jtam); + // should do client-side lookup - assertNotNull("Logger must survive serialization", serializedJtatm.logger); - assertTrue("UserTransaction looked up on client", serializedJtatm.getUserTransaction() == ut2); - assertNull("TransactionManager didn't survive", serializedJtatm.getTransactionManager()); + assertNotNull("Logger must survive serialization", + serializedJtatm.logger); + assertTrue("UserTransaction looked up on client", serializedJtatm + .getUserTransaction() == ut2); + assertNull("TransactionManager didn't survive", serializedJtatm + .getTransactionManager()); assertEquals(true, serializedJtatm.isRollbackOnCommitFailure()); } diff --git a/org.springframework.transaction/transaction.iml b/org.springframework.transaction/transaction.iml index 4ebec68b6a..bcc285d4e9 100644 --- a/org.springframework.transaction/transaction.iml +++ b/org.springframework.transaction/transaction.iml @@ -126,11 +126,11 @@ - + - + diff --git a/org.springframework.web.portlet/.classpath b/org.springframework.web.portlet/.classpath index ab7d3f7260..04db23494e 100644 --- a/org.springframework.web.portlet/.classpath +++ b/org.springframework.web.portlet/.classpath @@ -15,7 +15,7 @@ - + diff --git a/org.springframework.web.portlet/ivy.xml b/org.springframework.web.portlet/ivy.xml index c50c2653ca..86f1a14ba2 100644 --- a/org.springframework.web.portlet/ivy.xml +++ b/org.springframework.web.portlet/ivy.xml @@ -33,7 +33,7 @@ - + diff --git a/org.springframework.web.portlet/web-portlet.iml b/org.springframework.web.portlet/web-portlet.iml index c32a583e48..063f5ea8f5 100644 --- a/org.springframework.web.portlet/web-portlet.iml +++ b/org.springframework.web.portlet/web-portlet.iml @@ -74,11 +74,11 @@ - + - + diff --git a/org.springframework.web.servlet/.classpath b/org.springframework.web.servlet/.classpath index b5b922f450..8c1a83c51b 100644 --- a/org.springframework.web.servlet/.classpath +++ b/org.springframework.web.servlet/.classpath @@ -37,7 +37,7 @@ - + diff --git a/org.springframework.web.servlet/ivy.xml b/org.springframework.web.servlet/ivy.xml index 8fba6e90ab..988198590f 100644 --- a/org.springframework.web.servlet/ivy.xml +++ b/org.springframework.web.servlet/ivy.xml @@ -78,7 +78,7 @@ conf="compile->compile"/> - + - + - + diff --git a/org.springframework.web/.classpath b/org.springframework.web/.classpath index 073a9a14ea..457dac5485 100644 --- a/org.springframework.web/.classpath +++ b/org.springframework.web/.classpath @@ -27,7 +27,7 @@ - + diff --git a/org.springframework.web/ivy.xml b/org.springframework.web/ivy.xml index 5815f38280..f629e875db 100644 --- a/org.springframework.web/ivy.xml +++ b/org.springframework.web/ivy.xml @@ -70,7 +70,7 @@ conf="test->runtime"/> - + - + - +