From bc99ad2120f8a5a6f0be9bf6e5c24f5a03145e94 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 25 Mar 2015 10:45:57 +0000 Subject: [PATCH] =?UTF-8?q?Ignore=20Batch=20tests=20that=20use=20JDBC=20as?= =?UTF-8?q?=20they=20don=E2=80=99t=20work=20with=20Spring=204.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Spring Framework’s ParamterizedRowMapper has been deprecated since 3.1 and has been removed in 4.2. Spring Batch currently relies on ParameterizedRowMapper, making it incompatible with 4.2. To allow us to build successfully against 4.2, this commit ignores Spring Boot’s tests that use Spring Batch’s JDBC support. See gh-2575 --- .../autoconfigure/batch/BatchAutoConfigurationTests.java | 8 ++++++++ .../springframework/boot/cli/SampleIntegrationTests.java | 2 ++ .../java/sample/batch/SampleBatchApplicationTests.java | 2 ++ 3 files changed, 12 insertions(+) diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java index 02c8e92eb2f..6cf4186c03a 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java @@ -23,6 +23,7 @@ import javax.persistence.EntityManagerFactory; import javax.sql.DataSource; import org.junit.After; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -84,6 +85,7 @@ public class BatchAutoConfigurationTests { } @Test + @Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2") public void testDefaultContext() throws Exception { this.context = new AnnotationConfigApplicationContext(); this.context.register(TestConfiguration.class, @@ -120,6 +122,7 @@ public class BatchAutoConfigurationTests { } @Test + @Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2") public void testDefinesAndLaunchesJob() throws Exception { this.context = new AnnotationConfigApplicationContext(); this.context.register(JobConfiguration.class, @@ -133,6 +136,7 @@ public class BatchAutoConfigurationTests { } @Test + @Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2") public void testDefinesAndLaunchesNamedJob() throws Exception { this.context = new AnnotationConfigApplicationContext(); EnvironmentTestUtils.addEnvironment(this.context, @@ -149,6 +153,7 @@ public class BatchAutoConfigurationTests { } @Test + @Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2") public void testDefinesAndLaunchesLocalJob() throws Exception { this.context = new AnnotationConfigApplicationContext(); EnvironmentTestUtils.addEnvironment(this.context, @@ -164,6 +169,7 @@ public class BatchAutoConfigurationTests { } @Test + @Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2") public void testDisableLaunchesJob() throws Exception { this.context = new AnnotationConfigApplicationContext(); EnvironmentTestUtils.addEnvironment(this.context, @@ -177,6 +183,7 @@ public class BatchAutoConfigurationTests { } @Test + @Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2") public void testDisableSchemaLoader() throws Exception { this.context = new AnnotationConfigApplicationContext(); EnvironmentTestUtils.addEnvironment(this.context, @@ -193,6 +200,7 @@ public class BatchAutoConfigurationTests { } @Test + @Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2") public void testUsingJpa() throws Exception { this.context = new AnnotationConfigApplicationContext(); // The order is very important here: DataSource -> Hibernate -> Batch diff --git a/spring-boot-cli/src/test/java/org/springframework/boot/cli/SampleIntegrationTests.java b/spring-boot-cli/src/test/java/org/springframework/boot/cli/SampleIntegrationTests.java index d0453f119b7..5e80ea77caa 100644 --- a/spring-boot-cli/src/test/java/org/springframework/boot/cli/SampleIntegrationTests.java +++ b/spring-boot-cli/src/test/java/org/springframework/boot/cli/SampleIntegrationTests.java @@ -63,6 +63,7 @@ public class SampleIntegrationTests { } @Test + @Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2") public void jobSample() throws Exception { String output = this.cli.run("job.groovy", "foo=bar"); assertTrue("Wrong output: " + output, @@ -81,6 +82,7 @@ public class SampleIntegrationTests { } @Test + @Ignore("Spring Batch is incompatible with Spring Framework 4.2") public void jobWebSample() throws Exception { String output = this.cli.run("job.groovy", "web.groovy", "foo=bar"); assertTrue("Wrong output: " + output, diff --git a/spring-boot-samples/spring-boot-sample-batch/src/test/java/sample/batch/SampleBatchApplicationTests.java b/spring-boot-samples/spring-boot-sample-batch/src/test/java/sample/batch/SampleBatchApplicationTests.java index 6b469edd872..b7365cd4e5c 100644 --- a/spring-boot-samples/spring-boot-sample-batch/src/test/java/sample/batch/SampleBatchApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-batch/src/test/java/sample/batch/SampleBatchApplicationTests.java @@ -16,6 +16,7 @@ package sample.batch; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.springframework.boot.SpringApplication; @@ -24,6 +25,7 @@ import org.springframework.boot.test.OutputCapture; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +@Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2") public class SampleBatchApplicationTests { @Rule