Hi,
my first guess is that the inputstream object might be NULL which in turn leads to further NPEs inside Castor.
Make sure that the 'portlet.xml' is on the classpath at runtime. The simplest way to achieve this is to have this file in the Java source path
as Eclipse copies all resources automatically into the build dir when compiling.
Hope this helps
Graham Klyne <[EMAIL PROTECTED]> schrieb am 12.10.2005 12:58:16:
> Hi,
>
> I'm fishing for some hints and pointers for running the Pluto unit tests
> within Eclipse.
>
> I've managed to install Pluto and run the tests successfully (modulo a
> couple of comments noted at
> http://issues.apache.org/jira/browse/PLUTO-172) using Maven.
>
> I've also managed to import Pluto into Eclipse, and get it to compile,
> apparently compiles fine. But I'm getting a bit lost trying to run the
> unit tests from within Eclipse. From my notes:
> [[
> Now I try to run unit tests under Eclipse. The only one that shows any
> sign of working is pluto-descriptors, which reports a number of failures
> (as well as some successes, so there's some progress). I think one
> problem may be a failure to read portlet.xml, possibly due to an
> incorrect working directory, but I couldn't be sure.
> ]]
>
> Failing tests are:
> portlet.CastorMappingTest
> services.impl.AbstractPortletAppDescriptorServiceTest
> servlet.CastorMappingTest
>
> Succeeding tests are:
> servlet.WebAppDDTest
> portlet.PortletAppDDTest
>
> In the Eclipse package explorer window I highlight the pluto-descriptors
> package, then select menu commands "Run -> Run as -> JUnit test". If I
> try the same for pluto or pluto-portal package, I get "No tests found";
> for "pluto-deploy" or "testsuite" packages I get "Cannot find class
> junit.framework.testcase on the build path".
>
> I'm not sure where to look to figure out what's happening here. I
> suspect there's something simple I'm doing wrong when running the tests
> I'm still coming up to speed on Pluto and Maven, and also catching up
> with the latest version of Eclipse, so my lack of understanding could be
> anywhere in the mix.
>
> #g
> --
>
> Stack trace from testing PortletDescriptors:
> [[
> java.lang.NullPointerException
> at org.exolab.castor.mapping.Mapping.loadMapping(Mapping.java:427)
> at
> org.apache.pluto.descriptors.services.impl.
> AbstractPortletAppDescriptorService.
> getCastorMapping(AbstractPortletAppDescriptorService.java:128)
> at
> org.apache.pluto.descriptors.services.impl.
> AbstractCastorDescriptorService.
> readInternal(AbstractCastorDescriptorService.java:65)
> at
> org.apache.pluto.descriptors.services.impl.
> AbstractPortletAppDescriptorService.
> read(AbstractPortletAppDescriptorService.java:81)
> at
> org.apache.pluto.descriptors.portlet.CastorMappingTest.
> testUnmarshalWebXml(CastorMappingTest.java:47)
> 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:585)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at junit.framework.TestCase.runBare(TestCase.java:127)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:118)
> at junit.framework.TestSuite.runTest(TestSuite.java:208)
> at junit.framework.TestSuite.run(TestSuite.java:203)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.
> runTests(RemoteTestRunner.java:478)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.
> run(RemoteTestRunner.java:344)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.
> main(RemoteTestRunner.java:196)
> java.lang.NullPointerException
> at org.exolab.castor.mapping.Mapping.loadMapping(Mapping.java:427)
> at
> org.apache.pluto.descriptors.services.impl.
> AbstractPortletAppDescriptorService.
> getCastorMapping(AbstractPortletAppDescriptorService.java:128)
> at
> org.apache.pluto.descriptors.services.impl.
> AbstractCastorDescriptorService.
> readInternal(AbstractCastorDescriptorService.java:65)
> at
> org.apache.pluto.descriptors.services.impl.
> AbstractPortletAppDescriptorService.
> read(AbstractPortletAppDescriptorService.java:81)
> at
> org.apache.pluto.descriptors.services.impl.
> AbstractPortletAppDescriptorServiceTest.
> testPortletCount(AbstractPortletAppDescriptorServiceTest.java:51)
> 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:585)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at junit.framework.TestCase.runBare(TestCase.java:127)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:118)
> at junit.framework.TestSuite.runTest(TestSuite.java:208)
> at junit.framework.TestSuite.run(TestSuite.java:203)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.
> runTests(RemoteTestRunner.java:478)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.
> run(RemoteTestRunner.java:344)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.
> main(RemoteTestRunner.java:196)
> java.lang.NullPointerException
> at org.exolab.castor.mapping.Mapping.loadMapping(Mapping.java:427)
> at
> org.apache.pluto.descriptors.services.impl.
> AbstractPortletAppDescriptorService.
> getCastorMapping(AbstractPortletAppDescriptorService.java:128)
> at
> org.apache.pluto.descriptors.services.impl.
> AbstractCastorDescriptorService.
> readInternal(AbstractCastorDescriptorService.java:65)
> at
> org.apache.pluto.descriptors.services.impl.
> AbstractPortletAppDescriptorService.
> read(AbstractPortletAppDescriptorService.java:81)
> at
> org.apache.pluto.descriptors.services.impl.
> AbstractPortletAppDescriptorServiceTest.
> testPortletNames(AbstractPortletAppDescriptorServiceTest.java:56)
> 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:585)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at junit.framework.TestCase.runBare(TestCase.java:127)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:118)
> at junit.framework.TestSuite.runTest(TestSuite.java:208)
> at junit.framework.TestSuite.run(TestSuite.java:203)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.
> runTests(RemoteTestRunner.java:478)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.
> run(RemoteTestRunner.java:344)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.
> main(RemoteTestRunner.java:196)
> java.lang.NullPointerException
> at org.exolab.castor.mapping.Mapping.loadMapping(Mapping.java:427)
> at
> org.apache.pluto.descriptors.services.impl.
> AbstractPortletAppDescriptorService.
> getCastorMapping(AbstractPortletAppDescriptorService.java:128)
> at
> org.apache.pluto.descriptors.services.impl.
> AbstractCastorDescriptorService.
> readInternal(AbstractCastorDescriptorService.java:65)
> at
> org.apache.pluto.descriptors.services.impl.
> AbstractPortletAppDescriptorService.
> read(AbstractPortletAppDescriptorService.java:81)
> at
> org.apache.pluto.descriptors.services.impl.
> AbstractPortletAppDescriptorServiceTest.
> testPortletClassNames(AbstractPortletAppDescriptorServiceTest.java:62)
> 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:585)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at junit.framework.TestCase.runBare(TestCase.java:127)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:118)
> at junit.framework.TestSuite.runTest(TestSuite.java:208)
> at junit.framework.TestSuite.run(TestSuite.java:203)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.
> runTests(RemoteTestRunner.java:478)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.
> run(RemoteTestRunner.java:344)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.
> main(RemoteTestRunner.java:196)
> ]]
>
>
> --
> Graham Klyne
> Research Technology Service
> Oxford University Computing Services
>
--
Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
- Setting up Pluto unit tests to run under Eclipse Graham Klyne
- Re: Setting up Pluto unit tests to run under Eclipse David H. DeWolf
- Re: Setting up Pluto unit tests to run under Ecli... Graham Klyne
- Re: Setting up Pluto unit tests to run under ... Graham Klyne
- Re: Setting up Pluto unit tests to run under Ecli... Graham Klyne
- Re: Setting up Pluto unit tests to run under ... David H. DeWolf
- Re: Setting up Pluto unit tests to run un... Graham Klyne
- Antwort: Setting up Pluto unit tests to run under Ecl... Nico Max
- Setting up Pluto unit tests to run under Eclipse Graham Klyne
