author | Jaroslav Tulach <jtulach@netbeans.org> |
Sun, 02 May 2010 14:35:48 +0200 | |
changeset 350 | b8edf9de56c5 |
parent 348 | samples/stateful/test/org/apidesign/stateful/api/ProgressTest.java@26f9a0ec4315 |
permissions | -rw-r--r-- |
jtulach@348 | 1 |
package org.apidesign.stateful.api; |
jtulach@348 | 2 |
|
jtulach@348 | 3 |
import junit.framework.TestCase; |
jtulach@348 | 4 |
|
jtulach@350 | 5 |
public class ProgressStatefulTest extends TestCase { |
jtulach@348 | 6 |
|
jtulach@350 | 7 |
public ProgressStatefulTest(String testName) { |
jtulach@348 | 8 |
super(testName); |
jtulach@348 | 9 |
} |
jtulach@348 | 10 |
|
jtulach@348 | 11 |
public void testProgressWithoutStart() { |
jtulach@348 | 12 |
try { |
jtulach@348 | 13 |
// BEGIN: progress.wrong.order |
jtulach@350 | 14 |
ProgressStateful p = ProgressStateful.create("WrongOrder"); |
jtulach@348 | 15 |
p.progress(10); |
jtulach@348 | 16 |
p.finish(); |
jtulach@348 | 17 |
// END: progress.wrong.order |
jtulach@348 | 18 |
|
jtulach@348 | 19 |
fail("Calling progress without start yields an exception!?"); |
jtulach@348 | 20 |
} catch (IllegalStateException ex) { |
jtulach@348 | 21 |
// OK |
jtulach@348 | 22 |
} |
jtulach@348 | 23 |
} |
jtulach@348 | 24 |
|
jtulach@348 | 25 |
} |