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 java.util.ArrayList;
20: import java.util.List;
21:
22: import edu.iu.uis.eden.Id;
23: import edu.iu.uis.eden.engine.RouteContext;
24: import edu.iu.uis.eden.exception.EdenUserNotFoundException;
25: import edu.iu.uis.eden.plugin.attributes.RoleAttribute;
26: import edu.iu.uis.eden.routeheader.DocumentContent;
27: import edu.iu.uis.eden.workgroup.GroupNameId;
28:
29: /**
30: * A workgroup role attribute which resolves to workgroups with empty ids. This
31: * should result in an error being thrown from the engine.
32: *
33: * @author ewestfal
34: */
35: public class TestBadWorkgroupRoleAttribute extends
36: AbstractRoleAttribute {
37:
38: public List<Role> getRoleNames() {
39: List<Role> roles = new ArrayList<Role>();
40: roles.add(new Role(getClass(), "workgroup", "workgroup label"));
41: return roles;
42: }
43:
44: public List<String> getQualifiedRoleNames(String roleName,
45: DocumentContent documentContent)
46: throws EdenUserNotFoundException {
47: List<String> qualRoleNames = new ArrayList<String>();
48: qualRoleNames.add("TestWorkgroup");
49: return qualRoleNames;
50: }
51:
52: public ResolvedQualifiedRole resolveQualifiedRole(
53: RouteContext routeContext, String roleName,
54: String qualifiedRole) throws EdenUserNotFoundException {
55: List<Id> recipients = new ArrayList<Id>();
56: recipients.add(new GroupNameId(null));
57: recipients.add(new GroupNameId(""));
58: return new ResolvedQualifiedRole("workgroup role label",
59: recipients);
60: }
61:
62: }
|