1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
package org.kuali.rice.kew.routing; |
18 |
|
|
19 |
|
import static org.junit.Assert.assertTrue; |
20 |
|
import static org.junit.Assert.fail; |
21 |
|
|
22 |
|
import org.junit.Test; |
23 |
|
import org.kuali.rice.kew.exception.InvalidActionTakenException; |
24 |
|
import org.kuali.rice.kew.exception.WorkflowException; |
25 |
|
import org.kuali.rice.kew.service.WorkflowDocument; |
26 |
|
import org.kuali.rice.kew.test.KEWTestCase; |
27 |
|
import org.kuali.rice.kew.test.TestUtilities; |
28 |
|
import org.kuali.rice.test.BaselineTestCase.BaselineMode; |
29 |
|
import org.kuali.rice.test.BaselineTestCase.Mode; |
30 |
|
|
31 |
|
@BaselineMode(Mode.CLEAR_DB) |
|
|
| 0% |
Uncovered Elements: 16 (16) |
Complexity: 5 |
Complexity Density: 0.36 |
|
32 |
|
public class RoutingToInactiveWorkgroupTest extends KEWTestCase { |
33 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
34 |
0
|
protected void loadTestData() throws Exception {... |
35 |
0
|
loadXmlFile("RoutingConfig.xml"); |
36 |
|
} |
37 |
|
|
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 4 |
Complexity Density: 0.31 |
4
-
|
|
38 |
0
|
@Test public void testRoutingToInactiveWorkgroup() throws Exception {... |
39 |
0
|
WorkflowDocument doc = new WorkflowDocument(getPrincipalIdForName("rkirkend"), "InactiveWorkgroupDocType"); |
40 |
0
|
try { |
41 |
0
|
doc.routeDocument(""); |
42 |
0
|
fail("document should have thrown routing exception"); |
43 |
|
} catch (Exception e) { |
44 |
0
|
e.printStackTrace(); |
45 |
|
} |
46 |
0
|
TestUtilities.getExceptionThreader().join(); |
47 |
0
|
doc = new WorkflowDocument(getPrincipalIdForName("rkirkend"), doc.getRouteHeaderId()); |
48 |
0
|
assertTrue("Document should be in exception routing because workgroup is inactive", doc.stateIsException()); |
49 |
|
|
50 |
0
|
try { |
51 |
0
|
doc.routeDocument("routing a document that is in exception routing"); |
52 |
0
|
fail("Succeeded in routing document that is in exception routing"); |
53 |
|
} catch (InvalidActionTakenException iate) { |
54 |
0
|
log.info("Expected exception occurred: " + iate); |
55 |
|
} catch (WorkflowException we) { |
56 |
0
|
fail("Attempt at routing document in exception routing succeeded, when it should have been an InvalidActionTakenException"); |
57 |
|
} |
58 |
|
} |
59 |
|
} |