CoCoME System Tests

org.cocome.tradingsystem.systests.interfaces
Interface IStorePC


public interface IStorePC

Interface of the store PC. This is the view the environment (and thus the system tests) has on the system. It is mostly used for actions on the inventory (for most implementation these will map to database calls).

Version:
$Rev: 47 $
Author:
Benjamin Hummel, $Author: hummel $

Method Summary
 IOrder createOrder()
          Creates a new, empty order, which can be filled with order items and executed in the ordering process.
 void executeOrder(IOrder order)
          Execute an order, i.e., we are done with adding products to that order so it can be sent out.
 int getAmount(IProduct product)
          Get the current amount of a product in this store.
 void insertStockItem(IProduct product, int salesPrice, int amount, int minAmount)
          Insert a new item into the stock of this store.
 void rollInOrder(IOrder order)
          Indicates that all products of this order have been received, so they should be added to the current stock.
 

Method Detail

insertStockItem

void insertStockItem(IProduct product,
                     int salesPrice,
                     int amount,
                     int minAmount)
                     throws java.lang.Exception
Insert a new item into the stock of this store. The primary use of this is the initial creation of test data. Additional fields required by the database should be provided by the test driver.

Parameters:
product - the product added to the store.
salesPrice - the price at which the product is sold in the store in Cent.
amount - the amount available in the store.
minAmount - the minimal amount which should be available.
Throws:
java.lang.Exception

getAmount

int getAmount(IProduct product)
              throws java.lang.Exception
Get the current amount of a product in this store.

Parameters:
product - the product whose amount we are interested in.
Returns:
the amount of the given product available in this store.
Throws:
java.lang.Exception

createOrder

IOrder createOrder()
                   throws java.lang.Exception
Creates a new, empty order, which can be filled with order items and executed in the ordering process.

Throws:
java.lang.Exception

executeOrder

void executeOrder(IOrder order)
                  throws java.lang.Exception
Execute an order, i.e., we are done with adding products to that order so it can be sent out.

Parameters:
order - the order being executed.
Throws:
java.lang.Exception

rollInOrder

void rollInOrder(IOrder order)
                 throws java.lang.Exception
Indicates that all products of this order have been received, so they should be added to the current stock.

Parameters:
order - the order being delivered.
Throws:
java.lang.Exception

CoCoME System Tests

CoCoME System Tests - 0.1