~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to lib/orber/test/iiop_module_test_impl.erl

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%%
 
2
%% %CopyrightBegin%
 
3
%% 
 
4
%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
 
5
%% 
 
6
%% The contents of this file are subject to the Erlang Public License,
 
7
%% Version 1.1, (the "License"); you may not use this file except in
 
8
%% compliance with the License. You should have received a copy of the
 
9
%% Erlang Public License along with this software. If not, it can be
 
10
%% retrieved online at http://www.erlang.org/.
 
11
%% 
 
12
%% Software distributed under the License is distributed on an "AS IS"
 
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 
14
%% the License for the specific language governing rights and limitations
 
15
%% under the License.
 
16
%% 
 
17
%% %CopyrightEnd%
 
18
%%
 
19
%%
 
20
 
 
21
-module(iiop_module_test_impl).
 
22
-include_lib("orber/include/corba.hrl").
 
23
-include("idl_output/iiop_module.hrl").
 
24
 
 
25
 
 
26
-export([send_void/1, send_short/3, send_ushort/3]).
 
27
-export([send_long/3, send_ulong/3, send_float/3]).
 
28
-export([send_double/3, send_boolean/3, send_char/3]).
 
29
-export([send_octet/3, send_any/3, send_object/3]).
 
30
-export([send_struct1/3, send_union1/3, send_enum1/3]).
 
31
-export([send_string/3, send_sequence1/3, send_array1/3]).
 
32
-export([ret_systemexception/1, ret_userexception/1]).
 
33
 
 
34
 
 
35
 
 
36
-export([start/0, stop/0]).
 
37
-export([init/1, terminate/2]).
 
38
 
 
39
 
 
40
init(_) ->
 
41
    {ok, []}.
 
42
 
 
43
terminate(Reason, _State) ->
 
44
    io:format("~p terminating with reason ~p~n", [?MODULE, Reason]),
 
45
    ok.
 
46
 
 
47
 
 
48
start() ->
 
49
    SFok = corba:create('iiop_module_test', "IDL:iiop_module/test:1.0"),
 
50
    NS = corba:resolve_initial_references("NameService"),
 
51
    NC1 = lname_component:set_id(lname_component:create(), "iiop_test"),
 
52
    NC2 = lname_component:set_id(lname_component:create(), "erl_test"),
 
53
    N = lname:insert_component(lname:create(), 1, NC1),
 
54
    N1 = lname:insert_component(N, 2, NC2),
 
55
    'CosNaming_NamingContext':bind(NS, N1, SFok),
 
56
    SFok.
 
57
 
 
58
stop() ->
 
59
    NS = corba:resolve_initial_references("NameService"),
 
60
    NC1 = lname_component:set_id(lname_component:create(), "iiop_test"),
 
61
    NC2 = lname_component:set_id(lname_component:create(), "erl_test"),
 
62
    N = lname:insert_component(lname:create(), 1, NC1),
 
63
    N1 = lname:insert_component(N, 2, NC2),
 
64
    'CosNaming_NamingContext':unbind(NS, N1).
 
65
 
 
66
 
 
67
 
 
68
send_void(S) ->
 
69
    {ok, S}.
 
70
 
 
71
send_short(S, P1, P2) ->
 
72
    {{P1, P1, P2}, S}.
 
73
 
 
74
send_ushort(S, P1, P2) ->
 
75
    {{P1, P1, P2}, S}.
 
76
 
 
77
send_long(S, P1, P2) ->
 
78
    {{P1, P1, P2}, S}.
 
79
 
 
80
send_ulong(S, P1, P2) ->
 
81
    {{P1, P1, P2}, S}.
 
82
 
 
83
send_float(S, P1, P2) ->
 
84
    {{P1, P1, P2}, S}.
 
85
 
 
86
send_double(S, P1, P2) ->
 
87
    {{P1, P1, P2}, S}.
 
88
 
 
89
send_boolean(S, P1, P2) ->
 
90
    {{P1, P1, P2}, S}.
 
91
 
 
92
send_char(S, P1, P2) ->
 
93
    {{P1, P1, P2}, S}.
 
94
 
 
95
send_octet(S, P1, P2) ->
 
96
    {{P1, P1, P2}, S}.
 
97
 
 
98
send_any(S, P1, P2) ->
 
99
    {{P1, P1, P2}, S}.
 
100
 
 
101
send_object(S, P1, P2) ->
 
102
    {{P1, P1, P2}, S}.
 
103
 
 
104
send_struct1(S, P1, P2) ->
 
105
    {{P1, P1, P2}, S}.
 
106
 
 
107
send_union1(S, P1, P2) ->
 
108
    {{P1, P1, P2}, S}.
 
109
 
 
110
send_enum1(S, P1, P2) ->
 
111
    {{P1, P1, P2}, S}.
 
112
 
 
113
send_string(S, P1, P2) ->
 
114
    {{P1, P1, P2}, S}.
 
115
 
 
116
send_sequence1(S, P1, P2) ->
 
117
    {{P1, P1, P2}, S}.
 
118
 
 
119
send_array1(S, P1, P2) ->
 
120
    {{P1, P1, P2}, S}.
 
121
 
 
122
ret_systemexception(S) ->
 
123
    throw(#'BAD_PARAM'{}),
 
124
    {ok, S}.
 
125
 
 
126
ret_userexception(S) ->
 
127
    throw(#iiop_module_Except1{why="not readable",rest_of_name=["foo", "bar"]}),
 
128
    {ok, S}.