1 4 package org.oddjob.ant; 5 6 import java.io.ByteArrayInputStream ; 7 import java.io.InputStream ; 8 9 import junit.framework.TestCase; 10 11 import org.oddjob.Oddjob; 12 import org.oddjob.state.JobState; 13 14 17 public class AntJobTest extends TestCase { 18 19 public void testJob() { 20 String config="<oddjob id='this'><ant>" + 21 "<echo message='${this.args[0]}'/>" + 22 "</ant></oddjob>"; 23 Oddjob oj = new Oddjob(); 24 InputStream in = new ByteArrayInputStream (config.getBytes()); 25 oj.setInput(in); 26 oj.setArgs(new String [] { "greeting" }); 27 oj.run(); 28 29 assertEquals(JobState.COMPLETE, oj.lastJobStateEvent().getJobState()); 30 } 31 } 32 | Popular Tags |