java - junit testing a class with shell scripting functionality under win32 -


We have an API that is used in any class through an interface. The API is for the Unix family and believes that every bin / bin / sh is thus when we run a Junich test under Win32, we get:

The program "/ bin / sh" Can be run

Is it a catch-22 position or is it a chance to work? There is probably no other structure than junit which can be easily run under UNIX. Thank you.

Update:

This code is portable and it means that you can run on multiple OS. I want to write some unit tests (which is my own initiative) and some parts of the code open in front of me in the API (being tested in other departments). Now when I run a test for my code, because it relies on the APIS code, it is behind some magic, like calling shell script, which is virgin Win32 (we develop ours using Win32 + ssh) Are not present in

Switching to Linux is not currently an option. Eclipse on UNIX + GIE via NX Client may be an option however. Hope this makes it a little clearer.

Your question is unclear. Obviously, if code is for Unix, then it will not work under Win32, so it's natural (and OK) to fail the unit test. If you are testing the test code for Unix under Unix so?

If you can not test under Unix (or the code to be platform-independent), then there are some options:

  • Direct access / Code Refactor for Bin / S; You can mimic the dependency to obtain a true unit test, which platform will be independent (note that the interpretation of a test that relies on external resources such as / bin / sh is not a unit test,
  • To replace / bin / sh some type of dummy script on win32 (and possibly make path configurable)
  • Platform-based and-independent testing Divide your Janet examinations in, and only run tests under Win32, which works there (and the rest of Unix)

But you must first clarify that you How to test platform-specific functionality


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -