1: %%-----------------------------------------------------------------
    2: %%
    3: %% %CopyrightBegin%
    4: %% 
    5: %% Copyright Ericsson AB 2001-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: 
   23: -module(event_domain_SUITE).
   24: 
   25: -include_lib("test_server/include/test_server.hrl").
   26: -include_lib("orber/include/corba.hrl").
   27: -include_lib("cosNotification/include/CosNotifyChannelAdmin.hrl").
   28: -include_lib("cosNotification/include/CosNotification.hrl").
   29: 
   30: -include_lib("cosEventDomain/include/CosEventDomainAdmin.hrl").
   31: -include_lib("cosEventDomain/src/cosEventDomainApp.hrl").
   32: 
   33: %%-----------------------------------------------------------------
   34: %% Macros
   35: %%-----------------------------------------------------------------
   36: 
   37: -define(default_timeout, ?t:minutes(5)).
   38: 
   39: 
   40: -define(match(ExpectedRes, Expr),
   41:         fun() ->
   42: 		AcTuAlReS = (catch (Expr)),
   43: 		case AcTuAlReS of
   44: 		    ExpectedRes ->
   45: 			io:format("------ CORRECT RESULT ------~n~p~n",
   46: 				  [AcTuAlReS]),
   47: 			AcTuAlReS;
   48: 		    _ ->
   49: 			io:format("###### ERROR ERROR ######~n~p~n",
   50: 				  [AcTuAlReS]),
   51: 			?line exit(AcTuAlReS)
   52: 		end
   53: 	end()).
   54: 
   55: 
   56: %%-----------------------------------------------------------------
   57: %% External exports
   58: %%-----------------------------------------------------------------
   59: -export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2, 
   60: 	 event_domain_api/1, event_domain_factory_api/1,
   61: 	 cases/0, init_per_suite/1, end_per_suite/1, 
   62: 	 init_per_testcase/2, end_per_testcase/2, app_test/1]).
   63: 
   64: %%-----------------------------------------------------------------
   65: %% Internal exports
   66: %%-----------------------------------------------------------------
   67: 
   68: suite() -> [{ct_hooks,[ts_install_cth]}].
   69: 
   70: all() -> 
   71:     cases().
   72: 
   73: groups() -> 
   74:     [].
   75: 
   76: init_per_group(_GroupName, Config) ->
   77:     Config.
   78: 
   79: end_per_group(_GroupName, Config) ->
   80:     Config.
   81: 
   82: 
   83: cases() -> 
   84:     [event_domain_api, event_domain_factory_api, app_test].
   85: 
   86: %%-----------------------------------------------------------------
   87: %% Init and cleanup functions.
   88: %%-----------------------------------------------------------------
   89: 
   90: init_per_testcase(_Case, Config) ->
   91:     ?line Dog=test_server:timetrap(?default_timeout),
   92:     [{watchdog, Dog}|Config].
   93: 
   94: 
   95: end_per_testcase(_Case, Config) ->
   96:     Dog = ?config(watchdog, Config),
   97:     test_server:timetrap_cancel(Dog),
   98:     ok.
   99: 
  100: init_per_suite(Config) when is_list(Config) ->
  101:     mnesia:delete_schema([node()]),
  102:     mnesia:create_schema([node()]),
  103:     ok = corba:orb_init([{flags, 16#02}, 
  104: 			 {orber_debug_level, 10}]),
  105:     orber:install([node()]),
  106:     application:start(mnesia),
  107:     application:start(orber),
  108:     cosEventApp:install(),
  109:     cosEventApp:start(),
  110:     cosNotificationApp:install(),
  111:     cosNotificationApp:start(),
  112:     cosEventDomainApp:install(),
  113:     cosEventDomainApp:start(),
  114:     Config.
  115: 
  116: end_per_suite(Config) when is_list(Config) ->
  117:     cosEventDomainApp:stop(),
  118:     cosEventDomainApp:uninstall(),
  119:     cosNotificationApp:stop(),
  120:     cosNotificationApp:uninstall(),
  121:     cosEventApp:stop(),
  122:     cosEventApp:uninstall(),
  123:     application:stop(orber),
  124:     application:stop(mnesia),
  125:     mnesia:delete_schema([node()]),
  126:     Config.
  127: 
  128: %%-----------------------------------------------------------------
  129: %%  Tests app file
  130: %%-----------------------------------------------------------------
  131: app_test(doc) -> [];
  132: app_test(suite) -> [];
  133: app_test(_Config) ->
  134:     ok=test_server:app_test(cosEventDomain),
  135:     ok.
  136: 
  137: 
  138: event_domain_api(doc) -> ["Testing the CosEventDomain Domain API", ""];
  139: event_domain_api(suite) -> [];
  140: event_domain_api(_Config) ->
  141: 
  142:     %% We will setup a cluster looking like:
  143:     %%       7-8--->
  144:     %%      /
  145:     %% 2 - 4     6->
  146:     %%      \   /
  147:     %% 5---9-1-3
  148:     
  149:     %% 2-4
  150:     %% 4-1
  151:     %% 1-3
  152:     %% 3-6
  153:     %% 5-9
  154:     %% 9-1
  155:     %% 4-7
  156:     %% 7-8
  157:    
  158: 
  159:     ChFac = ?match({_,key,_,_,_,_},
  160: 		   cosNotificationApp:start_global_factory([{pullInterval,1}])),
  161:     {Ch0,_} = ?match({{_,key,_,_,_,_}, _},
  162: 		     'CosNotifyChannelAdmin_EventChannelFactory':create_channel(ChFac, [], [])),
  163:     Fac = ?match({_,key,_,_,_,_},
  164: 		 cosEventDomainApp:start_factory()),
  165:     {ED, _} = ?match({{_,key,_,_,_,_}, _},
  166: 		     'CosEventDomainAdmin_EventDomainFactory':create_event_domain(Fac, [], [])),
  167:     ID0 = 'CosEventDomainAdmin_EventDomain':add_channel(ED, Ch0),
  168:     ?match(Ch0, 'CosEventDomainAdmin_EventDomain':get_channel(ED, ID0)),
  169:     ?match([0], 'CosEventDomainAdmin_EventDomain':get_all_channels(ED)),
  170:     ?match({'EXCEPTION',{'CosNotifyChannelAdmin_ChannelNotFound',_}},
  171: 	   'CosEventDomainAdmin_EventDomain':get_channel(ED, 100)),
  172:     ?match({'EXCEPTION',{'CosNotifyChannelAdmin_ChannelNotFound',_}},
  173: 	   'CosEventDomainAdmin_EventDomain':remove_channel(ED, 100)),
  174:     ?match(ok, 'CosEventDomainAdmin_EventDomain':remove_channel(ED, 0)),
  175:     ?match([], 'CosEventDomainAdmin_EventDomain':get_all_channels(ED)),
  176:     ?match({'EXCEPTION',{'CosNotifyChannelAdmin_ChannelNotFound',_}},
  177: 	   'CosEventDomainAdmin_EventDomain':remove_channel(ED, 0)),
  178: 
  179:     %% Create a new event channel.
  180:     {Ch1,_} = ?match({{_,key,_,_,_,_}, _},
  181: 		     'CosNotifyChannelAdmin_EventChannelFactory':create_channel(ChFac, [], [])),
  182:     {Ch2,_} = ?match({{_,key,_,_,_,_}, _},
  183: 		     'CosNotifyChannelAdmin_EventChannelFactory':create_channel(ChFac, [], [])),
  184:     {Ch3,_} = ?match({{_,key,_,_,_,_}, _},
  185: 		     'CosNotifyChannelAdmin_EventChannelFactory':create_channel(ChFac, [], [])),
  186:     {Ch4,_} = ?match({{_,key,_,_,_,_}, _},
  187: 		     'CosNotifyChannelAdmin_EventChannelFactory':create_channel(ChFac, [], [])),
  188:     {Ch5,_} = ?match({{_,key,_,_,_,_}, _},
  189: 		     'CosNotifyChannelAdmin_EventChannelFactory':create_channel(ChFac, [], [])),
  190:     {Ch6,_} = ?match({{_,key,_,_,_,_}, _},
  191: 		     'CosNotifyChannelAdmin_EventChannelFactory':create_channel(ChFac, [], [])),
  192:     {Ch7,_} = ?match({{_,key,_,_,_,_}, _},
  193: 		     'CosNotifyChannelAdmin_EventChannelFactory':create_channel(ChFac, [], [])),
  194:     {Ch8,_} = ?match({{_,key,_,_,_,_}, _},
  195: 		     'CosNotifyChannelAdmin_EventChannelFactory':create_channel(ChFac, [], [])),
  196:     {Ch9,_} = ?match({{_,key,_,_,_,_}, _},
  197: 		     'CosNotifyChannelAdmin_EventChannelFactory':create_channel(ChFac, [], [])),
  198:  
  199:     ID1 = 'CosEventDomainAdmin_EventDomain':add_channel(ED, Ch1),
  200:     ID2 = 'CosEventDomainAdmin_EventDomain':add_channel(ED, Ch2),
  201:     ID3 = 'CosEventDomainAdmin_EventDomain':add_channel(ED, Ch3),
  202:     ID4 = 'CosEventDomainAdmin_EventDomain':add_channel(ED, Ch4),
  203:     ID5 = 'CosEventDomainAdmin_EventDomain':add_channel(ED, Ch5),
  204:     ID6 = 'CosEventDomainAdmin_EventDomain':add_channel(ED, Ch6),
  205:     ID7 = 'CosEventDomainAdmin_EventDomain':add_channel(ED, Ch7),
  206:     ID8 = 'CosEventDomainAdmin_EventDomain':add_channel(ED, Ch8),
  207:     ID9 = 'CosEventDomainAdmin_EventDomain':add_channel(ED, Ch9),
  208:     ?match([_,_,_,_,_,_,_,_,_], 
  209: 	   'CosEventDomainAdmin_EventDomain':get_all_channels(ED)),
  210: 
  211:     ?match([], 'CosEventDomainAdmin_EventDomain':get_all_connections(ED)),
  212:     C1 = #'CosEventDomainAdmin_Connection'{supplier_id=ID2, 
  213: 					   consumer_id=ID4,
  214: 					   ctype='STRUCTURED_EVENT',
  215: 					   notification_style='Pull'},
  216:     C2 = #'CosEventDomainAdmin_Connection'{supplier_id=ID4, 
  217: 					   consumer_id=ID1,
  218: 					   ctype='ANY_EVENT',
  219: 					   notification_style='Push'},
  220:     C3 = #'CosEventDomainAdmin_Connection'{supplier_id=ID1, 
  221: 					   consumer_id=ID3,
  222: 					   ctype='ANY_EVENT',
  223: 					   notification_style='Pull'},
  224:     C4 = #'CosEventDomainAdmin_Connection'{supplier_id=ID3, 
  225: 					   consumer_id=ID6,
  226: 					   ctype='STRUCTURED_EVENT',
  227: 					   notification_style='Push'},
  228:     C5 = #'CosEventDomainAdmin_Connection'{supplier_id=ID5, 
  229: 					   consumer_id=ID9,
  230: 					   ctype='ANY_EVENT',
  231: 					   notification_style='Pull'},
  232:     C6 = #'CosEventDomainAdmin_Connection'{supplier_id=ID9, 
  233: 					   consumer_id=ID1,
  234: 					   ctype='ANY_EVENT',
  235: 					   notification_style='Push'},
  236:     C7 = #'CosEventDomainAdmin_Connection'{supplier_id=ID4, 
  237: 					   consumer_id=ID7,
  238: 					   ctype='STRUCTURED_EVENT',
  239: 					   notification_style='Pull'},
  240:     C8 = #'CosEventDomainAdmin_Connection'{supplier_id=ID7, 
  241: 					   consumer_id=ID8,
  242: 					   ctype='ANY_EVENT',
  243: 					   notification_style='Push'},
  244:     C9 = #'CosEventDomainAdmin_Connection'{supplier_id=ID8, 
  245: 					   consumer_id=ID4,
  246: 					   ctype='ANY_EVENT',
  247: 					   notification_style='Pull'},
  248:     C10 = #'CosEventDomainAdmin_Connection'{supplier_id=ID5, 
  249: 					    consumer_id=ID4,
  250: 					    ctype='ANY_EVENT',
  251: 					    notification_style='Pull'},
  252:     C11 = #'CosEventDomainAdmin_Connection'{supplier_id=ID4, 
  253: 					    consumer_id=ID6,
  254: 					    ctype='ANY_EVENT',
  255: 					    notification_style='Pull'},
  256:     C12 = #'CosEventDomainAdmin_Connection'{supplier_id=ID8, 
  257: 					    consumer_id=ID6,
  258: 					    ctype='ANY_EVENT',
  259: 					    notification_style='Pull'},
  260: 
  261:     CID1 = 'CosEventDomainAdmin_EventDomain':add_connection(ED, C1),
  262:     ?match([CID1], 'CosEventDomainAdmin_EventDomain':get_all_connections(ED)),
  263:     _CID2 = 'CosEventDomainAdmin_EventDomain':add_connection(ED, C2),
  264:     ?match([_,_], 
  265: 	   'CosEventDomainAdmin_EventDomain':get_all_connections(ED)),
  266:     _CID3 = 'CosEventDomainAdmin_EventDomain':add_connection(ED, C3),
  267:     ?match([_,_,_], 
  268: 	   'CosEventDomainAdmin_EventDomain':get_all_connections(ED)),
  269:     _CID4 = 'CosEventDomainAdmin_EventDomain':add_connection(ED, C4),
  270:     ?match([_,_,_,_], 
  271: 	   'CosEventDomainAdmin_EventDomain':get_all_connections(ED)),
  272:     _CID5 = 'CosEventDomainAdmin_EventDomain':add_connection(ED, C5),
  273:     ?match([_,_,_,_,_], 
  274: 	   'CosEventDomainAdmin_EventDomain':get_all_connections(ED)),
  275:     _CID6 = 'CosEventDomainAdmin_EventDomain':add_connection(ED, C6),
  276:     ?match([_,_,_,_,_,_], 
  277: 	   'CosEventDomainAdmin_EventDomain':get_all_connections(ED)),
  278:     CID7 = 'CosEventDomainAdmin_EventDomain':add_connection(ED, C7),
  279:     ?match([_,_,_,_,_,_,_], 
  280: 	   'CosEventDomainAdmin_EventDomain':get_all_connections(ED)),
  281:     _CID8 = 'CosEventDomainAdmin_EventDomain':add_connection(ED, C8),
  282:     ?match([_,_,_,_,_,_,_,_], 
  283: 	   'CosEventDomainAdmin_EventDomain':get_all_connections(ED)),
  284: 
  285:     ?match({'EXCEPTION',{'CosEventDomainAdmin_AlreadyExists', _}},
  286: 	   'CosEventDomainAdmin_EventDomain':add_connection(ED, C8)),
  287:     %% No cycles should exist.
  288:     ?match([], 'CosEventDomainAdmin_EventDomain':get_cycles(ED)),
  289: 
  290:     ?match([_, _], 'CosEventDomainAdmin_EventDomain':get_qos(ED)),
  291:     AllowCyclic = #'CosNotification_Property'{name=?CycleDetection, 
  292: 					      value=any:create(orber_tc:short(), 
  293: 							       ?AuthorizeCycles)},
  294:     ?match({'EXCEPTION',{'CosNotification_UnsupportedQoS',_,_}},
  295: 	   'CosEventDomainAdmin_EventDomain':set_qos(ED, [AllowCyclic])),
  296:     ForbidCyclic = #'CosNotification_Property'{name=?CycleDetection, 
  297: 					      value=any:create(orber_tc:short(), 
  298: 							       ?ForbidCycles)},
  299:     %% The same as before; must work.
  300:     ?match(ok, 'CosEventDomainAdmin_EventDomain':set_qos(ED, [ForbidCyclic])),
  301: 
  302:     AllowDiamonds = #'CosNotification_Property'{name=?DiamondDetection, 
  303: 						value=any:create(orber_tc:short(), 
  304: 								 ?AuthorizeDiamonds)},
  305:     %% Since no diamonds allowed before this is always ok.
  306:     ?match(ok, 'CosEventDomainAdmin_EventDomain':set_qos(ED, [AllowDiamonds])),
  307:     
  308:     ?match([_, _], 'CosEventDomainAdmin_EventDomain':get_qos(ED)),
  309: 
  310:     ForbidDiamonds = #'CosNotification_Property'{name=?DiamondDetection, 
  311: 						 value=any:create(orber_tc:short(), 
  312: 								  ?ForbidDiamonds)},
  313:     %% No diamonds created before. Hence, will work.
  314:     ?match(ok, 'CosEventDomainAdmin_EventDomain':set_qos(ED, [ForbidDiamonds])),
  315: 
  316:     ?match([_, _], 'CosEventDomainAdmin_EventDomain':get_qos(ED)),
  317:     
  318:     ?match({ok, [_]}, 'CosEventDomainAdmin_EventDomain':validate_qos(ED, 
  319: 								     [ForbidDiamonds, 
  320: 								      ForbidCyclic])),
  321:     %% No diamonds exists, hence, this is ok.
  322:     ?match({ok, [_]}, 'CosEventDomainAdmin_EventDomain':validate_qos(ED, 
  323: 								     [AllowDiamonds, 
  324: 								      ForbidCyclic])),
  325:     ?match({'EXCEPTION',{'CosNotification_UnsupportedQoS',_,_}},
  326: 	   'CosEventDomainAdmin_EventDomain':validate_qos(ED, [ForbidDiamonds, 
  327: 							       AllowCyclic])),
  328: 
  329:     %% Since the ED is started is asyclic we may not succeed with this invokation.
  330:     ?match({'EXCEPTION',{'CosEventDomainAdmin_CycleCreationForbidden',_,_}},
  331: 	   'CosEventDomainAdmin_EventDomain':add_connection(ED, C9)),
  332:     ?match([], 'CosEventDomainAdmin_EventDomain':get_offer_channels(ED, ID2)),
  333: 
  334:     ?match([2], 'CosEventDomainAdmin_EventDomain':get_offer_channels(ED, ID4)),
  335:     ?match([_,_,_], 'CosEventDomainAdmin_EventDomain':get_offer_channels(ED, ID8)),
  336:     ?match({'EXCEPTION',{'CosNotifyChannelAdmin_ChannelNotFound',_}},
  337: 	   'CosEventDomainAdmin_EventDomain':get_offer_channels(ED, 100)),
  338:     ?match([], 'CosEventDomainAdmin_EventDomain':get_subscription_channels(ED, ID8)),
  339:     ?match([_,_,_,_,_], 
  340: 	   'CosEventDomainAdmin_EventDomain':get_subscription_channels(ED, ID4)),
  341:     ?match([_,_,_,_,_,_], 
  342: 	   'CosEventDomainAdmin_EventDomain':get_subscription_channels(ED, ID2)),
  343:     ?match({'EXCEPTION',{'CosNotifyChannelAdmin_ChannelNotFound',_}},
  344: 	   'CosEventDomainAdmin_EventDomain':get_subscription_channels(ED, 100)),
  345:     Nil = corba:create_nil_objref(),
  346: 
  347:     P2=?match({_,key,_,_,_,_},
  348: 	      'CosEventDomainAdmin_EventDomain':connect_push_supplier_with_id(ED, Nil, ID2)),
  349:     P7=?match({_,key,_,_,_,_},
  350: 	      'CosEventDomainAdmin_EventDomain':connect_push_supplier_with_id(ED, Nil, ID7)),
  351:     P8=?match({_,key,_,_,_,_},
  352: 	      'CosEventDomainAdmin_EventDomain':connect_pull_consumer_with_id(ED, Nil, ID8)),
  353:     P6=?match({_,key,_,_,_,_},
  354: 	      'CosEventDomainAdmin_EventDomain':connect_pull_consumer_with_id(ED, Nil, ID6)),
  355:     E1 = #any{typecode=tk_long, value=1},
  356:     E2 = #any{typecode=tk_long, value=2},
  357:     
  358:     ?match(ok, 'CosNotifyChannelAdmin_ProxyPushConsumer':push(P2, E1)),
  359:     ?match(E1, 'CosNotifyChannelAdmin_ProxyPullSupplier':pull(P8)),
  360:     ?match(E1, 'CosNotifyChannelAdmin_ProxyPullSupplier':pull(P6)),
  361:     ?match(ok, 'CosNotifyChannelAdmin_ProxyPushConsumer':push(P7, E2)),
  362:     ?match(E2, 'CosNotifyChannelAdmin_ProxyPullSupplier':pull(P8)),
  363:     timer:sleep(10000),
  364:     ?match({_,false}, 'CosNotifyChannelAdmin_ProxyPullSupplier':try_pull(P6)),
  365: 
  366:     ?match(ok, 'CosEventDomainAdmin_EventDomain':remove_connection(ED, CID7)),
  367: 
  368:     ?match({'EXCEPTION',{'CosEventDomainAdmin_ConnectionNotFound',_}},
  369: 	   'CosEventDomainAdmin_EventDomain':remove_connection(ED, CID7)),
  370: 
  371:     ?match({'EXCEPTION',{'CosEventDomainAdmin_ConnectionNotFound',_}},
  372: 	   'CosEventDomainAdmin_EventDomain':remove_connection(ED, 100)),
  373: 
  374:     ?match([], 'CosEventDomainAdmin_EventDomain':get_offer_channels(ED, ID7)),
  375:     ?match([2], 'CosEventDomainAdmin_EventDomain':get_offer_channels(ED, ID4)),
  376: 
  377:     ?match([8], 'CosEventDomainAdmin_EventDomain':get_subscription_channels(ED, ID7)),
  378:     ?match([_,_,_], 'CosEventDomainAdmin_EventDomain':get_subscription_channels(ED, ID4)),
  379: 
  380:     CID10 = ?match(8, 'CosEventDomainAdmin_EventDomain':add_connection(ED, C7)),
  381: 
  382:     %% Now we'll check diamond management.
  383:     %% Currently it should not be possible to create a diamond (due to QoS-setting).
  384:     ?match({'EXCEPTION',{'CosEventDomainAdmin_DiamondCreationForbidden',_,_}},
  385: 	   'CosEventDomainAdmin_EventDomain':add_connection(ED, C11)),
  386:     ?match({'EXCEPTION',{'CosEventDomainAdmin_DiamondCreationForbidden',_,_}},
  387: 	   'CosEventDomainAdmin_EventDomain':add_connection(ED, C10)),
  388:     ?match({'EXCEPTION',{'CosEventDomainAdmin_DiamondCreationForbidden',_,_}},
  389: 	   'CosEventDomainAdmin_EventDomain':add_connection(ED, C12)),
  390:     ?match(ok, 'CosEventDomainAdmin_EventDomain':set_qos(ED, [AllowDiamonds])),
  391:     
  392:     CID11 = ?match(9, 'CosEventDomainAdmin_EventDomain':add_connection(ED, C10)),
  393:     ?match([_,_,_,_,_,_,_,_,_], 
  394: 	   'CosEventDomainAdmin_EventDomain':get_all_connections(ED)),
  395:     ?match([_], 'CosEventDomainAdmin_EventDomain':get_diamonds(ED)),
  396: 
  397:     CID12 = ?match(10, 'CosEventDomainAdmin_EventDomain':add_connection(ED, C11)),
  398:     ?match([_, _, _], 'CosEventDomainAdmin_EventDomain':get_diamonds(ED)),
  399: 
  400:     CID13 = ?match(11, 'CosEventDomainAdmin_EventDomain':add_connection(ED, C12)),
  401: 
  402:     ?match([_, _, _], 'CosEventDomainAdmin_EventDomain':get_diamonds(ED)),
  403: 
  404:     ?match({'EXCEPTION',{'CosNotification_UnsupportedQoS',_,_}},
  405: 	   'CosEventDomainAdmin_EventDomain':set_qos(ED, [ForbidDiamonds])),
  406: 
  407:     ?match(ok, 'CosEventDomainAdmin_EventDomain':remove_connection(ED, CID10)),
  408:     ?match(ok, 'CosEventDomainAdmin_EventDomain':remove_connection(ED, CID11)),
  409:     ?match(ok, 'CosEventDomainAdmin_EventDomain':remove_connection(ED, CID12)),
  410:     ?match(ok, 'CosEventDomainAdmin_EventDomain':remove_connection(ED, CID13)),
  411:     ?match(ok, 'CosEventDomainAdmin_EventDomain':set_qos(ED, [ForbidDiamonds])),
  412:     ?match([_, _], 'CosEventDomainAdmin_EventDomain':get_qos(ED)),
  413:     ?match({'EXCEPTION',{'CosEventDomainAdmin_DiamondCreationForbidden',_,_}},
  414: 	   'CosEventDomainAdmin_EventDomain':add_connection(ED, C10)),
  415: 
  416:     ?match(ok, 'CosEventDomainAdmin_EventDomain':destroy(ED)),
  417: 
  418:     ok.
  419: 
  420: event_domain_factory_api(doc) -> ["Testing the CosEventDomain Factory API", ""];
  421: event_domain_factory_api(suite) -> [];
  422: event_domain_factory_api(_Config) ->
  423: 
  424:     Cyclic = #'CosNotification_Property'{name=?CycleDetection, 
  425: 					 value=any:create(orber_tc:short(), 
  426: 							  ?ForbidCycles)},
  427: 
  428:     BadProp = #'CosNotification_Property'{name="Wrong", 
  429: 					  value=any:create(orber_tc:short(), 
  430: 							   ?ForbidCycles)},
  431: 
  432:     BadQoSVal = #'CosNotification_Property'{name=?CycleDetection, 
  433: 					    value=any:create(orber_tc:short(), 
  434: 							     10)},
  435: 
  436:     Fac = ?match({_,key,_,_,_,_},
  437: 		 cosEventDomainApp:start_factory()),
  438:     ?match([], 'CosEventDomainAdmin_EventDomainFactory':get_all_domains(Fac)),
  439:     ?match({'EXCEPTION',{'CosEventDomainAdmin_DomainNotFound',_}},
  440: 	   'CosEventDomainAdmin_EventDomainFactory':get_event_domain(Fac, 0)),
  441:     {ED,_} = 'CosEventDomainAdmin_EventDomainFactory':create_event_domain(Fac, [Cyclic], []),
  442:     ?match([0], 'CosEventDomainAdmin_EventDomainFactory':get_all_domains(Fac)),
  443:     ED = 'CosEventDomainAdmin_EventDomainFactory':get_event_domain(Fac, 0),
  444:     ?match({'EXCEPTION',{'CosEventDomainAdmin_DomainNotFound',_}},
  445: 	   'CosEventDomainAdmin_EventDomainFactory':get_event_domain(Fac, 1)),
  446:     corba:dispose(ED),
  447:     timer:sleep(3000),
  448:     ?match([], 'CosEventDomainAdmin_EventDomainFactory':get_all_domains(Fac)),
  449:     ?match({'EXCEPTION',{'CosEventDomainAdmin_DomainNotFound',_}},
  450: 	   'CosEventDomainAdmin_EventDomainFactory':get_event_domain(Fac, 0)),
  451:     {ED2,_} = ?match({{_,key,_,_,_,_}, _},
  452: 		     'CosEventDomainAdmin_EventDomainFactory':create_event_domain(Fac, [], [])),
  453:     ?match([1], 'CosEventDomainAdmin_EventDomainFactory':get_all_domains(Fac)),
  454:     ?match(ED2, 'CosEventDomainAdmin_EventDomainFactory':get_event_domain(Fac, 1)),
  455:     corba:dispose(ED2),
  456: 
  457:     ?match({'EXCEPTION', {'CosNotification_UnsupportedQoS',_,_}},
  458: 	   'CosEventDomainAdmin_EventDomainFactory':create_event_domain(Fac, [BadProp], [])),
  459:     ?match({'EXCEPTION',{'CosNotification_UnsupportedAdmin',_,_}},
  460: 	   'CosEventDomainAdmin_EventDomainFactory':create_event_domain(Fac, [], [BadProp])),
  461:     ?match({'EXCEPTION',{'CosNotification_UnsupportedQoS',_,_}},
  462: 	   'CosEventDomainAdmin_EventDomainFactory':create_event_domain(Fac, [BadQoSVal], [])),
  463:     ?match({'EXCEPTION',{'CosNotification_UnsupportedAdmin',_,_}},
  464: 	   'CosEventDomainAdmin_EventDomainFactory':create_event_domain(Fac, [], [BadQoSVal])),
  465: 
  466:     corba:dispose(Fac),
  467:     ok.