ParameterNoticeBoard
Class JunitParameterNoticeBoard

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by ParameterNoticeBoard.JunitParameterNoticeBoard
All Implemented Interfaces:
iParameterNoticeBoard.ParameterNoticeBoardListenerOperations, junit.framework.Test

public class JunitParameterNoticeBoard
extends junit.framework.TestCase
implements iParameterNoticeBoard.ParameterNoticeBoardListenerOperations

This class is a Junit test frame which tests the functionality of the ParameterNoticeBoard. When run it will perform a sequence of tests which will verify the correct operation of the noticeboard. In order to run these tests, the user must use the command ant test from the source directory which contains the parameter noticeboard.

Unfortunately the only thing that I cannot test is the noticebard listener interface as that requires dropping into the orb event loop which seemingly breaks the test framework.

Version:
$Id: JunitParameterNoticeBoard.java,v 1.2 2006/03/17 13:56:01 cb Exp $

Author:
Craige Bevil

Field Summary
(package private)  OCSCORBAHelper OCSCorba
          This will be used to perform a lot of the donkey work associated with setting up a CORBA server.
 iParameterNoticeBoard.ParameterNoticeBoardSupplier parameterNoticeBoard
          A CORBA reference to the parameter noticeboard
 
Constructor Summary
JunitParameterNoticeBoard()
           
 
Method Summary
static void main(java.lang.String[] argv)
           main method which will run the tests of the parameter
 void parameterChanged(java.lang.String ParameterName, org.omg.CORBA.Any ParameterValue)
          Obligation of the parameter notice board listener super class that we extend
 void parameterMonitorTerminated(java.lang.String Reason, java.lang.String ParameterName)
          Obligation of the parameter notice board listener super class that we extend
protected  void setUp()
          This class will be called to set up the test unit ahead of the tests being executed.
static junit.framework.TestSuite suite()
          Establish the test suite in this class, it goes through the class extracting the test methods and then building a Junit test suite which will be used to perform the tests.
protected  void tearDown()
          This method is called when the tests are finished and we close down the ORB so that we can run the tests again.
 void testDeleteParameter()
          Now test that we can delete parameters from the noticeboard
 void testInstrumentControllerInterface()
          Tests the instrument controller interface to the parameter noticeboard.
 void testParameterReadWrite()
          Test that we can write something to the noticeboard and read back the same value that we put into the noticeboard
 void testPersistentParameterReadWrite()
          Test that we can write something to the noticeboard and read back the same value that we put into the noticeboard when using persistent writes
 void testRegisterEventListener()
          Test that we can register for an event on the noticeboard.
 void testRegisterParameter()
          Tests whether we can register parameters with the noticeboard
 void testRegisterParameterWithExpiry()
          Tests whether we can register parameters with the noticeboard using an expiry time
 void testRequestFullListing()
          Test that we can retrieve the full parameter list from the noticeboard
 void testSyncParameterReadWrite()
          Test that we can write something to the noticeboard and read back the same value that we put into the noticeboard
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parameterNoticeBoard

public iParameterNoticeBoard.ParameterNoticeBoardSupplier parameterNoticeBoard
A CORBA reference to the parameter noticeboard


OCSCorba

OCSCORBAHelper OCSCorba
This will be used to perform a lot of the donkey work associated with setting up a CORBA server.

Constructor Detail

JunitParameterNoticeBoard

public JunitParameterNoticeBoard()
Method Detail

tearDown

protected void tearDown()
This method is called when the tests are finished and we close down the ORB so that we can run the tests again.

Overrides:
tearDown in class junit.framework.TestCase

setUp

protected void setUp()
This class will be called to set up the test unit ahead of the tests being executed. This will set up all of the CORBA connetion to the parameter noticeboard.

Overrides:
setUp in class junit.framework.TestCase

parameterMonitorTerminated

public void parameterMonitorTerminated(java.lang.String Reason,
                                       java.lang.String ParameterName)
Obligation of the parameter notice board listener super class that we extend

Specified by:
parameterMonitorTerminated in interface iParameterNoticeBoard.ParameterNoticeBoardListenerOperations

parameterChanged

public void parameterChanged(java.lang.String ParameterName,
                             org.omg.CORBA.Any ParameterValue)
Obligation of the parameter notice board listener super class that we extend

Specified by:
parameterChanged in interface iParameterNoticeBoard.ParameterNoticeBoardListenerOperations

testInstrumentControllerInterface

public void testInstrumentControllerInterface()
Tests the instrument controller interface to the parameter noticeboard.


testRegisterParameter

public void testRegisterParameter()
Tests whether we can register parameters with the noticeboard


testRegisterParameterWithExpiry

public void testRegisterParameterWithExpiry()
Tests whether we can register parameters with the noticeboard using an expiry time


testDeleteParameter

public void testDeleteParameter()
Now test that we can delete parameters from the noticeboard


testParameterReadWrite

public void testParameterReadWrite()
Test that we can write something to the noticeboard and read back the same value that we put into the noticeboard


testSyncParameterReadWrite

public void testSyncParameterReadWrite()
Test that we can write something to the noticeboard and read back the same value that we put into the noticeboard


testRequestFullListing

public void testRequestFullListing()
Test that we can retrieve the full parameter list from the noticeboard


testRegisterEventListener

public void testRegisterEventListener()
Test that we can register for an event on the noticeboard. Note that we cannot actually test that we get callbacks because we cannot seemingly drop into the ORB event loop whilst within the test framework.


testPersistentParameterReadWrite

public void testPersistentParameterReadWrite()
Test that we can write something to the noticeboard and read back the same value that we put into the noticeboard when using persistent writes


suite

public static junit.framework.TestSuite suite()
Establish the test suite in this class, it goes through the class extracting the test methods and then building a Junit test suite which will be used to perform the tests. This class will be called automatically by Junit

Returns:
TestSuite The list of test methods in this class

main

public static void main(java.lang.String[] argv)
main method which will run the tests of the parameter

Parameters:
argv - Command line arguments. The method starts up the Junit test GUI which will be used to test the software package.