On Feb 24, 2011 7:37 AM, "Jordi Fernandez" <
jordi.fernandez@xxxxxxxxxxxxxxx> wrote:
> I'm developing a test with SWTBot that is throwing NoClassDefFoundError when
> trying to load a class that is present in a runtime plugin dependency.
> 
> I'm using Eclipse 3.4.2. My workspace has several plugin projects for the
> product under development plus the SWTBot test plugin. Initially I code a
> simple test which just clicked in a menu. It runs fine:
> 
> ---------
> public void menuTest() throws Exception {
> 
>     bot.menu("A").menu("B").menu("C").click();
> 
>  }
> ----------
> 
> 
> Then I tried to access a custom developed widget using the following code:
> 
> 
> ----------------
> 
> public void menuTest() throws Exception {
>     SWTBotPreferences.TIMEOUT = 10000;
>     bot.menu("Aplicacion").menu("Comercial").menu("Posición
> Global").click();
>     System.out.println("Hola");
> 
>     Matcher matcher = allOf(
>             widgetOfType(ComboSearchSelector.class)
>           );
> 
>     ComboSearchSelector combo = (ComboSearchSelector) bot.widget(matcher);
>     assertTrue(combo.getItemCount() > 0);
> }
> 
> --------------------
> 
> This second test fails with a NoClassDefFoundError for the
> ComboSearchSelector class. This class is in one of the plugin projects of my
> workspace and is included as a plugin to load in the run configuration (as
> it is a required plugin for the product under development) . In order to
> compile my test, I added this plugin project as a project dependency in the
> java build path.
> 
> How come I'm getting a NoClassDefFoundError at runtime when the referenced
> class is loaded (because the plug-in that holds it is present at runtime)?
> 
> Thanks in advance.