01: package net.sourceforge.cruisecontrol;
02:
03: import junit.framework.TestCase;
04:
05: import java.util.Date;
06:
07: import net.sourceforge.cruisecontrol.labelincrementers.DefaultLabelIncrementer;
08:
09: /**
10: * @author Dan Rollo
11: * Date: Jul 31, 2007
12: * Time: 1:38:14 AM
13: */
14: public class ProgressImplTest extends TestCase {
15:
16: public void testProgressInitState() throws Exception {
17: final Progress progress = new ProgressImpl(null);
18: assertEquals("New Progress should support call to getValue.",
19: DateFormatFactory.getTimeFormat().format(new Date())
20: + " null", progress.getValue());
21: }
22:
23: public void testProgressSet() throws Exception {
24: final ProjectConfig config = new ProjectConfig();
25: config.add(new DefaultLabelIncrementer());
26:
27: final Project project = new MockProject();
28: project.setProjectConfig(config);
29:
30: final Progress progress = new ProgressImpl(project);
31:
32: final String testValue = "test value";
33: progress.setValue(testValue);
34: assertEquals(DateFormatFactory.getTimeFormat().format(
35: new Date())
36: + " " + testValue, progress.getValue());
37: }
38: }
|