001 /**
002 * Copyright 2005-2011 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.rice.ken.test;
017
018 import org.kuali.rice.ken.bo.NotificationProducerBo;
019 import org.kuali.rice.ken.util.NotificationConstants;
020
021 /**
022 * Constants reflecting test data that is used in tests.
023 * If tests or test data is updated, this file need to be updated
024 * to be kept in sync.
025 * @author Kuali Rice Team (rice.collab@kuali.org)
026 */
027 public final class TestConstants {
028 /**
029 * A primary key that won't exist in the database
030 */
031 public static final Long NON_EXISTENT_ID = new Long(-1);
032
033 /**
034 * Producers
035 */
036 public static final NotificationProducerBo PRODUCER_1 = new NotificationProducerBo();
037 static {
038 PRODUCER_1.setId(new Long(101));
039 PRODUCER_1.setDescription("First Producer for Unit Tests");
040 PRODUCER_1.setName("Test Producer #1");
041 PRODUCER_1.setContactInfo("producer_1_and_2@127.0.0.1");
042 }
043 public static final NotificationProducerBo PRODUCER_2 = new NotificationProducerBo();
044 static {
045 PRODUCER_2.setId(new Long(102));
046 PRODUCER_2.setName("Test Producer #2");
047 PRODUCER_2.setDescription("Second Producer for Unit Tests");
048 PRODUCER_2.setContactInfo("producer_1_and_2@127.0.0.1");
049 }
050 public static final NotificationProducerBo PRODUCER_3 = new NotificationProducerBo();
051 static {
052 PRODUCER_3.setId(new Long(103));
053 PRODUCER_3.setName("Test Producer #3");
054 PRODUCER_3.setDescription("Third Producer for Unit Tests");
055 PRODUCER_3.setContactInfo("producer_3@127.0.0.1");
056 }
057 public static final NotificationProducerBo PRODUCER_4 = new NotificationProducerBo();
058 static {
059 PRODUCER_4.setId(new Long(104));
060 PRODUCER_4.setName("Test Producer #4");
061 PRODUCER_4.setDescription("Fourth Producer for Unit Tests");
062 PRODUCER_4.setContactInfo("producer_4@127.0.0.1");
063 }
064 public static final NotificationProducerBo PRODUCER_5 = new NotificationProducerBo();
065 static {
066 PRODUCER_5.setId(new Long(105));
067 PRODUCER_5.setName("Notification System");
068 PRODUCER_5.setDescription("This producer represents messages sent from the general message sending form.");
069 PRODUCER_5.setContactInfo("admins-notsys@127.0.0.1");
070 }
071
072 public static final int NUM_TEST_PRODUCERS = 5;
073 public static final String CONTACT_INFO_2_PRODUCERS = "producer_1_and_2@127.0.0.1";
074 public static final String CONTACT_INFO_1_PRODUCER = "producer_3@127.0.0.1";
075
076 /**
077 * Some valid channels
078 */
079 public static final String VALID_CHANNEL_ONE = "Test Channel #1";
080 public static final Long VALID_CHANNEL_ONE_ID = new Long(101);
081 public static final String VALID_CHANNEL_TWO = "Test Channel #2";
082 public static final Long VALID_CHANNEL_TWO_ID = new Long(102);
083
084 /**
085 * Channel in test data:
086 * PRODUCER_3 MUST be a valid producer for this channel
087 * PRODUCER_4 MUST NOT be a valid producer for this channel
088 */
089 public static final Long CHANNEL_ID_1 = new Long(101);
090
091 /**
092 * A valid message delivery id in the test data
093 */
094 public static final Long VALID_MESSAGE_DELIVERY_ID = new Long(1);
095
096 /**
097 * Number of existing message deliveries in test data
098 */
099 public static final int NUM_OF_MSG_DELIVS_IN_TEST_DATA = 5;
100
101 /**
102 * A valid 'Email' message delivery id in the test data
103 */
104 public static final Long VALID_EMAIL_MESSAGE_DELIVERY_ID = new Long(8);
105
106 /**
107 * Id of message delivery which has been intentionally misconfigured in
108 * test data to fail delivery (e.g. invalid delivery type)
109 */
110 public static final Long BAD_MESSAGE_DELIVERY_ID = new Long(5);
111
112 /**
113 * A valid deliverer name
114 */
115 public static final String VALID_DELIVERER_NAME = NotificationConstants.MESSAGE_DELIVERY_TYPES.KEW_ACTION_LIST_MESSAGE_DELIVERY_TYPE;
116
117 /**
118 * An invalid deliverer name
119 */
120 public static final String NON_EXISTENT_DELIVERER_NAME = "BOGUS_DELIVERER";
121
122 /**
123 * Some user names
124 */
125 public static final String TEST_USER_ONE = "testuser1";
126 public static final String TEST_USER_ONE_DISPLAYNAME = "Test User 1";
127
128 public static final String TEST_USER_TWO = "testuser2";
129 public static final String TEST_USER_THREE = "testuser3";
130 public static final String TEST_USER_FOUR = "testuser4";
131 public static final String TEST_USER_FIVE = "testuser5";
132 public static final String TEST_USER_SIX = "testuser6";
133
134 public static final String ADMIN_USER_1 = "testadmin1";
135 public static final String NON_ADMIN_USER_1 = TEST_USER_ONE;
136 public static final String INVALID_USER_1 = "InvalidUser";
137
138 /**
139 * A user who is the target of a notification
140 */
141 public static final String NOTIFICATION_RECIPIENT_ID = "testuser5";
142 /**
143 * The content type of a notification for which the NOTIFICATION_RECIPIENT_ID user is a target
144 * (can by any content type as long as the user is the target of at least one notification with that content type)
145 */
146 public static final String NOTIFICATION_RECIPIENT_CONTENT_TYPE = NotificationConstants.CONTENT_TYPES.SIMPLE_CONTENT_TYPE;
147
148 /**
149 * A valid group
150 */
151 public static final String VALID_GROUP_NAME_1 = "RiceTeam";
152
153 /**
154 * A valid KIM group name
155 */
156 public static final String VALID_KIM_GROUP_NAME_1 = "KR-WKFLW:WorkflowAdmin";
157
158 /**
159 * A valid KIM group name
160 */
161 public static final String VALID_KIM_GROUP_ID_1 = "1000464";
162
163 /**
164 * A valid KIM principal name
165 */
166 //nb: the corresponding id should be TEST_USER_5 (ie "testuser5")
167 public static final String VALID_KIM_PRINCIPAL_NAME = "testuser5";
168
169 /**
170 * Number of members in this group
171 */
172 public static final int GROUP_1_MEMBERS = 6;
173
174 /**
175 *
176 */
177 public static final int KIM_GROUP_1_MEMBERS = 4;
178
179 /**
180 * An invalid content type
181 */
182 public static final String INVALID_CONTENT_TYPE = "Bad Type";
183
184 /**
185 * A valid notification id
186 */
187 public static final Long NOTIFICATION_1 = new Long(1);
188
189 /**
190 * Delivery type of the NOTIFICATION_1 notification
191 */
192 public static final String NOTIFICATION_1_DELIVERY_TYPE = NotificationConstants.DELIVERY_TYPES.FYI;
193 /**
194 * Number of message deliveries in the test data that are associated with notification #2
195 */
196 public static final int NUM_OF_MSG_DELIVS_FOR_NOTIF_1_TEST_USER_5 = 1;
197
198 /**
199 * Id of the message delivery in the test data for notification 1, test user 5, kew action list deliverer
200 */
201 public static final Long NOT_MSG_DELIV_NOTIF_1_TEST_USER_5_ACT_LST = new Long(1);
202
203 /**
204 * Id of the message delivery in the test data for notification 1, test user 5, email deliverer
205 */
206 public static final Long NOT_MSG_DELIV_NOTIF_1_TEST_USER_5 = new Long(1);
207
208 /**
209 * Email deliverer property
210 */
211 public static final String EMAIL_DELIVERER_PROPERTY_VALUE = "kuali-ken-testing@cornell.edu";
212
213 private TestConstants() {
214 throw new UnsupportedOperationException("do not call");
215 }
216
217 }