maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Shellenbarger <ch...@cloudrepo.io>
Subject Re: Integration testing of command line tools?
Date Mon, 20 Aug 2018 15:43:32 GMT
Have you considered writing an integration test that invoked your command
line tool from the command line?

When you use tools like Failsafe, JUnit, etc, you can know that the process
works in that environment, but the real world execution won't be the same.

While most of your corner cases, logic, etc can be covered by unit tests in
the framework, the final test (does it run on the command line) is
something you should be able to do with a simple shell script (call your
command line, check the output, exit 0 if things match, done).

I think of integration tests as 'testing that everything is hooked up
properly' and so just a couple executions usually can validate this.  I
leave all my edge cases and logic testing to unit tests, usually isolating
at the function level, where they become a lot simpler to test.


---
Chris Shellenbarger
Founder, CloudRepo <https://www.cloudrepo.io>

On Mon, Aug 20, 2018 at 8:59 AM, Mark H. Wood <mwood@iupui.edu> wrote:

> When writing integration tests for command-line tools, is there any
> support in Failsafe, jUnit, or elsewhere to fork a process and manage
> its standard IO streams?
>
> Or am I over-designing?  Would one typically write such an integration
> test rather like a unit test, bypassing the command analyzer and just
> calling the appropriate method on an instance created by the test
> suite?  Without stubbing or mocking the underlying code, of course,
> since it's an integration test.
>
> Is there a better place to ask?
>
> --
> Mark H. Wood
> Lead Technology Analyst
>
> University Library
> Indiana University - Purdue University Indianapolis
> 755 W. Michigan Street
> Indianapolis, IN 46202
> 317-274-0749
> www.ulib.iupui.edu
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message