01: /*
02: * Copyright 2005-2007 The Kuali Foundation.
03: *
04: *
05: * Licensed under the Educational Community License, Version 1.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.opensource.org/licenses/ecl1.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 edu.iu.uis.eden.routetemplate;
18:
19: import org.junit.Test;
20: import org.kuali.workflow.test.WorkflowTestCase;
21:
22: import edu.iu.uis.eden.KEWServiceLocator;
23: import edu.iu.uis.eden.clientapp.WorkflowDocument;
24: import edu.iu.uis.eden.clientapp.vo.NetworkIdVO;
25:
26: /**
27: * Tests the generation of Action Requests from RoleAttributes
28: *
29: * @author ewestfal
30: */
31: public class RoleAttributeTest extends WorkflowTestCase {
32:
33: @Test
34: public void testWorkgroupRoleAttribute() throws Exception {
35: loadXmlFile("WorkgroupRoleAttributeTestConfig.xml");
36: WorkflowDocument document = new WorkflowDocument(
37: new NetworkIdVO("user1"),
38: "WorkgroupRoleAttributeDocument");
39: document.routeDocument("");
40:
41: assertTrue("document should be enroute.", document
42: .stateIsEnroute());
43: }
44:
45: /**
46: * Tests that if you return a non-null Id object with a null id value inside, that the role action request
47: * generation handles it properly.
48: */
49: @Test
50: public void testBadWorkgroupRoleAttribute() throws Exception {
51: loadXmlFile("BadWorkgroupRoleAttributeTestConfig.xml");
52: WorkflowDocument document = new WorkflowDocument(
53: new NetworkIdVO("user1"),
54: "BadWorkgroupRoleAttributeDocument");
55:
56: try {
57: document.routeDocument("");
58: fail("Should have thrown an error because we had some bad ids.");
59: } catch (Exception e) {
60: }
61: }
62:
63: }
|