コード例 #1
0
 @Test
 public void testResumeCrashedJobInfo() {
   when(shardingService.getLocalHostShardingItems()).thenReturn(Collections.<Integer>emptyList());
   schedulerFacade.resumeCrashedJobInfo();
   verify(serverService).persistServerOnline();
   verify(shardingService).getLocalHostShardingItems();
   verify(executionService).clearRunningInfo(Collections.<Integer>emptyList());
 }
コード例 #2
0
 @Test
 public void testRegisterStartUpInfo() {
   schedulerFacade.registerStartUpInfo();
   verify(listenerManager).startAllListeners();
   verify(leaderElectionService).leaderElection();
   verify(configService).persistJobConfiguration();
   verify(serverService).persistServerOnline();
   verify(serverService).clearJobStoppedStatus();
   verify(statisticsService).startProcessCountJob();
   verify(shardingService).setReshardingFlag();
   verify(monitorService).listen();
 }
コード例 #3
0
 @Test
 public void testNewJobTriggerListener() {
   assertThat(schedulerFacade.newJobTriggerListener(), instanceOf(JobTriggerListener.class));
 }
コード例 #4
0
 @Test
 public void testIsMisfire() {
   when(configService.isMisfire()).thenReturn(true);
   assertTrue(schedulerFacade.isMisfire());
 }
コード例 #5
0
 @Test
 public void testGetCron() {
   when(configService.getCron()).thenReturn("0 * * * * *");
   assertThat(schedulerFacade.getCron(), is("0 * * * * *"));
 }
コード例 #6
0
 @Test
 public void testIsJobStoppedManually() {
   when(serverService.isJobStoppedManually()).thenReturn(true);
   assertTrue(schedulerFacade.isJobStoppedManually());
 }
コード例 #7
0
 @Test
 public void testClearJobStoppedStatus() {
   schedulerFacade.clearJobStoppedStatus();
   verify(serverService).clearJobStoppedStatus();
 }
コード例 #8
0
 @Test
 public void testReleaseJobResource() {
   schedulerFacade.releaseJobResource();
   verify(monitorService).close();
   verify(statisticsService).stopProcessCountJob();
 }