org.databene.benerator.test
Class ConsumerMock
java.lang.Object
org.databene.benerator.consumer.AbstractConsumer
org.databene.benerator.test.ConsumerMock
- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable, Consumer
public class ConsumerMock
- extends AbstractConsumer
Mock implementation of the Consumer
interface to be used for testing.
Created: 11.03.2010 12:51:40
- Since:
- 0.6.0
- Author:
- Volker Bergmann
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
START_CONSUMING
public static final java.lang.String START_CONSUMING
- See Also:
- Constant Field Values
FINISH_CONSUMING
public static final java.lang.String FINISH_CONSUMING
- See Also:
- Constant Field Values
FLUSH
public static final java.lang.String FLUSH
- See Also:
- Constant Field Values
CLOSE
public static final java.lang.String CLOSE
- See Also:
- Constant Field Values
instances
public static java.util.Map<java.lang.Integer,ConsumerMock> instances
products
public java.util.List<java.lang.Object> products
invocations
public java.util.List<java.lang.String> invocations
startConsumingCount
public volatile java.util.concurrent.atomic.AtomicInteger startConsumingCount
finishConsumingCount
public volatile java.util.concurrent.atomic.AtomicInteger finishConsumingCount
flushCount
public volatile java.util.concurrent.atomic.AtomicInteger flushCount
closeCount
public volatile java.util.concurrent.atomic.AtomicInteger closeCount
ConsumerMock
public ConsumerMock(boolean storeProducts)
ConsumerMock
public ConsumerMock(boolean storeProducts,
int id)
ConsumerMock
public ConsumerMock(boolean storeProducts,
int id,
int minDelay,
int maxDelay)
getProducts
public java.util.List<?> getProducts()
getThreadCount
public int getThreadCount()
startProductConsumption
public void startProductConsumption(java.lang.Object product)
- Specified by:
startProductConsumption
in class AbstractConsumer
finishProductConsumption
public void finishProductConsumption(java.lang.Object product)
- Overrides:
finishProductConsumption
in class AbstractConsumer
flush
public void flush()
- Description copied from interface:
Consumer
- Is called by Benerator for advising the Consumer to finish processing of the objects
consumed so far. In Benerator descriptor files, the flushing behavior is controlled
by the
pageSize
attribute.
- Specified by:
flush
in interface java.io.Flushable
- Specified by:
flush
in interface Consumer
- Overrides:
flush
in class AbstractConsumer
close
public void close()
- Description copied from interface:
Consumer
- When called, the implementor has to close and free all resources.
It will not receive any more calls.
- Specified by:
close
in interface java.io.Closeable
- Specified by:
close
in interface Consumer
- Overrides:
close
in class AbstractConsumer
toString
public java.lang.String toString()
- Overrides:
toString
in class AbstractConsumer
Copyright © 2013. All Rights Reserved.