Yup, it makes sense to add "easy" exit code for the process.

Regards
JB


On 10/11/2017 05:14 PM, Christian Schneider wrote:
I found a hacky way to get the exit code. See
https://gist.github.com/cschneider/5bb61baa032e16c4492e5c6235648de7

It would be great if we the TestContainer could return the Process as this then allows to wait for it to exit or get the exit code.

Christian

2017-10-11 13:21 GMT+02:00 'Christoph Läubrich' via OPS4J <[email protected] <mailto:[email protected]>>:

    Hi,

    currently the process of starting a "remote-container" is very
    implementation-specific and requires special code.

    For Pax Exam 5 I'm currently reworking the handling of (Test-)Containers
    and will then provide a way for more reliable and generic run and use
    remote containers so this should then be possible.
    Also managing multiple-containers in one test-run is then possible.

    Beside this, there might be a ways to archive this with the current
    code-base but it really depends on your needs and use-case.

    If you have control over these Java-Processes you can for example define a
    Systemproperty that points to a file where the process writes the
    exit-code to instead, or produce a wrapper that does that for you.

    To see how it might work in Exam 5, you can take a look at the new Eclipse
    Container that has a similar concept where you can specify an option like
    this (pseudo code!):

    application().mustReturnWith(exit code 3).within(5 seconds)

    For forked containers I plan to haven then an Option like this:

    fork().returnCode(8)

    or simmilar so PaxExam can check this in the stop() method of the container.

    Am 10.10.2017 um 15:30 schrieb Christian Schneider:

        I looked thorugh the pax exam code and found that when the java
        process is created we do not retrieve the Process object. So I do not
        think we can evaluate the exit code. Is this observation correct?

        Christian

        2017-10-10 11:25 GMT+02:00 Christian Schneider
        <[email protected] <mailto:[email protected]>
        <mailto:[email protected] <mailto:[email protected]>>>:

            I would like to create and start one or more additional java
            processes. Sometimes I need to evaluate the exit code these return
            when exiting. How do I do this in exam?

            I start the external container like this:

            ExamSystem consumer = createTestSystem(myconfig());
            TestContainer consumerContainer = createContainer(consumer).start();

            Christian


            --     --     Christian Schneider
        http://www.liquid-reality.de
           
        
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de
        
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>>

            Computer Scientist
        http://www.adobe.com




-- -- Christian Schneider
        http://www.liquid-reality.de
        
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de
        
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>>

        Computer Scientist
        http://www.adobe.com

-- -- ------------------
        OPS4J - http://www.ops4j.org - [email protected]
        <mailto:[email protected]>

        ---
        You received this message because you are subscribed to the Google
        Groups "OPS4J" group.
        To unsubscribe from this group and stop receiving emails from it, send
        an email to [email protected]
        <mailto:ops4j%[email protected]>
        <mailto:[email protected]
        <mailto:ops4j%[email protected]>>.
        For more options, visit https://groups.google.com/d/optout
        <https://groups.google.com/d/optout>.


-- -- ------------------
    OPS4J - http://www.ops4j.org - [email protected]
    <mailto:[email protected]>

    --- You received this message because you are subscribed to the Google
    Groups "OPS4J" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to [email protected]
    <mailto:ops4j%[email protected]>.
    For more options, visit https://groups.google.com/d/optout
    <https://groups.google.com/d/optout>.




--
--
Christian Schneider
http://www.liquid-reality.de <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>

Computer Scientist
http://www.adobe.com

--
--
------------------
OPS4J - http://www.ops4j.org - [email protected]

---
You received this message because you are subscribed to the Google Groups "OPS4J" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

--
--
------------------
OPS4J - http://www.ops4j.org - [email protected]

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

Reply via email to