how to include and access test resources in pax exam

196 views
Skip to first unread message

osgi...@gmail.com

unread,
Mar 4, 2016, 12:22:45 PM3/4/16
to OPS4J
Hi,

What do I have to do, to include test resource files (like an xml) in pax exam test jar.
The bundle built for the pax test includes my testclasses, but not my resources.
I did not find any documentation and am unaware what I missed.

Any hint is appreciated

Thank you
Hubert

Achim Nierbeck

unread,
Mar 5, 2016, 8:22:05 AM3/5/16
to op...@googlegroups.com
Hi, 

depending on which resources you are looking, for test-resources should be also available for your testclass, but if you are 
looking for resources from src/main/resources those aren't available. 
Pax Exam is for Integration tests, so those tests should be seperated from the classes to test. Never the less you can 
add your classes and resources to a special bundle, for example take a look at [1]. 

Another way you might want to look at, use the probe builder to extend your test environment. 

@ProbeBuilder
public TestProbeBuilder build(TestProbeBuilder builder)


regards, Achim 



--
--
------------------
OPS4J - http://www.ops4j.org - op...@googlegroups.com

---
You received this message because you are subscribed to the Google Groups "OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ops4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master 

osgi...@gmail.com

unread,
Mar 7, 2016, 3:20:46 AM3/7/16
to OPS4J
Achim,

Thank you very much for the clarification and explanation! It saved my monday :-)

Regards
Hubert


Reply all
Reply to author
Forward
0 new messages