<font class="Apple-style-span" face="georgia, serif">I'll take a look at how to add Java JUnit testing to the rosbuild cmake files first.  Whether I get it to work or not, I'll let you know how it goes.<br></font><div>

<font size="2"><font face="georgia,serif"><br></font></font></div><div><font size="2"><font face="georgia,serif">As for rostest, I had seen this, but I noticed that it is for C++ and Python only.  Once I get CMake JUnit testing  to work the rostest should be fairly straight forward.</font></font></div>

<div><font size="2"><font face="georgia,serif"><br clear="all"></font></font>Aaron Holroyd<br>B.S. Computer Science and Robotics Engineering<br>WPI M.S. CS 2011<br><a href="http://users.wpi.edu/~aholroyd">http://users.wpi.edu/~aholroyd</a><br>


<br><br><div class="gmail_quote">On Tue, Jul 6, 2010 at 14:04, Brian Gerkey <span dir="ltr"><<a href="mailto:gerkey@willowgarage.com">gerkey@willowgarage.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">On Tue, Jul 6, 2010 at 7:12 AM, Aaron Holroyd <<a href="mailto:aholroyd@wpi.edu">aholroyd@wpi.edu</a>> wrote:<br>
> I would like to start writing some test cases for rosjava code I have<br>
> written.  Unfortunately, I can't seem to figure out how this should be done<br>
> with ROS.<br>
> I've been using Eclipse for my development, and I could continue to just use<br>
> it's built in testing environment.  The only problem with this is that when<br>
> the code is released, the test cases won't work.  Are there any other<br>
> suggestions, or a preferred way to do this?<br>
<br>
</div>hi Aaron,<br>
<br>
I don't know enough about Eclipse to give a recommendation there, but<br>
there are two ways that you can test your code at the command-line:<br>
<br>
(1) Use rostest (<a href="http://www.ros.org/wiki/rostest" target="_blank">http://www.ros.org/wiki/rostest</a>).  It allows you to<br>
bring up a ROS network, then use a program to run tests against that<br>
network.<br>
<br>
(2) Write standalone unit tests.  The ROS build system has support for<br>
running C/C++ (gtest) and Python (pyunit) tests.  We don't yet have<br>
support for Java, which I guess would use JUnit.  It should be easy to<br>
add support.  Look in rosbuild/public.cmake and rosbuild/private.cmake<br>
for how it's done for the other languages.  Essentially, you need to<br>
know the command-line that's required to invoke your compiled test<br>
program, including redirection of test results to a particular<br>
location.  I can help with the CMake integration if you want.<br>
<br>
Note that, for (1), if you want to write the test program itself in<br>
Java, then you'll also need the new JUnit support described in (2)<br>
(you could write test programs in Python or C++ using the current<br>
infrastructure).<br>
<font color="#888888"><br>
        brian.<br>
</font></blockquote></div><br></div>