01: /* Copyright 2004 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.channels;
07:
08: import java.util.List;
09:
10: import org.jasig.portal.IChannel;
11: import org.jasig.portal.PortalEvent;
12:
13: import junit.framework.TestCase;
14:
15: /**
16: * Testcase for CSecureInfo.
17: * @author andrew.petro@yale.edu
18: */
19: public class CSecureInfoTest extends TestCase {
20:
21: /**
22: * Test that CSecureInfo propogates channel events to
23: * the wrapped channel.
24: */
25: public void testReceiveEvent() {
26: EventRecordingChannel irc = new EventRecordingChannel();
27:
28: IChannel cSecureInfo = new CSecureInfo("bugusSubId", irc);
29:
30: assertTrue(irc.getEventsReceived().isEmpty());
31:
32: cSecureInfo.receiveEvent(PortalEvent.SESSION_DONE_EVENT);
33:
34: List eventsReceived = irc.getEventsReceived();
35: assertFalse(eventsReceived.isEmpty());
36: PortalEvent event = (PortalEvent) irc.getEventsReceived()
37: .get(0);
38: assertEquals(PortalEvent.SESSION_DONE, event.getEventNumber());
39: }
40:
41: }
|