Error in MANIFEST.MF of SWTBot test plugin - eclipse

I would want to try out SWTBot to test our RCP application's user interface. For that I started with the sample test which worked perfectly as documented here. I wanted to try similarly on our application and for that I checked out our UI plugin and was able to launch it as eclipse application. Then I created a new SWTBot test plugin. Just after creating test plugin, I see error "Bundle 'org.eclipse.swtbot.go' cannot be resolved" in MANIFEST.MF file on line "Require-Bundle: org.eclipse.swtbot.go".
I am not sure why I am getting this error only when I try to create the test plugin for our custom RCP application and not when I am trying out the example provided in the above link. I compared both test plugin MANIFEST.MF file but left with no clue.
Has anyone faced such error while creating the SWTBot test plugin for the custom RCP application?
Thanks in advance !!
Prakash

Make sure the org.eclipse.swtbot.go is actually the name of the plugin (maybe the plugin is called something else).
Make sure your target platform in PDE contains the SWTBot stuff. You can also use the PDE Plugins view to see if you see the SWTBot plugins.

Related

How to test an application as JUnit-Plugin test in Eclipse

I am trying to set up a JUnit Plugin test for a RCP-Application. Thereby I am using Tycho (0.18), maven 3.0.2, eclipse INDIGO and JUnit4.
When I configure a Plugin Test, the to be tested application starts as expected, but the chosen test case does not run. Whereby I do not get any error or exception messages.
Because I did not find anything with google, I would be very happy if someone could provide some helpful information or tutorials.
Update: I have found this tutorial: How to JUnitPluginTests. But the UnitTests didn't start without any error message...
I have the assumption that the JUnit-Plugin-Test launcher does not work in a correct manner. Because I have to define my application separately in the arguments tab, else the following error appears:
Application "org.eclipse.pde.junit.runtime.nonuithreadtestapplication" could not be found in the registry
Have you checked Christian Pontesegger's tutorial on Tycho, which includes a post about tests?
I had apparently the same problem. I tried a number of things, but what worked for me was:
Open the run configuration
Switch to the Main tab
Select 'Run an application'
Select '[No Application] - Headless mode'
I didn't need to run my product and this allowed the JUnit plug-in test runner to locate the unit tests.

Eclipse RCP: Plugin does not start

I wrote a new plugin for my eclipse rcp application and added the plugin to the dependencies of my product. I also tried to set the auto-start value of the new plugin to true but it does not start. It shows up as resolved but not as started.
Basically the only thing that this plugin does is to add a help file (table of contents) via the extension point org.eclipse.help.toc.
Any idea why the plugin code isn't executed?
Also: the plugin adds its content if I execute it from inside eclipse. The problem occures after I export it.
Just to be clear ... you're not expecting 'code' to run, but when you launch the exported RCP application standalone, the help contents does not appear in the TOC, right?
How did you define your RCP product? As a feature or plug-in based product?
If based on plug-in's, did you define all the necessary plug-in's on the product dependencies tab?
If based on features, did you add the new plug-in to the feature?

Eclipse plugin development: Missing dependencies at runtime

Background
I'm currently trying to extend Junit (org.eclipse.jdt) in order to do some tracing.
Therefore I created my own plugin project which (among others) provides a class which should be used by the junit runtime plugin.
I have setup my project as a dependency for junit and the package containing my class is listed as "exported" in my Manifest in the runtime tab. If I run the plugins as an eclipse application everything builds and starts allright and.
Problem
However, if in the started eclipse I perform a "Run as Junit", I get a NoClassDefFoundError concerning my class. In my understanding this means, that at runtime my class is not visible in the started eclipse. I thus printed the classpath while running and like expected my plugin doesn't show up.
Do I have to add my plugin to the "runtime" settings of the junit plugin? In the Manifest, my package is not available under the "export -> add" button. I tried importing a jar of my plugin and configuring those exports manually here, but this did not help either.
My thought process kind of gets stuck with this "run in run" configuration...
Any help is welcome!
Digging deeper in the code I found that the reason for the error is, that the part which calls my code and throws the error is run in a seperately started VM which has its classpath set via code. Nothing was wrong with the configuration, it just was not used in this case.
So if you ever stumble upon a "VMRunnerConfiguration" while having classpath problems, this might be your problem. ;)

How to setup the project & workspace for building Androlate; an Eclipse Plugin

Does anyone know how to properly setup an Eclipse project in order to build the Androlate plugin; which can be found at http://code.google.com/p/androlate/issues/list?
I need this in order to replace the older Google translation code - which no longer works - with the newer Bing Translation code (see Issue #2 of this plugin for more information).
I've never built an Eclipse plugin before and all my attempts so far for this plugin have failed. However, I'm able to build the plugin examples given by Eclipse and I've also be able to build the complex Motodev plugin (http://www.motorola.com/sites/motodev/library/motodev_core_plugins.html); therefore my environment (Eclipse Juno) should be correct.
First, the source for this plugin is lacking its .project File; so I had to trick Eclipse in order to import this project into the workspace by overwriting a new plugin project over the source files. (BTW, does anyone knows why is it so difficult to simply add an existing project to the current workspace in Eclipse? Why did they have to make such a simple task so difficult?).
Second, when I try to launch this plugin under Debug Mode as an Eclipse application, I first got multiple error messages: Can't find bundle for base name feature, locale en_US.
Finally, when I try the plugin itself, I got the error Logging bundle must not be null at the line 60 of the AndrolateWizard.java file; indicating that the call to Platform.getBundle(Activator.PLUGIN_ID) at the previous line (line 59) return a null bundle.
This is because the Plugin Id specified in the activator does not match the plugin id specified in your MANIFEST.MF [Check and correct it to com.cicadalane.androlate]
Old post, but here is an androlate gradle plugin if it helps anyone https://github.com/ayvazj/gradle-androlate-plugin

Runtime error of NoClassDefFoundError when a eclipse plugin depends on other eclipse plugin

I have an eclipse plugin project com.prosseek.asttest, and I spin off a new plugin project com.prosseek.impactAnalyzer that has one class CallHierarchyGenerator.java. Now asttest project depends on impactAnalyzer project. I had no choice but to make impactAnalyzer project eclipse plugin as it uses JDT library.
After setting up the build path in com.prosseek.asttest, it builds without a problem.
However, when I execute the plugin, I got an error missing CallHierarchyGenerator.java class.
What might be wrong?
If you are running this as an OSGI or Eclipse Application, you need to explicity export packages as available to other plugins as by default they are not. Open your manifest editor in plugin 1. Click on the runtime tab and add the packages as "Exported" then the class loader in blugin 2 will be able to find it.
Also looks like you might be doing the class path configuration wrong. in plugin 2 make sure you add plugin 1 as a dependency in the dependencies tab of the manifest editor. Looks like you are doing a dependency configuration as if it were a regular java application
Based on Duncan's answer, I could fix this issue.
Export packages in impactAnalyzer
Actually I didn't add it manually, but it's already exported, as (I guess) I did it with Quick Assist automatically.
Required Plug-ins
I had to Add com.prosseek.impactAnalyzer in the dependecies.
Run configuration update
I had one more step to do, I had to open run configuration to add required plug-ins.
Export the plugin
When exporting the asttest plugin, I also had to export impactAnalyzer also.