Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 202735

Summary: [DataBinding] Add tests for IObservable.dispose() to conformance tests
Product: [Eclipse Project] Platform Reporter: Brad Reynolds <bradleyjames>
Component: UIAssignee: Brad Reynolds <bradleyjames>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: bokowski
Version: 3.4   
Target Milestone: 3.4 M3   
Hardware: All   
OS: All   
Whiteboard:

Description Brad Reynolds CLA 2007-09-08 23:54:05 EDT
We should be able to write conformance tests that assert that listeners are removed on dispose().
Comment 1 Brad Reynolds CLA 2007-10-06 14:21:50 EDT
FIXED > 20071006

Added a new test to ObservableContractTest.  It's going to be hard for this to be 100% correct.  I have to dispose the observable and then invoke delegate.change(observable).  The problem is that if the delegate isn't implemented to change the observed object, the observable might throw an exception.  I've updated the javadoc for IObservableContractDelegate.change(IObservable) stating that if possible the change needs to occur on the observed object.  The test wraps the call in a try catch to avoid receiving exceptions for delegates that can't invoke a change on the observed object.
Comment 2 Brad Reynolds CLA 2007-10-07 00:51:16 EDT
There's a better way to handle this...
Comment 3 Brad Reynolds CLA 2007-10-07 00:56:04 EDT
(In reply to comment #1)
> Added a new test to ObservableContractTest.  It's going to be hard for this to
> be 100% correct.  I have to dispose the observable and then invoke
> delegate.change(observable).  The problem is that if the delegate isn't
> implemented to change the observed object, the observable might throw an
> exception.  I've updated the javadoc for
> IObservableContractDelegate.change(IObservable) stating that if possible the
> change needs to occur on the observed object.  The test wraps the call in a try
> catch to avoid receiving exceptions for delegates that can't invoke a change on
> the observed object.
> 

FIXED > 20071006

There's no need to catch an exception.  The test now just creates a new observable and invokes a change on it.  The disposed observable should not receive an event when this occurs.

Comment 4 Brad Reynolds CLA 2007-10-31 22:24:09 EDT
VERIFIED in I20071031-1800.