Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 242480 - port Bugzilla tests to Mylyn 3.0 framework
Summary: port Bugzilla tests to Mylyn 3.0 framework
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: 3.1   Edit
Assignee: Frank Becker CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 237212 (view as bug list)
Depends on: 256045
Blocks:
  Show dependency tree
 
Reported: 2008-07-29 18:15 EDT by Robert Elves CLA
Modified: 2009-08-15 15:33 EDT (History)
1 user (show)

See Also:


Attachments
Patch for RepositoryReportFactoryTest (4.96 KB, patch)
2008-08-03 15:33 EDT, Frank Becker CLA
no flags Details | Diff
mylyn/context/zip (4.36 KB, application/octet-stream)
2008-08-03 15:33 EDT, Frank Becker CLA
no flags Details
updated Patch (14.27 KB, patch)
2008-08-04 18:31 EDT, Frank Becker CLA
no flags Details | Diff
mylyn/context/zip (16.96 KB, application/octet-stream)
2008-08-04 18:31 EDT, Frank Becker CLA
no flags Details
patch of BugzillaTaskListManagerTest (10.17 KB, patch)
2008-08-07 17:16 EDT, Frank Becker CLA
no flags Details | Diff
mylyn/context/zip (72.32 KB, application/octet-stream)
2008-08-07 17:16 EDT, Frank Becker CLA
no flags Details
3. patch (10.77 KB, patch)
2008-08-12 17:10 EDT, Frank Becker CLA
no flags Details | Diff
mylyn/context/zip (37.43 KB, application/octet-stream)
2008-08-12 17:10 EDT, Frank Becker CLA
no flags Details
update (9.31 KB, patch)
2008-08-19 16:41 EDT, Frank Becker CLA
no flags Details | Diff
mylyn/context/zip (34.81 KB, application/octet-stream)
2008-08-19 16:41 EDT, Frank Becker CLA
no flags Details
some more tests (46.28 KB, patch)
2008-11-26 06:04 EST, Frank Becker CLA
no flags Details | Diff
mylyn/context/zip (34.67 KB, application/octet-stream)
2008-11-26 06:04 EST, Frank Becker CLA
no flags Details
attachment tests (11.30 KB, patch)
2009-01-02 15:53 EST, Frank Becker CLA
no flags Details | Diff
mylyn/context/zip (5.24 KB, application/octet-stream)
2009-01-02 15:53 EST, Frank Becker CLA
no flags Details
fix for failing test (7.49 KB, patch)
2009-01-14 16:19 EST, Robert Elves CLA
no flags Details | Diff
patch for last three tests (16.82 KB, patch)
2009-01-24 14:42 EST, Frank Becker CLA
no flags Details | Diff
mylyn/context/zip (7.54 KB, application/octet-stream)
2009-01-24 14:42 EST, Frank Becker CLA
no flags Details
updated patch (17.55 KB, patch)
2009-01-24 16:07 EST, Frank Becker CLA
no flags Details | Diff
mylyn/context/zip (8.11 KB, application/octet-stream)
2009-01-24 16:07 EST, Frank Becker CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Elves CLA 2008-07-29 18:15:37 EDT
The test suite has a number of failing tests that need to be updated.
Comment 1 Frank Becker CLA 2008-08-03 15:33:03 EDT
Created attachment 109019 [details]
Patch for RepositoryReportFactoryTest
Comment 2 Frank Becker CLA 2008-08-03 15:33:06 EDT
Created attachment 109020 [details]
mylyn/context/zip
Comment 3 Frank Becker CLA 2008-08-04 18:31:14 EDT
Created attachment 109103 [details]
updated Patch

actually I fixed the followings files

BugzillaSearchEngineTest
BugzillaConfigurationTest
AllBugzillaTests
RepositoryReportFactoryTest
BugzillaRepositoryConnectorTest2
BugzillaProductParserTest

What I need to know is how should I remove the "new BugzillaTask"?

Can I use TasksUi.getRepositoryModel().createTask() ?

This is used in TaskListNotificationManagerTest
Comment 4 Frank Becker CLA 2008-08-04 18:31:22 EDT
Created attachment 109104 [details]
mylyn/context/zip
Comment 5 Robert Elves CLA 2008-08-05 17:38:45 EDT
Frank, this is awesome that you are hacking on this! This is a really critical task and if you have more time for it great! As for task creation, TasksUi.getRepositoryModel().createTask()  should do the trick.
Comment 6 Robert Elves CLA 2008-08-05 17:40:13 EDT
(patch applied and ip log updated)
Comment 7 Frank Becker CLA 2008-08-07 17:16:07 EDT
Created attachment 109461 [details]
patch of BugzillaTaskListManagerTest

Here my patch for BugzillaTaskListManagerTest

