It's all about the answers!

Ask a question

How to create Service test cases to schedule a task


Meghana Pandey (15111514) | asked Sep 25 '09, 7:00 a.m.
Hi,

I have implemented a scheduled task which extends AbstractAutoScheduledTask.
I want to create a service junit test case to programmatically schedule this task.
Iam referring to the following tutorial on WIKI:
http://jazz.net/wiki/bin/view/Main/QueryDevGuide, which says for that you will have to get the handle of
IAsynchronousTaskSchedulerService in your testcase.

Can you please share with me how to do this. Also, If you can share with me any RTC service test cases, it will be an immense help.

Regards,
Meghana

36 answers



permanent link
Meghana Pandey (15111514) | answered Aug 14 '11, 5:06 p.m.
Hi, also Iam facing problem when Iam trying to create a test Database as mentioned in the
"https://jazz.net/wiki/bin/view/Main/RTCSDK20_DevelopmentEnvironmentSetup"
Though I have unzipped RTC SDK into the mentioned dir "$INSTALLDIR/jazz/client/eclipse " and have set my target platform acc, still when I try to import
plugins from this target platform , I do not see "com.ibm.team.common.tests.utils" plugin listed. But when I browse to the same directory, I can locate the same plugin.
Can you please suggest what could have gone wrong or any other work around for this.

Regards
Meghana

permanent link
Meghana Pandey (15111514) | answered Aug 14 '11, 4:32 p.m.
Hi,
Iam trying to set up my development environment using RTC 3.0.1
Wanted to know, which version of code gen tools is compatible with this.
Also, I see two servers now, JTS and RTC server. Can you please point me to some link explaining the architecture details on this.

Regards,
Meghana

permanent link
Nick Edgar (6.5k711) | answered Feb 23 '11, 1:34 p.m.
JAZZ DEVELOPER
You could have a look at the source for com.ibm.team.build.internal.service.AbstractTeamBuildService.runAsRetryableIncludingStaleData(ITeamBuildRunnable<T>)
and how it's used in the modify operations like doDelete and doSave.

permanent link
Meghana Pandey (15111514) | answered Feb 23 '11, 12:42 p.m.
Thanks for the reply.

It would be great help if you could please post some code snippet showing re saving what you have mentioned. Also can you also mention any such class here which I can look into as reference.

Thanks

permanent link
Nick Edgar (6.5k711) | answered Feb 22 '11, 1:32 p.m.
JAZZ DEVELOPER
If you have 2 different advisors, one modifying its parents, and one modifying its children, then that sounds like a recipe for them stomping on each other, especially if the save triggers the advisors again.

Combining the advisors may let you coordinate the parent / child sequence more predictably, but you'd still need to be careful about the secondary saves triggering concurrent advisors.

In most of the Build service methods, we retry the transaction a few times if it fails with a StaleDataException, which can happen if a user makes a change at the same time as the service method. You might try this approach too. You would need to re-read the current state of the item, and re-apply the changes, of course, to avoid the SDE.

permanent link
Meghana Pandey (15111514) | answered Feb 21 '11, 12:05 a.m.
Hi,
I have developed two follow up actions. One follow up action, rolls up its children's state to the parent. For ex, if all its children have moved to Review state from DRAFT then its parent would also be changed to Review state.

The other follow up does the opposite, it propagates a field like say owner/estimate to all its children .

I have both this configured in my project area operations on WI save.
Now, I open a plan which has a parent WI and two children. I change the state of the tasks and hit save on plan itself. This is giving me a stale data exception in my team advisor window. I had put stale data exception handlers in both the follow ups but still getting this stale data exception from repository.

Please help what is wrong here and how to fix this. Also the problem persists only if both the children are saved concurrently.(like saving a plan after editing both children)
Back to top
Private Message | E-mail

permanent link
Meghana Pandey (15111514) | answered Feb 17 '11, 6:48 a.m.
Hi,
I have developed two follow up actions. One follow up action, rolls up its children's state to the parent. For ex, if all its children have moved to Review state from DRAFT then its parent would also be changed to Review state.

The other follow up does the opposite, it propagates a field like say owner/estimate to all its children .

I have both this configured in my project area operations on WI save.
Now, I open a plan which has a parent WI and two children. I change the state of the tasks and hit save on plan itself. This is giving me a stale data exception in my team advisor window. I had put stale data exception handlers in both the follow ups but still getting this stale data exception from repository.

Please help what is wrong here and how to fix this. Also the problem persists only if both the children are saved concurrently.(like saving a plan after editing both children)

permanent link
Nick Edgar (6.5k711) | answered Apr 07 '10, 2:29 p.m.
JAZZ DEVELOPER
So since the operation and server process are for the project area, it doesn't see the process customization in the team area. If the team area is the natural process area to use for the operation, it should be the one passed to the operation, and the one used to obtain the server process for looking up the advisors.

permanent link
Meghana Pandey (15111514) | answered Apr 07 '10, 12:48 p.m.
Hi,

1)Iam obtaining the serverProcess for the project area(IProjectArea) like follows:
IServerProcess serverProcess = processServerService
.getServerProcess(projectAreaWhole);

2)The AdvisableOperation's contructor is as follows:

MailNotificationOperation(IProjectArea projectArea,
IDevelopmentLine devLine) {
super(OPERATION_ID_MAIL_NOTIFICATION, null, projectArea, null);
this.projectArea = projectArea;
this.devLine = devLine;
}


3)And the advisor has been configured in the team area.

Thanks & Regards,
Meghana

permanent link
Nick Edgar (6.5k711) | answered Apr 05 '10, 3:44 p.m.
JAZZ DEVELOPER
A few questions to help narrow this down:
For which process area did you obtain the serverProcess? Is it the project area or a team area? Where did you configure the advisor, in the project area or team area? What is projectAreaWhole?

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.