The Meta-Environment API

nl.cwi.sen1.visbase.rstorecontainer
Class RStoreContainerTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by nl.cwi.sen1.visbase.rstorecontainer.RStoreContainerTest
All Implemented Interfaces:
junit.framework.Test

public class RStoreContainerTest
extends junit.framework.TestCase

JUnit Testcase used to test RStoreContainer. Some tests depend on the file.

Author:
Ricardo Lindooren, Arend van Beelen (reviewer)

Field Summary
private  RStoreContainer m_container
           
private static org.apache.commons.logging.Log m_log
           
private static java.lang.String NAME_OF_TESTFILE
           
private static java.lang.String NAME_OF_UPDATED_TESTFILE
           
 
Constructor Summary
RStoreContainerTest()
           
 
Method Summary
private  java.io.File getTestFile()
          Returns a File reference to a test file.
private  java.io.File getUpdatedTestFile()
          Returns a File reference to a test file that is a updated version of the default test file.
protected  void setUp()
           
protected  void tearDown()
           
 void testGetLoadedRStoresMap()
          Very simple test to make sure that the Map containing the loaded RStores is never null.
 void testGetName()
          Simple getter test
 void testGetPureFactory()
          Very simple test to make sure that the Factory is never null
 void testInputStreamFromFile()
          Opens the reference to the Test File (DTF).
 void testMainWithoutToolbusConnection()
          Tests the static main method that is called by the ToolBus Java connector.
 void testParseRstore()
          Parses the RStore data from the test file and checks the expected values.
 void testRcGetFactDataWithoutToolbusConnection()
          Tests the rcGetFactData method without having an actual connection with the Toolbus.
 void testRcGetRstoreFactsWithoutToolbusConnection()
          Tests the rcGetRstoreFacts method without having an actual connection with the Toolbus.
 void testRcLoadRstoreWithoutToolbusConnection()
          Tests the rcLoadRstore method without having an actual connection with the Toolbus.
 void testRcUnLoadRstoreWithoutToolbusConnection()
          Tests the rcUnloadRstore method without having an actual connection with the Toolbus.
 void testRecTerminateWithoutToolbusConnection()
          Only calls the recTerminate method
 void testRegisterRStore()
          Creates a RStore and tries to register it.
 void testSendFactUpdatedEvents()
          Only tests null input exceptions
 void testToolbusConstructorWithoutToolbusConnection()
          Tests the constructor that is used to make a connection with the ToolBus.
 
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

m_container

private RStoreContainer m_container

m_log

private static final org.apache.commons.logging.Log m_log

NAME_OF_TESTFILE

private static final java.lang.String NAME_OF_TESTFILE
See Also:
Constant Field Values

NAME_OF_UPDATED_TESTFILE

private static final java.lang.String NAME_OF_UPDATED_TESTFILE
See Also:
Constant Field Values
Constructor Detail

RStoreContainerTest

public RStoreContainerTest()
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception

tearDown

protected void tearDown()
                 throws java.lang.Exception
Overrides:
tearDown in class junit.framework.TestCase
Throws:
java.lang.Exception

testInputStreamFromFile

public void testInputStreamFromFile()
                             throws java.lang.Exception
Opens the reference to the Test File (DTF). Creates an InputStream (IS) based on the DTF. Reads bytes from the IS and prints these to System.out till there are no more bytes left.

Throws:
java.lang.Exception

testParseRstore

public void testParseRstore()
                     throws java.lang.Exception
Parses the RStore data from the test file and checks the expected values.

Throws:
java.lang.Exception

testRegisterRStore

public void testRegisterRStore()
                        throws java.lang.Exception
Creates a RStore and tries to register it.

Throws:
java.lang.Exception

testGetLoadedRStoresMap

public void testGetLoadedRStoresMap()
Very simple test to make sure that the Map containing the loaded RStores is never null.


testRcLoadRstoreWithoutToolbusConnection

public void testRcLoadRstoreWithoutToolbusConnection()
Tests the rcLoadRstore method without having an actual connection with the Toolbus. Input and output is processed in this test.


testRcGetRstoreFactsWithoutToolbusConnection

public void testRcGetRstoreFactsWithoutToolbusConnection()
Tests the rcGetRstoreFacts method without having an actual connection with the Toolbus. Input and output is processed in this test.


testRcGetFactDataWithoutToolbusConnection

public void testRcGetFactDataWithoutToolbusConnection()
Tests the rcGetFactData method without having an actual connection with the Toolbus. Input and output is processed in this test.


testRcUnLoadRstoreWithoutToolbusConnection

public void testRcUnLoadRstoreWithoutToolbusConnection()
Tests the rcUnloadRstore method without having an actual connection with the Toolbus. Input and output is processed in this test.


testToolbusConstructorWithoutToolbusConnection

public void testToolbusConstructorWithoutToolbusConnection()
Tests the constructor that is used to make a connection with the ToolBus. Because there is no Toolbus process available this test is used to test the try-catch blocks surrounding the connection initialization code.


testMainWithoutToolbusConnection

public void testMainWithoutToolbusConnection()
Tests the static main method that is called by the ToolBus Java connector. Because there is no Toolbus process it will not really connect with the Toolbus.


testRecTerminateWithoutToolbusConnection

public void testRecTerminateWithoutToolbusConnection()
Only calls the recTerminate method


testGetPureFactory

public void testGetPureFactory()
Very simple test to make sure that the Factory is never null


getTestFile

private java.io.File getTestFile()
Returns a File reference to a test file. The test file is stored in the same package as this file.

Returns:
the test file

getUpdatedTestFile

private java.io.File getUpdatedTestFile()
Returns a File reference to a test file that is a updated version of the default test file. The updated test file is stored in the same package as this file.

Returns:
the updated test file
See Also:
getTestFile()

testGetName

public void testGetName()
Simple getter test


testSendFactUpdatedEvents

public void testSendFactUpdatedEvents()
Only tests null input exceptions


The Meta-Environment API