Skip to main content

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

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

Attachment: resource-tests.zip
Description: Zip archive


Back to the top