For TaskListNotificationManagerTest I need some help.
Comment 8 Frank Becker CLA 2008-08-07 17:16:53 EDT
Created attachment 109462 [details]
mylyn/context/zip
Comment 9 Robert Elves CLA 2008-08-07 18:06:47 EDT
Patch applied, IP log updated. 

 (In reply to comment #7)
> For TaskListNotificationManagerTest I need some help.
Just leave this test for last if you can Frank.
Comment 10 Frank Becker CLA 2008-08-12 17:10:02 EDT
Created attachment 109833 [details]
3. patch

now included fixes for

EncodingTest
	testDifferentReportEncoding
	testProperEncodingUponPost
TaskEditorTest
	testAccessNewEditor
	testinitializeTaskData
 

In TaskListStandaloneTest I found the following problem.

task.isPastReminder() returns an other value then 

TasksUiPlugin.getTaskActivityManager().isPastReminder(task)

This was the change from TaskActivityManager Version 1.60

|| !task.getScheduledForDate().isDay() was insert in the if statment.

What is to do for this?
Comment 11 Frank Becker CLA 2008-08-12 17:10:06 EDT
Created attachment 109834 [details]
mylyn/context/zip
Comment 12 Robert Elves CLA 2008-08-13 18:29:08 EDT
(In reply to comment #10)
> Created an attachment (id=109833)
> 3. patch
> 
> now included fixes for
> 
> EncodingTest
> testDifferentReportEncoding
> testProperEncodingUponPost
> TaskEditorTest
> testAccessNewEditor
> testinitializeTaskData
> 
> 
> In TaskListStandaloneTest I found the following problem.
> 
> task.isPastReminder() returns an other value then
> 
> TasksUiPlugin.getTaskActivityManager().isPastReminder(task)
> 
> This was the change from TaskActivityManager Version 1.60
> 
> || !task.getScheduledForDate().isDay() was insert in the if statment.
> 
> What is to do for this?

Greate Frank. Patch applied, ip log updated. Regarding your question, I'll need to fix this discrepancy and eliminate all use of the old api. For tests if you could use the new api that would be ideal.
Comment 13 Frank Becker CLA 2008-08-19 16:15:33 EDT
(In reply to comment #12)
> (In reply to comment #10)
> > Created an attachment (id=109833)
> > 3. patch
> >
> > now included fixes for
> >
> > EncodingTest
> > testDifferentReportEncoding
> > testProperEncodingUponPost
> > TaskEditorTest
> > testAccessNewEditor
> > testinitializeTaskData
> >
> >
> > In TaskListStandaloneTest I found the following problem.
> >
> > task.isPastReminder() returns an other value then
> >
> > TasksUiPlugin.getTaskActivityManager().isPastReminder(task)
> >
> > This was the change from TaskActivityManager Version 1.60
> >
> > || !task.getScheduledForDate().isDay() was insert in the if statment.
> >
> > What is to do for this?
> 
> Greate Frank. Patch applied, ip log updated. Regarding your question, I'll need
> to fix this discrepancy and eliminate all use of the old api. For tests if you
> could use the new api that would be ideal.

Rob,
what is the expected Result of isPastReminder for the given Sourcecode
		AbstractTask task = new LocalTask("1", "1");
		task.setScheduledForDate(new DateRange(Calendar.getInstance()));
old API return true
new API return false

Comment 14 Frank Becker CLA 2008-08-19 16:41:41 EDT
Created attachment 110394 [details]
update

Here the not fixed problems from AllBugzillaTests
1 Error; 6 failure
TaskListNotificationManagerTest
	testTaskListNotificationIncoming (failure)
	testTaskListNotificationQueryIncoming (failure)
	testTaskListNotificationQueryIncomingRepeats (failure)
BugzillaTaskTest
	testCompletionDate (error)
BugzillaTaskDataHandlerTest
	warning (failure)
TaskListStandaloneTest
	testOrphanedTasks (failure)
	testOrphanedQueries (failure)

Please can somon give me some information how to fix this or do the remaining work.
Comment 15 Frank Becker CLA 2008-08-19 16:41:46 EDT
Created attachment 110395 [details]
mylyn/context/zip
Comment 16 Robert Elves CLA 2008-09-03 16:52:37 EDT
(In reply to comment #13)
> (In reply to comment #12)
> > (In reply to comment #10)
> > > Created an attachment (id=109833)
> > > 3. patch
> > >
> > > now included fixes for
> > >
> > > EncodingTest
> > > testDifferentReportEncoding
> > > testProperEncodingUponPost
> > > TaskEditorTest
> > > testAccessNewEditor
> > > testinitializeTaskData
> > >
> > >
> > > In TaskListStandaloneTest I found the following problem.
> > >
> > > task.isPastReminder() returns an other value then
> > >
> > > TasksUiPlugin.getTaskActivityManager().isPastReminder(task)
> > >
> > > This was the change from TaskActivityManager Version 1.60
> > >
> > > || !task.getScheduledForDate().isDay() was insert in the if statment.
> > >
> > > What is to do for this?
> >
> > Greate Frank. Patch applied, ip log updated. Regarding your question, I'll
> need
> > to fix this discrepancy and eliminate all use of the old api. For tests if you
> > could use the new api that would be ideal.
> 
> Rob,
> what is the expected Result of isPastReminder for the given Sourcecode
> AbstractTask task = new LocalTask("1", "1");
> task.setScheduledForDate(new DateRange(Calendar.getInstance()));
> old API return true
> new API return false

false is correct since this the DateRange isn't for a specific day in this case.  I'll address this on bug#244092. Then more of these notification tests should fall into place.
Comment 17 Robert Elves CLA 2008-09-28 23:43:06 EDT
Patch applied, ip log updated.
Comment 18 Robert Elves CLA 2008-10-01 22:01:26 EDT
Update: 75/75 test are now passing. Thanks for all the help here Frank.  Are you interested in continuing with porting the rest of the old BugzillaRepositoryConnectorTest tests to the new class? There are a few remaining that might be good to have running.
Comment 19 Frank Becker CLA 2008-11-07 06:09:34 EST
(In reply to comment #18)
> Update: 75/75 test are now passing. Thanks for all the help here Frank.  Are you
> interested in continuing with porting the rest of the old
> BugzillaRepositoryConnectorTest tests to the new class? There are a few
> remaining that might be good to have running.
Yes, I can do this. Is there a List of tests that I should port to the new class or should I port all remaining tests.
Comment 20 Robert Elves CLA 2008-11-09 14:57:10 EST
(In reply to comment #19)
> Yes, I can do this. Is there a List of tests that I should port to the new class
> or should I port all remaining tests.
Tests that should be tasks framework level tests (i.e. that simply test state changes incoming/outgoing/synchronized) can likely be ignored and flagged for moving into a tasks unit test if not covered already.  Other bugzilla specific tests such as attachments, time submission, etc would be great to have ported. If a test is ambiguous, just fire me an email Frank and I'll get back to you asap. 
Comment 21 Frank Becker CLA 2008-11-26 06:04:18 EST
Created attachment 118767 [details]
some more tests
Comment 22 Frank Becker CLA 2008-11-26 06:04:21 EST
Created attachment 118768 [details]
mylyn/context/zip
Comment 23 Robert Elves CLA 2008-12-01 20:16:14 EST
Patch applied, ip log updated.
Comment 24 Robert Elves CLA 2008-12-01 20:18:39 EST
.
Comment 25 Robert Elves CLA 2008-12-01 20:43:50 EST
Merged BRCTest2 all back into BRCTest.java. Tests remaining to port appended to bottom of file.
Comment 26 Frank Becker CLA 2009-01-02 15:53:39 EST
Created attachment 121435 [details]
attachment tests

after apply patch (attachment ID 121363) from bug#208839 comment#5 you can do this patch to add more tests.
Comment 27 Frank Becker CLA 2009-01-02 15:53:42 EST
Created attachment 121436 [details]
mylyn/context/zip
Comment 28 Robert Elves CLA 2009-01-12 18:54:26 EST
(In reply to comment #26)
> Created an attachment (id=121435)
> attachment tests
> 
> after apply patch (attachment ID 121363) from bug#208839 comment#5 you can do
> this patch to add more tests.
Patch applied, ip log updated.
Comment 29 Steffen Pingel CLA 2009-01-13 05:01:34 EST
Is there anything left to do here? Otherwise I would suggest closing the bug and adding additional tests as we move along.
Comment 30 Frank Becker CLA 2009-01-14 14:58:14 EST
(In reply to comment #29)
> Is there anything left to do here? Otherwise I would suggest closing the bug and
> adding additional tests as we move along.

There are  tests that need some work
- testSynchronize old code is commented out
- testTimeTracker222 and testTimeTracker218
- testSynchChangedReports

I did not know how important this is and if it is OK to do this an an new bug.
Comment 31 Robert Elves CLA 2009-01-14 16:19:10 EST
Created attachment 122586 [details]
fix for failing test
Comment 32 Robert Elves CLA 2009-01-14 16:24:46 EST
(In reply to comment #30)
> - testTimeTracker222 and testTimeTracker218
> - testSynchChangedReports

Yes, I'd like to have these ported before we mark this one resolved.
Comment 33 Frank Becker CLA 2009-01-24 14:42:12 EST
Created attachment 123641 [details]
patch for last three tests

What is the replace of "assertFalse(taskData4.isStale());" I need this for finish testSynchChangedReports.
Comment 34 Frank Becker CLA 2009-01-24 14:42:15 EST
Created attachment 123642 [details]
mylyn/context/zip
Comment 35 Steffen Pingel CLA 2009-01-24 15:06:34 EST
The connector invokes session.markStale(task); in preSynchronization(). you can check if a task ist stale using session.getStaleTasks().contains(task).
Comment 36 Frank Becker CLA 2009-01-24 16:07:41 EST
Created attachment 123646 [details]
updated patch

comment#33 included in this patch
Comment 37 Frank Becker CLA 2009-01-24 16:07:44 EST
Created attachment 123647 [details]
mylyn/context/zip
Comment 38 Robert Elves CLA 2009-01-27 19:27:00 EST
Excellent! Patch applied, ip log update.
Comment 39 Frank Becker CLA 2009-08-15 15:33:40 EDT
*** Bug 237212 has been marked as a duplicate of this bug. ***