Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » No runnable method
No runnable method [message #597557] Sat, 16 May 2009 15:51
Michal Olejnik is currently offline Michal OlejnikFriend
Messages: 13
Registered: July 2009
Junior Member

i'm currently writing a plugin which is supposed to launch JUnit4 Tests
after each save. So far i'm only loading every class that is changed using
IResourceChangedListener and URLClassLoader:

URLClassLoader classLoader = new URLClassLoader(new URL[]
{outputDirectory.toURL(), new
URL("file:/D:/eclipse/plugins/org.junit4_4.3.1/junit.jar") });

Class<?> clazz = classLoader.loadClass(fileName);

At this point everything looks great - when i modify JUnit4 test class it
gets loaded with annotations on proper methods (thanks to second URL -
without it no annotation was loaded, and to be honest i don't know why).
However, things start to go wrong when i pass the loaded class to method - the result i always get says that there was "No
runnable method" exception even though there are clearly some method
annotaded with @Test...

I have little experience in writing plugins for Eclipse, so i'm kind of
lost now... I may suspect, that the problem is with not sufficient
classpath (cause it seems that it was a reason why i had to add another
URL to class loader) of my plugin. So i'm asking if anyone ever tried to
dynamically load test classes from Eclipse plugin and run them using
JUnitCore - if so, I'd be very grateful for helping me out with this

Thanks in advance.
Best regards,
Michal Olejnik
Previous Topic:repository name in artifacts.xml / content.xml
Next Topic:repository name in artifacts.xml / content.xml
Goto Forum:

Current Time: Sat Oct 01 14:51:19 GMT 2022

Powered by FUDForum. Page generated in 0.01976 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top