Bug 182059 - [DataBinding] Expose conformance tests
Summary: [DataBinding] Expose conformance tests
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: 3.4 M3   Edit
Assignee: Brad Reynolds CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 202657 204918
Blocks:
  Show dependency tree
 
Reported: 2007-04-11 22:50 EDT by Brad Reynolds CLA
Modified: 2007-10-31 22:16 EDT (History)
5 users (show)

See Also:


Attachments
observable and observable value conformance tests (41.70 KB, patch)
2007-07-15 01:17 EDT, Brad Reynolds CLA
no flags Details | Diff
Patch for new project (293.92 KB, patch)
2007-09-15 20:35 EDT, Brad Reynolds CLA
no flags Details | Diff
patch to tests.databinding (173.00 KB, patch)
2007-09-25 20:48 EDT, Brad Reynolds CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brad Reynolds CLA 2007-04-11 22:50:04 EDT
We have quite a few tests and some of them could be abstracted into a suite of tests to be ran by consumers on their own observable implementations.  By exposing such a suite it would allow consumers to be certain of proper behavior while lessening the testing burden.
Comment 1 Boris Bokowski CLA 2007-04-12 09:40:43 EDT
great idea!
Comment 2 Dave Orme CLA 2007-04-12 09:43:10 EDT
++1++

:-)
Comment 3 Brad Reynolds CLA 2007-07-09 23:47:56 EDT
I'm going to start prototyping this out in my spare time.
Comment 4 Brad Reynolds CLA 2007-07-15 01:17:04 EDT
Created attachment 73801 [details]
observable and observable value conformance tests

I wanted to get your guys' feedback before I get deep into this.  I've attached a patch, against HEAD, that contains conformance tests for observables and observable values.  I've modified a few test cases to use these tests.  When ran you'll see failures in ButtonObservableValueTestCase because there are bugs[1][2] in its implementation.

The guidelines are:
* The tests should be JUnit3 based.
* The tests can only assert the conformance to the defined contract.
* The tests should follow existing JUnit conventions to allow for integration into existing tests.
* Each test should assert one outcome.
* Assert message should be detailed defining the requirement being asserted.

I'm using the parameterized test pattern that is found in JUnit Recipes[3] in order to make this happen.  Each TestCase will need to create a setup() method that adds the appropriate conformance tests to a suite along with creating a delegate of the correct type.  That's all that it takes.  I'll try to find some time to make sure that this direction will work with JUnit4 as well.

Any and all feedback is welcome.

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=195603
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=196557
[3] http://www.manning.com/rainsberger/
Comment 5 Brad Reynolds CLA 2007-07-16 22:00:21 EDT
I created a branch of the test project for this.

