Nilhcem/FakeSMTP

when starting in background mode, the welcome banner should not be displayed

Opened this issue · 6 comments

when running the server in background mode, it would be necessary not to display the welcome banner to be able to run tests in a headless mode, e.g. on Jenkins.

I assume the welcome banner uses awt or swing, that will not be available in a server process.

Vest commented

I know this issue is very old. I do not know why I have decided to review it :) Ok, let me summarize:
The splash screen is displayed automatically by Java via MANIFEST.MF the help link.
I have honestly tested the snapshot (2.1) in Ubuntu Server (no GUI), and Java was quite smart, so it didn't throw any AWT exceptions. So, actually there is no bug, but...
If you execute the same server in Windows, you will see the splash screen. The problem is that (according to the help link above) the splash screen is closed when you display any AWT window, or click somewhere. Even if I hide the window via API:

/* main */
SplashScreen splash = SplashScreen.getSplashScreen();
if (splash != null) {
    splash.close();
}

I still see it for half a second.
We have several options for the issue:

On Windows 8, when I run FakeSMTP in background mode, the splash screen is displayed. Hovering it shows a loading mouse icon, the splash screen cannot be clicked away. Is this issue related?

image

Vest commented

@marcovtwout this is what I wrote above. Please check the links I have posted.
By default, the splash screen is always displayed, if it is specified in the manifest file. On my Windows 7, if I click on the background (desktop).

Not being able to dismiss the splash screen wasn't clear to me from the posts above. That's why I added my observation. ;)

Vest commented

If you have proposals how this should be implemented, I can try to prepare a pull request.
Currently the implementation requires less effort.

Pull request #47 closes the splash (as a minor secondary modification), same way that Vest mentions above. Yes after the change it still appears for a fraction of a second but as already mentioned, it's harmless. I think if it gets merged, this issue should be closed.