org.eclipse.core.tests.harness
Class TestJob

java.lang.Object
  extended by org.eclipse.core.runtime.PlatformObject
      extended by org.eclipse.core.internal.jobs.InternalJob
          extended by org.eclipse.core.runtime.jobs.Job
              extended by org.eclipse.core.tests.harness.TestJob
All Implemented Interfaces:
java.lang.Comparable, org.eclipse.core.runtime.IAdaptable

public class TestJob
extends org.eclipse.core.runtime.jobs.Job

A job that runs for a specified amount of ticks, where each tick is represented by a sleep for a specified amount of milliseconds.


Field Summary
 
Fields inherited from class org.eclipse.core.runtime.jobs.Job
ASYNC_FINISH, BUILD, DECORATE, INTERACTIVE, LONG, NONE, RUNNING, SHORT, SLEEPING, WAITING
 
Constructor Summary
TestJob(java.lang.String name)
          A job that runs for one second in 100 millisecond increments.
TestJob(java.lang.String name, int ticks, long tickDuration)
          A job that runs for the specified number of ticks at the given tick duration.
 
Method Summary
 int getRunCount()
          Returns the number of times this job instance has been run, possibly including the current invocation if the job is currently running.
 org.eclipse.core.runtime.IStatus run(org.eclipse.core.runtime.IProgressMonitor monitor)
           
 
Methods inherited from class org.eclipse.core.runtime.jobs.Job
addJobChangeListener, belongsTo, cancel, done, getJobManager, getName, getPriority, getProperty, getResult, getRule, getState, getThread, isBlocking, isSystem, isUser, join, removeJobChangeListener, schedule, schedule, setName, setPriority, setProgressGroup, setProperty, setRule, setSystem, setThread, setUser, shouldRun, shouldSchedule, sleep, wakeUp, wakeUp
 
Methods inherited from class org.eclipse.core.internal.jobs.InternalJob
compareTo, toString
 
Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Constructor Detail

TestJob

public TestJob(java.lang.String name)
A job that runs for one second in 100 millisecond increments.


TestJob

public TestJob(java.lang.String name,
               int ticks,
               long tickDuration)
A job that runs for the specified number of ticks at the given tick duration.

Parameters:
name - The name of this test job
ticks - The number of work ticks that this job should perform
tickDuration - The duration in milliseconds of each work tick
Method Detail

getRunCount

public int getRunCount()
Returns the number of times this job instance has been run, possibly including the current invocation if the job is currently running.


run

public org.eclipse.core.runtime.IStatus run(org.eclipse.core.runtime.IProgressMonitor monitor)
Specified by:
run in class org.eclipse.core.runtime.jobs.Job