Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] problem with getClass().getResource(...)

Not that I'm aware of. The problem appears to be that the scheme for returned URL for the resource is "bundleresource" rather than "file". It doesn't seem like this should be insurmountable, tho.

On Wed, May 9, 2012 at 5:44 PM, Igor Fedorenko <igor@xxxxxxxxxxxxxx> wrote:
Does the test work as expected from PDE or any other OSGi-aware dev tool?

--
Regards,
Igor


On 12-05-09 4:49 PM, Matthew O'Connor wrote:
Hello,

getClass().getResource("/resource/file") fails when running `mvn
integration-test`. This appears to be related to running in an OSGi
container. Attached is a sample project.

The exception thrown is:

java.lang.NullPointerException
at tycho.demo.itp01.tests.ITP01Test.sampleAction(ITP01Test.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Is there an accepted way to load a file from a classpath resource in
Tycho tests?

Thanks,
Matt


_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user


Back to the top