1: %%-----------------------------------------------------------------
    2: %%
    3: %% %CopyrightBegin%
    4: %% 
    5: %% Copyright Ericsson AB 2004-2011. All Rights Reserved.
    6: %% 
    7: %% The contents of this file are subject to the Erlang Public License,
    8: %% Version 1.1, (the "License"); you may not use this file except in
    9: %% compliance with the License. You should have received a copy of the
   10: %% Erlang Public License along with this software. If not, it can be
   11: %% retrieved online at http://www.erlang.org/.
   12: %% 
   13: %% Software distributed under the License is distributed on an "AS IS"
   14: %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
   15: %% the License for the specific language governing rights and limitations
   16: %% under the License.
   17: %% 
   18: %% %CopyrightEnd%
   19: %%
   20: %%
   21: %%-----------------------------------------------------------------
   22: %% File    : generated_SUITE.erl
   23: %% Purpose : 
   24: %%-----------------------------------------------------------------
   25: 
   26: -module(generated_SUITE).
   27: 
   28: -include_lib("test_server/include/test_server.hrl").
   29: -include_lib("orber/include/corba.hrl").
   30: 
   31: -define(default_timeout, ?t:minutes(3)).
   32: 
   33: -define(match(ExpectedRes, Expr),
   34:         fun() ->
   35: 		AcTuAlReS = (catch (Expr)),
   36: 		case AcTuAlReS of
   37: 		    ExpectedRes ->
   38: 			AcTuAlReS;
   39: 		    _ ->
   40: 			io:format("###### ERROR ERROR ######~n~p~n",
   41: 				  [AcTuAlReS]),
   42: 			?line exit(AcTuAlReS)
   43: 		end
   44: 	end()).
   45: 
   46: -define(nomatch(Not, Expr),
   47:         fun() ->
   48: 		AcTuAlReS = (catch (Expr)),
   49: 		case AcTuAlReS of
   50: 		    Not ->
   51: 			io:format("###### ERROR ERROR ######~n~p~n",
   52: 				  [AcTuAlReS]),
   53: 			?line exit(AcTuAlReS);
   54: 		    _ ->
   55: 			AcTuAlReS
   56: 		end
   57: 	end()).
   58: 
   59: 
   60: -define(checktc(_Op),
   61:         fun(TC) ->
   62: 		case orber_tc:check_tc(TC) of
   63: 		    false ->
   64: 			io:format("###### ERROR ERROR ######~n~p - ~p~n", [Op, TC]),
   65: 			?line exit(TC);
   66: 		    true ->
   67: 			true
   68: 		end
   69: 	end).
   70: 
   71: %%-----------------------------------------------------------------
   72: %% External exports
   73: %%-----------------------------------------------------------------
   74: -export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, 
   75: 	 init_per_group/2,end_per_group/2]).
   76: 
   77: %%-----------------------------------------------------------------
   78: %% Internal exports
   79: %%-----------------------------------------------------------------
   80: -export([]).
   81: -compile(export_all).
   82: 
   83: %%-----------------------------------------------------------------
   84: %% Func: all/1
   85: %% Args: 
   86: %% Returns: 
   87: %%-----------------------------------------------------------------
   88: suite() -> [{ct_hooks,[ts_install_cth]}].
   89: 
   90: all() -> 
   91:     ['OrberApp_IFR', erlang_binary, erlang_pid, erlang_port,
   92:      erlang_ref, 'CosNaming_Binding',
   93:      'CosNaming_BindingList', 'CosNaming_Name',
   94:      'CosNaming_NameComponent',
   95:      'CosNaming_NamingContextExt_InvalidAddress',
   96:      'CosNaming_NamingContext_AlreadyBound',
   97:      'CosNaming_NamingContext_CannotProceed',
   98:      'CosNaming_NamingContext_InvalidName',
   99:      'CosNaming_NamingContext_NotEmpty',
  100:      'CosNaming_NamingContext_NotFound',
  101:      'CosNaming_BindingIterator', 'CosNaming_NamingContext',
  102:      'CosNaming_NamingContextExt'].
  103: 
  104: groups() -> 
  105:     [].
  106: 
  107: init_per_suite(Config) ->
  108:     Config.
  109: 
  110: end_per_suite(_Config) ->
  111:     ok.
  112: 
  113: init_per_group(_GroupName, Config) ->
  114:     Config.
  115: 
  116: end_per_group(_GroupName, Config) ->
  117:     Config.
  118: 
  119: 
  120: %%-----------------------------------------------------------------
  121: %% Init and cleanup functions.
  122: %%-----------------------------------------------------------------
  123: init_per_testcase(_Case, Config) ->
  124:     ?line Dog=test_server:timetrap(?default_timeout),
  125:     [{watchdog, Dog}|Config].
  126: 
  127: 
  128: end_per_testcase(_Case, Config) ->
  129:     Dog = ?config(watchdog, Config),
  130:     test_server:timetrap_cancel(Dog),
  131:     ok.
  132: 
  133: %%-----------------------------------------------------------------
  134: %% Test Case:'OrberApp_IFR'
  135: %% Description: 
  136: %%-----------------------------------------------------------------
  137: 'OrberApp_IFR'(doc) -> [""];
  138: 'OrberApp_IFR'(suite) -> [];
  139: 'OrberApp_IFR'(_) ->
  140:     ?nomatch(undefined, 'OrberApp_IFR':oe_tc(get_absolute_name)),
  141:     ?nomatch(undefined, 'OrberApp_IFR':oe_tc(get_user_exception_type)),
  142:     ?match(undefined, 'OrberApp_IFR':oe_tc(undefined)),
  143:     ?match([_|_], 'OrberApp_IFR':oe_get_interface()),
  144:     ?match("IDL:OrberApp/IFR:1.0", 'OrberApp_IFR':typeID()),
  145:     check_tc('OrberApp_IFR':oe_get_interface()),
  146:     ?match(true, 'OrberApp_IFR':oe_is_a('OrberApp_IFR':typeID())),
  147:     ?match(false, 'OrberApp_IFR':oe_is_a("wrong")),
  148:     ok.
  149: 
  150: 
  151: %%-----------------------------------------------------------------
  152: %% Test Case: erlang_binary
  153: %% Description: 
  154: %%-----------------------------------------------------------------
  155: erlang_binary(doc) -> [""];
  156: erlang_binary(suite) -> [];
  157: erlang_binary(_) ->
  158:     ?match(true, orber_tc:check_tc(erlang_binary:tc())),
  159:     ?match("IDL:erlang/binary:1.0", erlang_binary:id()),
  160:     ?match("erlang_binary", erlang_binary:name()),
  161:     ok.
  162: 
  163: %%-----------------------------------------------------------------
  164: %% Test Case: erlang_pid
  165: %% Description: 
  166: %%-----------------------------------------------------------------
  167: erlang_pid(doc) -> [""];
  168: erlang_pid(suite) -> [];
  169: erlang_pid(_) ->
  170:     ?match(true, orber_tc:check_tc(erlang_pid:tc())),
  171:     ?match("IDL:erlang/pid:1.0", erlang_pid:id()),
  172:     ?match("erlang_pid", erlang_pid:name()),
  173:     ok.
  174: 
  175: %%-----------------------------------------------------------------
  176: %% Test Case: erlang_port
  177: %% Description: 
  178: %%-----------------------------------------------------------------
  179: erlang_port(doc) -> [""];
  180: erlang_port(suite) -> [];
  181: erlang_port(_) ->
  182:     ?match(true, orber_tc:check_tc(erlang_port:tc())),
  183:     ?match("IDL:erlang/port:1.0", erlang_port:id()),
  184:     ?match("erlang_port", erlang_port:name()),
  185:     ok.
  186: 
  187: %%-----------------------------------------------------------------
  188: %% Test Case: erlang_ref
  189: %% Description: 
  190: %%-----------------------------------------------------------------
  191: erlang_ref(doc) -> [""];
  192: erlang_ref(suite) -> [];
  193: erlang_ref(_) ->
  194:     ?match(true, orber_tc:check_tc(erlang_ref:tc())),
  195:     ?match("IDL:erlang/ref:1.0", erlang_ref:id()),
  196:     ?match("erlang_ref", erlang_ref:name()),
  197:     ok.
  198: 
  199: %%-----------------------------------------------------------------
  200: %% Test Case: 'CosNaming_Binding'
  201: %% Description: 
  202: %%-----------------------------------------------------------------
  203: 'CosNaming_Binding'(doc) -> [""];
  204: 'CosNaming_Binding'(suite) -> [];
  205: 'CosNaming_Binding'(_) ->
  206:     ?match(true, orber_tc:check_tc('CosNaming_Binding':tc())),
  207:     ?match("IDL:omg.org/CosNaming/Binding:1.0", 'CosNaming_Binding':id()),
  208:     ?match("CosNaming_Binding", 'CosNaming_Binding':name()),
  209:     ok.
  210: 
  211: %%-----------------------------------------------------------------
  212: %% Test Case: 'CosNaming_BindingList'
  213: %% Description: 
  214: %%-----------------------------------------------------------------
  215: 'CosNaming_BindingList'(doc) -> [""];
  216: 'CosNaming_BindingList'(suite) -> [];
  217: 'CosNaming_BindingList'(_) ->
  218:     ?match(true, orber_tc:check_tc('CosNaming_BindingList':tc())),
  219:     ?match("IDL:omg.org/CosNaming/BindingList:1.0", 'CosNaming_BindingList':id()),
  220:     ?match("CosNaming_BindingList", 'CosNaming_BindingList':name()),
  221:     ok.
  222: 
  223: %%-----------------------------------------------------------------
  224: %% Test Case: 'CosNaming_Name'
  225: %% Description: 
  226: %%-----------------------------------------------------------------
  227: 'CosNaming_Name'(doc) -> [""];
  228: 'CosNaming_Name'(suite) -> [];
  229: 'CosNaming_Name'(_) ->
  230:     ?match(true, orber_tc:check_tc('CosNaming_Name':tc())),
  231:     ?match("IDL:omg.org/CosNaming/Name:1.0", 'CosNaming_Name':id()),
  232:     ?match("CosNaming_Name", 'CosNaming_Name':name()),
  233:     ok.
  234: 
  235: %%-----------------------------------------------------------------
  236: %% Test Case: 'CosNaming_NameComponent'
  237: %% Description: 
  238: %%-----------------------------------------------------------------
  239: 'CosNaming_NameComponent'(doc) -> [""];
  240: 'CosNaming_NameComponent'(suite) -> [];
  241: 'CosNaming_NameComponent'(_) ->
  242:     ?match(true, orber_tc:check_tc('CosNaming_NameComponent':tc())),
  243:     ?match("IDL:omg.org/CosNaming/NameComponent:1.0", 'CosNaming_NameComponent':id()),
  244:     ?match("CosNaming_NameComponent", 'CosNaming_NameComponent':name()),
  245:     ok.
  246: 
  247: %%-----------------------------------------------------------------
  248: %% Test Case: 'CosNaming_NamingContextExt_InvalidAddress'
  249: %% Description: 
  250: %%-----------------------------------------------------------------
  251: 'CosNaming_NamingContextExt_InvalidAddress'(doc) -> [""];
  252: 'CosNaming_NamingContextExt_InvalidAddress'(suite) -> [];
  253: 'CosNaming_NamingContextExt_InvalidAddress'(_) ->
  254:     ?match(true, orber_tc:check_tc('CosNaming_NamingContextExt_InvalidAddress':tc())),
  255:     ?match("IDL:omg.org/CosNaming/NamingContextExt/InvalidAddress:1.0", 'CosNaming_NamingContextExt_InvalidAddress':id()),
  256:     ?match("CosNaming_NamingContextExt_InvalidAddress", 'CosNaming_NamingContextExt_InvalidAddress':name()),
  257:     ok.
  258: 
  259: %%-----------------------------------------------------------------
  260: %% Test Case: 'CosNaming_NamingContext_AlreadyBound'
  261: %% Description: 
  262: %%-----------------------------------------------------------------
  263: 'CosNaming_NamingContext_AlreadyBound'(doc) -> [""];
  264: 'CosNaming_NamingContext_AlreadyBound'(suite) -> [];
  265: 'CosNaming_NamingContext_AlreadyBound'(_) ->
  266:     ?match(true, orber_tc:check_tc('CosNaming_NamingContext_AlreadyBound':tc())),
  267:     ?match("IDL:omg.org/CosNaming/NamingContext/AlreadyBound:1.0", 'CosNaming_NamingContext_AlreadyBound':id()),
  268:     ?match("CosNaming_NamingContext_AlreadyBound", 'CosNaming_NamingContext_AlreadyBound':name()),
  269:     ok.
  270: 
  271: %%-----------------------------------------------------------------
  272: %% Test Case: 'CosNaming_NamingContext_CannotProceed'
  273: %% Description: 
  274: %%-----------------------------------------------------------------
  275: 'CosNaming_NamingContext_CannotProceed'(doc) -> [""];
  276: 'CosNaming_NamingContext_CannotProceed'(suite) -> [];
  277: 'CosNaming_NamingContext_CannotProceed'(_) ->
  278:     ?match(true, orber_tc:check_tc('CosNaming_NamingContext_CannotProceed':tc())),
  279:     ?match("IDL:omg.org/CosNaming/NamingContext/CannotProceed:1.0", 'CosNaming_NamingContext_CannotProceed':id()),
  280:     ?match("CosNaming_NamingContext_CannotProceed", 'CosNaming_NamingContext_CannotProceed':name()),
  281:     ok.
  282: 
  283: %%-----------------------------------------------------------------
  284: %% Test Case: 'CosNaming_NamingContext_InvalidName'
  285: %% Description: 
  286: %%-----------------------------------------------------------------
  287: 'CosNaming_NamingContext_InvalidName'(doc) -> [""];
  288: 'CosNaming_NamingContext_InvalidName'(suite) -> [];
  289: 'CosNaming_NamingContext_InvalidName'(_) ->
  290:     ?match(true, orber_tc:check_tc('CosNaming_NamingContext_InvalidName':tc())),
  291:     ?match("IDL:omg.org/CosNaming/NamingContext/InvalidName:1.0", 'CosNaming_NamingContext_InvalidName':id()),
  292:     ?match("CosNaming_NamingContext_InvalidName", 'CosNaming_NamingContext_InvalidName':name()),
  293:     ok.
  294: 
  295: %%-----------------------------------------------------------------
  296: %% Test Case: 'CosNaming_NamingContext_NotEmpty'
  297: %% Description: 
  298: %%-----------------------------------------------------------------
  299: 'CosNaming_NamingContext_NotEmpty'(doc) -> [""];
  300: 'CosNaming_NamingContext_NotEmpty'(suite) -> [];
  301: 'CosNaming_NamingContext_NotEmpty'(_) ->
  302:     ?match(true, orber_tc:check_tc('CosNaming_NamingContext_NotEmpty':tc())),
  303:     ?match("IDL:omg.org/CosNaming/NamingContext/NotEmpty:1.0", 'CosNaming_NamingContext_NotEmpty':id()),
  304:     ?match("CosNaming_NamingContext_NotEmpty", 'CosNaming_NamingContext_NotEmpty':name()),
  305:     ok.
  306: 
  307: %%-----------------------------------------------------------------
  308: %% Test Case: 'CosNaming_NamingContext_NotFound'
  309: %% Description: 
  310: %%-----------------------------------------------------------------
  311: 'CosNaming_NamingContext_NotFound'(doc) -> [""];
  312: 'CosNaming_NamingContext_NotFound'(suite) -> [];
  313: 'CosNaming_NamingContext_NotFound'(_) ->
  314:     ?match(true, orber_tc:check_tc('CosNaming_NamingContext_NotFound':tc())),
  315:     ?match("IDL:omg.org/CosNaming/NamingContext/NotFound:1.0", 'CosNaming_NamingContext_NotFound':id()),
  316:     ?match("CosNaming_NamingContext_NotFound", 'CosNaming_NamingContext_NotFound':name()),
  317:     ok.
  318: 
  319: %%-----------------------------------------------------------------
  320: %% Test Case: 'CosNaming_BindingIterator'
  321: %% Description: 
  322: %%-----------------------------------------------------------------
  323: 'CosNaming_BindingIterator'(doc) -> [""];
  324: 'CosNaming_BindingIterator'(suite) -> [];
  325: 'CosNaming_BindingIterator'(_) ->
  326:     ?nomatch(undefined, 'CosNaming_BindingIterator':oe_tc(next_one)),
  327:     ?nomatch(undefined, 'CosNaming_BindingIterator':oe_tc(next_n)),
  328:     ?nomatch(undefined, 'CosNaming_BindingIterator':oe_tc(destroy)),
  329:     ?match(undefined, 'CosNaming_BindingIterator':oe_tc(undefined)),
  330:     ?match([_|_], 'CosNaming_BindingIterator':oe_get_interface()),
  331:     ?match("IDL:omg.org/CosNaming/BindingIterator:1.0", 
  332: 	   'CosNaming_BindingIterator':typeID()),
  333:     check_tc('CosNaming_BindingIterator':oe_get_interface()),
  334:     ?match(true, 'CosNaming_BindingIterator':oe_is_a('CosNaming_BindingIterator':typeID())),
  335:     ?match(false, 'CosNaming_BindingIterator':oe_is_a("wrong")),
  336:     ok.
  337: 
  338: 
  339: %%-----------------------------------------------------------------
  340: %% Test Case: 'CosNaming_NamingContext'
  341: %% Description: 
  342: %%-----------------------------------------------------------------
  343: 'CosNaming_NamingContext'(doc) -> [""];
  344: 'CosNaming_NamingContext'(suite) -> [];
  345: 'CosNaming_NamingContext'(_) ->
  346:     ?nomatch(undefined, 'CosNaming_NamingContext':oe_tc(bind)),
  347:     ?nomatch(undefined, 'CosNaming_NamingContext':oe_tc(rebind)),
  348:     ?nomatch(undefined, 'CosNaming_NamingContext':oe_tc(bind_context)),
  349:     ?nomatch(undefined, 'CosNaming_NamingContext':oe_tc(rebind_context)),
  350:     ?nomatch(undefined, 'CosNaming_NamingContext':oe_tc(resolve)),
  351:     ?nomatch(undefined, 'CosNaming_NamingContext':oe_tc(unbind)),
  352:     ?nomatch(undefined, 'CosNaming_NamingContext':oe_tc(new_context)),
  353:     ?nomatch(undefined, 'CosNaming_NamingContext':oe_tc(bind_new_context)),
  354:     ?nomatch(undefined, 'CosNaming_NamingContext':oe_tc(destroy)),
  355:     ?nomatch(undefined, 'CosNaming_NamingContext':oe_tc(list)),
  356:     ?match(undefined, 'CosNaming_NamingContext':oe_tc(undefined)),
  357:     ?match([_|_], 'CosNaming_NamingContext':oe_get_interface()),
  358:     ?match("IDL:omg.org/CosNaming/NamingContext:1.0", 
  359: 	   'CosNaming_NamingContext':typeID()),
  360:     check_tc('CosNaming_NamingContext':oe_get_interface()),
  361:     ?match(true, 'CosNaming_NamingContext':oe_is_a('CosNaming_NamingContext':typeID())),
  362:     ?match(false, 'CosNaming_NamingContext':oe_is_a("wrong")),
  363:     ok.
  364: 
  365: 
  366: %%-----------------------------------------------------------------
  367: %% Test Case: 'CosNaming_NamingContexExt'
  368: %% Description: 
  369: %%-----------------------------------------------------------------
  370: 'CosNaming_NamingContextExt'(doc) -> [""];
  371: 'CosNaming_NamingContextExt'(suite) -> [];
  372: 'CosNaming_NamingContextExt'(_) ->
  373:     ?nomatch(undefined, 'CosNaming_NamingContextExt':oe_tc(to_string)),
  374:     ?nomatch(undefined, 'CosNaming_NamingContextExt':oe_tc(to_name)),
  375:     ?nomatch(undefined, 'CosNaming_NamingContextExt':oe_tc(to_url)),
  376:     ?nomatch(undefined, 'CosNaming_NamingContextExt':oe_tc(resolve_str)),
  377:     ?nomatch(undefined, 'CosNaming_NamingContextExt':oe_tc(bind)),
  378:     ?nomatch(undefined, 'CosNaming_NamingContextExt':oe_tc(rebind)),
  379:     ?nomatch(undefined, 'CosNaming_NamingContextExt':oe_tc(bind_context)),
  380:     ?nomatch(undefined, 'CosNaming_NamingContextExt':oe_tc(rebind_context)),
  381:     ?nomatch(undefined, 'CosNaming_NamingContextExt':oe_tc(new_context)),
  382:     ?nomatch(undefined, 'CosNaming_NamingContextExt':oe_tc(bind_new_context)),
  383:     ?nomatch(undefined, 'CosNaming_NamingContextExt':oe_tc(destroy)),
  384:     ?nomatch(undefined, 'CosNaming_NamingContextExt':oe_tc(list)),
  385:     ?match(undefined, 'CosNaming_NamingContextExt':oe_tc(undefined)),
  386:     ?match([_|_], 'CosNaming_NamingContextExt':oe_get_interface()),
  387:     ?match("IDL:omg.org/CosNaming/NamingContextExt:1.0", 
  388: 	   'CosNaming_NamingContextExt':typeID()),
  389:     check_tc('CosNaming_NamingContextExt':oe_get_interface()),
  390:     ?match(true, 'CosNaming_NamingContextExt':oe_is_a('CosNaming_NamingContextExt':typeID())),
  391:     ?match(true, 'CosNaming_NamingContextExt':oe_is_a('CosNaming_NamingContext':typeID())),
  392:     ?match(false, 'CosNaming_NamingContextExt':oe_is_a("wrong")),
  393:     ok.
  394: 
  395: 
  396: %%-----------------------------------------------------------------
  397: %% MISC functions
  398: %%-----------------------------------------------------------------
  399: check_tc([]) ->
  400:     ok;
  401: check_tc([{Op, {RetType, InParameters, OutParameters}}|T]) ->
  402:     io:format("checked - ~s~n", [Op]),
  403:     lists:all(?checktc(Op), [RetType|InParameters]),
  404:     lists:all(?checktc(Op), OutParameters),
  405:     check_tc(T).
  406:     
  407: