@Test public void setRunningTrueWhenRunning() throws Exception { setTaskState("RUNNING"); Assert.assertFalse(task.setRunning(true)); Assert.assertEquals("RUNNING", getTaskState()); }
synchronized boolean setRunning(boolean running) { if (isDone()) { return false; } if (running) { if ((state != State.RUNNABLE) && (state != State.INTERRUPTED)) { return false; } state = State.RUNNING; } else { if (state != State.RUNNING) { return false; } state = State.RUNNABLE; notifyAll(); } return true; }
ScheduledTaskImpl implements ScheduledTask { synchronized boolean setRunning(boolean running) { if (isDone()) { return false; } if (running) { if ((state != State.RUNNABLE) && (state != State.INTERRUPTED)) { return false; } state = State.RUNNING; } else { if (state != State.RUNNING) { return false; } state = State.RUNNABLE; notifyAll(); } return true; } }
ScheduledTaskImpl implements ScheduledTask { synchronized boolean setRunning(boolean running) { if (isDone()) { return false; } if (running) { if ((state != State.RUNNABLE) && (state != State.INTERRUPTED)) { return false; } state = State.RUNNING; } else { if (state != State.RUNNING) { return false; } state = State.RUNNABLE; notifyAll(); } return true; } private  ScheduledTaskImpl(Builder builder); }
ScheduledTaskImpl implements ScheduledTask { synchronized boolean setRunning(boolean running) { if (isDone()) { return false; } if (running) { if ((state != State.RUNNABLE) && (state != State.INTERRUPTED)) { return false; } state = State.RUNNING; } else { if (state != State.RUNNING) { return false; } state = State.RUNNABLE; notifyAll(); } return true; } private  ScheduledTaskImpl(Builder builder); KernelRunnable getTask(); Identity getOwner(); Priority getPriority(); long getStartTime(); long getPeriod(); int getTryCount(); long getTimeout(); Throwable getLastFailure(); void setPriority(Priority priority); boolean isRecurring(); RecurringTaskHandle getRecurringTaskHandle(); synchronized boolean isCancelled(); synchronized boolean cancel(boolean block); void setTimeout(long timeout); String toString(); }
ScheduledTaskImpl implements ScheduledTask { synchronized boolean setRunning(boolean running) { if (isDone()) { return false; } if (running) { if ((state != State.RUNNABLE) && (state != State.INTERRUPTED)) { return false; } state = State.RUNNING; } else { if (state != State.RUNNING) { return false; } state = State.RUNNABLE; notifyAll(); } return true; } private  ScheduledTaskImpl(Builder builder); KernelRunnable getTask(); Identity getOwner(); Priority getPriority(); long getStartTime(); long getPeriod(); int getTryCount(); long getTimeout(); Throwable getLastFailure(); void setPriority(Priority priority); boolean isRecurring(); RecurringTaskHandle getRecurringTaskHandle(); synchronized boolean isCancelled(); synchronized boolean cancel(boolean block); void setTimeout(long timeout); String toString();  }