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: | Maven ignores src/test/resources when starting single-file-test | ||
---|---|---|---|
Product: | java | Reporter: | lorien <lorien> |
Component: | Source | Assignee: | Rastislav Komara <moonko> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | jpospisil, mkleint, sustaining |
Priority: | P2 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | Linux | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
lorien
2009-06-09 16:09:07 UTC
The project I was using while the error occured: http://github.com/MCS/badminton-ladder/tree/master Testing the whole project works fine, testing "LadderServiceImplTest,java" fails. possible workaround is to disable "compile on save" for tests in project properties. http://hg.netbeans.org/main/rev/cb1e43c6aa24 should fix it, it reverses the order of output folders, test output folder comes first now, please test after it reaches the daily builds (automated message will be added to the issue). I was not able to verify as your project could not build out of the box (missing dependencies) Where can I download a version including your fix? Alternatively, I updated my Git project to run out-of-the-box (now it's using just standard dependencies). Maybe you might try the test with the updated version. Integrated into 'main-golden', will be available in build *200906110201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/cb1e43c6aa24 User: Milos Kleint <mkleint@netbeans.org> Log: #166790 test output folder comes before the regular output folder Sorry, the bug is just partly fixed (tested with nightly 2009-06-11_14-01-07). Please download the current version of my project: http://github.com/MCS/badminton-ladder/tree/master The spring context is now included, but the hibernate schema creation is not done when testing a single file instead of the whole project. Worked fine in NB 6.5 a workaround is to disable Compile on Save for tests. Then single test execution is also performed via maven execution and passed. I'm somewhat clueless with regard how to debug the problem. I'm not fluent with Spring or Hibernate. Where is the hibernate schema creation happening? is it part of the build process? or part of the test codebase? It is part of the build process, implicitly done by Hibernate on startup. When starting the global test, the Maven command executed by Netbeans is printed into the output console. This does not happen on single-test execution. Has the called command changed from 6.5 to 6.7? The problem is in the way the JavaRunner implementation translates the execution classpath passed to it. What we do at maven side is to pass the test output folder (target/test-classes) and application output folder (target/classes) followed by the binary dependencies of the project (jars in local repository). Then the method org.netbeans.modules.java.source.ant.TranslateClassPath.translateEntry(String path) seems to take that classpath and for each of the output folders append the source folders (src/main/java, src/main/resources for the application output and src/test/java, src/test/resources for the test output folder) to the classpath. Doing that breaks the test execution in this project. There is no way for me in maven projects to suppress this behavior. Reassigning to java team. related bugfix in maven codebase: http://hg.netbeans.org/main/rev/72d08b52cadd the proper jdk used in the project was not passed to javarunner, if IDE was running on 1.5, but project required 1.6, there was an error when running. Integrated into 'main-golden', will be available in build *200906170201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/72d08b52cadd User: Milos Kleint <mkleint@netbeans.org> Log: #166790 use the correct jdk as assigned with the project when using JavaRunner I am very glad that you really try to fix the bug, but it is sadly still present. At least, with the newest nb version I get an error window with the following exception: Annotation: while loading from {service=org.netbeans.modules.websvc.project.spi.WebServiceDataProvider, class=org.netbeans.modules.websvc.core.jaxws.projects.AntJaxWsServicesProvider, instanceCreate=org.netbeans.modules.projectapi.LazyLookupProviders$1@19a6445} while loading from {service=org.netbeans.modules.websvc.project.spi.WebServiceDataProvider, class=org.netbeans.modules.websvc.core.jaxws.projects.AntJaxWsServicesProvider, instanceCreate=org.netbeans.modules.projectapi.LazyLookupProviders$1@19a6445} Caused by: java.lang.ClassNotFoundException: org.netbeans.modules.websvc.core.jaxws.projects.AntJaxWsServicesProvider at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at org.apache.tools.ant.module.bridge.AntBridge$MainClassLoader.findClass(AntBridge.java:622) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at org.netbeans.modules.projectapi.LazyLookupProviders.loadPSPInstance(LazyLookupProviders.java:98) at org.netbeans.modules.projectapi.LazyLookupProviders.access$000(LazyLookupProviders.java:64) at org.netbeans.modules.projectapi.LazyLookupProviders$1$1.beforeLookup(LazyLookupProviders.java:80) at org.openide.util.lookup.ProxyLookup$R.myBeforeLookup(ProxyLookup.java:645) at org.openide.util.lookup.ProxyLookup$R.computeResult(ProxyLookup.java:518) at org.openide.util.lookup.ProxyLookup$R.allInstances(ProxyLookup.java:489) at org.openide.util.lookup.ProxyLookup$R.computeResult(ProxyLookup.java:548) at org.openide.util.lookup.ProxyLookup$R.allInstances(ProxyLookup.java:489) at org.netbeans.modules.websvc.project.spi.LookupMergerSupport$WebServiceDataProviderImpl.setLookup(LookupMergerSupport.java:107) at org.netbeans.modules.websvc.project.spi.LookupMergerSupport$WebServiceDataProviderImpl.access$200(LookupMergerSupport.java:86) at org.netbeans.modules.websvc.project.spi.LookupMergerSupport$WebServiceDataProviderMerger.merge(LookupMergerSupport.java:81) at org.netbeans.modules.websvc.project.spi.LookupMergerSupport$WebServiceDataProviderMerger.merge(LookupMergerSupport.java:70) at org.netbeans.spi.project.support.LookupProviderSupport$DelegatingLookupImpl.doDelegate(LookupProviderSupport.java:223) at org.netbeans.spi.project.support.LookupProviderSupport$DelegatingLookupImpl.<init>(LookupProviderSupport.java:130) at org.netbeans.spi.project.support.LookupProviderSupport$DelegatingLookupImpl.<init>(LookupProviderSupport.java:118) at org.netbeans.spi.project.support.LookupProviderSupport.createCompositeLookup(LookupProviderSupport.java:89) at org.netbeans.modules.web.project.WebProject.createLookup(WebProject.java:541) at org.netbeans.modules.web.project.WebProject.<init>(WebProject.java:370) at org.netbeans.modules.web.project.WebProjectType.createProject(WebProjectType.java:83) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.netbeans.modules.project.ant.AntBasedGenericType.createProject(AntBasedGenericType.java:119) at org.netbeans.modules.project.ant.AntBasedProjectFactorySingleton.loadProject(AntBasedProjectFactorySingleton.java:240) at org.netbeans.api.project.ProjectManager.createProject(ProjectManager.java:354) at org.netbeans.api.project.ProjectManager.access$300(ProjectManager.java:80) at org.netbeans.api.project.ProjectManager$2.run(ProjectManager.java:275) at org.netbeans.api.project.ProjectManager$2.run(ProjectManager.java:227) at org.openide.util.Mutex.readAccess(Mutex.java:327) at org.netbeans.api.project.ProjectManager.findProject(ProjectManager.java:227) at org.netbeans.modules.projectapi.SimpleFileOwnerQueryImplementation.getOwner(SimpleFileOwnerQueryImplementation.java:129) at org.netbeans.modules.projectapi.SimpleFileOwnerQueryImplementation.getOwner(SimpleFileOwnerQueryImplementation.java:95) at org.netbeans.api.project.FileOwnerQuery.getOwner(FileOwnerQuery.java:147) at org.netbeans.modules.java.project.ProjectSourceForBinaryQuery.findSourceRoots(ProjectSourceForBinaryQuery.java:64) at org.netbeans.api.java.queries.SourceForBinaryQuery.findSourceRoots(SourceForBinaryQuery.java:90) at org.netbeans.api.java.classpath.GlobalPathRegistry.getSourceRoots(GlobalPathRegistry.java:328) at org.netbeans.api.java.classpath.GlobalPathRegistry.findResource(GlobalPathRegistry.java:377) at org.netbeans.modules.java.project.JavaAntLogger.messageLogged(JavaAntLogger.java:236) at org.apache.tools.ant.module.bridge.impl.NbBuildLogger.messageLogged(NbBuildLogger.java:607) at org.apache.tools.ant.Project.fireMessageLoggedEvent(Project.java:2200) at org.apache.tools.ant.Project.fireMessageLogged(Project.java:2300) at org.apache.tools.ant.Project.log(Project.java:455) at org.apache.tools.ant.Task.log(Task.java:294) at org.apache.tools.ant.taskdefs.LogOutputStream.processLine(LogOutputStream.java:100) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask$JUnitLogOutputStream.processLine(JUnitTask.java:1931) at org.apache.tools.ant.taskdefs.LogOutputStream.processLine(LogOutputStream.java:90) at org.apache.tools.ant.util.LineOrientedOutputStream.processBuffer(LineOrientedOutputStream.java:82) at org.apache.tools.ant.taskdefs.LogOutputStream.processBuffer(LogOutputStream.java:77) at org.apache.tools.ant.util.LineOrientedOutputStream.write(LineOrientedOutputStream.java:57) at org.apache.tools.ant.util.LineOrientedOutputStream.write(LineOrientedOutputStream.java:132) at org.apache.tools.ant.taskdefs.StreamPumper.run(StreamPumper.java:93) at java.lang.Thread.run(Thread.java:619) while loading from {service=org.netbeans.modules.websvc.project.spi.WebServiceDataProvider, class=org.netbeans.modules.websvc.core.jaxws.projects.AntJaxWsServicesProvider, instanceCreate=org.netbeans.modules.projectapi.LazyLookupProviders$1@19a6445} Testing the whole project still works fine. Hope that helps, Marcus the last exception is probably unrelated to the problem in this report, please file separately, with steps to reproduce. Okay, created ticket here: http://statistics.netbeans.org/analytics/exception.do?id=216644 But the single-testfile problem is still existing in the dev-build 200906170201. I don't know what happened, but with RC3 the problem seems to be fixed: Single-file-tests seem to work now. Just one wish: Please re-enable the "Test" option when right-clicking into an open testfile in edit-mode. But that is just a very little nice-to-have feature; Ctrl+F6 already works fine. Thanks for the great work! Netbeans continues to be my favourite Java IDE for more than 6 months - it almost never disappointed me :-) Based on report's feedback closing as verified. The fix has been ported into the release67_fixes repository. http://hg.netbeans.org/release67_fixes/rev/a5a21f2e7ad3 v. in 6.7.1 |