KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > oddjob > jobs > SequenceJobTest


1 /*
2  * (c) Rob Gordon 2005
3  */

4 package org.oddjob.jobs;
5
6 import java.util.Map JavaDoc;
7
8 import junit.framework.TestCase;
9
10 import org.oddjob.Helper;
11 import org.oddjob.framework.RunnableWrapper;
12 import org.oddjob.monitor.model.Describer;
13
14 public class SequenceJobTest extends TestCase {
15
16     public void testSerialize() throws Exception JavaDoc {
17         SequenceJob test = new SequenceJob();
18         test.setFrom(22);
19         
20         test.run();
21         
22         assertEquals(new Integer JavaDoc(22), test.getCurrent());
23     
24         SequenceJob copy = (SequenceJob) Helper.copy(test);
25         
26         assertEquals(new Integer JavaDoc(22), copy.getCurrent());
27     }
28     
29     public void testDescribe() {
30         SequenceJob test = new SequenceJob();
31         
32         Runnable JavaDoc wrapper = RunnableWrapper.wrapperFor(test);
33         
34         wrapper.run();
35         
36         Map JavaDoc m = Describer.describe(wrapper);
37         
38         String JavaDoc current = (String JavaDoc)m.get("current");
39         assertEquals("0", current);
40     }
41 }
42
Popular Tags