CoCoME System Tests

org.cocome.tradingsystem.systests.scenarios
Class TestScenarioBase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.cocome.tradingsystem.systests.scenarios.TestScenarioBase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
OrderAndReceiveProductsTest, ProcessSaleBase

public abstract class TestScenarioBase
extends junit.framework.TestCase

This is the base class for all test scenarios. It prepares the system for testing and provides helper methods to simplify test setup and testing.

Version:
$Rev: 64 $
Author:
Benjamin Hummel, Christian Pfaller, $Author: hummel $

Nested Class Summary
protected  class TestScenarioBase.StoreWrapper
          Class holding a store and some management information.
 
Field Summary
protected  IBank bank
          The bank
protected  IEnterprise enterprise
          The (globally unique) enterprise used.
protected  ProductGenerator productGenerator
          Generator used for adding new products.
protected  java.util.Random seedRng
          Random number generator used to generate seeds for other RNGs.
protected  java.util.List<TestScenarioBase.StoreWrapper> stores
          The list of stores.
protected  ITestDriver testDriver
          The test driver used for this test.
 
Constructor Summary
TestScenarioBase()
           
 
Method Summary
protected  void copySetup(TestScenarioBase otherBase)
          Copy the setup information from another scenario.
protected  TestScenarioBase.StoreWrapper createStore(int numCashLines)
          Creates a new store with the given number of cash lines and a generated stock.
protected  void setUp()
          
protected  void tearDown()
          
 
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, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

seedRng

protected final java.util.Random seedRng
Random number generator used to generate seeds for other RNGs.


testDriver

protected ITestDriver testDriver
The test driver used for this test.


enterprise

protected IEnterprise enterprise
The (globally unique) enterprise used.


productGenerator

protected ProductGenerator productGenerator
Generator used for adding new products.


stores

protected java.util.List<TestScenarioBase.StoreWrapper> stores
The list of stores.


bank

protected IBank bank
The bank

Constructor Detail

TestScenarioBase

public TestScenarioBase()
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception

Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception

copySetup

protected void copySetup(TestScenarioBase otherBase)
Copy the setup information from another scenario. This is used to initialize this class without actually creating new objects which is useful for concurrent testing where this is only the base for some tests.


createStore

protected TestScenarioBase.StoreWrapper createStore(int numCashLines)
                                             throws java.lang.Exception
Creates a new store with the given number of cash lines and a generated stock.

Throws:
java.lang.Exception

tearDown

protected void tearDown()
                 throws java.lang.Exception

Overrides:
tearDown in class junit.framework.TestCase
Throws:
java.lang.Exception

CoCoME System Tests

CoCoME System Tests - 0.1