@Test public void testInitializeJobWorkflow01() { int resetTime = 301; boolean includeMessages = true; ArrayList<Integer> rwTimes = new ArrayList<>(); rwTimes.add( 45 ); rwTimes.add( 120 ); int totalTime = 0; List<MineJob> jWorkflow = initializeJobWorkflow( resetTime, includeMessages, rwTimes ); assertNotNull( jWorkflow ); assertEquals( 3, jWorkflow.size() ); Stack<MineJob> jobStack = new Stack<>(); jobStack.addAll( jWorkflow ); assertEquals( 3, jobStack.size() ); { MineJob job1 = jobStack.pop(); assertEquals( 2, jobStack.size() ); assertTrue( job1.getAction() == MineJobAction.MESSAGE ); assertEquals( 181.0d, job1.getDelayActionSec(), 0.1d ); assertEquals( 120.0d, job1.getResetInSec(), 0.1d ); totalTime += job1.getDelayActionSec(); } { MineJob job2 = jobStack.pop(); assertEquals( 1, jobStack.size() ); assertTrue( job2.getAction() == MineJobAction.MESSAGE ); assertEquals( 75.0d, job2.getDelayActionSec(), 0.1d ); assertEquals( 45.0d, job2.getResetInSec(), 0.1d ); totalTime += job2.getDelayActionSec(); } { MineJob job3 = jobStack.pop(); assertEquals( 0, jobStack.size() ); assertTrue( job3.getAction() == MineJobAction.RESET_SYNC ); assertEquals( 45.0d, job3.getDelayActionSec(), 0.1d ); assertEquals( 0.0d, job3.getResetInSec(), 0.1d ); totalTime += job3.getDelayActionSec(); } assertEquals( resetTime, totalTime ); }
private List<MineJob> initializeJobWorkflow() { if ( PrisonMines.getInstance() != null ) { MinesConfig config = PrisonMines.getInstance().getConfig(); return initializeJobWorkflow(getResetTime(), config.resetMessages, config.resetWarningTimes ); } return new ArrayList<>(); }
MineScheduler extends MineReset implements PrisonRunnable { private List<MineJob> initializeJobWorkflow() { if ( PrisonMines.getInstance() != null ) { MinesConfig config = PrisonMines.getInstance().getConfig(); return initializeJobWorkflow(getResetTime(), config.resetMessages, config.resetWarningTimes ); } return new ArrayList<>(); } }
MineScheduler extends MineReset implements PrisonRunnable { private List<MineJob> initializeJobWorkflow() { if ( PrisonMines.getInstance() != null ) { MinesConfig config = PrisonMines.getInstance().getConfig(); return initializeJobWorkflow(getResetTime(), config.resetMessages, config.resetWarningTimes ); } return new ArrayList<>(); } MineScheduler(); }
MineScheduler extends MineReset implements PrisonRunnable { private List<MineJob> initializeJobWorkflow() { if ( PrisonMines.getInstance() != null ) { MinesConfig config = PrisonMines.getInstance().getConfig(); return initializeJobWorkflow(getResetTime(), config.resetMessages, config.resetWarningTimes ); } return new ArrayList<>(); } MineScheduler(); @Override void run(); void terminateJob(); void submit( int offset ); void manualReset(); boolean checkZeroBlockReset(); List<MineJob> getJobWorkflow(); void setJobWorkflow( List<MineJob> jobWorkflow ); Stack<MineJob> getJobStack(); void setJobStack( Stack<MineJob> jobStack ); MineJob getCurrentJob(); void setCurrentJob( MineJob currentJob ); Integer getTaskId(); void setTaskId( Integer taskId ); }
MineScheduler extends MineReset implements PrisonRunnable { private List<MineJob> initializeJobWorkflow() { if ( PrisonMines.getInstance() != null ) { MinesConfig config = PrisonMines.getInstance().getConfig(); return initializeJobWorkflow(getResetTime(), config.resetMessages, config.resetWarningTimes ); } return new ArrayList<>(); } MineScheduler(); @Override void run(); void terminateJob(); void submit( int offset ); void manualReset(); boolean checkZeroBlockReset(); List<MineJob> getJobWorkflow(); void setJobWorkflow( List<MineJob> jobWorkflow ); Stack<MineJob> getJobStack(); void setJobStack( Stack<MineJob> jobStack ); MineJob getCurrentJob(); void setCurrentJob( MineJob currentJob ); Integer getTaskId(); void setTaskId( Integer taskId );  }