A stub implementation of caplin.services.messaging.MessageService for use in tests and workbenches.
This class uses emitr.
Attributes | Name and Description |
---|---|
|
caplin.services.testing.MessageServiceStub()
Constructs a |
Attributes | Name and Description |
---|---|
<static>
|
caplin.services.testing.MessageServiceStub.EVENTS
A map of events that this class may trigger. |
Attributes | Name and Description |
---|---|
|
void
addDataGenerator(caplin.workbench.model.DataGenerator generator)
Adds a data generator that will be used to generate field data for all records. |
|
void
addSubjectPrefixData(String prefix, Object data)
Sets initial data for all records that have a subject starting with the given prefix. |
|
void
clearDataSubscribers()
|
|
caplin.services.testing.RecordStub
getRecordStub(String subject)
Gets the caplin.services.testing.RecordStub for the given subject. |
|
Map
getRecordStubs()
Gets a map of all caplin.services.testing.RecordStubs. |
|
void
invokeSendDataToListenerOnDataSubscribers( subject, data)
|
|
void
publish( subject, updateData, listener, hints)
This stub does not handle contribs |
|
void
publishSessionMessage( subject, updateData, listener, hints)
This stub does not handle session messages |
|
void
reset()
Resets the stub, clearing all records, data generators and subject prefix mappings. |
|
caplin.services.testing.SubscriptionStub
subscribe( subject, listener)
|
|
void
updateSubjectData(String subject, Object data)
Updates field data for a record, which then notifies all of its subscriptions of the change. |
►
caplin.services.testing.MessageServiceStub()
Constructs a caplin.services.testing.MessageServiceStub
.
►
<static>
caplin.services.testing.MessageServiceStub.EVENTS
A map of events that this class may trigger.
Contains the following events:
caplin.services.testing.RecordStub | record | The newly created record. |
►
void
addDataGenerator(caplin.workbench.model.DataGenerator generator)
Adds a data generator that will be used to generate field data for all records. Each record's initial values will be used as seeds for the generated values.
caplin.workbench.model.DataGenerator | generator | The data generator. |
►
void
addSubjectPrefixData(String prefix, Object data)
Sets initial data for all records that have a subject starting with the given prefix. This does not affect already existing records.
String | prefix | The subject prefix of records that should be initialised with the data. |
Object | data | The initial data for matching records. |
►
void
clearDataSubscribers()
►
caplin.services.testing.RecordStub
getRecordStub(String subject)
Gets the caplin.services.testing.RecordStub for the given subject.
String | subject | The subject of the RecordStub to get. |
►
void
invokeSendDataToListenerOnDataSubscribers( subject, data)
subject | ||
data |
►
void
publish( subject, updateData, listener, hints)
This stub does not handle contribs
subject | ||
updateData | ||
listener | ||
hints |
►
void
publishSessionMessage( subject, updateData, listener, hints)
This stub does not handle session messages
subject | ||
updateData | ||
listener | ||
hints |
►
void
reset()
Resets the stub, clearing all records, data generators and subject prefix mappings.
►
caplin.services.testing.SubscriptionStub
subscribe( subject, listener)
subject | ||
listener |
►
void
updateSubjectData(String subject, Object data)
Updates field data for a record, which then notifies all of its subscriptions of the change.
String | subject | The subject of the record to be updated. |
Object | data | The new field data for the record. |