aboutsummaryrefslogtreecommitdiffstats
path: root/lib/jinterface/test/jitu.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2013-03-05 09:58:06 +0100
committerSiri Hansen <[email protected]>2013-03-05 09:58:06 +0100
commitfc6ce3f254fb231d157a765e1720612d0611baa2 (patch)
tree35f7f4281f12c806c5226ef273987e633cf88acb /lib/jinterface/test/jitu.erl
parent35030ae2cd6a6a6af4986f9f1ae8a98d76f43863 (diff)
downloadotp-fc6ce3f254fb231d157a765e1720612d0611baa2.tar.gz
otp-fc6ce3f254fb231d157a765e1720612d0611baa2.tar.bz2
otp-fc6ce3f254fb231d157a765e1720612d0611baa2.zip
[jinterface] Kill process between tests to avoid consequential error
In some cases when a test case fails, the erl_link_server process (which is spawned by many test cases in jinterface_SUITE) does not terminate. This causes the next test case to fail with a badarg as it tries to register a new process with the same name. To avoid this, erl_link_server, if it exists, is now killed in end_per_testcase. Also, some compiler warnings are removed from jitu.erl.
Diffstat (limited to 'lib/jinterface/test/jitu.erl')
-rw-r--r--lib/jinterface/test/jitu.erl14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/jinterface/test/jitu.erl b/lib/jinterface/test/jitu.erl
index 0de074a9c9..0e1af0ff22 100644
--- a/lib/jinterface/test/jitu.erl
+++ b/lib/jinterface/test/jitu.erl
@@ -48,7 +48,7 @@ java(Java, Dir, Class, Args, Props) ->
-init_all(Config) when list(Config) ->
+init_all(Config) when is_list(Config) ->
case find_executable(["java"]) of
false -> {skip,"Found no Java VM"};
Path -> [{java,Path}|Config]
@@ -69,13 +69,13 @@ find_executable([E|T]) ->
Path -> Path
end.
-to_string([H|T]) when integer(H) ->
+to_string([H|T]) when is_integer(H) ->
integer_to_list(H)++" "++to_string(T);
-to_string([H|T]) when atom(H) ->
+to_string([H|T]) when is_atom(H) ->
atom_to_list(H)++" "++to_string(T);
-to_string([H|T]) when pid(H) ->
+to_string([H|T]) when is_pid(H) ->
pid_to_list(H)++" "++to_string(T);
-to_string([H|T]) when list(H) ->
+to_string([H|T]) when is_list(H) ->
lists:flatten(H)++" "++to_string(T);
to_string([]) -> [].
@@ -109,12 +109,12 @@ cmd(Cmd) ->
PortOpts = [{line,80},eof,exit_status,stderr_to_stdout],
io:format("cmd: ~s~n", [Cmd]),
case catch open_port({spawn,Cmd}, PortOpts) of
- Port when port(Port) ->
+ Port when is_port(Port) ->
Result = cmd_loop(Port, []),
io:format("cmd res: ~w~n", [Result]),
case Result of
0 -> ok;
- ExitCode when integer(ExitCode) -> {error,ExitCode};
+ ExitCode when is_integer(ExitCode) -> {error,ExitCode};
Error -> Error
end;
{'EXIT',Reason} ->