Bug182059_investigation
Comment 6 Brad Reynolds CLA 2007-07-16 22:01:56 EDT
(In reply to comment #4)
> I'm using the parameterized test pattern that is found in JUnit Recipes[3] in
> order to make this happen.  Each TestCase will need to create a setup() method
> that adds the appropriate conformance tests to a suite along with creating a
> delegate of the correct type.  

That should be "a suite() method" and not "a setup() method".
Comment 7 Brad Reynolds CLA 2007-07-22 11:25:57 EDT
Boris, I'd like to move these into a new project.  I have implemented tests for IObservable, IObservableValue, IObservableCollection, and IObservableList.  I have integrated these into some our tests but not all (we have well over 1,000 tests running now in the branch).  Over time I'll be tweaking existing tests and writing others but I'd like to make these available to early adopters.  During the course of 3.4 we'll be able to tweak these based upon feedback received. I was thinking of moving these into a org.eclipse.jface.databinding.tck project.  I'm also working on documentation on the wiki.  Let me know what you think on a new project.
Comment 8 Brad Reynolds CLA 2007-07-22 12:16:15 EDT
The wiki page has been created.

http://wiki.eclipse.org/JFace_Data_Binding/TCK
Comment 9 Boris Bokowski CLA 2007-07-23 06:28:25 EDT
This is great, and should be very useful for extenders.

McQ/Jeff, we would like to create a new test plug-in containing conformance tests for use in third-party tests, as well as our own data binding tests. An informal +1 from you would be good before I'll file a bugzilla to this effect against Community/CVS.

As for the name, it seems that similar things are being called "test harness" elsewhere in Eclipse. Should the name of the new plug-in be:

org.eclipse.core.tests.databinding.harness

or is TCK more appropriate, e.g:

org.eclipse.core.tests.databinding.tck
Comment 10 Brad Reynolds CLA 2007-07-23 13:53:51 EDT
(In reply to comment #9)
> As for the name, it seems that similar things are being called "test harness"
> elsewhere in Eclipse. Should the name of the new plug-in be:
> 
> org.eclipse.core.tests.databinding.harness
> 
> or is TCK more appropriate, e.g:
> 
> org.eclipse.core.tests.databinding.tck
> 

I didn't use test harness because that has other implications.  Maybe eventually we will provide test harness like capabilities.  The current goal is to test the conformity of implementations thus TCK was used.  But I don't have strong feelings either way and my guess is over time we'll be adding more test harness like capabilities.

Also the reason I didn't put "core" in my recommendation is that we'd eventually add JFace dependencies along with others into the project.
Comment 11 Brad Reynolds CLA 2007-07-24 11:44:38 EDT
(In reply to comment #9)
> McQ/Jeff, we would like to create a new test plug-in containing conformance
> tests for use in third-party tests, as well as our own data binding tests. An
> informal +1 from you would be good before I'll file a bugzilla to this effect
> against Community/CVS.

Boris, did you send this to a mailing list or did you mean to add them to the bug?
Comment 12 Boris Bokowski CLA 2007-07-24 12:25:25 EDT
(In reply to comment #10)
> Also the reason I didn't put "core" in my recommendation is that we'd
> eventually add JFace dependencies along with others into the project.

Shouldn't we try to keep the conformance tests clean, so that others using it don't have to depend on JFace if all they do is (for example) implement observables for EMF?
Comment 13 Boris Bokowski CLA 2007-07-24 12:34:39 EDT
oops - forgot to add to the cc list.

(In reply to comment #9)
> McQ/Jeff, we would like to create a new test plug-in containing conformance
> tests for use in third-party tests, as well as our own data binding tests. An
> informal +1 from you would be good before I'll file a bugzilla to this effect
> against Community/CVS.
Comment 14 Brad Reynolds CLA 2007-07-24 13:51:11 EDT
(In reply to comment #12)
> (In reply to comment #10)
> > Also the reason I didn't put "core" in my recommendation is that we'd
> > eventually add JFace dependencies along with others into the project.
> 
> Shouldn't we try to keep the conformance tests clean, so that others using it
> don't have to depend on JFace if all they do is (for example) implement
> observables for EMF?

My hope was to get something out there for early adopters.  Since we have all of 3.4, and I feel that it's pretty wide open as to what we might want to provide, creating one project and seeing what happens was my approach.  I didn't want to have to create another project later with just 2 files that created a test harness for our jface support.

Comment 15 Brad Reynolds CLA 2007-07-24 19:31:04 EDT
Comment on attachment 73801 [details]
observable and observable value conformance tests

See HEAD for the latest.
Comment 16 Brad Reynolds CLA 2007-07-26 17:53:54 EDT
(In reply to comment #13)
> oops - forgot to add to the cc list.
> 
> (In reply to comment #9)
> > McQ/Jeff, we would like to create a new test plug-in containing conformance
> > tests for use in third-party tests, as well as our own data binding tests. An
> > informal +1 from you would be good before I'll file a bugzilla to this effect
> > against Community/CVS.
> 

Has anything happened in regards to getting a project created?
Comment 17 Mike Wilson CLA 2007-07-31 09:11:40 EDT
Sorry, no. Boris is back in Canada next week, and we'll get it done then.
Comment 18 Brad Reynolds CLA 2007-08-14 12:36:44 EDT
ping
Comment 19 Brad Reynolds CLA 2007-09-03 00:06:22 EDT
I checked in tests for IObservableSets, added realm checking to the collection tests, and added a formatFail(...) method to build failure strings.  When a test fails it now includes the TestCase class name and the name of the delegate.  Without something in the fail message it's impossible to know what is failing when running the BindingTestSuite in Eclipse.  I don't like having to do this and hopefully we can figure out something better.

The only thing left to write are tests for IObservableMaps and to make sure all test cases are using the conformance tests.

(In reply to comment #15)
> (From update of attachment 73801 [details])
> See HEAD for the latest.
> 

This is not in HEAD yet.  That was a mistake.  Everything's still in the Bug182059_investigation branch.
Comment 20 Boris Bokowski CLA 2007-09-07 11:32:55 EDT
Sorry about the delay. I have filed bug 202657 for creating a new project org.eclipse.jface.tests.databinding.conformance (the name has been discussed with Brad, and we are both happy with it).
Comment 21 Brad Reynolds CLA 2007-09-08 23:45:59 EDT
I've merged branch Bug182059_investigation to HEAD to minimize the merge effort.
Comment 22 Brad Reynolds CLA 2007-09-15 20:35:25 EDT
Created attachment 78508 [details]
Patch for new project

Moves the conformance tests and test utilities into the conformance project.  This will be applied after next weeks integration build.
Comment 23 Brad Reynolds CLA 2007-09-25 12:13:12 EDT
Boris, when can I apply the patch?  I remember there needing to be some coordination to do this.
Comment 24 Brad Reynolds CLA 2007-09-25 20:48:51 EDT
Created attachment 79178 [details]
patch to tests.databinding

I applied the part of attachment 78508 [details] that applied to the new project as per our conversation  (between Boris and myself).  This patch contains the resulting changes to org.eclipse.jface.tests.databinding.
Comment 25 Boris Bokowski CLA 2007-09-28 14:11:52 EDT
The test build was successful.
Comment 26 Brad Reynolds CLA 2007-10-31 22:16:20 EDT
VERIFIED in I20071031-1800.