Skip to content
This repository was archived by the owner on Mar 29, 2019. It is now read-only.

Commit e6fb28d

Browse files
committed
Update project dependencies to be Spring IO compliant
This commit updates project dependencies to be complaint with Spring IO 1.1. Along with this, unit tests have been updated to use Mockito instead of EasyMock and unused dependencies have been removed. This commit addresses BATCHADM-202.
1 parent fda05cf commit e6fb28d

54 files changed

Lines changed: 797 additions & 927 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<modules>
5454
<module>spring-batch-admin-parent</module>
5555
<module>spring-batch-admin-resources</module>
56-
<module>spring-batch-integration</module>
56+
<!--<module>spring-batch-integration</module>-->
5757
<module>spring-batch-admin-manager</module>
5858
<module>spring-batch-admin-sample</module>
5959
</modules>

‎spring-batch-admin-manager/pom.xml‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,9 @@ visualization of Batch meta data, and also launching and stopping jobs inside th
1717
<groupId>junit</groupId>
1818
<artifactId>junit</artifactId>
1919
</dependency>
20-
<dependency>
21-
<groupId>org.easymock</groupId>
22-
<artifactId>easymock</artifactId>
23-
</dependency>
2420
<dependency>
2521
<groupId>javax.servlet</groupId>
26-
<artifactId>servlet-api</artifactId>
22+
<artifactId>javax.servlet-api</artifactId>
2723
</dependency>
2824
<dependency>
2925
<groupId>org.aspectj</groupId>
@@ -37,6 +33,10 @@ visualization of Batch meta data, and also launching and stopping jobs inside th
3733
<groupId>org.springframework</groupId>
3834
<artifactId>spring-test</artifactId>
3935
</dependency>
36+
<dependency>
37+
<groupId>org.springframework</groupId>
38+
<artifactId>spring-context-support</artifactId>
39+
</dependency>
4040
<dependency>
4141
<groupId>org.springframework</groupId>
4242
<artifactId>spring-context</artifactId>
@@ -71,7 +71,6 @@ visualization of Batch meta data, and also launching and stopping jobs inside th
7171
<dependency>
7272
<groupId>org.springframework.batch</groupId>
7373
<artifactId>spring-batch-integration</artifactId>
74-
<version>2.0.0.BUILD-SNAPSHOT</version>
7574
</dependency>
7675
<dependency>
7776
<groupId>org.springframework.integration</groupId>
@@ -130,7 +129,7 @@ visualization of Batch meta data, and also launching and stopping jobs inside th
130129
<artifactId>commons-collections</artifactId>
131130
</dependency>
132131
<dependency>
133-
<groupId>hsqldb</groupId>
132+
<groupId>org.hsqldb</groupId>
134133
<artifactId>hsqldb</artifactId>
135134
<scope>test</scope>
136135
</dependency>
@@ -159,8 +158,13 @@ visualization of Batch meta data, and also launching and stopping jobs inside th
159158
<version>2.0.0.BUILD-SNAPSHOT</version>
160159
</dependency>
161160
<dependency>
162-
<groupId>org.codehaus.jackson</groupId>
163-
<artifactId>jackson-mapper-asl</artifactId>
161+
<groupId>com.fasterxml.jackson.core</groupId>
162+
<artifactId>jackson-databind</artifactId>
163+
</dependency>
164+
<dependency>
165+
<groupId>org.mockito</groupId>
166+
<artifactId>mockito-all</artifactId>
167+
<scope>test</scope>
164168
</dependency>
165169
</dependencies>
166170
<build>
@@ -173,10 +177,6 @@ visualization of Batch meta data, and also launching and stopping jobs inside th
173177
<target>1.6</target>
174178
</configuration>
175179
</plugin>
176-
<plugin>
177-
<groupId>com.springsource.bundlor</groupId>
178-
<artifactId>com.springsource.bundlor.maven</artifactId>
179-
</plugin>
180180
<plugin>
181181
<groupId>org.mortbay.jetty</groupId>
182182
<artifactId>maven-jetty-plugin</artifactId>

‎spring-batch-admin-manager/src/main/java/org/springframework/batch/admin/web/JobExecutionController.java‎

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,20 @@
1515
*/
1616
package org.springframework.batch.admin.web;
1717

18+
import java.io.IOException;
19+
import java.util.ArrayList;
20+
import java.util.Collection;
21+
import java.util.Date;
22+
import java.util.HashMap;
23+
import java.util.HashSet;
24+
import java.util.Iterator;
25+
import java.util.Map;
26+
import java.util.TimeZone;
27+
28+
import com.fasterxml.jackson.databind.ObjectMapper;
1829
import org.apache.commons.logging.Log;
1930
import org.apache.commons.logging.LogFactory;
20-
import org.codehaus.jackson.map.ObjectMapper;
31+
2132
import org.springframework.batch.admin.service.JobService;
2233
import org.springframework.batch.core.JobExecution;
2334
import org.springframework.batch.core.JobInstance;
@@ -42,16 +53,6 @@
4253
import org.springframework.web.bind.annotation.RequestMethod;
4354
import org.springframework.web.bind.annotation.RequestParam;
4455

