diff options
Diffstat (limited to 'lib/jinterface/test')
20 files changed, 59 insertions, 39 deletions
| diff --git a/lib/jinterface/test/Makefile b/lib/jinterface/test/Makefile index 40abcd18a0..3eff11e4f7 100644 --- a/lib/jinterface/test/Makefile +++ b/lib/jinterface/test/Makefile @@ -1,7 +1,7 @@  #  # %CopyrightBegin%  # -# Copyright Ericsson AB 2004-2012. All Rights Reserved. +# Copyright Ericsson AB 2004-2016. All Rights Reserved.  #  # Licensed under the Apache License, Version 2.0 (the "License");  # you may not use this file except in compliance with the License. diff --git a/lib/jinterface/test/jinterface.spec b/lib/jinterface/test/jinterface.spec index b0d0fa9d8d..7c815d2b5b 100644 --- a/lib/jinterface/test/jinterface.spec +++ b/lib/jinterface/test/jinterface.spec @@ -2,7 +2,7 @@  %%  %% %CopyrightBegin%  %% -%% Copyright Ericsson AB 2006-2010. All Rights Reserved. +%% Copyright Ericsson AB 2006-2016. All Rights Reserved.  %%  %% Licensed under the Apache License, Version 2.0 (the "License");  %% you may not use this file except in compliance with the License. diff --git a/lib/jinterface/test/jinterface_SUITE.erl b/lib/jinterface/test/jinterface_SUITE.erl index 5c4618dcde..73851f47e0 100644 --- a/lib/jinterface/test/jinterface_SUITE.erl +++ b/lib/jinterface/test/jinterface_SUITE.erl @@ -1,7 +1,7 @@  %%  %% %CopyrightBegin%  %% -%% Copyright Ericsson AB 2004-2013. All Rights Reserved. +%% Copyright Ericsson AB 2004-2016. All Rights Reserved.  %%  %% Licensed under the Apache License, Version 2.0 (the "License");  %% you may not use this file except in compliance with the License. diff --git a/lib/jinterface/test/jinterface_SUITE_data/BooleanAtom.java b/lib/jinterface/test/jinterface_SUITE_data/BooleanAtom.java index 0d482f3fd2..849cfb1c72 100644 --- a/lib/jinterface/test/jinterface_SUITE_data/BooleanAtom.java +++ b/lib/jinterface/test/jinterface_SUITE_data/BooleanAtom.java @@ -1,7 +1,7 @@  /*   * %CopyrightBegin%   * - * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * Copyright Ericsson AB 2004-2016. All Rights Reserved.   *   * Licensed under the Apache License, Version 2.0 (the "License");   * you may not use this file except in compliance with the License. diff --git a/lib/jinterface/test/jinterface_SUITE_data/FunEquals.java b/lib/jinterface/test/jinterface_SUITE_data/FunEquals.java index e15ba30a52..3cb408994f 100644 --- a/lib/jinterface/test/jinterface_SUITE_data/FunEquals.java +++ b/lib/jinterface/test/jinterface_SUITE_data/FunEquals.java @@ -1,7 +1,7 @@  /*   * %CopyrightBegin%   * - * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * Copyright Ericsson AB 2004-2016. All Rights Reserved.   *   * Licensed under the Apache License, Version 2.0 (the "License");   * you may not use this file except in compliance with the License. diff --git a/lib/jinterface/test/jinterface_SUITE_data/GetNames.java b/lib/jinterface/test/jinterface_SUITE_data/GetNames.java index 87a27f71ab..a0b396947d 100644 --- a/lib/jinterface/test/jinterface_SUITE_data/GetNames.java +++ b/lib/jinterface/test/jinterface_SUITE_data/GetNames.java @@ -1,7 +1,7 @@  /*   * %CopyrightBegin%   * - * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * Copyright Ericsson AB 2004-2016. All Rights Reserved.   *   * Licensed under the Apache License, Version 2.0 (the "License");   * you may not use this file except in compliance with the License. diff --git a/lib/jinterface/test/jinterface_SUITE_data/Makefile.src b/lib/jinterface/test/jinterface_SUITE_data/Makefile.src index 94625da188..19c2157f7a 100644 --- a/lib/jinterface/test/jinterface_SUITE_data/Makefile.src +++ b/lib/jinterface/test/jinterface_SUITE_data/Makefile.src @@ -1,7 +1,7 @@  #  # %CopyrightBegin%  # -# Copyright Ericsson AB 2004-2010. All Rights Reserved. +# Copyright Ericsson AB 2004-2016. All Rights Reserved.  #  # Licensed under the Apache License, Version 2.0 (the "License");  # you may not use this file except in compliance with the License. diff --git a/lib/jinterface/test/jinterface_SUITE_data/Maps.java b/lib/jinterface/test/jinterface_SUITE_data/Maps.java index e31b476e02..e8a05245da 100644 --- a/lib/jinterface/test/jinterface_SUITE_data/Maps.java +++ b/lib/jinterface/test/jinterface_SUITE_data/Maps.java @@ -11,7 +11,7 @@ import com.ericsson.otp.erlang.OtpOutputStream;  /*   * %CopyrightBegin%   * - * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * Copyright Ericsson AB 2004-2016. All Rights Reserved.   *   * Licensed under the Apache License, Version 2.0 (the "License");   * you may not use this file except in compliance with the License. diff --git a/lib/jinterface/test/jinterface_SUITE_data/MboxLinkUnlink.java b/lib/jinterface/test/jinterface_SUITE_data/MboxLinkUnlink.java index 7042b6297d..8cb4aa2ed6 100644 --- a/lib/jinterface/test/jinterface_SUITE_data/MboxLinkUnlink.java +++ b/lib/jinterface/test/jinterface_SUITE_data/MboxLinkUnlink.java @@ -1,7 +1,7 @@  /*   * %CopyrightBegin%   * - * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * Copyright Ericsson AB 2004-2016. All Rights Reserved.   *   * Licensed under the Apache License, Version 2.0 (the "License");   * you may not use this file except in compliance with the License. diff --git a/lib/jinterface/test/jinterface_SUITE_data/MboxPing.java b/lib/jinterface/test/jinterface_SUITE_data/MboxPing.java index 13e2c8edc4..629fd49c93 100644 --- a/lib/jinterface/test/jinterface_SUITE_data/MboxPing.java +++ b/lib/jinterface/test/jinterface_SUITE_data/MboxPing.java @@ -1,7 +1,7 @@  /*   * %CopyrightBegin%   * - * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * Copyright Ericsson AB 2004-2016. All Rights Reserved.   *   * Licensed under the Apache License, Version 2.0 (the "License");   * you may not use this file except in compliance with the License. diff --git a/lib/jinterface/test/jinterface_SUITE_data/MboxSendReceive.java b/lib/jinterface/test/jinterface_SUITE_data/MboxSendReceive.java index 67ab6b13aa..8e25e0f8b5 100644 --- a/lib/jinterface/test/jinterface_SUITE_data/MboxSendReceive.java +++ b/lib/jinterface/test/jinterface_SUITE_data/MboxSendReceive.java @@ -1,7 +1,7 @@  /*   * %CopyrightBegin%   * - * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * Copyright Ericsson AB 2004-2016. All Rights Reserved.   *   * Licensed under the Apache License, Version 2.0 (the "License");   * you may not use this file except in compliance with the License. diff --git a/lib/jinterface/test/jinterface_SUITE_data/NodePing.java b/lib/jinterface/test/jinterface_SUITE_data/NodePing.java index 5938f2b335..fe5592ef7e 100644 --- a/lib/jinterface/test/jinterface_SUITE_data/NodePing.java +++ b/lib/jinterface/test/jinterface_SUITE_data/NodePing.java @@ -1,7 +1,7 @@  /*   * %CopyrightBegin%   * - * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * Copyright Ericsson AB 2004-2016. All Rights Reserved.   *   * Licensed under the Apache License, Version 2.0 (the "License");   * you may not use this file except in compliance with the License. diff --git a/lib/jinterface/test/jinterface_SUITE_data/NodeStatusHandler.java b/lib/jinterface/test/jinterface_SUITE_data/NodeStatusHandler.java index bb21fa85ad..f27a49ce81 100644 --- a/lib/jinterface/test/jinterface_SUITE_data/NodeStatusHandler.java +++ b/lib/jinterface/test/jinterface_SUITE_data/NodeStatusHandler.java @@ -1,7 +1,7 @@  /*   * %CopyrightBegin%   * - * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * Copyright Ericsson AB 2004-2016. All Rights Reserved.   *   * Licensed under the Apache License, Version 2.0 (the "License");   * you may not use this file except in compliance with the License. diff --git a/lib/jinterface/test/jinterface_SUITE_data/Nodename.java b/lib/jinterface/test/jinterface_SUITE_data/Nodename.java index 770431a414..2a236b4bad 100644 --- a/lib/jinterface/test/jinterface_SUITE_data/Nodename.java +++ b/lib/jinterface/test/jinterface_SUITE_data/Nodename.java @@ -1,7 +1,7 @@  /*   * %CopyrightBegin%   * - * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * Copyright Ericsson AB 2004-2016. All Rights Reserved.   *   * Licensed under the Apache License, Version 2.0 (the "License");   * you may not use this file except in compliance with the License. diff --git a/lib/jinterface/test/jinterface_SUITE_data/RegisterAndWhereis.java b/lib/jinterface/test/jinterface_SUITE_data/RegisterAndWhereis.java index 3612460cce..18c865fada 100644 --- a/lib/jinterface/test/jinterface_SUITE_data/RegisterAndWhereis.java +++ b/lib/jinterface/test/jinterface_SUITE_data/RegisterAndWhereis.java @@ -1,7 +1,7 @@  /*   * %CopyrightBegin%   * - * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * Copyright Ericsson AB 2004-2016. All Rights Reserved.   *   * Licensed under the Apache License, Version 2.0 (the "License");   * you may not use this file except in compliance with the License. diff --git a/lib/jinterface/test/jitu.erl b/lib/jinterface/test/jitu.erl index adcadac85e..961130585a 100644 --- a/lib/jinterface/test/jitu.erl +++ b/lib/jinterface/test/jitu.erl @@ -1,7 +1,7 @@  %%  %% %CopyrightBegin%  %% -%% Copyright Ericsson AB 2004-2014. All Rights Reserved. +%% Copyright Ericsson AB 2004-2016. All Rights Reserved.  %%  %% Licensed under the Apache License, Version 2.0 (the "License");  %% you may not use this file except in compliance with the License. diff --git a/lib/jinterface/test/nc_SUITE.erl b/lib/jinterface/test/nc_SUITE.erl index 9910334749..81944f71d4 100644 --- a/lib/jinterface/test/nc_SUITE.erl +++ b/lib/jinterface/test/nc_SUITE.erl @@ -1,7 +1,7 @@  %%  %% %CopyrightBegin%  %% -%% Copyright Ericsson AB 2004-2013. All Rights Reserved. +%% Copyright Ericsson AB 2004-2016. All Rights Reserved.  %%  %% Licensed under the Apache License, Version 2.0 (the "License");  %% you may not use this file except in compliance with the License. @@ -31,6 +31,10 @@  -define(NEW_REFERENCE_EXT,   114).  -define(ATOM_UTF8_EXT,       118).  -define(SMALL_ATOM_UTF8_EXT, 119). +-define(NEW_PID_EXT,         $X). +-define(NEW_PORT_EXT,        $Y). +-define(NEWER_REFERENCE_EXT, $Z). +  -export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,  	 init_per_suite/1, @@ -123,12 +127,13 @@ pid_roundtrip(doc) -> [];  pid_roundtrip(suite) -> [];  pid_roundtrip(Config) when is_list(Config)->      ThisNode = {node(), erlang:system_info(creation)}, -    RemNode = {gurka@sallad, 2}, +    RemPids = [mk_pid({gurka@sallad, Cr}, Num, Ser) +	       || Cr <- [1,2,3,4,16#adec0ded], +		  {Num, Ser} <- [{4711,4711},{32767, 8191}]],      do_echo([self(),  	     mk_pid(ThisNode, 4711, 4711), -	     mk_pid(ThisNode, 32767, 8191), -	     mk_pid(RemNode, 4711, 4711), -	     mk_pid(RemNode, 32767, 8191)], +	     mk_pid(ThisNode, 32767, 8191) +	     | RemPids],  	    Config).  fun_roundtrip(doc) -> []; @@ -144,26 +149,29 @@ port_roundtrip(doc) -> [];  port_roundtrip(suite) -> [];  port_roundtrip(Config) when is_list(Config)->      ThisNode = {node(), erlang:system_info(creation)}, -    RemNode = {gurka@sallad, 2}, +    RemPorts = [mk_port({gurka@sallad, Cr}, Num) +		|| Cr <- [1,2,3,4,16#adec0ded], +		   Num <- [4711, 268435455]],      do_echo([hd(erlang:ports()),  	     mk_port(ThisNode, 4711), -	     mk_port(ThisNode, 268435455), -	     mk_port(RemNode, 4711), -	     mk_port(RemNode, 268435455)], +	     mk_port(ThisNode, 268435455) +	     | RemPorts],  	    Config).  ref_roundtrip(doc) -> [];  ref_roundtrip(suite) -> [];  ref_roundtrip(Config) when is_list(Config)->      ThisNode = {node(), erlang:system_info(creation)}, -    RemNode = {gurka@sallad, 2}, +    RemRefs = [mk_ref({gurka@sallad, Cr}, Words) +	       || Cr <- [1,2,3,4,16#adec0ded], +		  Words <- [[4711], +			    [4711, 4711, 4711], +			    [262143, 4294967295, 4294967295]]],      do_echo([make_ref(),  	     mk_ref(ThisNode, [4711]),  	     mk_ref(ThisNode, [4711, 4711, 4711]), -	     mk_ref(ThisNode, [262143, 4294967295, 4294967295]), -	     mk_ref(RemNode, [4711]), -	     mk_ref(RemNode, [4711, 4711, 4711]), -	     mk_ref(RemNode, [262143, 4294967295, 4294967295])], +	     mk_ref(ThisNode, [262143, 4294967295, 4294967295]) +	     | RemRefs],  	    Config).  new_float(doc) -> []; @@ -759,17 +767,22 @@ uint8(Uint) ->      exit({badarg, uint8, [Uint]}). +pid_tag(Creation) when Creation =< 3 -> ?PID_EXT; +pid_tag(_Creation) -> ?NEW_PID_EXT. + +enc_creation(Creation) when Creation =< 3 -> uint8(Creation); +enc_creation(Creation) -> uint32_be(Creation).  mk_pid({NodeName, Creation}, Number, Serial) when is_atom(NodeName) ->      <<?VERSION_MAGIC, NodeNameExt/binary>> = term_to_binary(NodeName),      mk_pid({NodeNameExt, Creation}, Number, Serial);  mk_pid({NodeNameExt, Creation}, Number, Serial) ->      case catch binary_to_term(list_to_binary([?VERSION_MAGIC, -					      ?PID_EXT, +					      pid_tag(Creation),  					      NodeNameExt,  					      uint32_be(Number),  					      uint32_be(Serial), -					      uint8(Creation)])) of +					      enc_creation(Creation)])) of  	Pid when is_pid(Pid) ->  	    Pid;  	{'EXIT', {badarg, _}} -> @@ -778,15 +791,18 @@ mk_pid({NodeNameExt, Creation}, Number, Serial) ->  	    exit({unexpected_binary_to_term_result, Other})      end. +port_tag(Creation) when Creation =< 3 -> ?PORT_EXT; +port_tag(_Creation) -> ?NEW_PORT_EXT. +  mk_port({NodeName, Creation}, Number) when is_atom(NodeName) ->      <<?VERSION_MAGIC, NodeNameExt/binary>> = term_to_binary(NodeName),      mk_port({NodeNameExt, Creation}, Number);  mk_port({NodeNameExt, Creation}, Number) ->      case catch binary_to_term(list_to_binary([?VERSION_MAGIC, -					      ?PORT_EXT, +					      port_tag(Creation),  					      NodeNameExt,  					      uint32_be(Number), -					      uint8(Creation)])) of +					      enc_creation(Creation)])) of  	Port when is_port(Port) ->  	    Port;  	{'EXIT', {badarg, _}} -> @@ -795,12 +811,16 @@ mk_port({NodeNameExt, Creation}, Number) ->  	    exit({unexpected_binary_to_term_result, Other})      end. +ref_tag(Creation) when Creation =< 3 -> ?NEW_REFERENCE_EXT; +ref_tag(_Creation) -> ?NEWER_REFERENCE_EXT. +  mk_ref({NodeName, Creation}, [Number] = NL) when is_atom(NodeName),  						 is_integer(Creation),  						 is_integer(Number) ->      <<?VERSION_MAGIC, NodeNameExt/binary>> = term_to_binary(NodeName),      mk_ref({NodeNameExt, Creation}, NL);  mk_ref({NodeNameExt, Creation}, [Number]) when is_integer(Creation), +					       Creation =< 3,  					       is_integer(Number) ->      case catch binary_to_term(list_to_binary([?VERSION_MAGIC,  					      ?REFERENCE_EXT, @@ -822,10 +842,10 @@ mk_ref({NodeName, Creation}, Numbers) when is_atom(NodeName),  mk_ref({NodeNameExt, Creation}, Numbers) when is_integer(Creation),  					      is_list(Numbers) ->      case catch binary_to_term(list_to_binary([?VERSION_MAGIC, -					      ?NEW_REFERENCE_EXT, +					      ref_tag(Creation),  					      uint16_be(length(Numbers)),  					      NodeNameExt, -					      uint8(Creation), +					      enc_creation(Creation),  					      lists:map(fun (N) ->  								uint32_be(N)  							end, diff --git a/lib/jinterface/test/nc_SUITE_data/Makefile.src b/lib/jinterface/test/nc_SUITE_data/Makefile.src index 3d02389df8..94e2c1fa47 100644 --- a/lib/jinterface/test/nc_SUITE_data/Makefile.src +++ b/lib/jinterface/test/nc_SUITE_data/Makefile.src @@ -1,7 +1,7 @@  #  # %CopyrightBegin%  # -# Copyright Ericsson AB 2004-2010. All Rights Reserved. +# Copyright Ericsson AB 2004-2016. All Rights Reserved.  #  # Licensed under the Apache License, Version 2.0 (the "License");  # you may not use this file except in compliance with the License. diff --git a/lib/jinterface/test/nc_SUITE_data/connection_server.java b/lib/jinterface/test/nc_SUITE_data/connection_server.java index 36c5074031..97273f5306 100644 --- a/lib/jinterface/test/nc_SUITE_data/connection_server.java +++ b/lib/jinterface/test/nc_SUITE_data/connection_server.java @@ -1,7 +1,7 @@  /*   * %CopyrightBegin%   * - * Copyright Ericsson AB 2004-2010. All Rights Reserved. + * Copyright Ericsson AB 2004-2016. All Rights Reserved.   *   * Licensed under the Apache License, Version 2.0 (the "License");   * you may not use this file except in compliance with the License. diff --git a/lib/jinterface/test/nc_SUITE_data/echo_server.java b/lib/jinterface/test/nc_SUITE_data/echo_server.java index 4caf0dedde..49846a6972 100644 --- a/lib/jinterface/test/nc_SUITE_data/echo_server.java +++ b/lib/jinterface/test/nc_SUITE_data/echo_server.java @@ -1,7 +1,7 @@  /*   * %CopyrightBegin%   * - * Copyright Ericsson AB 2004-2012. All Rights Reserved. + * Copyright Ericsson AB 2004-2016. All Rights Reserved.   *   * Licensed under the Apache License, Version 2.0 (the "License");   * you may not use this file except in compliance with the License. | 
