alma::alarmsystem::clients::test::CategoryClientTest Class Reference

Inheritance diagram for alma::alarmsystem::clients::test::CategoryClientTest:
Inheritance graph
[legend]
Collaboration diagram for alma::alarmsystem::clients::test::CategoryClientTest:
Collaboration graph
[legend]

List of all members.

Public Types

enum  AlarmsFromCDB {
  M1_1A = ("TEST", "TEST_MEMBER1", 1, true,2,"The cause","Run and fix quickly","Test alarm 1","A disaster"), M1_2A = ("TEST", "TEST_MEMBER1", 2, true,3,null,null,"Test alarm 2",null), M2_1A = ("TEST", "TEST_MEMBER2", 1, true,2,"The cause","Run and fix quickly","Test alarm 1","A disaster"), M2_2A = ("TEST", "TEST_MEMBER2", 2, true,3,null,null,"Test alarm 2",null),
  M1_1I = ("TEST", "TEST_MEMBER1", 1, false,2,"The cause","Run and fix quickly","Test alarm 1","A disaster"), M1_2I = ("TEST", "TEST_MEMBER1", 2, false,3,null,null,"Test alarm 2",null), M2_1I = ("TEST", "TEST_MEMBER2", 1, false,2,"The cause","Run and fix quickly","Test alarm 1","A disaster"), M2_2I = ("TEST", "TEST_MEMBER2", 2, false,3,null,null,"Test alarm 2",null)
}

Public Member Functions

 CategoryClientTest () throws Exception
void setUp () throws Exception
void tearDown () throws Exception
void onAlarm (Alarm alarm)
void onException (LaserSelectionException e)
void testAlarmReception () throws Exception

Private Member Functions

void send_alarm (String family, String member, int code, boolean active) throws Exception
int waitForMessages (int numOfMessages)

Private Attributes

CategoryClient categoryClient
Vector< AlarmalarmsReceived

Static Private Attributes

static final int MAX_TIMEOUT = 120

Member Enumeration Documentation

The definition of the alarms as we expect they arrive from the alarm system

Author:
acaproni
Enumerator:
M1_1A 
M1_2A 
M2_1A 
M2_2A 
M1_1I 
M1_2I 
M2_1I 
M2_2I 

Constructor & Destructor Documentation

alma::alarmsystem::clients::test::CategoryClientTest::CategoryClientTest (  )  throws Exception [inline]

Constructor

Exceptions:
Exception 

Member Function Documentation

void alma::alarmsystem::clients::test::CategoryClientTest::onAlarm ( Alarm  alarm  )  [inline]
See also:
AlarmSelectionListener

Implements cern::laser::client::services::selection::AlarmSelectionListener.

References alarmsReceived.

void alma::alarmsystem::clients::test::CategoryClientTest::onException ( LaserSelectionException  e  )  [inline]
See also:
AlarmSelectionListener

Implements cern::laser::client::services::selection::AlarmSelectionListener.

void alma::alarmsystem::clients::test::CategoryClientTest::send_alarm ( String  family,
String  member,
int  code,
boolean  active 
) throws Exception [inline, private]
void alma::alarmsystem::clients::test::CategoryClientTest::setUp (  )  throws Exception [inline]
void alma::alarmsystem::clients::test::CategoryClientTest::tearDown (  )  throws Exception [inline]
void alma::alarmsystem::clients::test::CategoryClientTest::testAlarmReception (  )  throws Exception [inline]

Sends a couple of alarms and check if they arrive from the client

Exceptions:
Exception 

References alarmsReceived, categoryClient, alma::alarmsystem::clients::CategoryClient::connect(), send_alarm(), and waitForMessages().

int alma::alarmsystem::clients::test::CategoryClientTest::waitForMessages ( int  numOfMessages  )  [inline, private]

Wait for the messages from the alarm system.

Parameters:
numOfMessages The number of messages to wait for
Returns:
true if all the messages are received false in case of timeout (i.e. not all the messages received in MAX_TIMEOUT seconds)

References alarmsReceived, and MAX_TIMEOUT.

Referenced by testAlarmReception().


Member Data Documentation

The vector with the alarms received

Referenced by onAlarm(), setUp(), tearDown(), testAlarmReception(), and waitForMessages().

The categoryClient to test

Referenced by setUp(), tearDown(), and testAlarmReception().

Max number of seconds to wait for the messages

Referenced by waitForMessages().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2