It's all about the answers!

Ask a question

RTC Custom Precondition - Not able to access Junit View Part(eclipse api) in custom pre condition

Shanmugam Subramanian (1112) | asked Apr 09 '15, 3:12 a.m.
edited Apr 09 '15, 3:13 a.m.
I am trying to write a rtc precondition that stops the developer from delivering the code to the server when there are any junit errors reported in the eclipse JUnit view.

To acheive this i tried using eclipse APIs, ViewPart(org.eclipse.ui.part.ViewPart) &TestRunnerViewPart(org.eclipse.jdt.internal.junit.ui).

The newly written precondition is listed as one of the preconditions by RTC but when the deliver option is done, this 
precondition is not executed. Tried printing in the console but even the first line is not getting printed. But when i remove this reference to ViewPart of the eclipse API, then the plugin/precondition gets invoked during deliver action. Can any one give me a suggestion as to how to go about the issues.

One answer

permanent link
Ralph Schoon (59.7k23643) | answered Apr 09 '15, 5:01 a.m.
edited Apr 09 '15, 5:03 a.m.
If the plug in does not get picked up, there is almost always a problem with missing dependencies.
If the plugin works with an Eclipse development environment (see but not in the production environment this is the typical issue.

This kind of precondition would have to be deployed and run in the Eclipse client as well, since it refers to a client plugin.

It might be worth to mention that there are related preconditions available already:

Shanmugam Subramanian commented Apr 09 '15, 5:39 a.m.

Thanks a lot for the quick response!. 

I also explored the already available "Require Junit Test Run" pre condition, but is running Test suite, but the project we are working on is huge and has got loads of Test cases,  so we prefer to validate only specific test files when the developer tries to deliver the source code to the server.Due to this reason we started building our own pre condition.
I will try to add few more eclipse UI dependencies to the plug-in and try on the server. 
Mean while i have couple of questions,
1) would like to understand, whether the custom precondition should always refer to the same version of eclipse(dependency/APIs) that RTC is using for its existing precondition or can the precondition run on a different version. 

will there be any problem due to mismatch in version?

2)Where can we see the error logs(dependency missing) on the RTC?


Ralph Schoon commented Apr 09 '15, 5:47 a.m.

I don't know what your state of experience with extending. You can debug Client and Server extensions. See
You should have run the workshop mentioned above and in that post.

You fail to provide information if this is a client or server extension. Errors are in the Eclipse log in the workspace (in .metadata) or in the CCM log on the server.

The extension should refer to a version equal or earlier than available in the target. The API is very stable, so If it works with an earlier verion of the SDK, it usually works with later versions as well.

Your answer

Register or to post your answer.