45-
import java.io.IOException;
46-
import java.util.ArrayList;
47-
import java.util.Collection;
48-
import java.util.Date;
49-
import java.util.HashMap;
50-
import java.util.HashSet;
51-
import java.util.Iterator;
52-
import java.util.Map;
53-
import java.util.TimeZone;
54-
5556
/**
5657
* Controller for job executions.
5758
*

‎spring-batch-admin-manager/src/main/java/org/springframework/batch/admin/web/StepExecutionController.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
import java.util.Map;
2424
import java.util.TimeZone;
2525

26-
import org.codehaus.jackson.map.ObjectMapper;
26+
import com.fasterxml.jackson.databind.ObjectMapper;
27+
2728
import org.springframework.batch.admin.history.StepExecutionHistory;
2829
import org.springframework.batch.admin.service.JobService;
2930
import org.springframework.batch.admin.service.NoSuchStepExecutionException;

‎spring-batch-admin-manager/src/main/resources/META-INF/spring/batch/bootstrap/integration/configuration-context.xml‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<beans:beans xmlns="http://www.springframework.org/schema/integration" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop"
3+
xmlns:beans="http://www.springframework.org/schema/beans"
44
xmlns:file="http://www.springframework.org/schema/integration/file"
5-
xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
6-
http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file.xsd
5+
xsi:schemaLocation="http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file.xsd
76
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
87
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd">
98

‎spring-batch-admin-manager/src/main/resources/META-INF/spring/batch/bootstrap/integration/launcher-context.xml‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<beans:beans xmlns="http://www.springframework.org/schema/integration" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop"
4-
xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
5-
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
3+
xmlns:beans="http://www.springframework.org/schema/beans"
4+
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
65
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd">
76

87
<channel id="job-requests" />

‎spring-batch-admin-manager/src/main/resources/META-INF/spring/batch/bootstrap/manager/data-source-context.xml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
4-
xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
5-
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
4+
xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
5+
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
66

77
<bean id="dataSource"
88
class="org.apache.commons.dbcp.BasicDataSource">

‎spring-batch-admin-manager/src/main/resources/META-INF/spring/batch/servlet/manager/controller-context.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525
</property>
2626
</bean>
2727

28-
<bean id="objectMapper" class="org.codehaus.jackson.map.ObjectMapper"/>
28+
<bean id="objectMapper" class="com.fasterxml.jackson.databind.ObjectMapper"/>
2929
</beans>

‎spring-batch-admin-manager/src/test/java/org/springframework/batch/admin/BootstrapTests.java‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
import org.apache.commons.io.FileUtils;
2828
import org.junit.Test;
29+
2930
import org.springframework.batch.admin.web.JobController;
3031
import org.springframework.batch.admin.web.resources.MenuManager;
3132
import org.springframework.batch.admin.web.util.HomeController;
@@ -39,7 +40,6 @@
3940
import org.springframework.beans.factory.BeanFactoryUtils;
4041
import org.springframework.context.support.ClassPathXmlApplicationContext;
4142
import org.springframework.mock.web.MockHttpServletRequest;
42-
import org.springframework.test.annotation.DirtiesContext;
4343
import org.springframework.ui.ModelMap;
4444
import org.springframework.util.ClassUtils;
4545
import org.springframework.util.StringUtils;
@@ -48,7 +48,6 @@
4848
* @author Dave Syer
4949
*
5050
*/
51-
@DirtiesContext
5251
public class BootstrapTests {
5352

5453
@Test

‎spring-batch-admin-manager/src/test/java/org/springframework/batch/admin/integration/JobConfigurationRequestLoaderTests.java‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@
1515
*/
1616
package org.springframework.batch.admin.integration;
1717

18-
import static org.easymock.EasyMock.expect;
19-
import static org.easymock.EasyMock.replay;
2018
import static org.junit.Assert.assertEquals;
19+
import static org.mockito.Mockito.*;
2120

2221
import java.util.Collection;
2322

24-
import org.easymock.EasyMock;
2523
import org.junit.Before;
2624
import org.junit.Test;
25+
import org.mockito.Mock;
26+
import org.mockito.MockitoAnnotations;
27+
2728
import org.springframework.batch.admin.service.JobService;
2829
import org.springframework.batch.admin.web.JobInfo;
2930
import org.springframework.batch.core.Job;
@@ -38,17 +39,19 @@
3839
public class JobConfigurationRequestLoaderTests {
3940

4041
private JobConfigurationResourceLoader loader = new JobConfigurationResourceLoader();
41-
42-
private JobService jobService = EasyMock.createMock(JobService.class);
42+
43+
@Mock
44+
private JobService jobService;
4345

4446
@Before
4547
public void setUp() throws Exception {
48+
MockitoAnnotations.initMocks(this);
4649
loader.setJobLoader(new DefaultJobLoader(new MapJobRegistry()));
4750
loader.setJobService(jobService);
48-
expect(jobService.countJobExecutionsForJob("job")).andReturn(2);
49-
expect(jobService.isIncrementable("job")).andReturn(true);
50-
expect(jobService.isLaunchable("job")).andReturn(true);
51-
replay(jobService);
51+
52+
when(jobService.countJobExecutionsForJob("job")).thenReturn(2);
53+
when(jobService.isIncrementable("job")).thenReturn(true);
54+
when(jobService.isLaunchable("job")).thenReturn(true);
5255
}
5356

5457
@Test

0 commit comments

Comments
 (0)