How to create Service test cases to schedule a task
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
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 |
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. |
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 |
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. |
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 |
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 |
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.