1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/samples/stateful/test/org/apidesign/stateful/api/ProgressStatefulTest.java Sun May 02 14:35:48 2010 +0200
1.3 @@ -0,0 +1,25 @@
1.4 +package org.apidesign.stateful.api;
1.5 +
1.6 +import junit.framework.TestCase;
1.7 +
1.8 +public class ProgressStatefulTest extends TestCase {
1.9 +
1.10 + public ProgressStatefulTest(String testName) {
1.11 + super(testName);
1.12 + }
1.13 +
1.14 + public void testProgressWithoutStart() {
1.15 + try {
1.16 + // BEGIN: progress.wrong.order
1.17 + ProgressStateful p = ProgressStateful.create("WrongOrder");
1.18 + p.progress(10);
1.19 + p.finish();
1.20 + // END: progress.wrong.order
1.21 +
1.22 + fail("Calling progress without start yields an exception!?");
1.23 + } catch (IllegalStateException ex) {
1.24 + // OK
1.25 + }
1.26 + }
1.27 +
1.28 +}