View Javadoc

1   /**
2    * Copyright 2005-2013 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.ken.test;
17  
18  import org.kuali.rice.ken.bo.NotificationProducerBo;
19  import org.kuali.rice.ken.util.NotificationConstants;
20  
21  /**
22   * Constants reflecting test data that is used in tests.
23   * If tests or test data is updated, this file need to be updated
24   * to be kept in sync.
25   * @author Kuali Rice Team (rice.collab@kuali.org)
26   */
27  public final class TestConstants {
28      /**
29       * A primary key that won't exist in the database
30       */
31      public static final Long NON_EXISTENT_ID = new Long(-1);
32  
33      /**
34       * Producers
35       */
36      public static final NotificationProducerBo PRODUCER_1 = new NotificationProducerBo();
37      static {
38          PRODUCER_1.setId(new Long(101));
39          PRODUCER_1.setDescription("First Producer for Unit Tests");
40          PRODUCER_1.setName("Test Producer #1");
41          PRODUCER_1.setContactInfo("producer_1_and_2@127.0.0.1");
42      }
43      public static final NotificationProducerBo PRODUCER_2 = new NotificationProducerBo();
44      static {
45          PRODUCER_2.setId(new Long(102));
46          PRODUCER_2.setName("Test Producer #2");
47          PRODUCER_2.setDescription("Second Producer for Unit Tests");
48          PRODUCER_2.setContactInfo("producer_1_and_2@127.0.0.1");
49      }
50      public static final NotificationProducerBo PRODUCER_3 = new NotificationProducerBo();
51      static {
52          PRODUCER_3.setId(new Long(103));
53          PRODUCER_3.setName("Test Producer #3");
54          PRODUCER_3.setDescription("Third Producer for Unit Tests");
55          PRODUCER_3.setContactInfo("producer_3@127.0.0.1");
56      }
57      public static final NotificationProducerBo PRODUCER_4 = new NotificationProducerBo();
58      static {
59          PRODUCER_4.setId(new Long(104));
60          PRODUCER_4.setName("Test Producer #4");
61          PRODUCER_4.setDescription("Fourth Producer for Unit Tests");
62          PRODUCER_4.setContactInfo("producer_4@127.0.0.1");
63      }
64      public static final NotificationProducerBo PRODUCER_5 = new NotificationProducerBo();
65      static {
66          PRODUCER_5.setId(new Long(105));
67          PRODUCER_5.setName("Notification System");
68          PRODUCER_5.setDescription("This producer represents messages sent from the general message sending form.");
69          PRODUCER_5.setContactInfo("admins-notsys@127.0.0.1");
70      }
71  
72      public static final int NUM_TEST_PRODUCERS = 5;
73      public static final String CONTACT_INFO_2_PRODUCERS = "producer_1_and_2@127.0.0.1";
74      public static final String CONTACT_INFO_1_PRODUCER = "producer_3@127.0.0.1";
75  
76      /**
77       * Some valid channels
78       */
79      public static final String VALID_CHANNEL_ONE = "Test Channel #1";
80      public static final Long VALID_CHANNEL_ONE_ID = new Long(101);
81      public static final String VALID_CHANNEL_TWO = "Test Channel #2";
82      public static final Long VALID_CHANNEL_TWO_ID = new Long(102);
83  
84      /**
85       * Channel in test data:
86       * PRODUCER_3 MUST be a valid producer for this channel
87       * PRODUCER_4 MUST NOT be a valid producer for this channel
88       */
89      public static final Long CHANNEL_ID_1 = new Long(101);
90  
91      /**
92       * A valid message delivery id in the test data
93       */
94      public static final Long VALID_MESSAGE_DELIVERY_ID = new Long(1);
95  
96      /**
97       * Number of existing message deliveries in test data
98       */
99      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 }