@Test public void testReload() throws Exception { GenericApplicationContextFactory factory = new GenericApplicationContextFactory(new ClassPathResource( "trivial-context.xml", getClass())); jobLoader.load(factory); assertEquals(1, jobRegistry.getJobNames().size()); assertStepExist(TEST_JOB_NAME, TEST_STEP_NAME); jobLoader.reload(factory); assertEquals(1, jobRegistry.getJobNames().size()); assertStepExist(TEST_JOB_NAME, TEST_STEP_NAME); }
@Test public void testReloadWithAutoRegister() throws Exception { GenericApplicationContextFactory factory = new GenericApplicationContextFactory(new ClassPathResource( "trivial-context-autoregister.xml", getClass())); jobLoader.load(factory); assertEquals(1, jobRegistry.getJobNames().size()); assertStepExist(TEST_JOB_NAME, TEST_STEP_NAME); jobLoader.reload(factory); assertEquals(1, jobRegistry.getJobNames().size()); assertStepExist(TEST_JOB_NAME, TEST_STEP_NAME); }
@Test public void testLoadWithExplicitName() throws Exception { GenericApplicationContextFactory factory = new GenericApplicationContextFactory(new ByteArrayResource( JOB_XML.getBytes())); jobLoader.load(factory); assertEquals(1, jobRegistry.getJobNames().size()); jobLoader.reload(factory); assertEquals(1, jobRegistry.getJobNames().size()); }