A good approach to workaround the presence of third party libraries that
call System.exit is to set a SecurityManager that prevents calls to
System.exit. I did it a few times with good results.
You will have to allow well known libraries like Eclipse test runner or
Surefire itself

Just my 2 cents

Enrico

Il giorno mer 7 ott 2020 alle ore 09:50 Mukul Gandhi <gandhi.mu...@gmail.com>
ha scritto:

> Hi Tibor,
>
> On Wed, Sep 30, 2020 at 5:03 PM Tibor Digana <tibordig...@apache.org>
> wrote:
>
> > Usually these errors appear in the test itself or the *libraries*.
> > As for instance, we found out that a Spring's library is implementing
> Kafka
> > stuff calling the "Runtime.getRuntime().halt( <int> )".
> > The same bad thing is to call the "System.exit(<int>)".
> > I have recognized this situation after I saw a crashed test in your logs.
> > The test is supposed to be crashed if the execution breaks abruptly
> without
> > receiving a JUnit/TestNG event about finishing the test, see this log:
> >
> > *[ERROR] Crashed tests: [ERROR] com.haldiram.business.helper.t*
> > *est.SuspiciousActivityHelperTe**st*
> >
>
> Nowhere within my code (that's been tested by junit) and within my unit
> tests, I've used things like 'Runtime.getRuntime().halt' or 'System.exit'.
>
> The following within the logs that I've shared,
>
> (i.e *[ERROR] Crashed tests: [ERROR] com.haldiram.business.helper.t*
> *est.SuspiciousActivityHelperTe**st*)
>
> that you've cited, doesn't indicate any of the things like use
> of 'Runtime.getRuntime().halt' or 'System.exit'. For the information, the
> name 'SuspiciousActivityHelper' is a business name within my application,
> and is not anything related to technical suspicious aspects within my
> application or test codebases.
>
> The issues that I've discussed within this thread, still causes the same
> problems to me.
>
>
>
>
> --
> Regards,
> Mukul Gandhi
>

Reply via email to