[jsword-svn] common/java/test/org/crosswire/common/progress s

jswordcvs at crosswire.org jswordcvs at crosswire.org
Mon Mar 7 19:31:42 MST 2005


Update of /cvs/jsword/common/java/test/org/crosswire/common/progress
In directory www.crosswire.org:/tmp/cvs-serv23334/java/test/org/crosswire/common/progress

Modified Files:
	JobTest.java 
Log Message:
Improved the Job class allowing for cooperative interruption.
Fixed the download cancel. Improved the cancel of indexing.
It works but you have to restart to try to index again.

Index: JobTest.java
===================================================================
RCS file: /cvs/jsword/common/java/test/org/crosswire/common/progress/JobTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** JobTest.java	20 Apr 2004 21:20:04 -0000	1.1
--- JobTest.java	8 Mar 2005 02:31:40 -0000	1.2
***************
*** 55,59 ****
          assertEquals(job.getJobDescription(), WIBBLE);
          assertEquals(job.isFinished(), false);
!         assertEquals(job.canInterrupt(), false);
          assertEquals(job.getStateDescription(), WIBBLE);
          assertEquals(job.getPercent(), 0);
--- 55,59 ----
          assertEquals(job.getJobDescription(), WIBBLE);
          assertEquals(job.isFinished(), false);
!         assertEquals(job.isInterruptable(), false);
          assertEquals(job.getStateDescription(), WIBBLE);
          assertEquals(job.getPercent(), 0);
***************
*** 63,72 ****
          assertEquals(job.getPercent(), 100);
          assertEquals(job.getReportedPercent(), 100);
!         assertEquals(job.canInterrupt(), false);
  
          job = JobManager.createJob(WIBBLE, Thread.currentThread(), false);
          assertEquals(job.getJobDescription(), WIBBLE);
          assertEquals(job.isFinished(), false);
!         assertEquals(job.canInterrupt(), true);
          assertEquals(job.getStateDescription(), WIBBLE);
          assertEquals(job.getPercent(), 0);
--- 63,72 ----
          assertEquals(job.getPercent(), 100);
          assertEquals(job.getReportedPercent(), 100);
!         assertEquals(job.isInterruptable(), false);
  
          job = JobManager.createJob(WIBBLE, Thread.currentThread(), false);
          assertEquals(job.getJobDescription(), WIBBLE);
          assertEquals(job.isFinished(), false);
!         assertEquals(job.isInterruptable(), true);
          assertEquals(job.getStateDescription(), WIBBLE);
          assertEquals(job.getPercent(), 0);
***************
*** 76,85 ****
          assertEquals(job.getPercent(), 100);
          assertEquals(job.getReportedPercent(), 100);
!         assertEquals(job.canInterrupt(), false);
  
          job = JobManager.createJob(WIBBLE, url, false);
          assertEquals(job.getJobDescription(), WIBBLE);
          assertEquals(job.isFinished(), false);
!         assertEquals(job.canInterrupt(), false);
          assertEquals(job.getStateDescription(), WIBBLE);
          assertEquals(job.getPercent(), 0);
--- 76,85 ----
          assertEquals(job.getPercent(), 100);
          assertEquals(job.getReportedPercent(), 100);
!         assertEquals(job.isInterruptable(), false);
  
          job = JobManager.createJob(WIBBLE, url, false);
          assertEquals(job.getJobDescription(), WIBBLE);
          assertEquals(job.isFinished(), false);
!         assertEquals(job.isInterruptable(), false);
          assertEquals(job.getStateDescription(), WIBBLE);
          assertEquals(job.getPercent(), 0);
***************
*** 89,98 ****
          assertEquals(job.getPercent(), 100);
          assertEquals(job.getReportedPercent(), 100);
!         assertEquals(job.canInterrupt(), false);
  
          job = JobManager.createJob(WIBBLE, url, Thread.currentThread(), false);
          assertEquals(job.getJobDescription(), WIBBLE);
          assertEquals(job.isFinished(), false);
!         assertEquals(job.canInterrupt(), true);
          assertEquals(job.getStateDescription(), WIBBLE);
          assertEquals(job.getPercent(), 0);
--- 89,98 ----
          assertEquals(job.getPercent(), 100);
          assertEquals(job.getReportedPercent(), 100);
!         assertEquals(job.isInterruptable(), false);
  
          job = JobManager.createJob(WIBBLE, url, Thread.currentThread(), false);
          assertEquals(job.getJobDescription(), WIBBLE);
          assertEquals(job.isFinished(), false);
!         assertEquals(job.isInterruptable(), true);
          assertEquals(job.getStateDescription(), WIBBLE);
          assertEquals(job.getPercent(), 0);
***************
*** 102,106 ****
          assertEquals(job.getPercent(), 100);
          assertEquals(job.getReportedPercent(), 100);
!         assertEquals(job.canInterrupt(), false);
      }
  }
--- 102,106 ----
          assertEquals(job.getPercent(), 100);
          assertEquals(job.getReportedPercent(), 100);
!         assertEquals(job.isInterruptable(), false);
      }
  }



More information about the jsword-svn mailing list