CoCoME TestDriver for Reference Implementation

org.cocome.tradingsystem.testdriver
Class CashBox

java.lang.Object
  extended by org.cocome.tradingsystem.testdriver.UpdateReceiver
      extended by org.cocome.tradingsystem.testdriver.CashBox
All Implemented Interfaces:
javax.jms.MessageListener, org.cocome.tradingsystem.systests.interfaces.ICashBox, org.cocome.tradingsystem.systests.interfaces.IUpdateReceiver

public class CashBox
extends UpdateReceiver
implements org.cocome.tradingsystem.systests.interfaces.ICashBox

Glue code for the cash box.

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

Field Summary
private  javax.jms.TopicPublisher publisher
          Publisher for sending events.
private  javax.jms.TopicSession session
          Session used for creating object messages.
 
Constructor Summary
CashBox(javax.jms.TopicPublisher publisher, javax.jms.TopicSession session, javax.jms.TopicSubscriber subscriber)
          Constructor.
 
Method Summary
private  org.cocome.tradingsystem.cashdeskline.datatypes.KeyStroke charToStroke(char c)
          Convert characters to keystrokes.
 void enterReceivedCash(int centAmount)
          
 void finishSale()
          
 void manuallyEnableCreditCardReader()
          
private  void publish(java.io.Serializable message)
          Publish a serializable message.
 void setCashboxStatus(boolean closed)
          
 void startCashPayment()
          
 void startCreditCardPayment()
          
 void startNewSale()
          
 boolean wasOpenSignalSent()
          
 
Methods inherited from class org.cocome.tradingsystem.testdriver.UpdateReceiver
expectMessage, getLastRelevantMessage, onMessage, waitForUpdate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.cocome.tradingsystem.systests.interfaces.IUpdateReceiver
waitForUpdate
 

Field Detail

publisher

private final javax.jms.TopicPublisher publisher
Publisher for sending events.


session

private final javax.jms.TopicSession session
Session used for creating object messages.

Constructor Detail

CashBox

public CashBox(javax.jms.TopicPublisher publisher,
               javax.jms.TopicSession session,
               javax.jms.TopicSubscriber subscriber)
        throws javax.jms.JMSException
Constructor.

Throws:
javax.jms.JMSException
Method Detail

publish

private void publish(java.io.Serializable message)
              throws javax.jms.JMSException
Publish a serializable message.

Throws:
javax.jms.JMSException

enterReceivedCash

public void enterReceivedCash(int centAmount)
                       throws javax.jms.JMSException

Specified by:
enterReceivedCash in interface org.cocome.tradingsystem.systests.interfaces.ICashBox
Throws:
javax.jms.JMSException

charToStroke

private org.cocome.tradingsystem.cashdeskline.datatypes.KeyStroke charToStroke(char c)
Convert characters to keystrokes.


finishSale

public void finishSale()
                throws javax.jms.JMSException

Specified by:
finishSale in interface org.cocome.tradingsystem.systests.interfaces.ICashBox
Throws:
javax.jms.JMSException

setCashboxStatus

public void setCashboxStatus(boolean closed)
                      throws javax.jms.JMSException

Specified by:
setCashboxStatus in interface org.cocome.tradingsystem.systests.interfaces.ICashBox
Throws:
javax.jms.JMSException

startCashPayment

public void startCashPayment()
                      throws javax.jms.JMSException

Specified by:
startCashPayment in interface org.cocome.tradingsystem.systests.interfaces.ICashBox
Throws:
javax.jms.JMSException

startCreditCardPayment

public void startCreditCardPayment()
                            throws javax.jms.JMSException

Specified by:
startCreditCardPayment in interface org.cocome.tradingsystem.systests.interfaces.ICashBox
Throws:
javax.jms.JMSException

startNewSale

public void startNewSale()
                  throws javax.jms.JMSException

Specified by:
startNewSale in interface org.cocome.tradingsystem.systests.interfaces.ICashBox
Throws:
javax.jms.JMSException

wasOpenSignalSent

public boolean wasOpenSignalSent()

Specified by:
wasOpenSignalSent in interface org.cocome.tradingsystem.systests.interfaces.ICashBox

manuallyEnableCreditCardReader

public void manuallyEnableCreditCardReader()
                                    throws javax.jms.JMSException

Specified by:
manuallyEnableCreditCardReader in interface org.cocome.tradingsystem.systests.interfaces.ICashBox
Throws:
javax.jms.JMSException

CoCoME TestDriver for Reference Implementation

CoCoME TestDriver for Reference Implementation - 0.1