New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a socket free SlimService. Remove all hassles with port conflicts and network setup #977
Conversation
this removes all hasles with port conflicts
and cleanup of code
I like it that you can use FitNesse without sockets. This will rule out a whole class of errors. Kudos! From the PR it was not clear to me how log messages on stdout and stderr mix with the Slim output. |
this.stdin = System.in; | ||
|
||
// bind System.stdout/System.stderr to original stderr | ||
System.setOut(new PrintStream(new LoggingOutputStream(this.stderr, "SOUT"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amolenaar
This redirects all messages send to stdout to stderr. So stdout is free. SLIM can send results without the SUT mixing in any log messages.
In line 58 in the "accept" method stdout is bound as communication channel for SLIM
public static final String SLIM_SSL = "SLIM_SSL"; | ||
public static final int SLIM_SLAVE_PORT = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't SLIM_STDOUT_PORT
a more descriptive name? It's odd to call it slave, where the child process is referred to as Slim service and Slim server.
I am trying to use the SocketFactory to also create the pipe-like socket. Expect a PR soon ;) |
Adding a socket free SlimService. Remove all hassles with port conflicts and network setup
Looks like the error message changed.
It's a Slim specific change, so it should be in the Slim package.
Use constants prefixing stdout/err in pipe communication mode.
…d html result extractor
Thanks. All merged. |
Adding a socket free SlimService. Remove all hassles with port conflicts and network setup
Awesome. I merged the PR. |
Port number 1 has now a special meaning: Don’t open a socket. Instead communicate via StdIn and StdOut. Nevertheless all output from the SUT is captured, tunneled via StdErr and added to the Execution Log.
This implementation is now the default behavior (= port number 1 is the default)
The change is fully backward compatible by specifying any other port number.
The Slim protocol number has been increased to 0.5
As there is no need to open a socket it now also easier to implement a Slim Server in other programming languages.
The socket functionality is still useful for distributed testing and should be preserved also in the future. Last but not least it is required for backward compatibility.