Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

alma::acs::component::client::ComponentClientTestCase Class Reference

Inheritance diagram for alma::acs::component::client::ComponentClientTestCase:

Inheritance graph
[legend]
Collaboration diagram for alma::acs::component::client::ComponentClientTestCase:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ComponentClientTestCase (String name) throws Exception

Protected Member Functions

void runTest () throws Throwable
void setUp () throws Exception
void connectToManager () throws Exception
String getFullName ()
ContainerServices getContainerServices ()
void tearDown () throws Exception
void initRemoteLogging ()
LogReceiver getLogReceiver () throws AcsJContainerServicesEx

Protected Attributes

AcsCorba acsCorba
AcsManagerProxy m_acsManagerProxy
AcsLogger m_logger
String m_managerLoc

Private Attributes

ContainerServicesImpl m_containerServices
CleaningDaemonThreadFactory m_threadFactory
LogReceiver logReceiver
ManagerClient managerClientImpl
Client m_managerClient
String m_namePrefix

Detailed Description

Base class for writing JUnit test clients for ACS components. Takes care of the communication with the ACS manager (local or provided in property ACS.manager).

Provides the ContainerServices.

Author:
hsommer Nov 21, 2002 5:53:05 PM


Constructor & Destructor Documentation

alma::acs::component::client::ComponentClientTestCase::ComponentClientTestCase String  name  )  throws Exception [inline]
 

Subclasses must call this ctor.

Parameters:
name the name used for the test case, and to talk with the ACS manager
Exceptions:
Exception 


Member Function Documentation

void alma::acs::component::client::ComponentClientTestCase::connectToManager  )  throws Exception [inline, protected]
 

Connects to the ACS Manager using AcsManagerProxy.

Exceptions:
Exception 

ContainerServices alma::acs::component::client::ComponentClientTestCase::getContainerServices  )  [inline, protected]
 

Gives access to the ContainerServices interface. This class plays the part of the role of the Java container that has to do with providing explicit services to the component, or test case respectively.

Returns:
ContainerServices

String alma::acs::component::client::ComponentClientTestCase::getFullName  )  [inline, protected]
 

LogReceiver alma::acs::component::client::ComponentClientTestCase::getLogReceiver  )  throws AcsJContainerServicesEx [inline, protected]
 

Gets a LogReceiver which can be used to verify log messages from both local and remote processes. The returned LogReceiver is already initialized. If initialization fails, an exception is thrown.

To receive logs from the log service, use either LogReceiver#getLogQueue() or LogReceiver#startCaptureLogs(java.io.PrintWriter).

Exceptions:
AcsJContainerServicesEx if the LogReceiver fails to initialize within 20 seconds.

void alma::acs::component::client::ComponentClientTestCase::initRemoteLogging  )  [inline, protected]
 

Sets up the test client logger(s) to send log records to the remote log service. Only one attempt to connect to the remote logger is made. If it fails, remote logging will be disabled.

Override this method to prevent remote logging.

void alma::acs::component::client::ComponentClientTestCase::runTest  )  throws Throwable [inline, protected]
 

Executes a single test method. Stray exceptions are logged using the test logger, so that they show in system logs.

See also:
junit.framework.TestCase#runTest()
Since:
ACS 6.0

void alma::acs::component::client::ComponentClientTestCase::setUp  )  throws Exception [inline, protected]
 

Starts CORBA in the client process and connects to the manager and logger.

Subclasses that override this method must call super.setUp(), likely before any other code in that method.

See also:
junit.framework.TestCase#setUp()

Reimplemented in alma::acs::component::client::ClientWithLogReceiverTest, and alma::acs::component::client::ComponentClientTestCaseTest.

void alma::acs::component::client::ComponentClientTestCase::tearDown  )  throws Exception [inline, protected]
 

Releases all previously obtained components (using manager), logs out from the manager, and terminates the CORBA ORB.

Subclasses that override this method must call super.tearDown(), likely after any other code in that method.

See also:
junit.framework.TestCase#tearDown()

Reimplemented in alma::acs::component::client::ClientWithLogReceiverTest, and alma::acs::component::client::ComponentClientTestCaseTest.


Member Data Documentation

AcsCorba alma::acs::component::client::ComponentClientTestCase::acsCorba [protected]
 

LogReceiver alma::acs::component::client::ComponentClientTestCase::logReceiver [private]
 

Reimplemented in alma::acs::component::client::ClientWithLogReceiverTest.

AcsManagerProxy alma::acs::component::client::ComponentClientTestCase::m_acsManagerProxy [protected]
 

Special tests that need to call directly the manager API could use this proxy object. To be used sparingly, as we need to exercise (and extend if necessary) the regular classes such as ContainerServices.

ContainerServicesImpl alma::acs::component::client::ComponentClientTestCase::m_containerServices [private]
 

AcsLogger alma::acs::component::client::ComponentClientTestCase::m_logger [protected]
 

Client alma::acs::component::client::ComponentClientTestCase::m_managerClient [private]
 

String alma::acs::component::client::ComponentClientTestCase::m_managerLoc [protected]
 

from property ACS.manager, or defaults to localhost

String alma::acs::component::client::ComponentClientTestCase::m_namePrefix [private]
 

CleaningDaemonThreadFactory alma::acs::component::client::ComponentClientTestCase::m_threadFactory [private]
 

ManagerClient alma::acs::component::client::ComponentClientTestCase::managerClientImpl [private]
 


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:52:17 2009 for ACS Java API by doxygen 1.3.8