1 package org.oddjob.dummy; 2 3 import java.io.File ; 4 5 import org.oddjob.framework.SimpleJob; 6 7 8 public class DummyExistsJob extends SimpleJob { 9 10 public void setFile(File file) { } 11 12 public int execute() throws Exception { 13 14 if (Math.random() > 0.9) { 15 16 throw new Exception ("Pretend File Exception"); 17 } 18 19 if (Math.random() > 0.5 ) { 20 21 return 1; 22 } 23 else { 24 25 return 0; 26 } 27 } 28 } 29 | Popular Tags |