Bug #357
Enforce Declared Informer Semantics
Status: | Resolved | Start date: | 06/09/2011 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | S. Wrede | % Done: | 100% | |
Category: | Specification | |||
Target version: | 0.4 |
Description
Only data of the declared type should be sent
Data of the declared type and subtypes can be send- Runtime errors should be signaled in case of violation
Only the declared scope is allowed
The declared scope and subscopes are allowed- Runtime errors should be signaled in case of violation
- C++ ✓
- Python ✓
- Common Lisp ✓
- Java ✓
Associated revisions
ensure that Events can only be sent with the type and scope of the informer
refs #357
refs #357
- src/rsb/Informer.h: check event type and scope against informer's
declared type and scope in checkedPublish - test/rsb/UserLevelTest.cpp: added test cases testCheckScope and
testCheckType
ensure that sent events have the correct scope and type
refs #357
fixes #357
- src/conditions.lisp (invalid-event): new condition; superclass for
conditions related to invalid events
(invalid-event-type): changed superclass rsb-error -> invalid-event
(invalid-event-scope): new condition; signaled when an event scope
is invalid in a given context - src/informer.lisp (informer::type): removed writer method
(send :before informer event): check event type and scope properly - src/package.lisp (package rsb): added exported symbols
invalid-event, invalid-event-event, invalid-event-type,
invalid-event-scope and invalid-event-expected-scope - test/informer.lisp (test informer-root::check-type): new test case;
check errors signals for invalid event types
(test informer-root::check-scope): new test case; check errors
signaled for invalid event scopes
refs #357
- rsb/__init__.py: use Event constructor in Informer.publishData;
changed checks in Informer.publishEvent to allow subscopes of the
informer's scope and subtypes of the informer's type - test/coretest.py: changed testSendEvent WrongScope and
testSendEventWrongType accordingly
refs #357
- src/rsb/Factory.h: use TypeName from Informer.h to generate string
representation of Informer type - src/rsb/Informer.h: added tag class AnyType for indicating arbitrary
types; added class TypeName for generating string representations of
types mapping AnyType to the empty string; relaxed type and scope
checking Informer::publish methods to allow subscopes of the
Informer scopes and arbitrary payload types when requested - test/rsb/integrationtest.cpp: added tests for arbitrary type in
testTypeCheck test case; added tests for subscopes in test case
testScope check
refs #357
- src/informer.lisp (send :before informer event): allow sub-scopes of
the informer's scope - src/conditions.lisp (invalid-event-scope): adapted report to changed
rules - test/informer.lisp (test informer-root::check-type): test subtypes
of the informer's type
(test informer-root::check-scope): test sub-scopes of the informer's
scope
History
#1 Updated by J. Wienke almost 13 years ago
- % Done changed from 0 to 50
#2 Updated by J. Wienke almost 13 years ago
- % Done changed from 50 to 80
#3 Updated by J. Moringen almost 13 years ago
- Status changed from New to Resolved
- % Done changed from 80 to 100
Applied in changeset r1479.
#4 Updated by S. Wrede over 12 years ago
- Category set to Specification
- Status changed from Resolved to Feedback
- Target version changed from 0.3 to 0.4
According to initial feedback (e.g. from Thies and Hendrik), this design decision needs some more consideration. As we anyways aggregate information at higher scopes with different types, it may make less sense to impose this special restriction.
Could we just have both? A typed and an un-typed informer that allows to send events of different types?
For scopes, I still think that a restriction on the configured one is useful.
#5 Updated by S. Wrede over 12 years ago
- % Done changed from 100 to 70
Testcases needed for each language.
#6 Updated by J. Moringen over 12 years ago
- Description updated (diff)
- Status changed from Feedback to In Progress
#7 Updated by J. Moringen over 12 years ago
- Description updated (diff)
- Assignee set to S. Wrede
#8 Updated by S. Wrede over 12 years ago
- Description updated (diff)
- % Done changed from 70 to 100
Added a test case. While polymorphic informers and sending to sub-scopes are possible, the Java implementation currently does not check for sending events only to sub-scopes.
#9 Updated by S. Wrede over 12 years ago
- Status changed from In Progress to Closed
#10 Updated by S. Wrede over 12 years ago
- Status changed from Closed to In Progress
- % Done changed from 100 to 90
#11 Updated by S. Wrede over 12 years ago
- Description updated (diff)
- Status changed from In Progress to Resolved
- % Done changed from 90 to 100
Done in r2336.