|
CoCoME System Tests | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.cocome.tradingsystem.systests.scenarios.TestScenarioBase
org.cocome.tradingsystem.systests.scenarios.ProcessSaleBase
public class ProcessSaleBase
This abstract class holds basic operations needed for a purchase and its variants as described in use case 1.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.cocome.tradingsystem.systests.scenarios.TestScenarioBase |
---|
TestScenarioBase.StoreWrapper |
Field Summary | |
---|---|
protected ICashBox |
cashBox
The cash box used for this sale |
protected ICashDesk |
cashDesk
The cash desk used for this sale |
protected int |
currentlySold
The number of items currently sold. |
protected int[] |
expectedAmounts
Array which holds the expected remaining amount of a product in the store |
private static int |
NUM_SOLD_ITEMS
The number of items sold for this test case. |
protected int |
priceSum
Holds the sum to pay |
protected IProduct[] |
products
The list of products which where bought |
protected IStorePC |
store
The store used for this sale |
Fields inherited from class org.cocome.tradingsystem.systests.scenarios.TestScenarioBase |
---|
bank, enterprise, productGenerator, seedRng, stores, testDriver |
Constructor Summary | |
---|---|
ProcessSaleBase()
|
Method Summary | |
---|---|
protected void |
enterAllRemainingProducts()
Executes actions for entering products in the cashbox. |
protected void |
enterProducts(int howMany)
Executes actions for entering products in the cashbox. |
protected void |
finishSale()
Executes actions for finishing sale (after entering all products in cashbox, before payment). |
protected void |
handleCashPayment()
Executs actions of handling cash payment. |
protected void |
initializeCashDesk(int storeIndex,
int cashDeskIndex)
Executes actions for initializing cash desk when a customer arrives there. |
void |
purchase()
Executes a standard purchase process at a cash desk with no exceptions. |
protected void |
setUp()
Setup only a single store with two cash desks. |
protected void |
startNewSale()
Executes actions for starting a new sale with a default number of items. |
protected void |
startNewSale(int how_many_items)
Executes actions for starting a new sale. |
protected void |
updateInventory()
Executes actions after reciept of payment. |
Methods inherited from class org.cocome.tradingsystem.systests.scenarios.TestScenarioBase |
---|
copySetup, createStore, 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 |
---|
private static final int NUM_SOLD_ITEMS
protected int currentlySold
protected IStorePC store
protected ICashDesk cashDesk
protected ICashBox cashBox
protected int[] expectedAmounts
protected IProduct[] products
protected int priceSum
Constructor Detail |
---|
public ProcessSaleBase()
Method Detail |
---|
protected void setUp() throws java.lang.Exception
setUp
in class TestScenarioBase
java.lang.Exception
public void purchase() throws java.lang.Exception
java.lang.Exception
protected void initializeCashDesk(int storeIndex, int cashDeskIndex) throws java.lang.Exception
storeIndex
- the index of the store used.cashDeskIndex
- the index of the cash desk in the store.
java.lang.Exception
protected void startNewSale() throws java.lang.Exception
java.lang.Exception
protected void startNewSale(int how_many_items) throws java.lang.Exception
how_many_items
- the number of items the sale should contain in total
java.lang.Exception
protected void enterAllRemainingProducts() throws java.lang.Exception, java.util.concurrent.TimeoutException
java.lang.Exception
java.util.concurrent.TimeoutException
protected void enterProducts(int howMany) throws java.lang.Exception, java.util.concurrent.TimeoutException
howMany
- the number of products to be sold next.
java.lang.Exception
java.util.concurrent.TimeoutException
protected void finishSale() throws java.lang.Exception
java.lang.Exception
protected void handleCashPayment() throws java.lang.Exception
java.lang.Exception
protected void updateInventory() throws java.lang.Exception
java.lang.Exception
|
CoCoME System Tests | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |