BATCH-1636: add Ordered interface

This commit is contained in:
dsyer
2010-10-10 16:06:20 +00:00
parent abd66edb30
commit 5545925e17
2 changed files with 28 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ import org.springframework.context.event.ContextClosedEvent;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.core.Ordered;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
@@ -39,6 +40,16 @@ public class AutomaticJobRegistrarTests {
registrar.setJobLoader(jobLoader);
}
@Test
public void testOrderedImplemented() throws Exception {
assertTrue(registrar instanceof Ordered);
assertEquals(Ordered.LOWEST_PRECEDENCE, registrar.getOrder());
registrar.setOrder(1);
assertEquals(1, registrar.getOrder());
}
@Test
public void testLocateJob() throws Exception {