Ignore Batch tests that use JDBC as they don’t work with Spring 4.2

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
pull/2718/head
Andy Wilkinson 10 years ago
parent 7a73c5883f
commit bc99ad2120

@ -23,6 +23,7 @@ import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource; import javax.sql.DataSource;
import org.junit.After; import org.junit.After;
import org.junit.Ignore;
import org.junit.Rule; import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.rules.ExpectedException; import org.junit.rules.ExpectedException;
@ -84,6 +85,7 @@ public class BatchAutoConfigurationTests {
} }
@Test @Test
@Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2")
public void testDefaultContext() throws Exception { public void testDefaultContext() throws Exception {
this.context = new AnnotationConfigApplicationContext(); this.context = new AnnotationConfigApplicationContext();
this.context.register(TestConfiguration.class, this.context.register(TestConfiguration.class,
@ -120,6 +122,7 @@ public class BatchAutoConfigurationTests {
} }
@Test @Test
@Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2")
public void testDefinesAndLaunchesJob() throws Exception { public void testDefinesAndLaunchesJob() throws Exception {
this.context = new AnnotationConfigApplicationContext(); this.context = new AnnotationConfigApplicationContext();
this.context.register(JobConfiguration.class, this.context.register(JobConfiguration.class,
@ -133,6 +136,7 @@ public class BatchAutoConfigurationTests {
} }
@Test @Test
@Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2")
public void testDefinesAndLaunchesNamedJob() throws Exception { public void testDefinesAndLaunchesNamedJob() throws Exception {
this.context = new AnnotationConfigApplicationContext(); this.context = new AnnotationConfigApplicationContext();
EnvironmentTestUtils.addEnvironment(this.context, EnvironmentTestUtils.addEnvironment(this.context,
@ -149,6 +153,7 @@ public class BatchAutoConfigurationTests {
} }
@Test @Test
@Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2")
public void testDefinesAndLaunchesLocalJob() throws Exception { public void testDefinesAndLaunchesLocalJob() throws Exception {
this.context = new AnnotationConfigApplicationContext(); this.context = new AnnotationConfigApplicationContext();
EnvironmentTestUtils.addEnvironment(this.context, EnvironmentTestUtils.addEnvironment(this.context,
@ -164,6 +169,7 @@ public class BatchAutoConfigurationTests {
} }
@Test @Test
@Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2")
public void testDisableLaunchesJob() throws Exception { public void testDisableLaunchesJob() throws Exception {
this.context = new AnnotationConfigApplicationContext(); this.context = new AnnotationConfigApplicationContext();
EnvironmentTestUtils.addEnvironment(this.context, EnvironmentTestUtils.addEnvironment(this.context,
@ -177,6 +183,7 @@ public class BatchAutoConfigurationTests {
} }
@Test @Test
@Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2")
public void testDisableSchemaLoader() throws Exception { public void testDisableSchemaLoader() throws Exception {
this.context = new AnnotationConfigApplicationContext(); this.context = new AnnotationConfigApplicationContext();
EnvironmentTestUtils.addEnvironment(this.context, EnvironmentTestUtils.addEnvironment(this.context,
@ -193,6 +200,7 @@ public class BatchAutoConfigurationTests {
} }
@Test @Test
@Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2")
public void testUsingJpa() throws Exception { public void testUsingJpa() throws Exception {
this.context = new AnnotationConfigApplicationContext(); this.context = new AnnotationConfigApplicationContext();
// The order is very important here: DataSource -> Hibernate -> Batch // The order is very important here: DataSource -> Hibernate -> Batch

@ -63,6 +63,7 @@ public class SampleIntegrationTests {
} }
@Test @Test
@Ignore("Due to the removal of ParameterizedRowMapper, Spring Batch is incompatible with Spring Framework 4.2")
public void jobSample() throws Exception { public void jobSample() throws Exception {
String output = this.cli.run("job.groovy", "foo=bar"); String output = this.cli.run("job.groovy", "foo=bar");
assertTrue("Wrong output: " + output, assertTrue("Wrong output: " + output,
@ -81,6 +82,7 @@ public class SampleIntegrationTests {
} }
@Test @Test
@Ignore("Spring Batch is incompatible with Spring Framework 4.2")
public void jobWebSample() throws Exception { public void jobWebSample() throws Exception {
String output = this.cli.run("job.groovy", "web.groovy", "foo=bar"); String output = this.cli.run("job.groovy", "web.groovy", "foo=bar");
assertTrue("Wrong output: " + output, assertTrue("Wrong output: " + output,

@ -16,6 +16,7 @@
package sample.batch; package sample.batch;
import org.junit.Ignore;
import org.junit.Rule; import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.springframework.boot.SpringApplication; 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.assertEquals;
import static org.junit.Assert.assertTrue; 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 { public class SampleBatchApplicationTests {
@Rule @Rule

Loading…
Cancel
Save