This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Awaitility ClassNotFoundExeption | ||
---|---|---|---|
Product: | platform | Reporter: | rsobies <rsobies> |
Component: | NB JUnit | Assignee: | Theofanis Oikonomou <theofanis> |
Status: | NEW --- | ||
Severity: | normal | CC: | rsobies |
Priority: | P3 | ||
Version: | 8.1 | ||
Hardware: | PC | ||
OS: | Windows 8.1 | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | Test depency |
..and the output Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 6.332 sec <<< FAILURE! - in com.radmor.wsd.ApplicationTest testApplication(com.radmor.wsd.ApplicationTest) Time elapsed: 0.01 sec <<< ERROR! java.lang.NoClassDefFoundError: org/awaitility/Awaitility at com.radmor.wsd.ApplicationTest.testApplication(ApplicationTest.java:50) Caused by: java.lang.ClassNotFoundException: org.awaitility.Awaitility starting from SystemClassLoader[78 modules] with possible defining loaders null and declared parents [org.netbeans.MainImpl$BootClassLoader@2ef5e5e3, ModuleCL@71e1ee30[org.netbeans.api.annotations.common], ModuleCL@31739508[org.openide.awt], ModuleCL@2a7e3226[org.netbeans.api.progress], ModuleCL@7bfdbd20[org.netbeans.api.progress.nb], ModuleCL@41b0f4b[org.openide.dialogs], ModuleCL@19503cca[org.openide.nodes], ModuleCL@65ae547d[org.openide.windows], ModuleCL@666c96e7[org.netbeans.modules.editor.mimelookup], ModuleCL@53edf7db[org.openide.text], ...59 more] at com.radmor.wsd.ApplicationTest.testApplication(ApplicationTest.java:50) Caused by: java.lang.ClassNotFoundException: org.awaitility.Awaitility at com.radmor.wsd.ApplicationTest.testApplication(ApplicationTest.java:50) |
Created attachment 162234 [details] Test depency i am trying to use Awaitility library in test unit of my netbens rcp application (tests are in main project, maven) When running public static Test.suite(), classes from awaitility lib are loaded by the systemClassLoader. but if the test method is invoked, the default class loader is changed( to org.netbeans.ModuleManager.SystemClassLoader i guess) and Awaitility classes are no longer seen. [code] import java.util.concurrent.TimeUnit; import junit.framework.Test; import org.awaitility.Awaitility; import org.netbeans.junit.NbModuleSuite; import org.netbeans.junit.NbTestCase; public class ApplicationTest extends NbTestCase { public static Test suite() { Awaitility.setDefaultTimeout(0, TimeUnit.DAYS); //this line makes no exceptions return NbModuleSuite.createConfiguration(ApplicationTest.class). gui(false). //failOnMessage(Level.WARNING). // works at least in RELEASE71 //failOnException(Level.INFO). enableClasspathModules(false). clusters(".*"). suite(); // RELEASE71+, else use NbModuleSuite.create(NbModuleSuite.createConfiguration(...)) } public ApplicationTest(String n) { super(n); } public void testApplication() { Awaitility.setDefaultTimeout(0, TimeUnit.DAYS); //this line makes NoclassFoundException } } [/code]