diff --git a/spring-batch-core/.settings/org.springframework.ide.eclipse.beans.core.prefs b/spring-batch-core/.settings/org.springframework.ide.eclipse.beans.core.prefs new file mode 100644 index 000000000..704aae680 --- /dev/null +++ b/spring-batch-core/.settings/org.springframework.ide.eclipse.beans.core.prefs @@ -0,0 +1,3 @@ +#Mon Feb 23 13:41:20 GMT 2009 +eclipse.preferences.version=1 +org.springframework.ide.eclipse.beans.core.ignoreMissingNamespaceHandler=false diff --git a/spring-batch-core/.springBeans b/spring-batch-core/.springBeans index 8bb3a49b4..a61ae3350 100644 --- a/spring-batch-core/.springBeans +++ b/spring-batch-core/.springBeans @@ -1,7 +1,7 @@ 1 - + @@ -57,6 +57,12 @@ src/test/resources/org/springframework/batch/core/configuration/xml/StepParserBeanNameTests-context.xml src/test/resources/org/springframework/batch/core/configuration/xml/StepParserTaskletAttributesTests-context.xml src/test/resources/org/springframework/batch/core/configuration/xml/StopIncompleteJobParserTests-context.xml + src/test/resources/org/springframework/batch/core/configuration/xml/AutoRegisteringStepScopeForJobElementTests-context.xml + src/test/resources/org/springframework/batch/core/configuration/xml/AutoRegisteringStepScopeForStepElementTests-context.xml + src/test/resources/org/springframework/batch/core/configuration/support/ClassPathXmlJobRegistryContextTests-context.xml + src/test/resources/org/springframework/batch/core/configuration/xml/StopAndRestartJobParserTests-context.xml + src/test/resources/org/springframework/batch/core/configuration/xml/StopRestartOnCompletedStepJobParserTests-context.xml + src/test/resources/org/springframework/batch/core/configuration/xml/StopRestartOnFailedStepJobParserTests-context.xml diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/support/SimpleJobRepositoryIntegrationTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/support/SimpleJobRepositoryIntegrationTests.java index 48370485b..284a05eeb 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/support/SimpleJobRepositoryIntegrationTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/support/SimpleJobRepositoryIntegrationTests.java @@ -32,17 +32,13 @@ import org.springframework.transaction.annotation.Transactional; @ContextConfiguration(locations = "/org/springframework/batch/core/repository/dao/sql-dao-test.xml") public class SimpleJobRepositoryIntegrationTests { + @Autowired private SimpleJobRepository jobRepository; private JobSupport job = new JobSupport("SimpleJobRepositoryIntegrationTestsJob"); private JobParameters jobParameters = new JobParameters(); - @Autowired - public void setJobRepository(SimpleJobRepository jobRepository) { - this.jobRepository = jobRepository; - } - /* * Create two job executions for same job+parameters tuple. Check both * executions belong to the same job instance and job. diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/support/SimpleJobRepositoryProxyTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/support/SimpleJobRepositoryProxyTests.java new file mode 100644 index 000000000..3665d4bb0 --- /dev/null +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/support/SimpleJobRepositoryProxyTests.java @@ -0,0 +1,56 @@ +package org.springframework.batch.core.repository.support; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import org.aopalliance.intercept.MethodInterceptor; +import org.aopalliance.intercept.MethodInvocation; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.batch.core.JobExecution; +import org.springframework.batch.core.JobParameters; +import org.springframework.batch.core.job.JobSupport; +import org.springframework.batch.core.repository.JobRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.transaction.annotation.Transactional; + +/** + * Repository tests using JDBC DAOs (rather than mocks). + * + * @author Robert Kasanicky + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration +public class SimpleJobRepositoryProxyTests { + + @Autowired + private JobRepository jobRepository; + + @Autowired + private Advice advice; + + private JobSupport job = new JobSupport("SimpleJobRepositoryProxyTestsJob"); + + @Transactional + @Test + public void testCreateAndFind() throws Exception { + assertFalse(advice.invoked); + JobExecution jobExecution = jobRepository.createJobExecution(job.getName(), new JobParameters()); + assertNotNull(jobExecution); + assertTrue(advice.invoked); + } + + public static class Advice implements MethodInterceptor { + + private boolean invoked; + + public Object invoke(MethodInvocation invocation) throws Throwable { + invoked = true; + return invocation.proceed(); + } + } + +} \ No newline at end of file diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/support/SimpleJobRepositoryProxyTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/support/SimpleJobRepositoryProxyTests-context.xml new file mode 100644 index 000000000..b08e39fd1 --- /dev/null +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/repository/support/SimpleJobRepositoryProxyTests-context.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-batch-infrastructure/pom.xml b/spring-batch-infrastructure/pom.xml index 7d6075a36..0d24a521d 100644 --- a/spring-batch-infrastructure/pom.xml +++ b/spring-batch-infrastructure/pom.xml @@ -21,8 +21,8 @@ - javax.xml.stream - com.springsource.javax.xml.stream + stax + stax diff --git a/spring-batch-infrastructure/src/test/java/MultiResourceItemWriterXmlTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/file/MultiResourceItemWriterXmlTests.java similarity index 97% rename from spring-batch-infrastructure/src/test/java/MultiResourceItemWriterXmlTests.java rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/file/MultiResourceItemWriterXmlTests.java index e42cc7227..9dedbb628 100644 --- a/spring-batch-infrastructure/src/test/java/MultiResourceItemWriterXmlTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/file/MultiResourceItemWriterXmlTests.java @@ -1,3 +1,4 @@ +package org.springframework.batch.item.file; import java.io.File; import java.io.IOException; import java.util.Arrays; @@ -10,7 +11,6 @@ import javax.xml.transform.Result; import static org.junit.Assert.*; import org.junit.Before; import org.junit.Test; -import org.springframework.batch.item.file.AbstractMultiResourceItemWriterTests; import org.springframework.batch.item.file.MultiResourceItemWriter; import org.springframework.batch.item.xml.StaxEventItemWriter; import org.springframework.oxm.Marshaller; diff --git a/spring-batch-samples/pom.xml b/spring-batch-samples/pom.xml index 860adef09..950f132bc 100644 --- a/spring-batch-samples/pom.xml +++ b/spring-batch-samples/pom.xml @@ -21,8 +21,8 @@ - javax.xml.stream - com.springsource.javax.xml.stream + stax + stax diff --git a/spring-batch-test/pom.xml b/spring-batch-test/pom.xml index 015028f11..0cad6a466 100755 --- a/spring-batch-test/pom.xml +++ b/spring-batch-test/pom.xml @@ -21,8 +21,8 @@ - javax.xml.stream - com.springsource.javax.xml.stream + stax + stax