001    package org.cocome.tradingsystem.systests.interfaces;
002    
003    /**
004     * Interface of the store PC. This is the view the environment (and thus the
005     * system tests) has on the system. It is mostly used for actions on the
006     * inventory (for most implementation these will map to database calls).
007     * 
008     * @author Benjamin Hummel
009     * @author $Author: hummel $
010     * @version $Rev: 47 $
011     * @levd.rating GREEN Rev: 47
012     */
013    public interface IStorePC {
014    
015            /**
016             * Insert a new item into the stock of this store. The primary use of this
017             * is the initial creation of test data. Additional fields required by the
018             * database should be provided by the test driver.
019             * 
020             * @param product
021             *            the product added to the store.
022             * @param salesPrice
023             *            the price at which the product is sold in the store in Cent.
024             * @param amount
025             *            the amount available in the store.
026             * @param minAmount
027             *            the minimal amount which should be available.
028             */
029            void insertStockItem(IProduct product, int salesPrice, int amount,
030                            int minAmount) throws Exception;
031    
032            /**
033             * Get the current amount of a product in this store.
034             * 
035             * @param product
036             *            the product whose amount we are interested in.
037             * @return the amount of the given product available in this store.
038             */
039            int getAmount(IProduct product) throws Exception;
040    
041            /**
042             * Creates a new, empty order, which can be filled with order items and
043             * executed in the ordering process.
044             */
045            IOrder createOrder() throws Exception;
046    
047            /**
048             * Execute an order, i.e., we are done with adding products to that order so
049             * it can be sent out.
050             * 
051             * @param order
052             *            the order being executed.
053             */
054            void executeOrder(IOrder order) throws Exception;
055    
056            /**
057             * Indicates that all products of this order have been received, so they
058             * should be added to the current stock.
059             * 
060             * @param order
061             *            the order being delivered.
062             */
063            void rollInOrder(IOrder order) throws Exception;
064    }