Note that there are some explanatory texts on larger screens.

plurals
  1. POCan I prevent application test with Java FEST from doing System.exit?
    text
    copied!<p>I try to test my application with FEST. Like in most other applications I have a <code>System.exit()</code> command in there. When I do nothing and run all tests, the test run is aborted when the <code>System.exit()</code> method is called for the first time.</p> <p>I searched and found something <a href="http://docs.codehaus.org/display/FEST/Handling+System.exit" rel="nofollow">here</a>. It seemed to be what I was looking for, but it leads to an unexpected behavior. When I call <code>System.exit()</code> I get an infinite loop in <code>System.exit()</code> which every time throws the <code>org.fest.swing.security.ExitException</code>. If I catch the exception the application is not closed and the test never ends.</p> <p>Does anyone have already used FEST like this?</p> <p>For additional information here the complete stacktrace:</p> <pre><code>Exception in thread "AWT-EventQueue-0" org.fest.swing.security.ExitException: Application tried to terminate current JVM with status 0 at org.fest.swing.security.NoExitSecurityManager.checkExit(NoExitSecurityManager.java:84) at java.lang.Runtime.exit(Unknown Source) at java.lang.System.exit(Unknown Source) at org.luciferius.banking.swingUi.internal.SwingUiBuilder$1.windowClosed(SwingUiBuilder.java:81) at java.awt.AWTEventMulticaster.windowClosed(Unknown Source) at java.awt.Window.processWindowEvent(Unknown Source) at javax.swing.JFrame.processWindowEvent(Unknown Source) at java.awt.Window.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$200(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) </code></pre> <p>Regards, Yggdrasil</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload