001 package org.cocome.tradingsystem.systests.interfaces;
002
003 /**
004 * This is the central interface for the glue code as it is the entry point for
005 * all tests. The test driver isolates the system tests from the actual
006 * implementation. This way the tests themselves can be kept simple and for
007 * testing a different implementation only the test driver needs to be adjusted.
008 * <p>
009 * The test driver is both used to initialize the entire system as well as a
010 * factory for stores and cash desks.
011 *
012 * @author Benjamin Hummel
013 * @author Christian Pfaller
014 * @author $Author: hummel $
015 * @version $Rev: 47 $
016 * @levd.rating GREEN Rev: 47
017 */
018 public interface ITestDriver {
019
020 /**
021 * This is the first method called before any other method of the test
022 * driver is called. Here the system is started.
023 *
024 * @return an enterprise object.
025 */
026 IEnterprise initializeSystem() throws Exception;
027
028 /**
029 * Releases all ressources and stops the system. No methods on this driver
030 * or any other of the objects created will be called afterwards. You are
031 * guaranteed that this will be called after testing is completed.
032 */
033 void shutdownSystem();
034
035 /** Returns a newly created store. */
036 IStorePC createStore() throws Exception;
037
038 /**
039 * Returns a newly created cash desk system. If required the test driver has
040 * to create the interfaces for the connected hardware as well.
041 *
042 * @param store
043 * the store this cash desk is connected to.
044 */
045 ICashDesk createCashDesk(IStorePC store) throws Exception;
046
047 /** Returns the globally unique bank used for all credit card transactions. */
048 IBank getBank() throws Exception;
049 }