Hi,

this is a rather interesting problem you need to solve.
As your tests do run within the OSGi environment you'll need to use some
OSGi ways of requesting the file.
Best is to include it in your classpath, as you'll never know what the
actual location on the system path is.
Right now I'd consider the Bundle.getEntry approach as being the best to
match.

regards, Achim


2017-03-02 16:19 GMT+01:00 sorok...@gmail.com <sorok...@gmail.com>:

> Hi, OPS4J folks,
>
> I'm building up some tests using Pax Exam with Apache Camel in Apache
> Karaf. The basic form of each test is just "Make an HTTP request to a given
> URI with a Camel route behind it, then compare the response with a
> known-good answer."
>
> I'd like to include my known-good answers as data files (they are RDF and
> have well-known serializations) instead of inline strings, but I'm not
> totally sure about the best way to do that. I've been tinkering with adding
> them to the source tree and using Bundle.getEntry() and so forth, but this
> seems rather fragile.
>
> Is there an accepted pattern for this use case, i.e. bringing data files
> along with the code for a test probe?
>
> I hope this is a reasonable question to ask this forum. Thanks for the
> excellent product that is Pax Exam. It's definitely the best way to do
> testing with Karaf!
>
> ---
> A. Soroka
> The University of Virginia Library
>
>
>
> --
> --
> ------------------
> OPS4J - http://www.ops4j.org - ops4j@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+unsubscr...@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

-- 
-- 
------------------
OPS4J - http://www.ops4j.org - ops4j@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to