Test with internally called server
In order to support automated tests, one may also start an internal server. The procedure is the same as described above, except, that the server need not to be started and the TestHTTP.osh script looks a bit different (see example below).
Moreover, the OShell.ini file needs slight modifications. The Allow and Authentication option from the server.ini file have to be moved to OShell.ini (see below).
A Server.ini file with an OHTTPServer section has to be provided at location defined in OHTTP.ServerIni. The Port number defined in OHTTP.Port has to be passed also to OHTTPExecute() function.
// TestHTTP.osh for internal server start (run with OShell)
set OHTTP.Port=8888
set OHTTP.ServerIni=Server.ini
cd Sample
osi 'dictionary.loadOSILibraries'
osi begin
HTTPGlobal::Start();
Option("HTTP.timeout").assign("300");
OHTTPExecute("Test.txt",%OHTTP.Port%);
HTTPGlobal::Stop();
end
q
// Modified section in OShell.ini
...
[OShell]
DSC_Language=English
ALLOW=all
Authentication=basic;Person::Login
...