On 4/20/07, Balasubramanian, Ravi Shankar <[EMAIL PROTECTED]> wrote:
Hi,
Following is my test class that starts a notepad process from within:
" public void startProcessNotepad() throws IOException {
                Process p = Runtime.getRuntime().exec("notepad");
                System.out.println("....NOTEPAD STARTED....");
        }
"

When I execute this test through maven using "mvn test" through the
surefire plugin, maven does not exit until the notepad process is
closed/terminated.
I have attached the thread dump long along with this mail. Please look
into it and let me know if there is a way to work around this. I will
want to be starting a server process in one of my test cases and wants
maven to continue with other builds for whose test cases, the server
needs to be running.

maven forks the test execution. This forked execution doesn't
terminate so maven doesn't terminate.

As to why the forked execution doesn't terminate, it's because you
didn't spaw a new process independent of the original one.

To achieve this you will have to use a cmd and special options. You
will also have to be careful at what your executed process does with
stdin/stdout/stderr

I suggest you to read this:
http://forums.java.net/jive/thread.jspa?threadID=24837

Jerome

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to