Clover Coverage Report - kew-test 2.0.0-SNAPSHOT
Coverage timestamp: Wed Dec 31 1969 19:00:00 EST
14   59   5   7
0   37   0.36   2
2     2.5  
1    
 
  RoutingToInactiveWorkgroupTest       Line # 32 14 0% 5 16 0% 0.0
 
No Tests
 
1    /*
2    * Copyright 2005-2007 The Kuali Foundation
3    *
4    *
5    * Licensed under the Educational Community License, Version 2.0 (the "License");
6    * you may not use this file except in compliance with the License.
7    * You may obtain a copy of the License at
8    *
9    * http://www.opensource.org/licenses/ecl2.php
10    *
11    * Unless required by applicable law or agreed to in writing, software
12    * distributed under the License is distributed on an "AS IS" BASIS,
13    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    * See the License for the specific language governing permissions and
15    * limitations under the License.
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)
 
32    public class RoutingToInactiveWorkgroupTest extends KEWTestCase {
33   
 
34  0 toggle protected void loadTestData() throws Exception {
35  0 loadXmlFile("RoutingConfig.xml");
36    }
37   
 
38  0 toggle @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();//wait for doc to go into exception routing
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    }