Is there a way to add a bundle to the bnd.bnd build path for use in testing only?

152 views
Skip to first unread message

Bill Phillips

unread,
Apr 22, 2015, 5:22:13 PM4/22/15
to bndtool...@googlegroups.com
I have a jar full of test utilities which I want to use for testing the osgi bundles that I'm making.

How can I add this to the bnd.bnd build path such that:
a. It is present when the test code is compile and run
b. It is NOT present when I deploy my bundle (as test utils are not needed at run time)


Thanks,

Bill

BJ Hargrave

unread,
Apr 22, 2015, 5:52:36 PM4/22/15
to bndtool...@googlegroups.com
Did you try -testpath instead of -buildpath? -testpath is for jars which are needed to compile the test source folder and run the gradle test task (JUnit tests).



Thanks,

Bill

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

-- 

BJ



Bill Phillips

unread,
Apr 22, 2015, 6:05:48 PM4/22/15
to bndtool...@googlegroups.com
I was not aware of the -testpath option.

This was exactly what I needed. 


Thanks,

Bill

--
You received this message because you are subscribed to a topic in the Google Groups "bndtools-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bndtools-users/PsYSF7oMSbU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bndtools-user...@googlegroups.com.

Bill Phillips

unread,
Apr 28, 2015, 4:47:45 PM4/28/15
to bndtool...@googlegroups.com
Did you try -testpath instead of -buildpath? -testpath is for jars which are needed to compile the test source folder and run the gradle test task (JUnit tests).
 
Is -testpath a 2.4.1 feature?


This works on Luna w/ bndtools 2.4.1

I am not having any luck with it in Kepler w/ bndtools 2.3.0.






Bill

BJ Hargrave

unread,
Apr 28, 2015, 5:05:04 PM4/28/15
to bndtool...@googlegroups.com
On Apr 28, 2015, at 16:47 , Bill Phillips <william.r....@gmail.com> wrote:

Did you try -testpath instead of -buildpath? -testpath is for jars which are needed to compile the test source folder and run the gradle test task (JUnit tests).
 
Is -testpath a 2.4.1 feature?

bndtools support for -testpath was added in 2.4.0: https://github.com/bndtools/bndtools/commit/576199f2aab541b8845db553eeaf794db16b12d9. gradle support was added also in bnd 2.4.0 which includes -testpath support.



This works on Luna w/ bndtools 2.4.1

I am not having any luck with it in Kepler w/ bndtools 2.3.0.






Bill

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

-- 

BJ



Bill Phillips

unread,
Apr 30, 2015, 6:02:48 PM4/30/15
to bndtool...@googlegroups.com
One more question on this.


Should I put ${junit} on the -testpath rather than the -buildpath?


Bill

BJ Hargrave

unread,
Apr 30, 2015, 6:07:21 PM4/30/15
to bndtool...@googlegroups.com
On Apr 30, 2015, at 18:02 , Bill Phillips <william.r....@gmail.com> wrote:

One more question on this.


Should I put ${junit} on the -testpath rather than the -buildpath?

Yes. if you only need junit for classes in your testsrc folder.

If you need junit for classes in your src folder, then you will need to put it on the -buildpath.
Reply all
Reply to author
Forward
0 new messages