From f2117134584093f9b001002576410be09321bbc3 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Tue, 30 Mar 2010 14:32:30 +0000 Subject: CORBA applications test suites published --- lib/cosNotification/test/Makefile | 190 ++ lib/cosNotification/test/cosNotification.spec | 19 + lib/cosNotification/test/eventDB_SUITE.erl | 902 ++++++++++ lib/cosNotification/test/generated_SUITE.erl | 2042 +++++++++++++++++++++ lib/cosNotification/test/grammar_SUITE.erl | 1094 ++++++++++++ lib/cosNotification/test/notification_SUITE.erl | 2185 +++++++++++++++++++++++ lib/cosNotification/test/notify_test_impl.erl | 299 ++++ lib/cosNotification/test/notify_test_server.cfg | 54 + lib/cosNotification/test/notify_test_server.idl | 113 ++ 9 files changed, 6898 insertions(+) create mode 100644 lib/cosNotification/test/Makefile create mode 100644 lib/cosNotification/test/cosNotification.spec create mode 100644 lib/cosNotification/test/eventDB_SUITE.erl create mode 100644 lib/cosNotification/test/generated_SUITE.erl create mode 100644 lib/cosNotification/test/grammar_SUITE.erl create mode 100644 lib/cosNotification/test/notification_SUITE.erl create mode 100644 lib/cosNotification/test/notify_test_impl.erl create mode 100644 lib/cosNotification/test/notify_test_server.cfg create mode 100644 lib/cosNotification/test/notify_test_server.idl (limited to 'lib/cosNotification/test') diff --git a/lib/cosNotification/test/Makefile b/lib/cosNotification/test/Makefile new file mode 100644 index 0000000000..df8f9e919b --- /dev/null +++ b/lib/cosNotification/test/Makefile @@ -0,0 +1,190 @@ +# +# %CopyrightBegin% +# +# Copyright Ericsson AB 1999-2009. All Rights Reserved. +# +# The contents of this file are subject to the Erlang Public License, +# Version 1.1, (the "License"); you may not use this file except in +# compliance with the License. You should have received a copy of the +# Erlang Public License along with this software. If not, it can be +# retrieved online at http://www.erlang.org/. +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +# the License for the specific language governing rights and limitations +# under the License. +# +# %CopyrightEnd% +# +# +include $(ERL_TOP)/make/target.mk +include $(ERL_TOP)/make/$(TARGET)/otp.mk + +# ---------------------------------------------------- +# Application version +# ---------------------------------------------------- +include ../vsn.mk +VSN=$(COSNOTIFICATION_VSN) +# ---------------------------------------------------- +# Release directory specification +# ---------------------------------------------------- +RELSYSDIR = $(RELEASE_PATH)/cosNotification_test + +# ---------------------------------------------------- +# Target Specs +# ---------------------------------------------------- +TEST_SPEC_FILE = cosNotification.spec + + +IDL_FILES = + +IDLOUTDIR = idl_output + +MODULES = \ + notification_SUITE \ + grammar_SUITE \ + eventDB_SUITE \ + generated_SUITE \ + notify_test_impl + +GEN_MODULES = \ + oe_notify_test_server \ + notify_test_data \ + notify_test_computer \ + notify_test_studies \ + notify_test_ShortArray \ + notify_test_uni1 \ + notify_test_uni2 \ + notify_test_X \ + notify_test_K \ + notify_test_SeqPushC \ + notify_test_StrPushC \ + notify_test_AnyPushC \ + notify_test_SeqPullC \ + notify_test_StrPullC \ + notify_test_AnyPullC \ + notify_test_SeqPushS \ + notify_test_StrPushS \ + notify_test_AnyPushS \ + notify_test_SeqPullS \ + notify_test_StrPullS \ + notify_test_AnyPullS \ + notify_test_funcs + +GEN_HRL_FILES = \ + oe_notify_test_server.hrl \ + notify_test_SeqPushC.hrl \ + notify_test_StrPushC.hrl \ + notify_test_AnyPushC.hrl \ + notify_test_SeqPullC.hrl \ + notify_test_StrPullC.hrl \ + notify_test_AnyPullC.hrl \ + notify_test_SeqPushS.hrl \ + notify_test_StrPushS.hrl \ + notify_test_AnyPushS.hrl \ + notify_test_SeqPullS.hrl \ + notify_test_StrPullS.hrl \ + notify_test_AnyPullS.hrl \ + notify_test.hrl \ + notify_test_funcs.hrl + +ERL_FILES = $(MODULES:%=%.erl) + +HRL_FILES = + +GEN_FILES = \ + $(GEN_HRL_FILES:%=$(IDLOUTDIR)/%) \ + $(GEN_MODULES:%=$(IDLOUTDIR)/%.erl) + +GEN_TARGET_FILES = $(GEN_MODULES:%=$(IDLOUTDIR)/%.$(EMULATOR)) + +SUITE_TARGET_FILES = $(MODULES:%=%.$(EMULATOR)) + +TARGET_FILES = \ + $(GEN_TARGET_FILES) \ + $(SUITE_TARGET_FILES) + + +# ---------------------------------------------------- +# PROGRAMS +# ---------------------------------------------------- +LOCAL_CLASSPATH = $(ERL_TOP)lib/cosNotification/priv:$(ERL_TOP)lib/cosNotification/test +# ---------------------------------------------------- +# FLAGS +# ---------------------------------------------------- +ERL_IDL_FLAGS += \ + -pa $(ERL_TOP)/lib/cosNotification/ebin \ + -pa $(ERL_TOP)/lib/cosNotification/src \ + -pa $(ERL_TOP)/lib/cosTime/ebin \ + -pa $(ERL_TOP)/lib/cosTime/include \ + -pa $(ERL_TOP)/lib/orber/ebin \ + -pa $(ERL_TOP)/lib/ic/ebin \ + -pa $(ERL_TOP)/lib/cosNotification/include \ + -I$(ERL_TOP)/lib/cosEvent/src \ + -I$(ERL_TOP)/lib/cosNotification/include \ + +ERL_COMPILE_FLAGS += \ + $(ERL_IDL_FLAGS) \ + -pa $(ERL_TOP)/lib/orber/include \ + -pa $(ERL_TOP)/internal_tools/test_server/ebin \ + -pa $(ERL_TOP)/lib/cosNotification/ebin \ + -pa $(ERL_TOP)/lib/cosNotification/test/idl_output \ + -pa $(ERL_TOP)/lib/cosTime/ebin \ + -pa $(ERL_TOP)/lib/cosTime/include \ + -pa $(ERL_TOP)/lib/cosNotification/include \ + -pa $(ERL_TOP)/lib/ic/ebin \ + -I$(ERL_TOP)/lib/cosTime/ebin \ + -I$(ERL_TOP)/lib/cosTime/include \ + -I$(ERL_TOP)/lib/orber/include \ + -I$(ERL_TOP)/lib/cosNotification/src \ + -I$(ERL_TOP)/lib/cosNotification/include \ + -I$(ERL_TOP)/lib/cosNotification \ + -I$(ERL_TOP)/lib/cosNotification/test/$(IDLOUTDIR) \ + -I$(ERL_TOP)/lib/test_server/include + +# ---------------------------------------------------- +# Targets +# ---------------------------------------------------- + + +tests debug opt: $(TARGET_FILES) + +clean: + rm -f idl_output/* + rm -f $(TARGET_FILES) + rm -f errs core *~ + +docs: + +# ---------------------------------------------------- +# Special Targets +# ---------------------------------------------------- + +TGT_TEST = \ + $(GEN_HRL_FILES:%=$(IDLOUTDIR)/%) \ + $(GEN_MODULES:%=$(IDLOUTDIR)/%.erl) + +$(TGT_TEST): notify_test_server.idl + erlc $(ERL_COMPILE_FLAGS) -o$(IDLOUTDIR) \ + +'{cfgfile,"notify_test_server.cfg"}' notify_test_server.idl + +# ---------------------------------------------------- +# Release Targets +# ---------------------------------------------------- +# We don't copy generated intermediate erlang and hrl files + +include $(ERL_TOP)/make/otp_release_targets.mk + +release_spec: + +release_docs_spec: + +release_tests_spec: tests + $(INSTALL_DIR) $(RELSYSDIR) + $(INSTALL_DATA) $(IDL_FILES) $(TEST_SPEC_FILE) \ + $(ERL_FILES) $(RELSYSDIR) + $(INSTALL_DIR) $(RELSYSDIR)/$(IDLOUTDIR) + $(INSTALL_DATA) $(GEN_TARGET_FILES) $(GEN_FILES) \ + $(RELSYSDIR)/$(IDLOUTDIR) + $(INSTALL_DATA) $(SUITE_TARGET_FILES) $(RELSYSDIR) + diff --git a/lib/cosNotification/test/cosNotification.spec b/lib/cosNotification/test/cosNotification.spec new file mode 100644 index 0000000000..8df89e7908 --- /dev/null +++ b/lib/cosNotification/test/cosNotification.spec @@ -0,0 +1,19 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +{topcase, {dir, "../cosNotification_test"}}. diff --git a/lib/cosNotification/test/eventDB_SUITE.erl b/lib/cosNotification/test/eventDB_SUITE.erl new file mode 100644 index 0000000000..9ddfb3d902 --- /dev/null +++ b/lib/cosNotification/test/eventDB_SUITE.erl @@ -0,0 +1,902 @@ +%%-------------------------------------------------------------------- +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +%% +%%-------------------------------------------------------------------- +%% File : eventDB_SUITE.erl +%% Purpose : +%%-------------------------------------------------------------------- + +-module(eventDB_SUITE). +%%--------------- INCLUDES ----------------------------------- +-include_lib("orber/include/corba.hrl"). +-include_lib("orber/include/ifr_types.hrl"). +%% cosEvent files. +-include_lib("cosEvent/include/CosEventChannelAdmin.hrl"). +%% cosTime files. +-include_lib("cosTime/include/TimeBase.hrl"). +%% Application files +-include_lib("cosNotification/include/CosNotification.hrl"). +-include_lib("cosNotification/include/CosNotifyChannelAdmin.hrl"). +-include_lib("cosNotification/include/CosNotifyComm.hrl"). +-include_lib("cosNotification/include/CosNotifyFilter.hrl"). + +-include_lib("cosNotification/src/CosNotification_Definitions.hrl"). + +-include("idl_output/notify_test.hrl"). + +-include("test_server.hrl"). + +%%--------------- DEFINES ------------------------------------ +-define(default_timeout, ?t:minutes(20)). +-define(match(ExpectedRes, Expr), + fun() -> + AcTuAlReS = (catch (Expr)), + case AcTuAlReS of + ExpectedRes -> + io:format("------ CORRECT RESULT ------~n~p~n", + [AcTuAlReS]), + AcTuAlReS; + _ -> + io:format("###### ERROR ERROR ######~n~p~n", + [AcTuAlReS]), + ?line exit(AcTuAlReS) + end + end()). + + +-define(EVENT1, ?not_CreateSE("","event1","", + [#'CosNotification_Property' + {name="Priority", + value=any:create(orber_tc:short(), 0)}, + #'CosNotification_Property' + {name="StartTime", + value=any:create('TimeBase_UtcT':tc(), + #'TimeBase_UtcT' + {time=900000000, + inacclo=0, inacchi=0, tdf=2})}, + #'CosNotification_Property' + {name="StopTime", + value=any:create('TimeBase_UtcT':tc(), + #'TimeBase_UtcT' + {time=900000000, + inacclo=0, inacchi=0, tdf=2})}, + #'CosNotification_Property' + {name="Timeout", + value=any:create(orber_tc:unsigned_long_long(), 900000000)}], + [], any:create(orber_tc:null(), null))). +-define(EVENT2, ?not_CreateSE("","event2","", + [#'CosNotification_Property' + {name="Priority", + value=any:create(orber_tc:short(), 0)}, + #'CosNotification_Property' + {name="StartTime", + value=any:create('TimeBase_UtcT':tc(), + #'TimeBase_UtcT' + {time=800000000, + inacclo=0, inacchi=0, tdf=2})}, + #'CosNotification_Property' + {name="StopTime", + value=any:create('TimeBase_UtcT':tc(), + #'TimeBase_UtcT' + {time=800000000, + inacclo=0, inacchi=0, tdf=2})}, + #'CosNotification_Property' + {name="Timeout", + value=any:create(orber_tc:unsigned_long_long(), 800000000)}], + [], any:create(orber_tc:null(), null))). +-define(EVENT3, ?not_CreateSE("","event3","", + [#'CosNotification_Property' + {name="Priority", + value=any:create(orber_tc:short(), 0)}, + #'CosNotification_Property' + {name="StartTime", + value=any:create('TimeBase_UtcT':tc(), + #'TimeBase_UtcT' + {time=700000000, + inacclo=0, inacchi=0, tdf=2})}, + #'CosNotification_Property' + {name="StopTime", + value=any:create('TimeBase_UtcT':tc(), + #'TimeBase_UtcT' + {time=700000000, + inacclo=0, inacchi=0, tdf=2})}, + #'CosNotification_Property' + {name="Timeout", + value=any:create(orber_tc:unsigned_long_long(), 700000000)}], + [], any:create(orber_tc:null(), null))). +-define(EVENT4, ?not_CreateSE("","event4","", + [#'CosNotification_Property' + {name="Priority", + value=any:create(orber_tc:short(), 2)}, + #'CosNotification_Property' + {name="StartTime", + value=any:create('TimeBase_UtcT':tc(), + #'TimeBase_UtcT' + {time=300000000, + inacclo=0, inacchi=0, tdf=2})}, + #'CosNotification_Property' + {name="StopTime", + value=any:create('TimeBase_UtcT':tc(), + #'TimeBase_UtcT' + {time=300000000, + inacclo=0, inacchi=0, tdf=2})}, + #'CosNotification_Property' + {name="Timeout", + value=any:create(orber_tc:unsigned_long_long(), 300000000)}], + [], any:create(orber_tc:null(), null))). +-define(EVENT5, ?not_CreateSE("","event5","", + [#'CosNotification_Property' + {name="Priority", + value=any:create(orber_tc:short(), 2)}, + #'CosNotification_Property' + {name="StartTime", + value=any:create('TimeBase_UtcT':tc(), + #'TimeBase_UtcT' + {time=200000000, + inacclo=0, inacchi=0, tdf=2})}, + #'CosNotification_Property' + {name="StopTime", + value=any:create('TimeBase_UtcT':tc(), + #'TimeBase_UtcT' + {time=200000000, + inacclo=0, inacchi=0, tdf=2})}, + #'CosNotification_Property' + {name="Timeout", + value=any:create(orber_tc:unsigned_long_long(), 200000000)}], + [], any:create(orber_tc:null(), null))). +-define(EVENT6, ?not_CreateSE("","event6","", + [#'CosNotification_Property' + {name="Priority", + value=any:create(orber_tc:short(), 0)}, + #'CosNotification_Property' + {name="StartTime", + value=any:create('TimeBase_UtcT':tc(), + #'TimeBase_UtcT' + {time=500000000, + inacclo=0, inacchi=0, tdf=2})}, + #'CosNotification_Property' + {name="StopTime", + value=any:create('TimeBase_UtcT':tc(), + #'TimeBase_UtcT' + {time=500000000, + inacclo=0, inacchi=0, tdf=2})}, + #'CosNotification_Property' + {name="Timeout", + value=any:create(orber_tc:unsigned_long_long(), 500000000)}], + [], any:create(orber_tc:null(), null))). +-define(EVENT7, ?not_CreateSE("","event7","", + [#'CosNotification_Property' + {name="Priority", + value=any:create(orber_tc:short(), -1)}, + #'CosNotification_Property' + {name="StartTime", + value=any:create('TimeBase_UtcT':tc(), + #'TimeBase_UtcT' + {time=400000000, + inacclo=0, inacchi=0, tdf=2})}, + #'CosNotification_Property' + {name="StopTime", + value=any:create('TimeBase_UtcT':tc(), + #'TimeBase_UtcT' + {time=400000000, + inacclo=0, inacchi=0, tdf=2})}, + #'CosNotification_Property' + {name="Timeout", + value=any:create(orber_tc:unsigned_long_long(), 400000000)}], + [], any:create(orber_tc:null(), null))). +-define(EVENT8, ?not_CreateSE("","event8","", + [#'CosNotification_Property' + {name="Priority", + value=any:create(orber_tc:short(), -1)}, + #'CosNotification_Property' + {name="StartTime", + value=any:create('TimeBase_UtcT':tc(), + #'TimeBase_UtcT' + {time=600000000, + inacclo=0, inacchi=0, tdf=2})}, + #'CosNotification_Property' + {name="StopTime", + value=any:create('TimeBase_UtcT':tc(), + #'TimeBase_UtcT' + {time=600000000, + inacclo=0, inacchi=0, tdf=2})}, + #'CosNotification_Property' + {name="Timeout", + value=any:create(orber_tc:unsigned_long_long(), 600000000)}], + [], any:create(orber_tc:null(), null))). +-define(EVENT9, ?not_CreateSE("","event9","", + [#'CosNotification_Property' + {name="Priority", + value=any:create(orber_tc:short(), 0)}, + #'CosNotification_Property' + {name="StartTime", + value=any:create('TimeBase_UtcT':tc(), + #'TimeBase_UtcT' + {time=100000000, + inacclo=0, inacchi=0, tdf=2})}, + #'CosNotification_Property' + {name="StopTime", + value=any:create('TimeBase_UtcT':tc(), + #'TimeBase_UtcT' + {time=100000000, + inacclo=0, inacchi=0, tdf=2})}, + #'CosNotification_Property' + {name="Timeout", + value=any:create(orber_tc:unsigned_long_long(), 100000000)}], + [], any:create(orber_tc:null(), null))). + +-define(EVENTS, [?EVENT1, ?EVENT2, ?EVENT3, ?EVENT4, ?EVENT5, ?EVENT6, ?EVENT7, + ?EVENT8, ?EVENT9]). + + +-define(PRIOORDER, [?EVENT4, ?EVENT5, ?EVENT1, ?EVENT2, ?EVENT3, ?EVENT6, ?EVENT9, + ?EVENT7, ?EVENT8]). + +-define(FIFOORDER, ?EVENTS). + +-define(DEADLINEORDER, [?EVENT9, ?EVENT5, ?EVENT4, ?EVENT7, ?EVENT6, ?EVENT8, ?EVENT3, + ?EVENT2, ?EVENT1]). + +-define(NO_OF_EVENTS, 9). + +%%----------------------------------------------------------------- +%% External exports +%%----------------------------------------------------------------- +-export([all/1, cases/0, init_all/1, finish_all/1, reorder_api/1, lookup_api/1, + discard_api/1, max_events_api/1, gc_api/1, auto_gc_api/1, + start_stop_time_api/1, mapping_filter_api/1, persisten_event_api/1, + init_per_testcase/2, fin_per_testcase/2]). + +%%----------------------------------------------------------------- +%% Func: all/1 +%% Args: +%% Returns: +%%----------------------------------------------------------------- +all(doc) -> ["API tests for the cosNotification interfaces", ""]; +all(suite) -> {req, + [mnesia, orber], + {conf, init_all, cases(), finish_all}}. + +cases() -> + [persisten_event_api, start_stop_time_api, mapping_filter_api, + max_events_api, discard_api, reorder_api, lookup_api, gc_api, + auto_gc_api]. + + + +%%----------------------------------------------------------------- +%% Init and cleanup functions. +%%----------------------------------------------------------------- + +init_per_testcase(_Case, Config) -> + ?line Dog=test_server:timetrap(?default_timeout), + [{watchdog, Dog}|Config]. + + +fin_per_testcase(_Case, Config) -> + Dog = ?config(watchdog, Config), + test_server:timetrap_cancel(Dog), + ok. + +init_all(Config) -> + Path = code:which(?MODULE), + code:add_pathz(filename:join(filename:dirname(Path), "idl_output")), + orber:jump_start(), + cosTime:install_time(), + cosTime:start(), + if + is_list(Config) -> + Config; + true -> + exit("Config not a list") + end. + +finish_all(Config) -> + Path = code:which(?MODULE), + code:del_path(filename:join(filename:dirname(Path), "idl_output")), + cosTime:stop(), + cosTime:uninstall_time(), + orber:jump_stop(), + Config. + + +%%----------------------------------------------------------------- +%% cosNotification_eventDB lookup API tests +%%----------------------------------------------------------------- +mapping_filter_api(doc) -> ["The event DB is used to store events which cannot be", + "delivered at once. This case is supposed to test", + "that the events are delivered in the correct order", + "if a MappingFilter have benn associated.", + ""]; +mapping_filter_api(suite) -> []; +mapping_filter_api(_Config) -> + InitQoS = ?not_CreateInitQoS(), + InitQoS2 = ?not_SetMaxEventsPerConsumer(InitQoS,100), + InitQoS3 = ?not_SetStartTimeSupported(InitQoS2, false), + InitQoS4 = ?not_SetStopTimeSupported(InitQoS3, true), + QoS = ?not_SetDiscardPolicy(InitQoS4, ?not_AnyOrder), + + PriorityQoS = ?not_SetOrderPolicy(QoS, ?not_PriorityOrder), + DeadlineQoS = ?not_SetOrderPolicy(QoS, ?not_DeadlineOrder), + + %% "Calculate" data once: + %% NOTE! Even though the an Event do not match any of the constarints the + %% default value will be used. Hence, the events will not be stored in the + %% way described in the definitions above. For example, when using deadline order + %% all the events will be stored in FIFO order since the usag of a MappingFilter + %% all evnts will have the same deadline (except event6). + Events = ?EVENTS, + PrioOrder = [?EVENT6, ?EVENT1, ?EVENT2, ?EVENT3, ?EVENT4, ?EVENT5, ?EVENT7, + ?EVENT8, ?EVENT9], + DeadlineOrder = [?EVENT1, ?EVENT2, ?EVENT3, ?EVENT4, ?EVENT5, ?EVENT7, ?EVENT8, + ?EVENT9], + + + FiFac = 'CosNotifyFilter_FilterFactory':oe_create(), + ?match({_,key,_,_,_,_}, FiFac), + + PrioFilter = 'CosNotifyFilter_FilterFactory': + create_mapping_filter(FiFac, "EXTENDED_TCL", any:create(orber_tc:short(), 0)), + DLFilter = 'CosNotifyFilter_FilterFactory': + create_mapping_filter(FiFac, "EXTENDED_TCL", any:create(orber_tc:unsigned_long_long(), 1000000000)), + + ?match([_], + 'CosNotifyFilter_MappingFilter':add_mapping_constraints(PrioFilter, + [#'CosNotifyFilter_MappingConstraintPair' + {constraint_expression = #'CosNotifyFilter_ConstraintExp' + {event_types = [#'CosNotification_EventType' + {domain_name = "", + type_name = "event6"}], + constraint_expr = "2==2"}, + result_to_set = any:create(orber_tc:short(), 10)}])), + ?match([_], + 'CosNotifyFilter_MappingFilter':add_mapping_constraints(DLFilter, + [#'CosNotifyFilter_MappingConstraintPair' + {constraint_expression = #'CosNotifyFilter_ConstraintExp' + {event_types = [#'CosNotification_EventType' + {domain_name = "", + type_name = "event6"}], + constraint_expr = "2==2"}, + result_to_set = any:create(orber_tc:unsigned_long_long(), 200000000)}])), + + + do_lookup(PriorityQoS, Events, PrioOrder, "Priority Order", undefined, PrioFilter, 0), + do_lookup(DeadlineQoS, Events, DeadlineOrder, "Deadline Order", DLFilter, undefined, 23000), + ok. + +do_lookup(QoS, Events, Return, Txt, DLFilter, PrioFilter, Timeout) -> + io:format("#################### ~s ###################~n", [Txt]), + Ref = cosNotification_eventDB:create_db(QoS, 60, 50, undefined), + create_loop(Events, Ref, DLFilter, PrioFilter), + timer:sleep(Timeout), + ?match({Return,_}, cosNotification_eventDB:get_events(Ref, ?NO_OF_EVENTS)), + cosNotification_eventDB:destroy_db(Ref). + +%%----------------------------------------------------------------- +%% cosNotification_eventDB discard API tests +%%----------------------------------------------------------------- +discard_api(doc) -> ["The event DB is used to store events which cannot be", + "delivered at once. If MaxEvents limit is reached there", + "different ways we can discard the. This case will test", + "all permutations of order and discard policies.", + ""]; +discard_api(suite) -> []; +discard_api(_Config) -> + InitQoS1 = ?not_CreateInitQoS(), + InitQoS2 = ?not_SetPriority(InitQoS1, 10), + InitQoS3 = ?not_SetStartTimeSupported(InitQoS2, false), + QoS = ?not_SetMaxEventsPerConsumer(InitQoS3, 5), + %% The different order policies. To each order we must apply every possible + %% discard policy to each order policy setting. We also have to test and + %% change the policies for each setting. + AnyQoS = ?not_SetOrderPolicy(QoS, ?not_AnyOrder), + PriorityQoS = ?not_SetOrderPolicy(QoS, ?not_PriorityOrder), + FifoQoS = ?not_SetOrderPolicy(QoS, ?not_FifoOrder), + DeadlineQoS = ?not_SetOrderPolicy(QoS, ?not_DeadlineOrder), + + Events = ?EVENTS, + + %% Test using Any discard policy + do_discard(Events, ?not_SetDiscardPolicy(AnyQoS, ?not_AnyOrder), + [?EVENT4, ?EVENT5, ?EVENT1, ?EVENT2, ?EVENT3], + "Discard and Order eq. Any"), + do_discard(Events, ?not_SetDiscardPolicy(PriorityQoS, ?not_AnyOrder), + [?EVENT4, ?EVENT5, ?EVENT1, ?EVENT2, ?EVENT3], + "Discard Any and Order Priority"), + do_discard(Events, ?not_SetDiscardPolicy(FifoQoS, ?not_AnyOrder), + [?EVENT1, ?EVENT2, ?EVENT3, ?EVENT4, ?EVENT5], + "Discard Any and Order Fifo"), + do_discard(Events, ?not_SetDiscardPolicy(DeadlineQoS, ?not_AnyOrder), + [?EVENT5, ?EVENT4, ?EVENT3, ?EVENT2, ?EVENT1], + "Discard Any and Order Deadline"), + + %% Test using RejectNewEvents discard policy + do_discard(Events, ?not_SetDiscardPolicy(AnyQoS, ?not_RejectNewEvents), + [?EVENT4, ?EVENT5, ?EVENT1, ?EVENT2, ?EVENT3], + "Discard RejectNewEvents and Order Any"), + do_discard(Events, ?not_SetDiscardPolicy(PriorityQoS, ?not_RejectNewEvents), + [?EVENT4, ?EVENT5, ?EVENT1, ?EVENT2, ?EVENT3], + "Discard RejectNewEvents and Order Priority"), + do_discard(Events, ?not_SetDiscardPolicy(FifoQoS, ?not_RejectNewEvents), + [?EVENT1, ?EVENT2, ?EVENT3, ?EVENT4, ?EVENT5], + "Discard RejectNewEvents and Order Fifo"), + do_discard(Events, ?not_SetDiscardPolicy(DeadlineQoS, ?not_RejectNewEvents), + [?EVENT5, ?EVENT4, ?EVENT3, ?EVENT2, ?EVENT1], + "Discard RejectNewEvents and Order Deadline"), + + %% Test using Lifo discard policy + do_discard(Events, ?not_SetDiscardPolicy(AnyQoS, ?not_LifoOrder), + [?EVENT4, ?EVENT5, ?EVENT1, ?EVENT2, ?EVENT3], + "Discard Lifo and Order Any"), + do_discard(Events, ?not_SetDiscardPolicy(PriorityQoS, ?not_LifoOrder), + [?EVENT4, ?EVENT5, ?EVENT1, ?EVENT2, ?EVENT3], + "Discard Lifo and Order Priority"), + do_discard(Events, ?not_SetDiscardPolicy(FifoQoS, ?not_LifoOrder), + [?EVENT1, ?EVENT2, ?EVENT3, ?EVENT4, ?EVENT5], + "Discard Lifo and Order Fifo"), + do_discard(Events, ?not_SetDiscardPolicy(DeadlineQoS, ?not_LifoOrder), + [?EVENT5, ?EVENT4, ?EVENT3, ?EVENT2, ?EVENT1], + "Discard Lifo and Order Deadline"), + + %% Test using Fifo discard policy + do_discard(Events, ?not_SetDiscardPolicy(AnyQoS, ?not_FifoOrder), + [?EVENT5, ?EVENT6, ?EVENT9, ?EVENT7, ?EVENT8], + "Discard Fifo and Order Any"), + do_discard(Events, ?not_SetDiscardPolicy(PriorityQoS, ?not_FifoOrder), + [?EVENT5, ?EVENT6, ?EVENT9, ?EVENT7, ?EVENT8], + "Discard Fifo and Order Priority"), + do_discard(Events, ?not_SetDiscardPolicy(FifoQoS, ?not_FifoOrder), + [?EVENT5, ?EVENT6, ?EVENT7, ?EVENT8, ?EVENT9], + "Discard Fifo and Order Fifo"), + do_discard(Events, ?not_SetDiscardPolicy(DeadlineQoS, ?not_FifoOrder), + [?EVENT9, ?EVENT5, ?EVENT7, ?EVENT6, ?EVENT8], + "Discard Fifo and Order Deadline"), + + %% Test using Priority discard policy + do_discard(Events, ?not_SetDiscardPolicy(AnyQoS, ?not_PriorityOrder), + [?EVENT4, ?EVENT5, ?EVENT1, ?EVENT2, ?EVENT3], + "Discard Priority and Order Any"), + do_discard(Events, ?not_SetDiscardPolicy(PriorityQoS, ?not_PriorityOrder), + [?EVENT4, ?EVENT5, ?EVENT1, ?EVENT2, ?EVENT3], + "Discard Priority and Order Priority"), + do_discard(Events, ?not_SetDiscardPolicy(FifoQoS, ?not_PriorityOrder), + [?EVENT1, ?EVENT2, ?EVENT3, ?EVENT4, ?EVENT5], + "Discard Priority and Order Fifo"), + do_discard(Events, ?not_SetDiscardPolicy(DeadlineQoS, ?not_PriorityOrder), + [?EVENT5, ?EVENT4, ?EVENT3, ?EVENT2, ?EVENT1], + "Discard Priority and Order Deadline"), + + %% Test using Deadline discard policy + do_discard(Events, ?not_SetDiscardPolicy(AnyQoS, ?not_DeadlineOrder), + [?EVENT1, ?EVENT2, ?EVENT3, ?EVENT6, ?EVENT8], + "Discard Deadline and Order Any"), + do_discard(Events, ?not_SetDiscardPolicy(PriorityQoS, ?not_DeadlineOrder), + [?EVENT1, ?EVENT2, ?EVENT3, ?EVENT6, ?EVENT8], + "Discard Deadline and Order Priority"), + do_discard(Events, ?not_SetDiscardPolicy(FifoQoS, ?not_DeadlineOrder), + [?EVENT1, ?EVENT2, ?EVENT3, ?EVENT6, ?EVENT8], + "Discard Deadline and Order Fifo"), + do_discard(Events, ?not_SetDiscardPolicy(DeadlineQoS, ?not_DeadlineOrder), + [?EVENT6, ?EVENT8, ?EVENT3, ?EVENT2, ?EVENT1], + "Discard Deadline and Order Deadline"), + + ok. + +do_discard(Events, QoS, Reply, Txt) -> + io:format("################# ~s #################~n", [Txt]), + Ref = cosNotification_eventDB:create_db(QoS, 60, 50, undefined), + create_loop(Events, Ref), + ?match({Reply,_}, cosNotification_eventDB:get_events(Ref, ?NO_OF_EVENTS)), + cosNotification_eventDB:destroy_db(Ref). + + +%%----------------------------------------------------------------- +%% cosNotification_eventDB lookup API tests +%%----------------------------------------------------------------- +lookup_api(doc) -> ["The event DB is used to store events which cannot be", + "delivered at once. This case is supposed to test", + "that the events are delivered in the correct order.", + ""]; +lookup_api(suite) -> []; +lookup_api(_Config) -> + InitQoS = ?not_CreateInitQoS(), + InitQoS2 = ?not_SetMaxEventsPerConsumer(InitQoS,100), + InitQoS3 = ?not_SetStartTimeSupported(InitQoS2, false), + QoS = ?not_SetDiscardPolicy(InitQoS3, ?not_AnyOrder), + + AnyQoS = ?not_SetOrderPolicy(QoS, ?not_AnyOrder), + PriorityQoS = ?not_SetOrderPolicy(QoS, ?not_PriorityOrder), + FifoQoS = ?not_SetOrderPolicy(QoS, ?not_FifoOrder), + DeadlineQoS = ?not_SetOrderPolicy(QoS, ?not_DeadlineOrder), + + %% "Calculate" data once: + Events = ?EVENTS, + PrioOrder = ?PRIOORDER, + FifoOrder = ?FIFOORDER, + DeadlineOrder = ?DEADLINEORDER, + + do_lookup(PriorityQoS, Events, PrioOrder, "Priority Order"), + do_lookup(FifoQoS, Events, FifoOrder, "Fifo Order"), + do_lookup(DeadlineQoS, Events, DeadlineOrder, "Deadline Order"), + do_lookup(AnyQoS, Events, PrioOrder, "Any Order"), + ok. + +do_lookup(QoS, Events, Return, Txt) -> + io:format("#################### ~s ###################~n", [Txt]), + Ref = cosNotification_eventDB:create_db(QoS, 60, 50, undefined), + create_loop(Events, Ref), + ?match({Return,_}, cosNotification_eventDB:get_events(Ref, ?NO_OF_EVENTS)), + cosNotification_eventDB:destroy_db(Ref). + + +%%----------------------------------------------------------------- +%% cosNotification_eventDB max events API tests +%%----------------------------------------------------------------- +max_events_api(doc) -> ["The event DB is used to store events which cannot be", + "delivered at once. If the MaxEvents QoS is updated we must be", + "able to reduce the amount of stored events.", + ""]; +max_events_api(suite) -> []; +max_events_api(_Config) -> + + QoS1 = ?not_CreateInitQoS(), + QoS2 = ?not_SetOrderPolicy(QoS1, ?not_FifoOrder), + QoS3 = ?not_SetDiscardPolicy(QoS2, ?not_RejectNewEvents), + QoS4 = ?not_SetStartTimeSupported(QoS3, false), + QoS_NO_OF_EVENTS = ?not_SetMaxEventsPerConsumer(QoS4, ?NO_OF_EVENTS), + QoS_5_EVENTS = ?not_SetMaxEventsPerConsumer(QoS4, 5), + + Events = ?EVENTS, + Events5 = [?EVENT1, ?EVENT2, ?EVENT3, ?EVENT4, ?EVENT5], + + %% Initiate DB and 'NO_OF_EVENTS' events. + Ref1 = cosNotification_eventDB:create_db(QoS_NO_OF_EVENTS, 60, 50, undefined), + create_loop(Events, Ref1), + + %% Reduce the limit to 5 and extract all and see if it's ok. + Ref2 = cosNotification_eventDB:update(Ref1, QoS_5_EVENTS), + ?match({Events5, true}, cosNotification_eventDB:get_events(Ref2, ?NO_OF_EVENTS)), + + %% Add 'NO_OF_EVENTS' events. Since the only allow 5 events the DB will only + %% contain 5 events. + create_loop(Events, Ref2), + Ref3 = cosNotification_eventDB:update(Ref2, QoS_NO_OF_EVENTS), + + ?match({Events5, true}, cosNotification_eventDB:get_events(Ref3, ?NO_OF_EVENTS)), + create_loop(Events, Ref3), + ?match({Events, true}, cosNotification_eventDB:get_events(Ref3, ?NO_OF_EVENTS)), + cosNotification_eventDB:destroy_db(Ref3), + ok. + + +%%----------------------------------------------------------------- +%% cosNotification_eventDB persisten events API tests +%%----------------------------------------------------------------- +persisten_event_api(doc) -> ["The event DB is used to store events which cannot be", + "delivered at once.", + ""]; +persisten_event_api(suite) -> []; +persisten_event_api(_Config) -> + + QoS1 = ?not_CreateInitQoS(), + QoS2 = ?not_SetOrderPolicy(QoS1, ?not_FifoOrder), + QoS3 = ?not_SetDiscardPolicy(QoS2, ?not_RejectNewEvents), + QoS4 = ?not_SetStartTimeSupported(QoS3, false), + QoS = ?not_SetMaxEventsPerConsumer(QoS4, ?NO_OF_EVENTS), + + Event1 = ?EVENT1, + + Ref = cosNotification_eventDB:create_db(QoS, 60, 50, undefined), + %% Clean DB, should be empty + ?match(0, cosNotification_eventDB:status(Ref, eventCounter)), + cosNotification_eventDB:add_event(Ref, Event1), + ?match(1, cosNotification_eventDB:status(Ref, eventCounter)), + %% Get event without removing it. Should still be one event stored + ?match({[Event1], _, _}, cosNotification_eventDB:get_events(Ref, 2, false)), + ?match(1, cosNotification_eventDB:status(Ref, eventCounter)), + {_, _, Keys} = + ?match({Event1, _, _}, cosNotification_eventDB:get_event(Ref, false)), + ?match(1, cosNotification_eventDB:status(Ref, eventCounter)), + %% Clear the events and check that the DB is empty. + cosNotification_eventDB:delete_events(Keys), + ?match(0, cosNotification_eventDB:status(Ref, eventCounter)), + ?match({[], _, []}, cosNotification_eventDB:get_event(Ref, false)), + ?match({[], _, []}, cosNotification_eventDB:get_events(Ref, 2, false)), + + cosNotification_eventDB:destroy_db(Ref), + ok. + +%%----------------------------------------------------------------- +%% cosNotification_eventDB gc API tests +%%----------------------------------------------------------------- +gc_api(doc) -> ["The event DB is used to store events which cannot be", + "delivered at once. If Deadline defined the events that", + "are older must be discarded.", + ""]; +gc_api(suite) -> []; +gc_api(_Config) -> + + QoS1 = ?not_CreateInitQoS(), + QoS2 = ?not_SetOrderPolicy(QoS1, ?not_FifoOrder), + QoS3 = ?not_SetDiscardPolicy(QoS2, ?not_RejectNewEvents), + QoS4 = ?not_SetStartTimeSupported(QoS3, false), + QoS_NO_OF_EVENTS = ?not_SetMaxEventsPerConsumer(QoS4, ?NO_OF_EVENTS), + + Events = ?EVENTS, + Events6 = [?EVENT1, ?EVENT2, ?EVENT3, ?EVENT4, ?EVENT6, ?EVENT7, ?EVENT8], + %% Initiate DB and 'NO_OF_EVENTS' events. + Ref = cosNotification_eventDB:create_db(QoS_NO_OF_EVENTS, 60, 50, undefined), + create_loop(Events, Ref), + + %% Sleep so some events will get 'old'. + timer:sleep(23000), + + %% Reduce the limit to 5 and extract all and see if it's ok. + cosNotification_eventDB:gc_events(Ref, high), + + %% Since gc is done by another process we must wait so it will have a chance + %% to complete the job. + timer:sleep(2000), + + ?match({Events6, true}, cosNotification_eventDB:get_events(Ref, ?NO_OF_EVENTS)), + + create_loop(Events, Ref), + timer:sleep(23000), + ?match({Events6, true}, cosNotification_eventDB:get_events(Ref, ?NO_OF_EVENTS)), + cosNotification_eventDB:destroy_db(Ref), + ok. + + +%%----------------------------------------------------------------- +%% cosNotification_eventDB gc API tests +%%----------------------------------------------------------------- +auto_gc_api(doc) -> ["The event DB is used to store events which cannot be", + "delivered at once. If Deadline defined the events that", + "are older must be discarded.", + ""]; +auto_gc_api(suite) -> []; +auto_gc_api(_Config) -> + + QoS1 = ?not_CreateInitQoS(), + QoS2 = ?not_SetOrderPolicy(QoS1, ?not_FifoOrder), + QoS3 = ?not_SetDiscardPolicy(QoS2, ?not_RejectNewEvents), + QoS4 = ?not_SetStopTimeSupported(QoS3, true), + QoS5 = ?not_SetStartTimeSupported(QoS4, false), + QoS_NO_OF_EVENTS = ?not_SetMaxEventsPerConsumer(QoS5, ?NO_OF_EVENTS), + + Events6 = [?EVENT1, ?EVENT2, ?EVENT3, ?EVENT7, ?EVENT8, ?EVENT9], + %% Initiate DB + Ref = cosNotification_eventDB:create_db(QoS_NO_OF_EVENTS, 50, 50, undefined), + create_loop([?EVENT1, ?EVENT2, ?EVENT3, ?EVENT4, ?EVENT6], Ref), + + %% Sleep so some events will get 'old'. + timer:sleep(60000), + create_loop([?EVENT7, ?EVENT8, ?EVENT9], Ref), + + %% Since gc is done by another process we must wait so it will have a chance + %% to complete the job. + timer:sleep(2000), + + ?match({Events6, true}, cosNotification_eventDB:get_events(Ref, ?NO_OF_EVENTS)), + + cosNotification_eventDB:destroy_db(Ref), + + ok. + + +%%----------------------------------------------------------------- +%% cosNotification_eventDB start- and stop-time API tests +%%----------------------------------------------------------------- +start_stop_time_api(doc) -> ["The event DB is used to store events which cannot be", + "delivered at once. If Deadline defined the events that", + "are older must be discarded.", + ""]; +start_stop_time_api(suite) -> []; +start_stop_time_api(_Config) -> + + QoS1 = ?not_CreateInitQoS(), + QoS2 = ?not_SetOrderPolicy(QoS1, ?not_FifoOrder), + QoS3 = ?not_SetDiscardPolicy(QoS2, ?not_RejectNewEvents), + QoS4 = ?not_SetStopTimeSupported(QoS3, true), + QoS5 = ?not_SetStartTimeSupported(QoS4, true), + QoS_NO_OF_EVENTS = ?not_SetMaxEventsPerConsumer(QoS5, ?NO_OF_EVENTS), + + %% Initiate DB + TimeService = cosTime:start_time_service(2, 0), + Ref = cosNotification_eventDB:create_db(QoS_NO_OF_EVENTS, 50, 50, TimeService), + + T1 = 'CosTime_UTO':'_get_utc_time'('CosTime_UTO': + absolute_time('CosTime_TimeService': + new_universal_time(TimeService, + 100000000, 0, 2))), + T2 = 'CosTime_UTO':'_get_utc_time'('CosTime_UTO': + absolute_time('CosTime_TimeService': + new_universal_time(TimeService, + 200000000, 0, 2))), + T3 = 'CosTime_UTO':'_get_utc_time'('CosTime_UTO': + absolute_time('CosTime_TimeService': + new_universal_time(TimeService, + 300000000, 0, 2))), + T4 = 'CosTime_UTO':'_get_utc_time'('CosTime_UTO': + absolute_time('CosTime_TimeService': + new_universal_time(TimeService, + 400000000, 0, 2))), + %% Delivered after 10 seconds discarded after 20. + EVENT1 = ?not_CreateSE("","event1","", + [#'CosNotification_Property' + {name="Priority", + value=any:create(orber_tc:short(), 1)}, + #'CosNotification_Property' + {name="StartTime", + value=any:create('TimeBase_UtcT':tc(), T1)}, + #'CosNotification_Property' + {name="StopTime", + value=any:create('TimeBase_UtcT':tc(), T2)}], + [], any:create(orber_tc:null(), null)), + + %% Delivered after 30 seconds discarded after 10, i.e., always discarded. + EVENT2 = ?not_CreateSE("","event2","", + [#'CosNotification_Property' + {name="Priority", + value=any:create(orber_tc:short(), 3)}, + #'CosNotification_Property' + {name="StartTime", + value=any:create('TimeBase_UtcT':tc(), T3)}, + #'CosNotification_Property' + {name="StopTime", + value=any:create('TimeBase_UtcT':tc(), T1)}], + [], any:create(orber_tc:null(), null)), + + %% Delivered after 20 seconds discarded after 40 + EVENT3 = ?not_CreateSE("","event3","", + [#'CosNotification_Property' + {name="Priority", + value=any:create(orber_tc:short(), 2)}, + #'CosNotification_Property' + {name="StartTime", + value=any:create('TimeBase_UtcT':tc(), T2)}, + #'CosNotification_Property' + {name="StopTime", + value=any:create('TimeBase_UtcT':tc(), T4)}], + [], any:create(orber_tc:null(), null)), + + + + + create_loop([EVENT1, EVENT2, EVENT3], Ref), + + ?match({[], false}, cosNotification_eventDB:get_events(Ref, ?NO_OF_EVENTS)), + + %% Sleep so some events will get 'old'. + timer:sleep(12000), + + ?match({[EVENT1], true}, cosNotification_eventDB:get_events(Ref, ?NO_OF_EVENTS)), + + ?match({[], false}, cosNotification_eventDB:get_events(Ref, ?NO_OF_EVENTS)), + + timer:sleep(10000), + + ?match({[EVENT3], true}, cosNotification_eventDB:get_events(Ref, ?NO_OF_EVENTS)), + + timer:sleep(20000), + + %% See if EVENT2 really have been discarded. + ?match({[], false}, cosNotification_eventDB:get_events(Ref, ?NO_OF_EVENTS)), + + cosNotification_eventDB:destroy_db(Ref), + + cosTime:stop_time_service(TimeService), + + ok. + + +%%----------------------------------------------------------------- +%% cosNotification_eventDB order API tests +%%----------------------------------------------------------------- +reorder_api(doc) -> ["The event DB is used to store events which cannot be", + "delivered at once. If the QoS is updated we must be", + "able to change the ordering of events as the discard", + "and order policies tells us.", + ""]; +reorder_api(suite) -> []; +reorder_api(_Config) -> + %% We need to test switching between: + %% * Priority -> Fifo + %% * Priority -> Deadline + %% * Fifo -> Priority + %% * Fifo -> Deadline + %% * Deadline -> Priority + %% * Deadline -> Fifo + QoS = ?not_CreateInitQoS(), + QoS2 = ?not_SetMaxEventsPerConsumer(QoS,100), + QoS3 = ?not_SetPriority(QoS2, 10), + QoS4 = ?not_SetStartTimeSupported(QoS3, false), + QoS5 = ?not_SetOrderPolicy(QoS4, ?not_AnyOrder), + + + %% Test all order policies using Any order discard policy. + reorder_helper(?not_SetDiscardPolicy(QoS5, ?not_AnyOrder), "Discard Any"), + reorder_helper(?not_SetDiscardPolicy(QoS5, ?not_PriorityOrder), "Discard Priority"), + reorder_helper(?not_SetDiscardPolicy(QoS5, ?not_DeadlineOrder), "Discard Deadline"), + reorder_helper(?not_SetDiscardPolicy(QoS5, ?not_FifoOrder), "Discard Fifo"), + reorder_helper(?not_SetDiscardPolicy(QoS5, ?not_LifoOrder), "Discard Lifo"), + reorder_helper(?not_SetDiscardPolicy(QoS5, ?not_RejectNewEvents), "Reject New Events"), + + ok. + + +reorder_helper(QoS, Txt) -> + io:format("$$$$$$$$$$$$$$$$$$$$ ~s $$$$$$$$$$$$$$$$$$$~n", [Txt]), + %% Create a DB with the above settings. + Ref = cosNotification_eventDB:create_db(QoS, 60, 50, undefined), + + Events = ?EVENTS, + PrioOrder = ?PRIOORDER, + FifoOrder = ?FIFOORDER, + DeadlineOrder = ?DEADLINEORDER, + + %% Test all order policies using Any order discard policy. + Ref2 = do_reorder(Ref, Events, ?not_SetOrderPolicy(QoS, ?not_FifoOrder), + FifoOrder, "Priority -> Fifo"), + Ref3 = do_reorder(Ref2, Events, ?not_SetOrderPolicy(QoS, ?not_PriorityOrder), + PrioOrder, "Fifo -> Priority"), + Ref4 = do_reorder(Ref3, Events, ?not_SetOrderPolicy(QoS, ?not_DeadlineOrder), + DeadlineOrder, "Priority -> Deadline"), + + Ref5 = do_reorder(Ref4, Events, ?not_SetOrderPolicy(QoS, ?not_PriorityOrder), + PrioOrder, "Deadline -> Priority"), + + Ref6 = do_reorder(Ref5, Events, ?not_SetOrderPolicy(QoS, ?not_FifoOrder), + FifoOrder, "Priority -> Fifo"), + + Ref7 = do_reorder(Ref6, Events, ?not_SetOrderPolicy(QoS, ?not_DeadlineOrder), + DeadlineOrder, "Fifo -> Deadline"), + + Ref8 = do_reorder(Ref7, Events, ?not_SetOrderPolicy(QoS, ?not_FifoOrder), + FifoOrder, "Deadline -> Fifo"), + cosNotification_eventDB:destroy_db(Ref8), + ok. + + + +do_reorder(Ref, Events, QoS, Reply, Txt) -> + create_loop(Events, Ref), + io:format("################# ~s #################~n", [Txt]), + NewRef = cosNotification_eventDB:update(Ref, QoS), + ?match({Reply,_}, cosNotification_eventDB:get_events(NewRef, ?NO_OF_EVENTS)), + NewRef. + +%%----------------------------------------------------------------- +%% Internal functions +%%----------------------------------------------------------------- +%% This functions takes as argument a list of structured events. +create_loop([], _Ref) -> + ok; +create_loop([H|T], Ref) -> + catch cosNotification_eventDB:add_event(Ref, H), + create_loop(T, Ref). + +create_loop([], _Ref, _Life, _Prio) -> + ok; +create_loop([H|T], Ref, Life, Prio) -> + catch cosNotification_eventDB:add_event(Ref, H, Life, Prio), + create_loop(T, Ref, Life, Prio). + +%%-------------------- End of Module ------------------------------ diff --git a/lib/cosNotification/test/generated_SUITE.erl b/lib/cosNotification/test/generated_SUITE.erl new file mode 100644 index 0000000000..34b84041f0 --- /dev/null +++ b/lib/cosNotification/test/generated_SUITE.erl @@ -0,0 +1,2042 @@ +%%----------------------------------------------------------------- +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2004-2009. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +%% +%%----------------------------------------------------------------- +%% File : generated_SUITE.erl +%% Purpose : +%%----------------------------------------------------------------- + +-module(generated_SUITE). + +-include("test_server.hrl"). +-include_lib("orber/include/corba.hrl"). + +-define(default_timeout, ?t:minutes(3)). + +-define(match(ExpectedRes, Expr), + fun() -> + AcTuAlReS = (catch (Expr)), + case AcTuAlReS of + ExpectedRes -> + AcTuAlReS; + _ -> + io:format("###### ERROR ERROR ######~n~p~n", + [AcTuAlReS]), + ?line exit(AcTuAlReS) + end + end()). + +-define(nomatch(Not, Expr), + fun() -> + AcTuAlReS = (catch (Expr)), + case AcTuAlReS of + Not -> + io:format("###### ERROR ERROR ######~n~p~n", + [AcTuAlReS]), + ?line exit(AcTuAlReS); + _ -> + AcTuAlReS + end + end()). + + +-define(checktc(_Op), + fun(TC) -> + case orber_tc:check_tc(TC) of + false -> + io:format("###### ERROR ERROR ######~n~p - ~p~n", [Op, TC]), + ?line exit(TC); + true -> + true + end + end). + +%%----------------------------------------------------------------- +%% External exports +%%----------------------------------------------------------------- +-export([all/1]). + +%%----------------------------------------------------------------- +%% Internal exports +%%----------------------------------------------------------------- +-export([]). +-compile(export_all). + +%%----------------------------------------------------------------- +%% Func: all/1 +%% Args: +%% Returns: +%%----------------------------------------------------------------- +all(doc) -> ["This suite is for testing IC generated files"]; +all(suite) -> + ['CosNotification', 'CosNotification_AdminPropertiesAdmin', + 'CosNotification_EventHeader', 'CosNotification_EventType', + 'CosNotification_FixedEventHeader', 'CosNotification_NamedPropertyRange', + 'CosNotification_Property', 'CosNotification_PropertyError', + 'CosNotification_PropertyRange', 'CosNotification_QoSAdmin', + 'CosNotification_StructuredEvent', 'CosNotification_UnsupportedAdmin', + 'CosNotification_UnsupportedQoS', 'CosNotification_EventBatch', + 'CosNotification_EventTypeSeq', 'CosNotification_NamedPropertyRangeSeq', + 'CosNotification_PropertyErrorSeq', 'CosNotifyChannelAdmin_AdminLimit', + 'CosNotifyChannelAdmin_AdminNotFound', 'CosNotifyChannelAdmin_ChannelNotFound', + 'CosNotifyChannelAdmin_ConnectionAlreadyActive', 'CosNotifyChannelAdmin_ConnectionAlreadyInactive', + 'CosNotifyChannelAdmin_NotConnected', 'CosNotifyChannelAdmin_AdminIDSeq', + 'CosNotifyChannelAdmin_ChannelIDSeq', 'CosNotifyChannelAdmin_ProxyIDSeq', + 'CosNotifyFilter_CallbackNotFound', 'CosNotifyFilter_ConstraintExp', + 'CosNotifyFilter_ConstraintInfo', 'CosNotifyFilter_ConstraintNotFound', + 'CosNotifyFilter_DuplicateConstraintID', 'CosNotifyFilter_FilterNotFound', + 'CosNotifyFilter_InvalidConstraint', 'CosNotifyFilter_InvalidGrammar', + 'CosNotifyFilter_InvalidValue', 'CosNotifyFilter_MappingConstraintInfo', + 'CosNotifyFilter_MappingConstraintPair', 'CosNotifyFilter_UnsupportedFilterableData', + 'CosNotifyFilter_CallbackIDSeq', 'CosNotifyFilter_ConstraintExpSeq', + 'CosNotifyFilter_ConstraintIDSeq', 'CosNotifyFilter_ConstraintInfoSeq', + 'CosNotifyFilter_FilterIDSeq', 'CosNotifyFilter_MappingConstraintInfoSeq', + 'CosNotifyFilter_MappingConstraintPairSeq', 'CosNotifyComm_InvalidEventType', + 'CosNotifyChannelAdmin_ConsumerAdmin', 'CosNotifyChannelAdmin_EventChannel', + 'CosNotifyChannelAdmin_EventChannelFactory', 'CosNotifyChannelAdmin_ProxyConsumer', + 'CosNotifyChannelAdmin_ProxyNotFound', 'CosNotifyChannelAdmin_ProxyPullConsumer', + 'CosNotifyChannelAdmin_ProxyPullSupplier', 'CosNotifyChannelAdmin_ProxyPushConsumer', + 'CosNotifyChannelAdmin_ProxyPushSupplier', 'CosNotifyChannelAdmin_ProxySupplier', + 'CosNotifyChannelAdmin_SequenceProxyPullConsumer', 'CosNotifyChannelAdmin_SequenceProxyPullSupplier', + 'CosNotifyChannelAdmin_SequenceProxyPushConsumer', 'CosNotifyChannelAdmin_SequenceProxyPushSupplier', + 'CosNotifyChannelAdmin_StructuredProxyPullConsumer', 'CosNotifyChannelAdmin_StructuredProxyPullSupplier', + 'CosNotifyChannelAdmin_StructuredProxyPushConsumer', 'CosNotifyChannelAdmin_StructuredProxyPushSupplier', + 'CosNotifyChannelAdmin_SupplierAdmin', 'CosNotifyFilter_Filter', + 'CosNotifyFilter_FilterAdmin', 'CosNotifyFilter_FilterFactory', + 'CosNotifyFilter_MappingFilter', 'CosNotifyComm_NotifyPublish', + 'CosNotifyComm_NotifySubscribe', 'CosNotifyComm_PullConsumer', + 'CosNotifyComm_PullSupplier', 'CosNotifyComm_PushConsumer', + 'CosNotifyComm_PushSupplier', 'CosNotifyComm_SequencePullConsumer', + 'CosNotifyComm_SequencePullSupplier', 'CosNotifyComm_SequencePushConsumer', + 'CosNotifyComm_SequencePushSupplier', 'CosNotifyComm_StructuredPullConsumer', + 'CosNotifyComm_StructuredPullSupplier', 'CosNotifyComm_StructuredPushConsumer', + 'CosNotifyComm_StructuredPushSupplier', 'oe_CosNotificationComm_Event', + 'CosNotification_PropertySeq']. + +%%----------------------------------------------------------------- +%% Init and cleanup functions. +%%----------------------------------------------------------------- +init_per_testcase(_Case, Config) -> + ?line Dog=test_server:timetrap(?default_timeout), + [{watchdog, Dog}|Config]. + + +fin_per_testcase(_Case, Config) -> + Dog = ?config(watchdog, Config), + test_server:timetrap_cancel(Dog), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotification' +%% Description: +%%----------------------------------------------------------------- +'CosNotification'(doc) -> ["CosNotification"]; +'CosNotification'(suite) -> []; +'CosNotification'(_) -> + ?match("EventReliability", 'CosNotification':'EventReliability'()), + ?match(0, 'CosNotification':'BestEffort'()), + ?match(1, 'CosNotification':'Persistent'()), + ?match("ConnectionReliability", 'CosNotification':'ConnectionReliability'()), + ?match("Priority", 'CosNotification':'Priority'()), + ?match(-32767, 'CosNotification':'LowestPriority'()), + ?match(32767, 'CosNotification':'HighestPriority'()), + ?match(0, 'CosNotification':'DefaultPriority'()), + ?match("StartTime", 'CosNotification':'StartTime'()), + ?match("StopTime", 'CosNotification':'StopTime'()), + ?match("Timeout", 'CosNotification':'Timeout'()), + ?match("OrderPolicy", 'CosNotification':'OrderPolicy'()), + ?match(0, 'CosNotification':'AnyOrder'()), + ?match(1, 'CosNotification':'FifoOrder'()), + ?match(2, 'CosNotification':'PriorityOrder'()), + ?match(3, 'CosNotification':'DeadlineOrder'()), + ?match("DiscardPolicy", 'CosNotification':'DiscardPolicy'()), + ?match(4, 'CosNotification':'LifoOrder'()), + ?match(5, 'CosNotification':'RejectNewEvents'()), + ?match("MaximumBatchSize", 'CosNotification':'MaximumBatchSize'()), + ?match("PacingInterval", 'CosNotification':'PacingInterval'()), + ?match("StartTimeSupported", 'CosNotification':'StartTimeSupported'()), + ?match("StopTimeSupported", 'CosNotification':'StopTimeSupported'()), + ?match("MaxEventsPerConsumer", 'CosNotification':'MaxEventsPerConsumer'()), + ?match("MaxQueueLength", 'CosNotification':'MaxQueueLength'()), + ?match("MaxConsumers", 'CosNotification':'MaxConsumers'()), + ?match("MaxSuppliers", 'CosNotification':'MaxSuppliers'()), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotification_EventHeader' +%% Description: +%%----------------------------------------------------------------- +'CosNotification_EventHeader'(doc) -> ["CosNotification_EventHeader"]; +'CosNotification_EventHeader'(suite) -> []; +'CosNotification_EventHeader'(_) -> + ?match(true, orber_tc:check_tc('CosNotification_EventHeader':tc())), + ?match("IDL:omg.org/CosNotification/EventHeader:1.0", + 'CosNotification_EventHeader':id()), + ?match("CosNotification_EventHeader", + 'CosNotification_EventHeader':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotification_EventType' +%% Description: +%%----------------------------------------------------------------- +'CosNotification_EventType'(doc) -> ["CosNotification_EventType"]; +'CosNotification_EventType'(suite) -> []; +'CosNotification_EventType'(_) -> + ?match(true, orber_tc:check_tc('CosNotification_EventType':tc())), + ?match("IDL:omg.org/CosNotification/EventType:1.0", + 'CosNotification_EventType':id()), + ?match("CosNotification_EventType", + 'CosNotification_EventType':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotification_FixedEventHeader' +%% Description: +%%----------------------------------------------------------------- +'CosNotification_FixedEventHeader'(doc) -> ["CosNotification_FixedEventHeader"]; +'CosNotification_FixedEventHeader'(suite) -> []; +'CosNotification_FixedEventHeader'(_) -> + ?match(true, orber_tc:check_tc('CosNotification_FixedEventHeader':tc())), + ?match("IDL:omg.org/CosNotification/FixedEventHeader:1.0", + 'CosNotification_FixedEventHeader':id()), + ?match("CosNotification_FixedEventHeader", + 'CosNotification_FixedEventHeader':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotification_NamedPropertyRange' +%% Description: +%%----------------------------------------------------------------- +'CosNotification_NamedPropertyRange'(doc) -> ["CosNotification_NamedPropertyRange"]; +'CosNotification_NamedPropertyRange'(suite) -> []; +'CosNotification_NamedPropertyRange'(_) -> + ?match(true, orber_tc:check_tc('CosNotification_NamedPropertyRange':tc())), + ?match("IDL:omg.org/CosNotification/NamedPropertyRange:1.0", + 'CosNotification_NamedPropertyRange':id()), + ?match("CosNotification_NamedPropertyRange", + 'CosNotification_NamedPropertyRange':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotification_Property' +%% Description: +%%----------------------------------------------------------------- +'CosNotification_Property'(doc) -> ["CosNotification_Property"]; +'CosNotification_Property'(suite) -> []; +'CosNotification_Property'(_) -> + ?match(true, orber_tc:check_tc('CosNotification_Property':tc())), + ?match("IDL:omg.org/CosNotification/Property:1.0", + 'CosNotification_Property':id()), + ?match("CosNotification_Property", + 'CosNotification_Property':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotification_PropertyError' +%% Description: +%%----------------------------------------------------------------- +'CosNotification_PropertyError'(doc) -> ["CosNotification_PropertyError"]; +'CosNotification_PropertyError'(suite) -> []; +'CosNotification_PropertyError'(_) -> + ?match(true, orber_tc:check_tc('CosNotification_PropertyError':tc())), + ?match("IDL:omg.org/CosNotification/PropertyError:1.0", + 'CosNotification_PropertyError':id()), + ?match("CosNotification_PropertyError", + 'CosNotification_PropertyError':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotification_PropertyRange' +%% Description: +%%----------------------------------------------------------------- +'CosNotification_PropertyRange'(doc) -> [""]; +'CosNotification_PropertyRange'(suite) -> []; +'CosNotification_PropertyRange'(_) -> + ?match(true, orber_tc:check_tc('CosNotification_PropertyRange':tc())), + ?match("IDL:omg.org/CosNotification/PropertyRange:1.0", + 'CosNotification_PropertyRange':id()), + ?match("CosNotification_PropertyRange", + 'CosNotification_PropertyRange':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotification_StructuredEvent' +%% Description: +%%----------------------------------------------------------------- +'CosNotification_StructuredEvent'(doc) -> ["CosNotification_StructuredEvent"]; +'CosNotification_StructuredEvent'(suite) -> []; +'CosNotification_StructuredEvent'(_) -> + ?match(true, orber_tc:check_tc('CosNotification_StructuredEvent':tc())), + ?match("IDL:omg.org/CosNotification/StructuredEvent:1.0", + 'CosNotification_StructuredEvent':id()), + ?match("CosNotification_StructuredEvent", + 'CosNotification_StructuredEvent':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotification_UnsupportedAdmin' +%% Description: +%%----------------------------------------------------------------- +'CosNotification_UnsupportedAdmin'(doc) -> ["CosNotification_UnsupportedAdmin"]; +'CosNotification_UnsupportedAdmin'(suite) -> []; +'CosNotification_UnsupportedAdmin'(_) -> + ?match(true, orber_tc:check_tc('CosNotification_UnsupportedAdmin':tc())), + ?match("IDL:omg.org/CosNotification/UnsupportedAdmin:1.0", + 'CosNotification_UnsupportedAdmin':id()), + ?match("CosNotification_UnsupportedAdmin", + 'CosNotification_UnsupportedAdmin':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotification_UnsupportedQoS' +%% Description: +%%----------------------------------------------------------------- +'CosNotification_UnsupportedQoS'(doc) -> ["CosNotification_UnsupportedQoS"]; +'CosNotification_UnsupportedQoS'(suite) -> []; +'CosNotification_UnsupportedQoS'(_) -> + ?match(true, orber_tc:check_tc('CosNotification_UnsupportedQoS':tc())), + ?match("IDL:omg.org/CosNotification/UnsupportedQoS:1.0", + 'CosNotification_UnsupportedQoS':id()), + ?match("CosNotification_UnsupportedQoS", + 'CosNotification_UnsupportedQoS':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotification_EventBatch' +%% Description: +%%----------------------------------------------------------------- +'CosNotification_EventBatch'(doc) -> ["CosNotification_EventBatch"]; +'CosNotification_EventBatch'(suite) -> []; +'CosNotification_EventBatch'(_) -> + ?match(true, orber_tc:check_tc('CosNotification_EventBatch':tc())), + ?match("IDL:omg.org/CosNotification/EventBatch:1.0", + 'CosNotification_EventBatch':id()), + ?match("CosNotification_EventBatch", + 'CosNotification_EventBatch':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotification_EventTypeSeq' +%% Description: +%%----------------------------------------------------------------- +'CosNotification_EventTypeSeq'(doc) -> ["CosNotification_EventTypeSeq"]; +'CosNotification_EventTypeSeq'(suite) -> []; +'CosNotification_EventTypeSeq'(_) -> + ?match(true, orber_tc:check_tc('CosNotification_EventTypeSeq':tc())), + ?match("IDL:omg.org/CosNotification/EventTypeSeq:1.0", + 'CosNotification_EventTypeSeq':id()), + ?match("CosNotification_EventTypeSeq", + 'CosNotification_EventTypeSeq':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotification_NamedPropertyRangeSeq' +%% Description: +%%----------------------------------------------------------------- +'CosNotification_NamedPropertyRangeSeq'(doc) -> ["CosNotification_NamedPropertyRangeSeq"]; +'CosNotification_NamedPropertyRangeSeq'(suite) -> []; +'CosNotification_NamedPropertyRangeSeq'(_) -> + ?match(true, orber_tc:check_tc('CosNotification_NamedPropertyRangeSeq':tc())), + ?match("IDL:omg.org/CosNotification/NamedPropertyRangeSeq:1.0", + 'CosNotification_NamedPropertyRangeSeq':id()), + ?match("CosNotification_NamedPropertyRangeSeq", + 'CosNotification_NamedPropertyRangeSeq':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotification_PropertyErrorSeq' +%% Description: +%%----------------------------------------------------------------- +'CosNotification_PropertyErrorSeq'(doc) -> ["CosNotification_PropertyErrorSeq"]; +'CosNotification_PropertyErrorSeq'(suite) -> []; +'CosNotification_PropertyErrorSeq'(_) -> + ?match(true, orber_tc:check_tc('CosNotification_PropertyErrorSeq':tc())), + ?match("IDL:omg.org/CosNotification/PropertyErrorSeq:1.0", + 'CosNotification_PropertyErrorSeq':id()), + ?match("CosNotification_PropertyErrorSeq", + 'CosNotification_PropertyErrorSeq':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotification_PropertySeq' +%% Description: +%%----------------------------------------------------------------- +'CosNotification_PropertySeq'(doc) -> ["CosNotification_PropertySeq"]; +'CosNotification_PropertySeq'(suite) -> []; +'CosNotification_PropertySeq'(_) -> + ?match(true, orber_tc:check_tc('CosNotification_PropertySeq':tc())), + ?match("IDL:omg.org/CosNotification/PropertySeq:1.0", + 'CosNotification_PropertySeq':id()), + ?match("CosNotification_PropertySeq", + 'CosNotification_PropertySeq':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_AdminLimit' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_AdminLimit'(doc) -> ["CosNotifyChannelAdmin_AdminLimit"]; +'CosNotifyChannelAdmin_AdminLimit'(suite) -> []; +'CosNotifyChannelAdmin_AdminLimit'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyChannelAdmin_AdminLimit':tc())), + ?match("IDL:omg.org/CosNotifyChannelAdmin/AdminLimit:1.0", + 'CosNotifyChannelAdmin_AdminLimit':id()), + ?match("CosNotifyChannelAdmin_AdminLimit", + 'CosNotifyChannelAdmin_AdminLimit':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_AdminLimitExceeded' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_AdminLimitExceeded'(doc) -> ["CosNotifyChannelAdmin_AdminLimitExceeded"]; +'CosNotifyChannelAdmin_AdminLimitExceeded'(suite) -> []; +'CosNotifyChannelAdmin_AdminLimitExceeded'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyChannelAdmin_AdminLimitExceeded':tc())), + ?match("IDL:omg.org/CosNotifyChannelAdmin/AdminLimitExceeded:1.0", + 'CosNotifyChannelAdmin_AdminLimitExceeded':id()), + ?match("CosNotifyChannelAdmin_AdminLimitExceeded", + 'CosNotifyChannelAdmin_AdminLimitExceeded':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_AdminNotFound' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_AdminNotFound'(doc) -> ["CosNotifyChannelAdmin_AdminNotFound"]; +'CosNotifyChannelAdmin_AdminNotFound'(suite) -> []; +'CosNotifyChannelAdmin_AdminNotFound'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyChannelAdmin_AdminNotFound':tc())), + ?match("IDL:omg.org/CosNotifyChannelAdmin/AdminNotFound:1.0", + 'CosNotifyChannelAdmin_AdminNotFound':id()), + ?match("CosNotifyChannelAdmin_AdminNotFound", + 'CosNotifyChannelAdmin_AdminNotFound':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_ChannelNotFound' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_ChannelNotFound'(doc) -> ["CosNotifyChannelAdmin_ChannelNotFound"]; +'CosNotifyChannelAdmin_ChannelNotFound'(suite) -> []; +'CosNotifyChannelAdmin_ChannelNotFound'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyChannelAdmin_ChannelNotFound':tc())), + ?match("IDL:omg.org/CosNotifyChannelAdmin/ChannelNotFound:1.0", + 'CosNotifyChannelAdmin_ChannelNotFound':id()), + ?match("CosNotifyChannelAdmin_ChannelNotFound", + 'CosNotifyChannelAdmin_ChannelNotFound':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_ConnectionAlreadyActive' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_ConnectionAlreadyActive'(doc) -> ["CosNotifyChannelAdmin_ConnectionAlreadyActive"]; +'CosNotifyChannelAdmin_ConnectionAlreadyActive'(suite) -> []; +'CosNotifyChannelAdmin_ConnectionAlreadyActive'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyChannelAdmin_ConnectionAlreadyActive':tc())), + ?match("IDL:omg.org/CosNotifyChannelAdmin/ConnectionAlreadyActive:1.0", + 'CosNotifyChannelAdmin_ConnectionAlreadyActive':id()), + ?match("CosNotifyChannelAdmin_ConnectionAlreadyActive", + 'CosNotifyChannelAdmin_ConnectionAlreadyActive':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_ConnectionAlreadyInactive' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_ConnectionAlreadyInactive'(doc) -> ["CosNotifyChannelAdmin_ConnectionAlreadyInactive"]; +'CosNotifyChannelAdmin_ConnectionAlreadyInactive'(suite) -> []; +'CosNotifyChannelAdmin_ConnectionAlreadyInactive'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyChannelAdmin_ConnectionAlreadyInactive':tc())), + ?match("IDL:omg.org/CosNotifyChannelAdmin/ConnectionAlreadyInactive:1.0", + 'CosNotifyChannelAdmin_ConnectionAlreadyInactive':id()), + ?match("CosNotifyChannelAdmin_ConnectionAlreadyInactive", + 'CosNotifyChannelAdmin_ConnectionAlreadyInactive':name()), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_NotConnected' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_NotConnected'(doc) -> ["CosNotifyChannelAdmin_NotConnected"]; +'CosNotifyChannelAdmin_NotConnected'(suite) -> []; +'CosNotifyChannelAdmin_NotConnected'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyChannelAdmin_NotConnected':tc())), + ?match("IDL:omg.org/CosNotifyChannelAdmin/NotConnected:1.0", + 'CosNotifyChannelAdmin_NotConnected':id()), + ?match("CosNotifyChannelAdmin_NotConnected", + 'CosNotifyChannelAdmin_NotConnected':name()), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_AdminIDSeq' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_AdminIDSeq'(doc) -> ["CosNotifyChannelAdmin_AdminIDSeq"]; +'CosNotifyChannelAdmin_AdminIDSeq'(suite) -> []; +'CosNotifyChannelAdmin_AdminIDSeq'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyChannelAdmin_AdminIDSeq':tc())), + ?match("IDL:omg.org/CosNotifyChannelAdmin/AdminIDSeq:1.0", + 'CosNotifyChannelAdmin_AdminIDSeq':id()), + ?match("CosNotifyChannelAdmin_AdminIDSeq", + 'CosNotifyChannelAdmin_AdminIDSeq':name()), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_ChannelIDSeq' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_ChannelIDSeq'(doc) -> ["CosNotifyChannelAdmin_ChannelIDSeq"]; +'CosNotifyChannelAdmin_ChannelIDSeq'(suite) -> []; +'CosNotifyChannelAdmin_ChannelIDSeq'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyChannelAdmin_ChannelIDSeq':tc())), + ?match("IDL:omg.org/CosNotifyChannelAdmin/ChannelIDSeq:1.0", + 'CosNotifyChannelAdmin_ChannelIDSeq':id()), + ?match("CosNotifyChannelAdmin_ChannelIDSeq", + 'CosNotifyChannelAdmin_ChannelIDSeq':name()), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_ProxyIDSeq' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_ProxyIDSeq'(doc) -> ["CosNotifyChannelAdmin_ProxyIDSeq"]; +'CosNotifyChannelAdmin_ProxyIDSeq'(suite) -> []; +'CosNotifyChannelAdmin_ProxyIDSeq'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyChannelAdmin_ProxyIDSeq':tc())), + ?match("IDL:omg.org/CosNotifyChannelAdmin/ProxyIDSeq:1.0", + 'CosNotifyChannelAdmin_ProxyIDSeq':id()), + ?match("CosNotifyChannelAdmin_ProxyIDSeq", + 'CosNotifyChannelAdmin_ProxyIDSeq':name()), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyFilter_CallbackNotFound' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyFilter_CallbackNotFound'(doc) -> ["CosNotifyFilter_CallbackNotFound"]; +'CosNotifyFilter_CallbackNotFound'(suite) -> []; +'CosNotifyFilter_CallbackNotFound'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyFilter_CallbackNotFound':tc())), + ?match("IDL:omg.org/CosNotifyFilter/CallbackNotFound:1.0", + 'CosNotifyFilter_CallbackNotFound':id()), + ?match("CosNotifyFilter_CallbackNotFound", + 'CosNotifyFilter_CallbackNotFound':name()), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyFilter_ConstraintExp' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyFilter_ConstraintExp'(doc) -> ["CosNotifyFilter_ConstraintExp"]; +'CosNotifyFilter_ConstraintExp'(suite) -> []; +'CosNotifyFilter_ConstraintExp'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyFilter_ConstraintExp':tc())), + ?match("IDL:omg.org/CosNotifyFilter/ConstraintExp:1.0", + 'CosNotifyFilter_ConstraintExp':id()), + ?match("CosNotifyFilter_ConstraintExp", + 'CosNotifyFilter_ConstraintExp':name()), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyFilter_ConstraintInfo' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyFilter_ConstraintInfo'(doc) -> ["CosNotifyFilter_ConstraintInfo"]; +'CosNotifyFilter_ConstraintInfo'(suite) -> []; +'CosNotifyFilter_ConstraintInfo'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyFilter_ConstraintInfo':tc())), + ?match("IDL:omg.org/CosNotifyFilter/ConstraintInfo:1.0", + 'CosNotifyFilter_ConstraintInfo':id()), + ?match("CosNotifyFilter_ConstraintInfo", + 'CosNotifyFilter_ConstraintInfo':name()), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyFilter_ConstraintNotFound' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyFilter_ConstraintNotFound'(doc) -> ["CosNotifyFilter_ConstraintNotFound"]; +'CosNotifyFilter_ConstraintNotFound'(suite) -> []; +'CosNotifyFilter_ConstraintNotFound'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyFilter_ConstraintNotFound':tc())), + ?match("IDL:omg.org/CosNotifyFilter/ConstraintNotFound:1.0", + 'CosNotifyFilter_ConstraintNotFound':id()), + ?match("CosNotifyFilter_ConstraintNotFound", + 'CosNotifyFilter_ConstraintNotFound':name()), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyFilter_DuplicateConstraintID' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyFilter_DuplicateConstraintID'(doc) -> ["CosNotifyFilter_DuplicateConstraintID"]; +'CosNotifyFilter_DuplicateConstraintID'(suite) -> []; +'CosNotifyFilter_DuplicateConstraintID'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyFilter_DuplicateConstraintID':tc())), + ?match("IDL:omg.org/CosNotifyFilter/DuplicateConstraintID:1.0", + 'CosNotifyFilter_DuplicateConstraintID':id()), + ?match("CosNotifyFilter_DuplicateConstraintID", + 'CosNotifyFilter_DuplicateConstraintID':name()), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyFilter_FilterNotFound' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyFilter_FilterNotFound'(doc) -> ["CosNotifyFilter_FilterNotFound"]; +'CosNotifyFilter_FilterNotFound'(suite) -> []; +'CosNotifyFilter_FilterNotFound'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyFilter_FilterNotFound':tc())), + ?match("IDL:omg.org/CosNotifyFilter/FilterNotFound:1.0", + 'CosNotifyFilter_FilterNotFound':id()), + ?match("CosNotifyFilter_FilterNotFound", + 'CosNotifyFilter_FilterNotFound':name()), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyFilter_InvalidConstraint' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyFilter_InvalidConstraint'(doc) -> ["CosNotifyFilter_InvalidConstraint"]; +'CosNotifyFilter_InvalidConstraint'(suite) -> []; +'CosNotifyFilter_InvalidConstraint'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyFilter_InvalidConstraint':tc())), + ?match("IDL:omg.org/CosNotifyFilter/InvalidConstraint:1.0", + 'CosNotifyFilter_InvalidConstraint':id()), + ?match("CosNotifyFilter_InvalidConstraint", + 'CosNotifyFilter_InvalidConstraint':name()), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyFilter_InvalidGrammar' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyFilter_InvalidGrammar'(doc) -> ["CosNotifyFilter_InvalidGrammar"]; +'CosNotifyFilter_InvalidGrammar'(suite) -> []; +'CosNotifyFilter_InvalidGrammar'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyFilter_InvalidGrammar':tc())), + ?match("IDL:omg.org/CosNotifyFilter/InvalidGrammar:1.0", + 'CosNotifyFilter_InvalidGrammar':id()), + ?match("CosNotifyFilter_InvalidGrammar", + 'CosNotifyFilter_InvalidGrammar':name()), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyFilter_InvalidValue' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyFilter_InvalidValue'(doc) -> ["CosNotifyFilter_InvalidValue"]; +'CosNotifyFilter_InvalidValue'(suite) -> []; +'CosNotifyFilter_InvalidValue'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyFilter_InvalidValue':tc())), + ?match("IDL:omg.org/CosNotifyFilter/InvalidValue:1.0", + 'CosNotifyFilter_InvalidValue':id()), + ?match("CosNotifyFilter_InvalidValue", + 'CosNotifyFilter_InvalidValue':name()), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyFilter_MappingConstraintInfo' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyFilter_MappingConstraintInfo'(doc) -> ["CosNotifyFilter_MappingConstraintInfo"]; +'CosNotifyFilter_MappingConstraintInfo'(suite) -> []; +'CosNotifyFilter_MappingConstraintInfo'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyFilter_MappingConstraintInfo':tc())), + ?match("IDL:omg.org/CosNotifyFilter/MappingConstraintInfo:1.0", + 'CosNotifyFilter_MappingConstraintInfo':id()), + ?match("CosNotifyFilter_MappingConstraintInfo", + 'CosNotifyFilter_MappingConstraintInfo':name()), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyFilter_MappingConstraintPair' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyFilter_MappingConstraintPair'(doc) -> ["CosNotifyFilter_MappingConstraintPair"]; +'CosNotifyFilter_MappingConstraintPair'(suite) -> []; +'CosNotifyFilter_MappingConstraintPair'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyFilter_MappingConstraintPair':tc())), + ?match("IDL:omg.org/CosNotifyFilter/MappingConstraintPair:1.0", + 'CosNotifyFilter_MappingConstraintPair':id()), + ?match("CosNotifyFilter_MappingConstraintPair", + 'CosNotifyFilter_MappingConstraintPair':name()), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyFilter_UnsupportedFilterableData' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyFilter_UnsupportedFilterableData'(doc) -> ["CosNotifyFilter_UnsupportedFilterableData"]; +'CosNotifyFilter_UnsupportedFilterableData'(suite) -> []; +'CosNotifyFilter_UnsupportedFilterableData'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyFilter_UnsupportedFilterableData':tc())), + ?match("IDL:omg.org/CosNotifyFilter/UnsupportedFilterableData:1.0", + 'CosNotifyFilter_UnsupportedFilterableData':id()), + ?match("CosNotifyFilter_UnsupportedFilterableData", + 'CosNotifyFilter_UnsupportedFilterableData':name()), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyFilter_CallbackIDSeq' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyFilter_CallbackIDSeq'(doc) -> ["CosNotifyFilter_CallbackIDSeq"]; +'CosNotifyFilter_CallbackIDSeq'(suite) -> []; +'CosNotifyFilter_CallbackIDSeq'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyFilter_CallbackIDSeq':tc())), + ?match("IDL:omg.org/CosNotifyFilter/CallbackIDSeq:1.0", + 'CosNotifyFilter_CallbackIDSeq':id()), + ?match("CosNotifyFilter_CallbackIDSeq", + 'CosNotifyFilter_CallbackIDSeq':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyFilter_ConstraintExpSeq' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyFilter_ConstraintExpSeq'(doc) -> ["CosNotifyFilter_ConstraintExpSeq"]; +'CosNotifyFilter_ConstraintExpSeq'(suite) -> []; +'CosNotifyFilter_ConstraintExpSeq'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyFilter_ConstraintExpSeq':tc())), + ?match("IDL:omg.org/CosNotifyFilter/ConstraintExpSeq:1.0", + 'CosNotifyFilter_ConstraintExpSeq':id()), + ?match("CosNotifyFilter_ConstraintExpSeq", + 'CosNotifyFilter_ConstraintExpSeq':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyFilter_ConstraintIDSeq' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyFilter_ConstraintIDSeq'(doc) -> ["CosNotifyFilter_ConstraintIDSeq"]; +'CosNotifyFilter_ConstraintIDSeq'(suite) -> []; +'CosNotifyFilter_ConstraintIDSeq'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyFilter_ConstraintIDSeq':tc())), + ?match("IDL:omg.org/CosNotifyFilter/ConstraintIDSeq:1.0", + 'CosNotifyFilter_ConstraintIDSeq':id()), + ?match("CosNotifyFilter_ConstraintIDSeq", + 'CosNotifyFilter_ConstraintIDSeq':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyFilter_ConstraintInfoSeq' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyFilter_ConstraintInfoSeq'(doc) -> ["CosNotifyFilter_ConstraintInfoSeq"]; +'CosNotifyFilter_ConstraintInfoSeq'(suite) -> []; +'CosNotifyFilter_ConstraintInfoSeq'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyFilter_ConstraintInfoSeq':tc())), + ?match("IDL:omg.org/CosNotifyFilter/ConstraintInfoSeq:1.0", + 'CosNotifyFilter_ConstraintInfoSeq':id()), + ?match("CosNotifyFilter_ConstraintInfoSeq", + 'CosNotifyFilter_ConstraintInfoSeq':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyFilter_FilterIDSeq' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyFilter_FilterIDSeq'(doc) -> ["CosNotifyFilter_FilterIDSeq"]; +'CosNotifyFilter_FilterIDSeq'(suite) -> []; +'CosNotifyFilter_FilterIDSeq'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyFilter_FilterIDSeq':tc())), + ?match("IDL:omg.org/CosNotifyFilter/FilterIDSeq:1.0", + 'CosNotifyFilter_FilterIDSeq':id()), + ?match("CosNotifyFilter_FilterIDSeq", + 'CosNotifyFilter_FilterIDSeq':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyFilter_MappingConstraintInfoSeq' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyFilter_MappingConstraintInfoSeq'(doc) -> ["CosNotifyFilter_MappingConstraintInfoSeq"]; +'CosNotifyFilter_MappingConstraintInfoSeq'(suite) -> []; +'CosNotifyFilter_MappingConstraintInfoSeq'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyFilter_MappingConstraintInfoSeq':tc())), + ?match("IDL:omg.org/CosNotifyFilter/MappingConstraintInfoSeq:1.0", + 'CosNotifyFilter_MappingConstraintInfoSeq':id()), + ?match("CosNotifyFilter_MappingConstraintInfoSeq", + 'CosNotifyFilter_MappingConstraintInfoSeq':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyFilter_MappingConstraintPairSeq' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyFilter_MappingConstraintPairSeq'(doc) -> ["CosNotifyFilter_MappingConstraintPairSeq"]; +'CosNotifyFilter_MappingConstraintPairSeq'(suite) -> []; +'CosNotifyFilter_MappingConstraintPairSeq'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyFilter_MappingConstraintPairSeq':tc())), + ?match("IDL:omg.org/CosNotifyFilter/MappingConstraintPairSeq:1.0", + 'CosNotifyFilter_MappingConstraintPairSeq':id()), + ?match("CosNotifyFilter_MappingConstraintPairSeq", + 'CosNotifyFilter_MappingConstraintPairSeq':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyComm_InvalidEventType' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyComm_InvalidEventType'(doc) -> ["CosNotifyComm_InvalidEventType"]; +'CosNotifyComm_InvalidEventType'(suite) -> []; +'CosNotifyComm_InvalidEventType'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyComm_InvalidEventType':tc())), + ?match("IDL:omg.org/CosNotifyComm/InvalidEventType:1.0", + 'CosNotifyComm_InvalidEventType':id()), + ?match("CosNotifyComm_InvalidEventType", + 'CosNotifyComm_InvalidEventType':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_ProxyNotFound' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_ProxyNotFound'(doc) -> ["CosNotifyChannelAdmin_ProxyNotFound"]; +'CosNotifyChannelAdmin_ProxyNotFound'(suite) -> []; +'CosNotifyChannelAdmin_ProxyNotFound'(_) -> + ?match(true, orber_tc:check_tc('CosNotifyChannelAdmin_ProxyNotFound':tc())), + ?match("IDL:omg.org/CosNotifyChannelAdmin/ProxyNotFound:1.0", + 'CosNotifyChannelAdmin_ProxyNotFound':id()), + ?match("CosNotifyChannelAdmin_ProxyNotFound", + 'CosNotifyChannelAdmin_ProxyNotFound':name()), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotification_AdminPropertiesAdmin' +%% Description: +%%----------------------------------------------------------------- +'CosNotification_AdminPropertiesAdmin'(doc) -> ["CosNotification_AdminPropertiesAdmin"]; +'CosNotification_AdminPropertiesAdmin'(suite) -> []; +'CosNotification_AdminPropertiesAdmin'(_) -> + ?nomatch(undefined, 'CosNotification_AdminPropertiesAdmin':oe_tc(get_admin)), + ?nomatch(undefined, 'CosNotification_AdminPropertiesAdmin':oe_tc(set_admin)), + ?match(undefined, 'CosNotification_AdminPropertiesAdmin':oe_tc(undefined)), + ?match([_|_], 'CosNotification_AdminPropertiesAdmin':oe_get_interface()), + ?match("IDL:omg.org/CosNotification/AdminPropertiesAdmin:1.0", + 'CosNotification_AdminPropertiesAdmin':typeID()), + check_tc('CosNotification_AdminPropertiesAdmin':oe_get_interface()), + ?match(true, 'CosNotification_AdminPropertiesAdmin':oe_is_a('CosNotification_AdminPropertiesAdmin':typeID())), + ?match(false, 'CosNotification_AdminPropertiesAdmin':oe_is_a("wrong")), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotification_QoSAdmin' +%% Description: +%%----------------------------------------------------------------- +'CosNotification_QoSAdmin'(doc) -> ["CosNotification_QoSAdmin"]; +'CosNotification_QoSAdmin'(suite) -> []; +'CosNotification_QoSAdmin'(_) -> + ?nomatch(undefined, 'CosNotification_QoSAdmin':oe_tc(get_qos)), + ?nomatch(undefined, 'CosNotification_QoSAdmin':oe_tc(set_qos)), + ?nomatch(undefined, 'CosNotification_QoSAdmin':oe_tc(validate_qos)), + ?match(undefined, 'CosNotification_QoSAdmin':oe_tc(undefined)), + ?match([_|_], 'CosNotification_QoSAdmin':oe_get_interface()), + ?match("IDL:omg.org/CosNotification/QoSAdmin:1.0", + 'CosNotification_QoSAdmin':typeID()), + check_tc('CosNotification_QoSAdmin':oe_get_interface()), + ?match(true, 'CosNotification_QoSAdmin':oe_is_a('CosNotification_QoSAdmin':typeID())), + ?match(false, 'CosNotification_QoSAdmin':oe_is_a("wrong")), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_ConsumerAdmin' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_ConsumerAdmin'(doc) -> ["CosNotifyChannelAdmin_ConsumerAdmin"]; +'CosNotifyChannelAdmin_ConsumerAdmin'(suite) -> []; +'CosNotifyChannelAdmin_ConsumerAdmin'(_) -> + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc('_get_MyID')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc('_get_MyChannel')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc('_get_MyOperator')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc('_get_priority_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc('_set_priority_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc('_get_lifetime_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc('_set_lifetime_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc('_get_pull_suppliers')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc('_get_push_suppliers')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc(get_proxy_supplier)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc(obtain_notification_pull_supplier)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc(obtain_notification_push_supplier)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc(destroy)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc(get_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc(set_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc(validate_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc(subscription_change)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc(add_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc(remove_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc(get_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc(get_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc(remove_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc(obtain_push_supplier)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc(obtain_pull_supplier)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc(callSeq)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc(callAny)), + ?match(undefined, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_tc(undefined)), + ?match([_|_], 'CosNotifyChannelAdmin_ConsumerAdmin':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyChannelAdmin/ConsumerAdmin:1.0", + 'CosNotifyChannelAdmin_ConsumerAdmin':typeID()), + check_tc('CosNotifyChannelAdmin_ConsumerAdmin':oe_get_interface()), + ?match(true, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_is_a('CosNotifyChannelAdmin_ConsumerAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_is_a('CosNotification_QoSAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_is_a('CosNotifyComm_NotifySubscribe':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_is_a('CosNotifyFilter_FilterAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_is_a('CosEventChannelAdmin_ConsumerAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_is_a('oe_CosNotificationComm_Event':typeID())), + ?match(false, 'CosNotifyChannelAdmin_ConsumerAdmin':oe_is_a("wrong")), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_EventChannel' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_EventChannel'(doc) -> ["CosNotifyChannelAdmin_EventChannel"]; +'CosNotifyChannelAdmin_EventChannel'(suite) -> []; +'CosNotifyChannelAdmin_EventChannel'(_) -> + ?nomatch(undefined, 'CosNotifyChannelAdmin_EventChannel':oe_tc('_get_MyFactory')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_EventChannel':oe_tc('_get_default_consumer_admin')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_EventChannel':oe_tc('_get_default_supplier_admin')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_EventChannel':oe_tc('_get_default_filter_factory')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_EventChannel':oe_tc(new_for_consumers)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_EventChannel':oe_tc(new_for_suppliers)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_EventChannel':oe_tc(get_consumeradmin)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_EventChannel':oe_tc(get_supplieradmin)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_EventChannel':oe_tc(get_all_consumeradmins)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_EventChannel':oe_tc(get_all_supplieradmins)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_EventChannel':oe_tc(get_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_EventChannel':oe_tc(set_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_EventChannel':oe_tc(validate_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_EventChannel':oe_tc(get_admin)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_EventChannel':oe_tc(set_admin)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_EventChannel':oe_tc(for_consumers)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_EventChannel':oe_tc(for_suppliers)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_EventChannel':oe_tc(destroy)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_EventChannel':oe_tc(callSeq)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_EventChannel':oe_tc(callAny)), + ?match(undefined, 'CosNotifyChannelAdmin_EventChannel':oe_tc(undefined)), + ?match([_|_], 'CosNotifyChannelAdmin_EventChannel':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyChannelAdmin/EventChannel:1.0", + 'CosNotifyChannelAdmin_EventChannel':typeID()), + check_tc('CosNotifyChannelAdmin_EventChannel':oe_get_interface()), + ?match(true, 'CosNotifyChannelAdmin_EventChannel':oe_is_a('CosNotifyChannelAdmin_EventChannel':typeID())), + ?match(true, 'CosNotifyChannelAdmin_EventChannel':oe_is_a('CosNotification_QoSAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_EventChannel':oe_is_a('CosNotification_AdminPropertiesAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_EventChannel':oe_is_a('CosEventChannelAdmin_EventChannel':typeID())), + ?match(true, 'CosNotifyChannelAdmin_EventChannel':oe_is_a('oe_CosNotificationComm_Event':typeID())), + ?match(false, 'CosNotifyChannelAdmin_EventChannel':oe_is_a("wrong")), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_EventChannelFactory' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_EventChannelFactory'(doc) -> ["CosNotifyChannelAdmin_EventChannelFactory"]; +'CosNotifyChannelAdmin_EventChannelFactory'(suite) -> []; +'CosNotifyChannelAdmin_EventChannelFactory'(_) -> + ?nomatch(undefined, 'CosNotifyChannelAdmin_EventChannelFactory':oe_tc(create_channel)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_EventChannelFactory':oe_tc(get_all_channels)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_EventChannelFactory':oe_tc(get_event_channel)), + ?match(undefined, 'CosNotifyChannelAdmin_EventChannelFactory':oe_tc(undefined)), + ?match([_|_], 'CosNotifyChannelAdmin_EventChannelFactory':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyChannelAdmin/EventChannelFactory:1.0", + 'CosNotifyChannelAdmin_EventChannelFactory':typeID()), + check_tc('CosNotifyChannelAdmin_EventChannelFactory':oe_get_interface()), + ?match(true, 'CosNotifyChannelAdmin_EventChannelFactory':oe_is_a('CosNotifyChannelAdmin_EventChannelFactory':typeID())), + ?match(false, 'CosNotifyChannelAdmin_EventChannelFactory':oe_is_a("wrong")), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_ProxyConsumer' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_ProxyConsumer'(doc) -> ["CosNotifyChannelAdmin_ProxyConsumer"]; +'CosNotifyChannelAdmin_ProxyConsumer'(suite) -> []; +'CosNotifyChannelAdmin_ProxyConsumer'(_) -> + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyConsumer':oe_tc('_get_MyType')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyConsumer':oe_tc('_get_MyAdmin')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyConsumer':oe_tc(obtain_subscription_types)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyConsumer':oe_tc(validate_event_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyConsumer':oe_tc(get_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyConsumer':oe_tc(set_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyConsumer':oe_tc(validate_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyConsumer':oe_tc(add_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyConsumer':oe_tc(remove_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyConsumer':oe_tc(get_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyConsumer':oe_tc(get_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyConsumer':oe_tc(remove_all_filters)), + ?match(undefined, 'CosNotifyChannelAdmin_ProxyConsumer':oe_tc(undefined)), + ?match([_|_], 'CosNotifyChannelAdmin_ProxyConsumer':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyChannelAdmin/ProxyConsumer:1.0", + 'CosNotifyChannelAdmin_ProxyConsumer':typeID()), + check_tc('CosNotifyChannelAdmin_ProxyConsumer':oe_get_interface()), + ?match(true, 'CosNotifyChannelAdmin_ProxyConsumer':oe_is_a('CosNotifyChannelAdmin_ProxyConsumer':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyConsumer':oe_is_a('CosNotification_QoSAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyConsumer':oe_is_a('CosNotifyFilter_FilterAdmin':typeID())), + ?match(false, 'CosNotifyChannelAdmin_ProxyConsumer':oe_is_a("wrong")), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_ProxyPullConsumer' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_ProxyPullConsumer'(doc) -> ["CosNotifyChannelAdmin_ProxyPullConsumer"]; +'CosNotifyChannelAdmin_ProxyPullConsumer'(suite) -> []; +'CosNotifyChannelAdmin_ProxyPullConsumer'(_) -> + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_tc(connect_any_pull_supplier)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_tc(suspend_connection)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_tc(resume_connection)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_tc('_get_MyType')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_tc('_get_MyAdmin')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_tc(obtain_subscription_types)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_tc(validate_event_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_tc(get_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_tc(set_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_tc(validate_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_tc(add_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_tc(remove_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_tc(get_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_tc(get_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_tc(remove_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_tc(offer_change)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_tc(disconnect_pull_consumer)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_tc(connect_pull_supplier)), + ?match(undefined, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_tc(undefined)), + ?match([_|_], 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyChannelAdmin/ProxyPullConsumer:1.0", + 'CosNotifyChannelAdmin_ProxyPullConsumer':typeID()), + check_tc('CosNotifyChannelAdmin_ProxyPullConsumer':oe_get_interface()), + ?match(true, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_is_a('CosNotifyChannelAdmin_ProxyPullConsumer':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_is_a('CosNotifyChannelAdmin_ProxyConsumer':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_is_a('CosNotification_QoSAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_is_a('CosNotifyFilter_FilterAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_is_a('CosNotifyComm_PullConsumer':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_is_a('CosNotifyComm_NotifyPublish':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_is_a('CosEventComm_PullConsumer':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_is_a('CosEventChannelAdmin_ProxyPullConsumer':typeID())), + ?match(false, 'CosNotifyChannelAdmin_ProxyPullConsumer':oe_is_a("wrong")), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_ProxyPullSupplier' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_ProxyPullSupplier'(doc) -> ["CosNotifyChannelAdmin_ProxyPullSupplier"]; +'CosNotifyChannelAdmin_ProxyPullSupplier'(suite) -> []; +'CosNotifyChannelAdmin_ProxyPullSupplier'(_) -> + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_tc('_get_MyType')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_tc('_get_MyAdmin')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_tc('_get_priority_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_tc('_set_priority_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_tc('_get_lifetime_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_tc('_set_lifetime_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_tc(obtain_offered_types)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_tc(validate_event_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_tc(get_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_tc(set_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_tc(validate_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_tc(add_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_tc(remove_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_tc(get_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_tc(get_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_tc(remove_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_tc(subscription_change)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_tc(pull)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_tc(try_pull)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_tc(disconnect_pull_supplier)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_tc(connect_pull_consumer)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_tc(callSeq)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_tc(callAny)), + ?match(undefined, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_tc(undefined)), + ?match([_|_], 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyChannelAdmin/ProxyPullSupplier:1.0", + 'CosNotifyChannelAdmin_ProxyPullSupplier':typeID()), + check_tc('CosNotifyChannelAdmin_ProxyPullSupplier':oe_get_interface()), + ?match(true, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_is_a('CosNotifyChannelAdmin_ProxyPullSupplier':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_is_a('CosNotifyChannelAdmin_ProxySupplier':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_is_a('CosNotification_QoSAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_is_a('CosNotifyFilter_FilterAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_is_a('CosNotifyComm_PullSupplier':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_is_a('CosNotifyComm_NotifySubscribe':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_is_a('CosEventComm_PullSupplier':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_is_a('CosEventChannelAdmin_ProxyPullSupplier':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_is_a('oe_CosNotificationComm_Event':typeID())), + ?match(false, 'CosNotifyChannelAdmin_ProxyPullSupplier':oe_is_a("wrong")), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_ProxyPushConsumer' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_ProxyPushConsumer'(doc) -> ["CosNotifyChannelAdmin_ProxyPushConsumer"]; +'CosNotifyChannelAdmin_ProxyPushConsumer'(suite) -> []; +'CosNotifyChannelAdmin_ProxyPushConsumer'(_) -> + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_tc(connect_any_push_supplier)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_tc('_get_MyType')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_tc('_get_MyAdmin')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_tc(obtain_subscription_types)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_tc(validate_event_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_tc(get_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_tc(set_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_tc(validate_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_tc(add_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_tc(remove_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_tc(get_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_tc(get_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_tc(remove_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_tc(offer_change)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_tc(push)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_tc(disconnect_push_consumer)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_tc(connect_push_supplier)), + ?match(undefined, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_tc(undefined)), + ?match([_|_], 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyChannelAdmin/ProxyPushConsumer:1.0", + 'CosNotifyChannelAdmin_ProxyPushConsumer':typeID()), + check_tc('CosNotifyChannelAdmin_ProxyPushConsumer':oe_get_interface()), + ?match(true, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_is_a('CosNotifyChannelAdmin_ProxyPushConsumer':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_is_a('CosNotifyChannelAdmin_ProxyConsumer':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_is_a('CosNotification_QoSAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_is_a('CosNotifyFilter_FilterAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_is_a('CosNotifyComm_PushConsumer':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_is_a('CosNotifyComm_NotifyPublish':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_is_a('CosEventComm_PushConsumer':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_is_a('CosEventChannelAdmin_ProxyPushConsumer':typeID())), + ?match(false, 'CosNotifyChannelAdmin_ProxyPushConsumer':oe_is_a("wrong")), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_ProxyPushSupplier' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_ProxyPushSupplier'(doc) -> ["CosNotifyChannelAdmin_ProxyPushSupplier"]; +'CosNotifyChannelAdmin_ProxyPushSupplier'(suite) -> []; +'CosNotifyChannelAdmin_ProxyPushSupplier'(_) -> + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_tc(connect_any_push_consumer)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_tc(suspend_connection)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_tc(resume_connection)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_tc('_get_MyType')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_tc('_get_MyAdmin')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_tc('_get_priority_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_tc('_set_priority_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_tc('_get_lifetime_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_tc('_set_lifetime_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_tc(obtain_offered_types)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_tc(validate_event_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_tc(get_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_tc(set_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_tc(validate_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_tc(add_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_tc(remove_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_tc(get_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_tc(get_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_tc(remove_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_tc(subscription_change)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_tc(disconnect_push_supplier)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_tc(connect_push_consumer)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_tc(callSeq)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_tc(callAny)), + ?match(undefined, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_tc(undefined)), + ?match([_|_], 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyChannelAdmin/ProxyPushSupplier:1.0", + 'CosNotifyChannelAdmin_ProxyPushSupplier':typeID()), + check_tc('CosNotifyChannelAdmin_ProxyPushSupplier':oe_get_interface()), + ?match(true, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_is_a('CosNotifyChannelAdmin_ProxyPushSupplier':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_is_a('CosNotifyChannelAdmin_ProxySupplier':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_is_a('CosNotification_QoSAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_is_a('CosNotifyFilter_FilterAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_is_a('CosNotifyComm_PushSupplier':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_is_a('CosNotifyComm_NotifySubscribe':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_is_a('CosEventComm_PushSupplier':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_is_a('CosEventChannelAdmin_ProxyPushSupplier':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_is_a('oe_CosNotificationComm_Event':typeID())), + ?match(false, 'CosNotifyChannelAdmin_ProxyPushSupplier':oe_is_a("wrong")), + ok. + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_ProxySupplier' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_ProxySupplier'(doc) -> ["CosNotifyChannelAdmin_ProxySupplier"]; +'CosNotifyChannelAdmin_ProxySupplier'(suite) -> []; +'CosNotifyChannelAdmin_ProxySupplier'(_) -> + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxySupplier':oe_tc('_get_MyType')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxySupplier':oe_tc('_get_MyAdmin')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxySupplier':oe_tc('_get_priority_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxySupplier':oe_tc('_set_priority_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxySupplier':oe_tc('_get_lifetime_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxySupplier':oe_tc('_set_lifetime_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxySupplier':oe_tc(obtain_offered_types)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxySupplier':oe_tc(validate_event_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxySupplier':oe_tc(get_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxySupplier':oe_tc(set_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxySupplier':oe_tc(validate_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxySupplier':oe_tc(add_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxySupplier':oe_tc(remove_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxySupplier':oe_tc(get_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxySupplier':oe_tc(get_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_ProxySupplier':oe_tc(remove_all_filters)), + ?match(undefined, 'CosNotifyChannelAdmin_ProxySupplier':oe_tc(undefined)), + ?match([_|_], 'CosNotifyChannelAdmin_ProxySupplier':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyChannelAdmin/ProxySupplier:1.0", + 'CosNotifyChannelAdmin_ProxySupplier':typeID()), + check_tc('CosNotifyChannelAdmin_ProxySupplier':oe_get_interface()), + ?match(true, 'CosNotifyChannelAdmin_ProxySupplier':oe_is_a('CosNotifyChannelAdmin_ProxySupplier':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxySupplier':oe_is_a('CosNotification_QoSAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_ProxySupplier':oe_is_a('CosNotifyFilter_FilterAdmin':typeID())), + ?match(false, 'CosNotifyChannelAdmin_ProxySupplier':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_SequenceProxyPullConsumer' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_SequenceProxyPullConsumer'(doc) -> ["CosNotifyChannelAdmin_SequenceProxyPullConsumer"]; +'CosNotifyChannelAdmin_SequenceProxyPullConsumer'(suite) -> []; +'CosNotifyChannelAdmin_SequenceProxyPullConsumer'(_) -> + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_tc(connect_sequence_pull_supplier)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_tc(suspend_connection)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_tc(resume_connection)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_tc('_get_MyType')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_tc('_get_MyAdmin')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_tc(obtain_subscription_types)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_tc(validate_event_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_tc(get_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_tc(set_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_tc(validate_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_tc(add_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_tc(remove_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_tc(get_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_tc(get_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_tc(remove_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_tc(disconnect_sequence_pull_consumer)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_tc(offer_change)), + ?match(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_tc(undefined)), + ?match([_|_], 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyChannelAdmin/SequenceProxyPullConsumer:1.0", + 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':typeID()), + check_tc('CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_get_interface()), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_is_a('CosNotifyChannelAdmin_SequenceProxyPullConsumer':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_is_a('CosNotifyChannelAdmin_ProxyConsumer':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_is_a('CosNotification_QoSAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_is_a('CosNotifyFilter_FilterAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_is_a('CosNotifyComm_SequencePullConsumer':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_is_a('CosNotifyComm_NotifyPublish':typeID())), + ?match(false, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_SequenceProxyPullSupplier' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_SequenceProxyPullSupplier'(doc) -> ["CosNotifyChannelAdmin_SequenceProxyPullSupplier"]; +'CosNotifyChannelAdmin_SequenceProxyPullSupplier'(suite) -> []; +'CosNotifyChannelAdmin_SequenceProxyPullSupplier'(_) -> + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_tc(connect_sequence_pull_consumer)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_tc('_get_MyType')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_tc('_get_MyAdmin')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_tc('_get_priority_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_tc('_set_priority_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_tc('_get_lifetime_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_tc('_set_lifetime_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_tc(obtain_offered_types)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_tc(validate_event_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_tc(get_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_tc(set_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_tc(validate_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_tc(add_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_tc(remove_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_tc(get_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_tc(get_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_tc(remove_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_tc(pull_structured_events)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_tc(try_pull_structured_events)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_tc(disconnect_sequence_pull_supplier)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_tc(subscription_change)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_tc(callSeq)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_tc(callAny)), + ?match(undefined, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_tc(undefined)), + ?match([_|_], 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyChannelAdmin/SequenceProxyPullSupplier:1.0", + 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':typeID()), + check_tc('CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_get_interface()), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_is_a('CosNotifyChannelAdmin_SequenceProxyPullSupplier':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_is_a('CosNotifyChannelAdmin_ProxySupplier':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_is_a('CosNotification_QoSAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_is_a('CosNotifyFilter_FilterAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_is_a('CosNotifyComm_SequencePullSupplier':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_is_a('CosNotifyComm_NotifySubscribe':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_is_a('oe_CosNotificationComm_Event':typeID())), + ?match(false, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_SequenceProxyPushConsumer' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_SequenceProxyPushConsumer'(doc) -> ["CosNotifyChannelAdmin_SequenceProxyPushConsumer"]; +'CosNotifyChannelAdmin_SequenceProxyPushConsumer'(suite) -> []; +'CosNotifyChannelAdmin_SequenceProxyPushConsumer'(_) -> + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_tc(connect_sequence_push_supplier)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_tc('_get_MyType')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_tc('_get_MyAdmin')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_tc(obtain_subscription_types)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_tc(validate_event_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_tc(get_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_tc(set_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_tc(validate_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_tc(add_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_tc(remove_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_tc(get_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_tc(get_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_tc(remove_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_tc(push_structured_events)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_tc(disconnect_sequence_push_consumer)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_tc(offer_change)), + ?match(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_tc(undefined)), + ?match([_|_], 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyChannelAdmin/SequenceProxyPushConsumer:1.0", + 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':typeID()), + check_tc('CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_get_interface()), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_is_a('CosNotifyChannelAdmin_SequenceProxyPushConsumer':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_is_a('CosNotifyChannelAdmin_ProxyConsumer':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_is_a('CosNotification_QoSAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_is_a('CosNotifyFilter_FilterAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_is_a('CosNotifyComm_SequencePushConsumer':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_is_a('CosNotifyComm_NotifyPublish':typeID())), + ?match(false, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_SequenceProxyPushSupplier' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_SequenceProxyPushSupplier'(doc) -> ["CosNotifyChannelAdmin_SequenceProxyPushSupplier"]; +'CosNotifyChannelAdmin_SequenceProxyPushSupplier'(suite) -> []; +'CosNotifyChannelAdmin_SequenceProxyPushSupplier'(_) -> + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_tc(connect_sequence_push_consumer)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_tc(suspend_connection)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_tc(resume_connection)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_tc('_get_MyType')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_tc('_get_MyAdmin')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_tc('_get_priority_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_tc('_set_priority_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_tc('_get_lifetime_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_tc('_set_lifetime_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_tc(obtain_offered_types)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_tc(validate_event_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_tc(get_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_tc(set_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_tc(validate_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_tc(add_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_tc(remove_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_tc(get_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_tc(get_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_tc(remove_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_tc(disconnect_sequence_push_supplier)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_tc(subscription_change)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_tc(callSeq)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_tc(callAny)), + ?match(undefined, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_tc(undefined)), + ?match([_|_], 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyChannelAdmin/SequenceProxyPushSupplier:1.0", + 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':typeID()), + check_tc('CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_get_interface()), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_is_a('CosNotifyChannelAdmin_SequenceProxyPushSupplier':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_is_a('CosNotifyChannelAdmin_ProxySupplier':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_is_a('CosNotification_QoSAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_is_a('CosNotifyFilter_FilterAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_is_a('CosNotifyComm_SequencePushSupplier':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_is_a('CosNotifyComm_NotifySubscribe':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_is_a('oe_CosNotificationComm_Event':typeID())), + ?match(false, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_StructuredProxyPullConsumer' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_StructuredProxyPullConsumer'(doc) -> ["CosNotifyChannelAdmin_StructuredProxyPullConsumer"]; +'CosNotifyChannelAdmin_StructuredProxyPullConsumer'(suite) -> []; +'CosNotifyChannelAdmin_StructuredProxyPullConsumer'(_) -> + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_tc(connect_structured_pull_supplier)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_tc(suspend_connection)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_tc(resume_connection)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_tc('_get_MyType')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_tc('_get_MyAdmin')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_tc(obtain_subscription_types)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_tc(validate_event_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_tc(get_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_tc(set_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_tc(validate_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_tc(add_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_tc(remove_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_tc(get_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_tc(get_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_tc(remove_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_tc(disconnect_structured_pull_consumer)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_tc(offer_change)), + ?match(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_tc(undefined)), + ?match([_|_], 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyChannelAdmin/StructuredProxyPullConsumer:1.0", + 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':typeID()), + check_tc('CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_get_interface()), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_is_a('CosNotifyChannelAdmin_StructuredProxyPullConsumer':typeID())), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_is_a('CosNotifyChannelAdmin_ProxyConsumer':typeID())), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_is_a('CosNotification_QoSAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_is_a('CosNotifyFilter_FilterAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_is_a('CosNotifyComm_StructuredPullConsumer':typeID())), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_is_a('CosNotifyComm_NotifyPublish':typeID())), + ?match(false, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_StructuredProxyPullSupplier' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_StructuredProxyPullSupplier'(doc) -> ["CosNotifyChannelAdmin_StructuredProxyPullSupplier"]; +'CosNotifyChannelAdmin_StructuredProxyPullSupplier'(suite) -> []; +'CosNotifyChannelAdmin_StructuredProxyPullSupplier'(_) -> + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_tc(connect_structured_pull_consumer)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_tc('_get_MyType')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_tc('_get_MyAdmin')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_tc('_get_priority_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_tc('_set_priority_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_tc('_get_lifetime_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_tc('_set_lifetime_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_tc(obtain_offered_types)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_tc(validate_event_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_tc(get_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_tc(set_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_tc(validate_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_tc(add_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_tc(remove_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_tc(get_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_tc(get_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_tc(remove_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_tc(pull_structured_event)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_tc(try_pull_structured_event)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_tc(disconnect_structured_pull_supplier)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_tc(subscription_change)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_tc(callSeq)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_tc(callAny)), + ?match(undefined, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_tc(undefined)), + ?match([_|_], 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyChannelAdmin/StructuredProxyPullSupplier:1.0", + 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':typeID()), + check_tc('CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_get_interface()), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_is_a('CosNotifyChannelAdmin_StructuredProxyPullSupplier':typeID())), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_is_a('CosNotifyChannelAdmin_ProxySupplier':typeID())), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_is_a('CosNotification_QoSAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_is_a('CosNotifyFilter_FilterAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_is_a('CosNotifyComm_StructuredPullSupplier':typeID())), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_is_a('CosNotifyComm_NotifySubscribe':typeID())), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_is_a('oe_CosNotificationComm_Event':typeID())), + ?match(false, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_StructuredProxyPushConsumer' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_StructuredProxyPushConsumer'(doc) -> ["CosNotifyChannelAdmin_StructuredProxyPushConsumer"]; +'CosNotifyChannelAdmin_StructuredProxyPushConsumer'(suite) -> []; +'CosNotifyChannelAdmin_StructuredProxyPushConsumer'(_) -> + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_tc(connect_structured_push_supplier)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_tc('_get_MyType')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_tc('_get_MyAdmin')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_tc(obtain_subscription_types)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_tc(validate_event_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_tc(get_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_tc(set_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_tc(validate_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_tc(add_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_tc(remove_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_tc(get_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_tc(get_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_tc(remove_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_tc(push_structured_event)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_tc(disconnect_structured_push_consumer)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_tc(offer_change)), + ?match(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_tc(undefined)), + ?match([_|_], 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyChannelAdmin/StructuredProxyPushConsumer:1.0", + 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':typeID()), + check_tc('CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_get_interface()), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_is_a('CosNotifyChannelAdmin_StructuredProxyPushConsumer':typeID())), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_is_a('CosNotifyChannelAdmin_ProxyConsumer':typeID())), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_is_a('CosNotification_QoSAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_is_a('CosNotifyFilter_FilterAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_is_a('CosNotifyComm_StructuredPushConsumer':typeID())), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_is_a('CosNotifyComm_NotifyPublish':typeID())), + ?match(false, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_StructuredProxyPushSupplier' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_StructuredProxyPushSupplier'(doc) -> ["CosNotifyChannelAdmin_StructuredProxyPushSupplier"]; +'CosNotifyChannelAdmin_StructuredProxyPushSupplier'(suite) -> []; +'CosNotifyChannelAdmin_StructuredProxyPushSupplier'(_) -> + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_tc(connect_structured_push_consumer)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_tc(suspend_connection)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_tc(resume_connection)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_tc('_get_MyType')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_tc('_get_MyAdmin')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_tc('_get_priority_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_tc('_set_priority_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_tc('_get_lifetime_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_tc('_set_lifetime_filter')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_tc(obtain_offered_types)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_tc(validate_event_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_tc(get_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_tc(set_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_tc(validate_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_tc(add_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_tc(remove_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_tc(get_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_tc(get_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_tc(remove_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_tc(disconnect_structured_push_supplier)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_tc(subscription_change)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_tc(callSeq)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_tc(callAny)), + ?match(undefined, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_tc(undefined)), + ?match([_|_], 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyChannelAdmin/StructuredProxyPushSupplier:1.0", + 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':typeID()), + check_tc('CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_get_interface()), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_is_a('CosNotifyChannelAdmin_StructuredProxyPushSupplier':typeID())), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_is_a('CosNotifyChannelAdmin_ProxySupplier':typeID())), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_is_a('CosNotification_QoSAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_is_a('CosNotifyFilter_FilterAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_is_a('CosNotifyComm_StructuredPushSupplier':typeID())), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_is_a('CosNotifyComm_NotifySubscribe':typeID())), + ?match(true, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_is_a('oe_CosNotificationComm_Event':typeID())), + ?match(false, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyChannelAdmin_SupplierAdmin' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyChannelAdmin_SupplierAdmin'(doc) -> ["CosNotifyChannelAdmin_SupplierAdmin"]; +'CosNotifyChannelAdmin_SupplierAdmin'(suite) -> []; +'CosNotifyChannelAdmin_SupplierAdmin'(_) -> + ?nomatch(undefined, 'CosNotifyChannelAdmin_SupplierAdmin':oe_tc('_get_MyID')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SupplierAdmin':oe_tc('_get_MyChannel')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SupplierAdmin':oe_tc('_get_MyOperator')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SupplierAdmin':oe_tc('_get_pull_consumers')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SupplierAdmin':oe_tc('_get_push_consumers')), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SupplierAdmin':oe_tc(get_proxy_consumer)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SupplierAdmin':oe_tc(obtain_notification_pull_consumer)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SupplierAdmin':oe_tc(obtain_notification_push_consumer)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SupplierAdmin':oe_tc(destroy)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SupplierAdmin':oe_tc(get_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SupplierAdmin':oe_tc(set_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SupplierAdmin':oe_tc(validate_qos)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SupplierAdmin':oe_tc(offer_change)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SupplierAdmin':oe_tc(add_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SupplierAdmin':oe_tc(remove_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SupplierAdmin':oe_tc(get_filter)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SupplierAdmin':oe_tc(get_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SupplierAdmin':oe_tc(remove_all_filters)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SupplierAdmin':oe_tc(obtain_push_consumer)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SupplierAdmin':oe_tc(obtain_pull_consumer)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SupplierAdmin':oe_tc(callSeq)), + ?nomatch(undefined, 'CosNotifyChannelAdmin_SupplierAdmin':oe_tc(callAny)), + ?match(undefined, 'CosNotifyChannelAdmin_SupplierAdmin':oe_tc(undefined)), + ?match([_|_], 'CosNotifyChannelAdmin_SupplierAdmin':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyChannelAdmin/SupplierAdmin:1.0", + 'CosNotifyChannelAdmin_SupplierAdmin':typeID()), + check_tc('CosNotifyChannelAdmin_SupplierAdmin':oe_get_interface()), + ?match(true, 'CosNotifyChannelAdmin_SupplierAdmin':oe_is_a('CosNotifyChannelAdmin_SupplierAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SupplierAdmin':oe_is_a('CosNotification_QoSAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SupplierAdmin':oe_is_a('CosNotifyComm_NotifyPublish':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SupplierAdmin':oe_is_a('CosNotifyFilter_FilterAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SupplierAdmin':oe_is_a('CosEventChannelAdmin_SupplierAdmin':typeID())), + ?match(true, 'CosNotifyChannelAdmin_SupplierAdmin':oe_is_a('oe_CosNotificationComm_Event':typeID())), + ?match(false, 'CosNotifyChannelAdmin_SupplierAdmin':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyFilter_Filter' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyFilter_Filter'(doc) -> ["CosNotifyFilter_Filter"]; +'CosNotifyFilter_Filter'(suite) -> []; +'CosNotifyFilter_Filter'(_) -> + ?nomatch(undefined, 'CosNotifyFilter_Filter':oe_tc('_get_constraint_grammar')), + ?nomatch(undefined, 'CosNotifyFilter_Filter':oe_tc(add_constraints)), + ?nomatch(undefined, 'CosNotifyFilter_Filter':oe_tc(modify_constraints)), + ?nomatch(undefined, 'CosNotifyFilter_Filter':oe_tc(get_constraints)), + ?nomatch(undefined, 'CosNotifyFilter_Filter':oe_tc(get_all_constraints)), + ?nomatch(undefined, 'CosNotifyFilter_Filter':oe_tc(remove_all_constraints)), + ?nomatch(undefined, 'CosNotifyFilter_Filter':oe_tc(destroy)), + ?nomatch(undefined, 'CosNotifyFilter_Filter':oe_tc(match)), + ?nomatch(undefined, 'CosNotifyFilter_Filter':oe_tc(match_structured)), + ?nomatch(undefined, 'CosNotifyFilter_Filter':oe_tc(match_typed)), + ?nomatch(undefined, 'CosNotifyFilter_Filter':oe_tc(attach_callback)), + ?nomatch(undefined, 'CosNotifyFilter_Filter':oe_tc(detach_callback)), + ?nomatch(undefined, 'CosNotifyFilter_Filter':oe_tc(get_callbacks)), + ?match(undefined, 'CosNotifyFilter_Filter':oe_tc(undefined)), + ?match([_|_], 'CosNotifyFilter_Filter':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyFilter/Filter:1.0", + 'CosNotifyFilter_Filter':typeID()), + check_tc('CosNotifyFilter_Filter':oe_get_interface()), + ?match(true, 'CosNotifyFilter_Filter':oe_is_a('CosNotifyFilter_Filter':typeID())), + ?match(false, 'CosNotifyFilter_Filter':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyFilter_FilterAdmin' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyFilter_FilterAdmin'(doc) -> ["CosNotifyFilter_FilterAdmin"]; +'CosNotifyFilter_FilterAdmin'(suite) -> []; +'CosNotifyFilter_FilterAdmin'(_) -> + ?nomatch(undefined, 'CosNotifyFilter_FilterAdmin':oe_tc(add_filter)), + ?nomatch(undefined, 'CosNotifyFilter_FilterAdmin':oe_tc(remove_filter)), + ?nomatch(undefined, 'CosNotifyFilter_FilterAdmin':oe_tc(get_filter)), + ?nomatch(undefined, 'CosNotifyFilter_FilterAdmin':oe_tc(get_all_filters)), + ?nomatch(undefined, 'CosNotifyFilter_FilterAdmin':oe_tc(remove_all_filters)), + ?match(undefined, 'CosNotifyFilter_FilterAdmin':oe_tc(undefined)), + ?match([_|_], 'CosNotifyFilter_FilterAdmin':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyFilter/FilterAdmin:1.0", + 'CosNotifyFilter_FilterAdmin':typeID()), + check_tc('CosNotifyFilter_FilterAdmin':oe_get_interface()), + ?match(true, 'CosNotifyFilter_FilterAdmin':oe_is_a('CosNotifyFilter_FilterAdmin':typeID())), + ?match(false, 'CosNotifyFilter_FilterAdmin':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyFilter_FilterFactory' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyFilter_FilterFactory'(doc) -> ["CosNotifyFilter_FilterFactory"]; +'CosNotifyFilter_FilterFactory'(suite) -> []; +'CosNotifyFilter_FilterFactory'(_) -> + ?nomatch(undefined, 'CosNotifyFilter_FilterFactory':oe_tc(create_filter)), + ?nomatch(undefined, 'CosNotifyFilter_FilterFactory':oe_tc(create_mapping_filter)), + ?match(undefined, 'CosNotifyFilter_FilterFactory':oe_tc(undefined)), + ?match([_|_], 'CosNotifyFilter_FilterFactory':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyFilter/FilterFactory:1.0", + 'CosNotifyFilter_FilterFactory':typeID()), + check_tc('CosNotifyFilter_FilterFactory':oe_get_interface()), + ?match(true, 'CosNotifyFilter_FilterFactory':oe_is_a('CosNotifyFilter_FilterFactory':typeID())), + ?match(false, 'CosNotifyFilter_FilterFactory':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyFilter_MappingFilter' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyFilter_MappingFilter'(doc) -> ["CosNotifyFilter_MappingFilter"]; +'CosNotifyFilter_MappingFilter'(suite) -> []; +'CosNotifyFilter_MappingFilter'(_) -> + ?nomatch(undefined, 'CosNotifyFilter_MappingFilter':oe_tc('_get_constraint_grammar')), + ?nomatch(undefined, 'CosNotifyFilter_MappingFilter':oe_tc('_get_value_type')), + ?nomatch(undefined, 'CosNotifyFilter_MappingFilter':oe_tc('_get_default_value')), + ?nomatch(undefined, 'CosNotifyFilter_MappingFilter':oe_tc(add_mapping_constraints)), + ?nomatch(undefined, 'CosNotifyFilter_MappingFilter':oe_tc(modify_mapping_constraints)), + ?nomatch(undefined, 'CosNotifyFilter_MappingFilter':oe_tc(get_mapping_constraints)), + ?nomatch(undefined, 'CosNotifyFilter_MappingFilter':oe_tc(get_all_mapping_constraints)), + ?nomatch(undefined, 'CosNotifyFilter_MappingFilter':oe_tc(remove_all_mapping_constraints)), + ?nomatch(undefined, 'CosNotifyFilter_MappingFilter':oe_tc(destroy)), + ?nomatch(undefined, 'CosNotifyFilter_MappingFilter':oe_tc(match)), + ?nomatch(undefined, 'CosNotifyFilter_MappingFilter':oe_tc(match_structured)), + ?nomatch(undefined, 'CosNotifyFilter_MappingFilter':oe_tc(match_typed)), + ?match(undefined, 'CosNotifyFilter_MappingFilter':oe_tc(undefined)), + ?match([_|_], 'CosNotifyFilter_MappingFilter':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyFilter/MappingFilter:1.0", + 'CosNotifyFilter_MappingFilter':typeID()), + check_tc('CosNotifyFilter_MappingFilter':oe_get_interface()), + ?match(true, 'CosNotifyFilter_MappingFilter':oe_is_a('CosNotifyFilter_MappingFilter':typeID())), + ?match(false, 'CosNotifyFilter_MappingFilter':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyComm_NotifyPublish' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyComm_NotifyPublish'(doc) -> ["CosNotifyComm_NotifyPublish"]; +'CosNotifyComm_NotifyPublish'(suite) -> []; +'CosNotifyComm_NotifyPublish'(_) -> + ?nomatch(undefined, 'CosNotifyComm_NotifyPublish':oe_tc(offer_change)), + ?match(undefined, 'CosNotifyComm_NotifyPublish':oe_tc(undefined)), + ?match([_|_], 'CosNotifyComm_NotifyPublish':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyComm/NotifyPublish:1.0", + 'CosNotifyComm_NotifyPublish':typeID()), + check_tc('CosNotifyComm_NotifyPublish':oe_get_interface()), + ?match(true, 'CosNotifyComm_NotifyPublish':oe_is_a('CosNotifyComm_NotifyPublish':typeID())), + ?match(false, 'CosNotifyComm_NotifyPublish':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyComm_NotifySubscribe' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyComm_NotifySubscribe'(doc) -> ["CosNotifyComm_NotifySubscribe"]; +'CosNotifyComm_NotifySubscribe'(suite) -> []; +'CosNotifyComm_NotifySubscribe'(_) -> + ?nomatch(undefined, 'CosNotifyComm_NotifySubscribe':oe_tc(subscription_change)), + ?match(undefined, 'CosNotifyComm_NotifySubscribe':oe_tc(undefined)), + ?match([_|_], 'CosNotifyComm_NotifySubscribe':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyComm/NotifySubscribe:1.0", + 'CosNotifyComm_NotifySubscribe':typeID()), + check_tc('CosNotifyComm_NotifySubscribe':oe_get_interface()), + ?match(true, 'CosNotifyComm_NotifySubscribe':oe_is_a('CosNotifyComm_NotifySubscribe':typeID())), + ?match(false, 'CosNotifyComm_NotifySubscribe':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyComm_PullConsumer' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyComm_PullConsumer'(doc) -> ["CosNotifyComm_PullConsumer"]; +'CosNotifyComm_PullConsumer'(suite) -> []; +'CosNotifyComm_PullConsumer'(_) -> + ?nomatch(undefined, 'CosNotifyComm_PullConsumer':oe_tc(offer_change)), + ?nomatch(undefined, 'CosNotifyComm_PullConsumer':oe_tc(disconnect_pull_consumer)), + ?match(undefined, 'CosNotifyComm_PullConsumer':oe_tc(undefined)), + ?match([_|_], 'CosNotifyComm_PullConsumer':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyComm/PullConsumer:1.0", + 'CosNotifyComm_PullConsumer':typeID()), + check_tc('CosNotifyComm_PullConsumer':oe_get_interface()), + ?match(true, 'CosNotifyComm_PullConsumer':oe_is_a('CosNotifyComm_PullConsumer':typeID())), + ?match(true, 'CosNotifyComm_PullConsumer':oe_is_a('CosNotifyComm_NotifyPublish':typeID())), + ?match(true, 'CosNotifyComm_PullConsumer':oe_is_a('CosEventComm_PullConsumer':typeID())), + ?match(false, 'CosNotifyComm_PullConsumer':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyComm_PullSupplier' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyComm_PullSupplier'(doc) -> ["CosNotifyComm_PullSupplier"]; +'CosNotifyComm_PullSupplier'(suite) -> []; +'CosNotifyComm_PullSupplier'(_) -> + ?nomatch(undefined, 'CosNotifyComm_PullSupplier':oe_tc(subscription_change)), + ?nomatch(undefined, 'CosNotifyComm_PullSupplier':oe_tc(pull)), + ?nomatch(undefined, 'CosNotifyComm_PullSupplier':oe_tc(try_pull)), + ?nomatch(undefined, 'CosNotifyComm_PullSupplier':oe_tc(disconnect_pull_supplier)), + ?match(undefined, 'CosNotifyComm_PullSupplier':oe_tc(undefined)), + ?match([_|_], 'CosNotifyComm_PullSupplier':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyComm/PullSupplier:1.0", + 'CosNotifyComm_PullSupplier':typeID()), + check_tc('CosNotifyComm_PullSupplier':oe_get_interface()), + ?match(true, 'CosNotifyComm_PullSupplier':oe_is_a('CosNotifyComm_PullSupplier':typeID())), + ?match(true, 'CosNotifyComm_PullSupplier':oe_is_a('CosNotifyComm_NotifySubscribe':typeID())), + ?match(true, 'CosNotifyComm_PullSupplier':oe_is_a('CosEventComm_PullSupplier':typeID())), + ?match(false, 'CosNotifyComm_PullSupplier':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyComm_PushConsumer' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyComm_PushConsumer'(doc) -> ["CosNotifyComm_PushConsumer"]; +'CosNotifyComm_PushConsumer'(suite) -> []; +'CosNotifyComm_PushConsumer'(_) -> + ?nomatch(undefined, 'CosNotifyComm_PushConsumer':oe_tc(offer_change)), + ?nomatch(undefined, 'CosNotifyComm_PushConsumer':oe_tc(push)), + ?nomatch(undefined, 'CosNotifyComm_PushConsumer':oe_tc(disconnect_push_consumer)), + ?match(undefined, 'CosNotifyComm_PushConsumer':oe_tc(undefined)), + ?match([_|_], 'CosNotifyComm_PushConsumer':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyComm/PushConsumer:1.0", + 'CosNotifyComm_PushConsumer':typeID()), + check_tc('CosNotifyComm_PushConsumer':oe_get_interface()), + ?match(true, 'CosNotifyComm_PushConsumer':oe_is_a('CosNotifyComm_PushConsumer':typeID())), + ?match(true, 'CosNotifyComm_PushConsumer':oe_is_a('CosNotifyComm_NotifyPublish':typeID())), + ?match(true, 'CosNotifyComm_PushConsumer':oe_is_a('CosEventComm_PushConsumer':typeID())), + ?match(false, 'CosNotifyComm_PushConsumer':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyComm_PushSupplier' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyComm_PushSupplier'(doc) -> ["CosNotifyComm_PushSupplier"]; +'CosNotifyComm_PushSupplier'(suite) -> []; +'CosNotifyComm_PushSupplier'(_) -> + ?nomatch(undefined, 'CosNotifyComm_PushSupplier':oe_tc(subscription_change)), + ?nomatch(undefined, 'CosNotifyComm_PushSupplier':oe_tc(disconnect_push_supplier)), + ?match(undefined, 'CosNotifyComm_PushSupplier':oe_tc(undefined)), + ?match([_|_], 'CosNotifyComm_PushSupplier':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyComm/PushSupplier:1.0", + 'CosNotifyComm_PushSupplier':typeID()), + check_tc('CosNotifyComm_PushSupplier':oe_get_interface()), + ?match(true, 'CosNotifyComm_PushSupplier':oe_is_a('CosNotifyComm_PushSupplier':typeID())), + ?match(true, 'CosNotifyComm_PushSupplier':oe_is_a('CosNotifyComm_NotifySubscribe':typeID())), + ?match(true, 'CosNotifyComm_PushSupplier':oe_is_a('CosEventComm_PushSupplier':typeID())), + ?match(false, 'CosNotifyComm_PushSupplier':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyComm_SequencePullConsumer' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyComm_SequencePullConsumer'(doc) -> ["CosNotifyComm_SequencePullConsumer"]; +'CosNotifyComm_SequencePullConsumer'(suite) -> []; +'CosNotifyComm_SequencePullConsumer'(_) -> + ?nomatch(undefined, 'CosNotifyComm_SequencePullConsumer':oe_tc(disconnect_sequence_pull_consumer)), + ?nomatch(undefined, 'CosNotifyComm_SequencePullConsumer':oe_tc(offer_change)), + ?match(undefined, 'CosNotifyComm_SequencePullConsumer':oe_tc(undefined)), + ?match([_|_], 'CosNotifyComm_SequencePullConsumer':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyComm/SequencePullConsumer:1.0", + 'CosNotifyComm_SequencePullConsumer':typeID()), + check_tc('CosNotifyComm_SequencePullConsumer':oe_get_interface()), + ?match(true, 'CosNotifyComm_SequencePullConsumer':oe_is_a('CosNotifyComm_SequencePullConsumer':typeID())), + ?match(true, 'CosNotifyComm_SequencePullConsumer':oe_is_a('CosNotifyComm_NotifyPublish':typeID())), + ?match(false, 'CosNotifyComm_SequencePullConsumer':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyComm_SequencePullSupplier' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyComm_SequencePullSupplier'(doc) -> ["CosNotifyComm_SequencePullSupplier"]; +'CosNotifyComm_SequencePullSupplier'(suite) -> []; +'CosNotifyComm_SequencePullSupplier'(_) -> + ?nomatch(undefined, 'CosNotifyComm_SequencePullSupplier':oe_tc(pull_structured_events)), + ?nomatch(undefined, 'CosNotifyComm_SequencePullSupplier':oe_tc(try_pull_structured_events)), + ?nomatch(undefined, 'CosNotifyComm_SequencePullSupplier':oe_tc(disconnect_sequence_pull_supplier)), + ?nomatch(undefined, 'CosNotifyComm_SequencePullSupplier':oe_tc(subscription_change)), + ?match(undefined, 'CosNotifyComm_SequencePullSupplier':oe_tc(undefined)), + ?match([_|_], 'CosNotifyComm_SequencePullSupplier':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyComm/SequencePullSupplier:1.0", + 'CosNotifyComm_SequencePullSupplier':typeID()), + check_tc('CosNotifyComm_SequencePullSupplier':oe_get_interface()), + ?match(true, 'CosNotifyComm_SequencePullSupplier':oe_is_a('CosNotifyComm_SequencePullSupplier':typeID())), + ?match(true, 'CosNotifyComm_SequencePullSupplier':oe_is_a('CosNotifyComm_NotifySubscribe':typeID())), + ?match(false, 'CosNotifyComm_SequencePullSupplier':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyComm_SequencePushConsumer' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyComm_SequencePushConsumer'(doc) -> ["CosNotifyComm_SequencePushConsumer"]; +'CosNotifyComm_SequencePushConsumer'(suite) -> []; +'CosNotifyComm_SequencePushConsumer'(_) -> + ?nomatch(undefined, 'CosNotifyComm_SequencePushConsumer':oe_tc(push_structured_events)), + ?nomatch(undefined, 'CosNotifyComm_SequencePushConsumer':oe_tc(disconnect_sequence_push_consumer)), + ?nomatch(undefined, 'CosNotifyComm_SequencePushConsumer':oe_tc(offer_change)), + ?match(undefined, 'CosNotifyComm_SequencePushConsumer':oe_tc(undefined)), + ?match([_|_], 'CosNotifyComm_SequencePushConsumer':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyComm/SequencePushConsumer:1.0", + 'CosNotifyComm_SequencePushConsumer':typeID()), + check_tc('CosNotifyComm_SequencePushConsumer':oe_get_interface()), + ?match(true, 'CosNotifyComm_SequencePushConsumer':oe_is_a('CosNotifyComm_SequencePushConsumer':typeID())), + ?match(true, 'CosNotifyComm_SequencePushConsumer':oe_is_a('CosNotifyComm_NotifyPublish':typeID())), + ?match(false, 'CosNotifyComm_SequencePushConsumer':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyComm_SequencePushSupplier' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyComm_SequencePushSupplier'(doc) -> ["CosNotifyComm_SequencePushSupplier"]; +'CosNotifyComm_SequencePushSupplier'(suite) -> []; +'CosNotifyComm_SequencePushSupplier'(_) -> + ?nomatch(undefined, 'CosNotifyComm_SequencePushSupplier':oe_tc(disconnect_sequence_push_supplier)), + ?nomatch(undefined, 'CosNotifyComm_SequencePushSupplier':oe_tc(subscription_change)), + ?match(undefined, 'CosNotifyComm_SequencePushSupplier':oe_tc(undefined)), + ?match([_|_], 'CosNotifyComm_SequencePushSupplier':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyComm/SequencePushSupplier:1.0", + 'CosNotifyComm_SequencePushSupplier':typeID()), + check_tc('CosNotifyComm_SequencePushSupplier':oe_get_interface()), + ?match(true, 'CosNotifyComm_SequencePushSupplier':oe_is_a('CosNotifyComm_SequencePushSupplier':typeID())), + ?match(true, 'CosNotifyComm_SequencePushSupplier':oe_is_a('CosNotifyComm_NotifySubscribe':typeID())), + ?match(false, 'CosNotifyComm_SequencePushSupplier':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyComm_StructuredPullConsumer' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyComm_StructuredPullConsumer'(doc) -> ["CosNotifyComm_StructuredPullConsumer"]; +'CosNotifyComm_StructuredPullConsumer'(suite) -> []; +'CosNotifyComm_StructuredPullConsumer'(_) -> + ?nomatch(undefined, 'CosNotifyComm_StructuredPullConsumer':oe_tc(disconnect_structured_pull_consumer)), + ?nomatch(undefined, 'CosNotifyComm_StructuredPullConsumer':oe_tc(offer_change)), + ?match(undefined, 'CosNotifyComm_StructuredPullConsumer':oe_tc(undefined)), + ?match([_|_], 'CosNotifyComm_StructuredPullConsumer':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyComm/StructuredPullConsumer:1.0", + 'CosNotifyComm_StructuredPullConsumer':typeID()), + check_tc('CosNotifyComm_StructuredPullConsumer':oe_get_interface()), + ?match(true, 'CosNotifyComm_StructuredPullConsumer':oe_is_a('CosNotifyComm_StructuredPullConsumer':typeID())), + ?match(true, 'CosNotifyComm_StructuredPullConsumer':oe_is_a('CosNotifyComm_NotifyPublish':typeID())), + ?match(false, 'CosNotifyComm_StructuredPullConsumer':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyComm_StructuredPullSupplier' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyComm_StructuredPullSupplier'(doc) -> ["CosNotifyComm_StructuredPullSupplier"]; +'CosNotifyComm_StructuredPullSupplier'(suite) -> []; +'CosNotifyComm_StructuredPullSupplier'(_) -> + ?nomatch(undefined, 'CosNotifyComm_StructuredPullSupplier':oe_tc(pull_structured_event)), + ?nomatch(undefined, 'CosNotifyComm_StructuredPullSupplier':oe_tc(try_pull_structured_event)), + ?nomatch(undefined, 'CosNotifyComm_StructuredPullSupplier':oe_tc(disconnect_structured_pull_supplier)), + ?nomatch(undefined, 'CosNotifyComm_StructuredPullSupplier':oe_tc(subscription_change)), + ?match(undefined, 'CosNotifyComm_StructuredPullSupplier':oe_tc(undefined)), + ?match([_|_], 'CosNotifyComm_StructuredPullSupplier':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyComm/StructuredPullSupplier:1.0", + 'CosNotifyComm_StructuredPullSupplier':typeID()), + check_tc('CosNotifyComm_StructuredPullSupplier':oe_get_interface()), + ?match(true, 'CosNotifyComm_StructuredPullSupplier':oe_is_a('CosNotifyComm_StructuredPullSupplier':typeID())), + ?match(true, 'CosNotifyComm_StructuredPullSupplier':oe_is_a('CosNotifyComm_NotifySubscribe':typeID())), + ?match(false, 'CosNotifyComm_StructuredPullSupplier':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyComm_StructuredPushConsumer' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyComm_StructuredPushConsumer'(doc) -> ["CosNotifyComm_StructuredPushConsumer"]; +'CosNotifyComm_StructuredPushConsumer'(suite) -> []; +'CosNotifyComm_StructuredPushConsumer'(_) -> + ?nomatch(undefined, 'CosNotifyComm_StructuredPushConsumer':oe_tc(push_structured_event)), + ?nomatch(undefined, 'CosNotifyComm_StructuredPushConsumer':oe_tc(disconnect_structured_push_consumer)), + ?nomatch(undefined, 'CosNotifyComm_StructuredPushConsumer':oe_tc(offer_change)), + ?match(undefined, 'CosNotifyComm_StructuredPushConsumer':oe_tc(undefined)), + ?match([_|_], 'CosNotifyComm_StructuredPushConsumer':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyComm/StructuredPushConsumer:1.0", + 'CosNotifyComm_StructuredPushConsumer':typeID()), + check_tc('CosNotifyComm_StructuredPushConsumer':oe_get_interface()), + ?match(true, 'CosNotifyComm_StructuredPushConsumer':oe_is_a('CosNotifyComm_StructuredPushConsumer':typeID())), + ?match(true, 'CosNotifyComm_StructuredPushConsumer':oe_is_a('CosNotifyComm_NotifyPublish':typeID())), + ?match(false, 'CosNotifyComm_StructuredPushConsumer':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'CosNotifyComm_StructuredPushSupplier' +%% Description: +%%----------------------------------------------------------------- +'CosNotifyComm_StructuredPushSupplier'(doc) -> ["CosNotifyComm_StructuredPushSupplier"]; +'CosNotifyComm_StructuredPushSupplier'(suite) -> []; +'CosNotifyComm_StructuredPushSupplier'(_) -> + ?nomatch(undefined, 'CosNotifyComm_StructuredPushSupplier':oe_tc(disconnect_structured_push_supplier)), + ?nomatch(undefined, 'CosNotifyComm_StructuredPushSupplier':oe_tc(subscription_change)), + ?match(undefined, 'CosNotifyComm_StructuredPushSupplier':oe_tc(undefined)), + ?match([_|_], 'CosNotifyComm_StructuredPushSupplier':oe_get_interface()), + ?match("IDL:omg.org/CosNotifyComm/StructuredPushSupplier:1.0", + 'CosNotifyComm_StructuredPushSupplier':typeID()), + check_tc('CosNotifyComm_StructuredPushSupplier':oe_get_interface()), + ?match(true, 'CosNotifyComm_StructuredPushSupplier':oe_is_a('CosNotifyComm_StructuredPushSupplier':typeID())), + ?match(true, 'CosNotifyComm_StructuredPushSupplier':oe_is_a('CosNotifyComm_NotifySubscribe':typeID())), + ?match(false, 'CosNotifyComm_StructuredPushSupplier':oe_is_a("wrong")), + ok. + + +%%----------------------------------------------------------------- +%% Test Case: 'oe_CosNotificationComm_Event' +%% Description: +%%----------------------------------------------------------------- +'oe_CosNotificationComm_Event'(doc) -> ["oe_CosNotificationComm_Event"]; +'oe_CosNotificationComm_Event'(suite) -> []; +'oe_CosNotificationComm_Event'(_) -> + ?nomatch(undefined, 'oe_CosNotificationComm_Event':oe_tc(callSeq)), + ?nomatch(undefined, 'oe_CosNotificationComm_Event':oe_tc(callAny)), + ?match(undefined, 'oe_CosNotificationComm_Event':oe_tc(undefined)), + ?match([_|_], 'oe_CosNotificationComm_Event':oe_get_interface()), + ?match("IDL:oe_CosNotificationComm/Event:1.0", + 'oe_CosNotificationComm_Event':typeID()), + check_tc('oe_CosNotificationComm_Event':oe_get_interface()), + ?match(true, 'oe_CosNotificationComm_Event':oe_is_a('oe_CosNotificationComm_Event':typeID())), + ?match(false, 'oe_CosNotificationComm_Event':oe_is_a("wrong")), + ok. + + + + +%%----------------------------------------------------------------- +%% MISC functions +%%----------------------------------------------------------------- +check_tc([]) -> + ok; +check_tc([{Op, {RetType, InParameters, OutParameters}}|T]) -> + io:format("checked - ~s~n", [Op]), + lists:all(?checktc(Op), [RetType|InParameters]), + lists:all(?checktc(Op), OutParameters), + check_tc(T). + + diff --git a/lib/cosNotification/test/grammar_SUITE.erl b/lib/cosNotification/test/grammar_SUITE.erl new file mode 100644 index 0000000000..30aec89e5f --- /dev/null +++ b/lib/cosNotification/test/grammar_SUITE.erl @@ -0,0 +1,1094 @@ +%%-------------------------------------------------------------------- +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +%% +%%-------------------------------------------------------------------- +%% File : grammar_SUITE.erl +%% Purpose : Testing the CosNotification BNF grammar. +%%-------------------------------------------------------------------- + +-module(grammar_SUITE). + + + +%%--------------- INCLUDES ----------------------------------- +-include_lib("orber/include/corba.hrl"). +-include_lib("orber/include/ifr_types.hrl"). +%% cosEvent files. +-include_lib("cosEvent/include/CosEventChannelAdmin.hrl"). +%% Application files +-include_lib("cosNotification/include/CosNotification.hrl"). +-include_lib("cosNotification/include/CosNotifyChannelAdmin.hrl"). +-include_lib("cosNotification/include/CosNotifyComm.hrl"). +-include_lib("cosNotification/include/CosNotifyFilter.hrl"). + +-include_lib("cosNotification/src/CosNotification_Definitions.hrl"). + +-include("idl_output/notify_test.hrl"). + +-include("test_server.hrl"). + +%%--------------- DEFINES ------------------------------------ +-define(default_timeout, ?t:minutes(20)). +-define(match(ExpectedRes, Expr), + fun() -> + AcTuAlReS = (catch (Expr)), + case AcTuAlReS of + ExpectedRes -> + io:format("------ CORRECT RESULT ------~n~p~n", + [AcTuAlReS]), + AcTuAlReS; + _ -> + io:format("###### ERROR ERROR ######~n~p~n", + [AcTuAlReS]), + ?line exit(AcTuAlReS) + end + end()). + +%%----------------------------------------------------------------- +%% External exports +%%----------------------------------------------------------------- +-export([all/1, cases/0, init_all/1, finish_all/1, + union_api/1, enum_api/1, simple_types_api/1, + components_api/1, positional_api/1, variable_api/1, + init_per_testcase/2, fin_per_testcase/2]). + +-import(cosNotification_Filter, [create_filter/1, eval/2]). + +%%----------------------------------------------------------------- +%% Func: all/1 +%% Args: +%% Returns: +%%----------------------------------------------------------------- +all(doc) -> ["API tests for the cosNotification interfaces", ""]; +all(suite) -> {req, + [], + {conf, init_all, cases(), finish_all}}. + +cases() -> + [variable_api, union_api, enum_api, simple_types_api, components_api, + positional_api]. + +%%----------------------------------------------------------------- +%% Init and cleanup functions. +%%----------------------------------------------------------------- + +init_per_testcase(_Case, Config) -> + Path = code:which(?MODULE), + code:add_pathz(filename:join(filename:dirname(Path), "idl_output")), + ?line Dog=test_server:timetrap(?default_timeout), + [{watchdog, Dog}|Config]. + + +fin_per_testcase(_Case, Config) -> + Path = code:which(?MODULE), + code:del_path(filename:join(filename:dirname(Path), "idl_output")), + Dog = ?config(watchdog, Config), + test_server:timetrap_cancel(Dog), + ok. + +init_all(Config) -> + Path = code:which(?MODULE), + code:add_pathz(filename:join(filename:dirname(Path), "idl_output")), + if + is_list(Config) -> + Config; + true -> + exit("Config not a list") + end. + +finish_all(Config) -> + Path = code:which(?MODULE), + code:del_path(filename:join(filename:dirname(Path), "idl_output")), + Config. + + +%%----------------------------------------------------------------- +%% simple types grammar tests +%%----------------------------------------------------------------- +simple_types_api(doc) -> ["CosNotification simple types grammar tests", ""]; +simple_types_api(suite) -> []; +simple_types_api(_Config) -> + %% Will always be true, no matter what kind of event we receive. + {ok,T1} = ?match({ok, _}, create_filter("2==2 and 3<4")), + ?match(true, eval(T1, ?not_CreateSE("DomainName","TypeName","EventName", + [],[], any:create(orber_tc:null(), null)))), + + %% Will always be true, no matter what kind of event we receive. + {ok,T2} = ?match({ok, _}, create_filter("")), + ?match(true, eval(T2, ?not_CreateSE("DomainName","TypeName","EventName", + [],[], any:create(orber_tc:null(), null)))), + + %% Check if $variable works + {ok,T3} = ?match({ok, _}, create_filter("$city == \'Berlin\'")), + ?match(true, eval(T3, ?not_CreateSE("DomainName","TypeName","EventName", + [#'CosNotification_Property'{name="city", + value=any:create(orber_tc:string(0), "Berlin")}], + [], any:create(orber_tc:null(), null)))), + ?match(false, eval(T3, ?not_CreateSE("DomainName","TypeName", "EventName", + [#'CosNotification_Property'{name="city", + value=any:create(orber_tc:string(0), "Dallas")}], + + [], any:create(orber_tc:null(), null)))), + + + {ok,T4} = ?match({ok, _}, create_filter("$zip == 44")), + ?match(true, eval(T4, ?not_CreateSE("DomainName","TypeName", "EventName", + [#'CosNotification_Property'{name="zip", + value=any:create(orber_tc:short(), 44)}], + + [], any:create(orber_tc:null(), null)))), + ?match(true, eval(T4, ?not_CreateSE("DomainName","TypeName", "EventName", + [],[], + any:create('CosNotification_Property':tc(), + #'CosNotification_Property' + {name="zip", + value=any:create(orber_tc:short(), + 44)})))), + ?match(false, eval(T4, ?not_CreateSE("DomainName","TypeName", "EventName", + [#'CosNotification_Property'{name="zip", + value=any:create(orber_tc:short(), 33)}], + + [], any:create(orber_tc:null(), null)))), + + %% Will always be true, no matter what kind of event we receive. + {ok,T5} = ?match({ok, _}, create_filter("\'oo'\~\'foobar\'")), + ?match(true, eval(T5, ?not_CreateSE("DomainName","TypeName","EventName", + [],[], any:create(orber_tc:null(), null)))), + %% Will always be false, no matter what kind of event we receive. + {ok,T6} = ?match({ok, _}, create_filter("\'o1'\~\'foobar\'")), + ?match(false, eval(T6, ?not_CreateSE("DomainName","TypeName","EventName", + [],[], any:create(orber_tc:null(), null)))), + + %% Can we apply the ~ operation as above using a variable + {ok,T7} = ?match({ok, _}, create_filter("$str~\'foobar\'")), + ?match(true, eval(T7, ?not_CreateSE("DomainName","TypeName","EventName", + [#'CosNotification_Property'{name="str", + value=any:create(orber_tc:string(0), "oo")}], + [], any:create(orber_tc:null(), null)))), + ?match(false, eval(T7, ?not_CreateSE("DomainName","TypeName","EventName", + [#'CosNotification_Property'{name="str", + value=any:create(orber_tc:string(0), "ok")}], + [], any:create(orber_tc:null(), null)))), + + + + {ok,_T8} = ?match({ok, _}, create_filter("$\\zip == 44444")), + + ok. + +%%----------------------------------------------------------------- +%% enum grammar tests +%%----------------------------------------------------------------- +enum_api(doc) -> ["CosNotification enum grammar tests", ""]; +enum_api(suite) -> []; +enum_api(_Config) -> + %% Accept events whose 'in' enum is set to the value 'HOUSE' or 'CAR'. + {ok,T1} = ?match({ok, _}, create_filter("$.\\in == HOUSE or $.\\in == CAR")), + + ?match(true, eval(T1, any:create(orber_tc:alias("IFRId","in",tk_any), + any:create({tk_enum, "IFRId", "in", ["HOUSE", "CAR"]}, + 'HOUSE')))), + ?match(false, eval(T1, any:create(orber_tc:alias("IFRId","in",tk_any), + any:create({tk_enum, "IFRId", "in", ["HOUSE", "CAR"]}, + 'GARAGE')))), + ok. + + +%%----------------------------------------------------------------- +%% Union grammar tests +%%----------------------------------------------------------------- +union_api(doc) -> ["CosNotification union grammar tests", ""]; +union_api(suite) -> []; +union_api(_Config) -> + {ok,T1} = ?match({ok, _}, create_filter("exist $.uni1._d and $.uni1._d == 1 and $.uni1.(1) == 10")), + {ok,T2} = ?match({ok, _}, create_filter("default $.uni1._d and $.uni1.() == 10")), + {ok,T3} = ?match({ok, _}, create_filter("default $.uni1._d and $.uni1.(999) == 10")), + ?match(true, eval(T1, ?not_CreateSE("DomainName","CommunicationsAlarm", + "EventName",[],[], + any:create(orber_tc:alias("IDL:notify_test/namedAny:1.0", + "uni1", + tk_any), + any:create(notify_test_uni1:tc(), + #notify_test_uni1{label= 1, + value=10}))))), + ?match(true, eval(T2, ?not_CreateSE("DomainName","CommunicationsAlarm", + "EventName",[],[], + any:create(orber_tc:alias("IDL:notify_test/namedAny:1.0", + "uni1", + tk_any), + any:create(notify_test_uni1:tc(), + #notify_test_uni1{label= 100, + value=10}))))), + ?match(true, eval(T3, ?not_CreateSE("DomainName","CommunicationsAlarm", + "EventName",[],[], + any:create(orber_tc:alias("IDL:notify_test/namedAny:1.0", + "uni1", + tk_any), + any:create(notify_test_uni1:tc(), + #notify_test_uni1{label= 100, + value=10}))))), + ?match(true, eval(T1, any:create(orber_tc:alias("IDL:notify_test/namedAny:1.0", + "uni1", + tk_any), + any:create(notify_test_uni1:tc(), + #notify_test_uni1{label= 1, + value=10})))), + ?match(false, eval(T2, any:create(orber_tc:alias("IDL:notify_test/namedAny:1.0", + "uni1", + tk_any), + any:create(notify_test_uni1:tc(), + #notify_test_uni1{label= 1, + value=10})))), + ?match(false, eval(T3, any:create(orber_tc:alias("IDL:notify_test/namedAny:1.0", + "uni1", + tk_any), + any:create(notify_test_uni1:tc(), + #notify_test_uni1{label= 1, + value=10})))), + ?match(true, eval(T1, ?not_CreateSE("DomainName","CommunicationsAlarm", + "EventName",[],[], + any:create(notify_test_studies:tc(), #notify_test_studies + {uni1 = #notify_test_uni1{label= 1, value=10}, + gpa = 90, + tests = [#'CosNotification_Property' + {name="midterm", value=any:create(orber_tc:short(), 70)}, + #'CosNotification_Property' + {name="final", value=any:create(orber_tc:short(), 60)}], + monthly_attendance = {0,1,2,10}})))), + ?match(false, eval(T2, ?not_CreateSE("DomainName","CommunicationsAlarm", + "EventName",[],[], + any:create(notify_test_studies:tc(), #notify_test_studies + {uni1 = #notify_test_uni1{label= 1, value=10}, + gpa = 90, + tests = [#'CosNotification_Property' + {name="midterm", value=any:create(orber_tc:short(), 70)}, + #'CosNotification_Property' + {name="final", value=any:create(orber_tc:short(), 60)}], + monthly_attendance = {0,1,2,10}})))), + ?match(false, eval(T3, ?not_CreateSE("DomainName","CommunicationsAlarm", + "EventName",[],[], + any:create(notify_test_studies:tc(), #notify_test_studies + {uni1 = #notify_test_uni1{label= 1, value=10}, + gpa = 90, + tests = [#'CosNotification_Property' + {name="midterm", value=any:create(orber_tc:short(), 70)}, + #'CosNotification_Property' + {name="final", value=any:create(orber_tc:short(), 60)}], + monthly_attendance = {0,1,2,10}})))), + ?match(true, eval(T1, any:create(notify_test_studies:tc(), #notify_test_studies + {uni1 = #notify_test_uni1{label= 1, value=10}, + gpa = 90, + tests = [#'CosNotification_Property' + {name="midterm", value=any:create(orber_tc:short(), 70)}, + #'CosNotification_Property' + {name="final", value=any:create(orber_tc:short(), 60)}], + monthly_attendance = {0,1,2,10}}))), + ?match(false, eval(T2, any:create(notify_test_studies:tc(), #notify_test_studies + {uni1 = #notify_test_uni1{label= 1, value=10}, + gpa = 90, + tests = [#'CosNotification_Property' + {name="midterm", value=any:create(orber_tc:short(), 70)}, + #'CosNotification_Property' + {name="final", value=any:create(orber_tc:short(), 60)}], + monthly_attendance = {0,1,2,10}}))), + ?match(false, eval(T3, any:create(notify_test_studies:tc(), #notify_test_studies + {uni1 = #notify_test_uni1{label= 1, value=10}, + gpa = 90, + tests = [#'CosNotification_Property' + {name="midterm", value=any:create(orber_tc:short(), 70)}, + #'CosNotification_Property' + {name="final", value=any:create(orber_tc:short(), 60)}], + monthly_attendance = {0,1,2,10}}))), + + {ok,T4} = ?match({ok, _}, create_filter("exist $.alias.uni1._d and $.alias.uni1._d == 1 and $.alias.uni1.(1) == 10")), + ?match(true, eval(T4, ?not_CreateSE("DomainName","CommunicationsAlarm", + "EventName",[],[], + any:create(orber_tc:alias(notify_test_studies:id(), + "alias", + notify_test_studies:tc()), + #notify_test_studies + {uni1 = #notify_test_uni1{label= 1, value=10}, + gpa = 90, tests = [], + monthly_attendance = {0,1,2,10}})))), + ?match(true, eval(T4, any:create(orber_tc:alias(notify_test_studies:id(), + "alias", + notify_test_studies:tc()), + #notify_test_studies + {uni1 = #notify_test_uni1{label= 1, value=10}, + gpa = 90, tests = [], + monthly_attendance = {0,1,2,10}}))), + %% Accept events with a default union discriminator set to the value 2. + {ok,T5} = ?match({ok, _}, create_filter("default $._d and $.defvalue == 2")), + ?match(true, eval(T5, any:create(notify_test_uni1:tc(), + #notify_test_uni1{label= 100, value=2}))), + %% label not default. + ?match(false, eval(T5, any:create(notify_test_uni1:tc(), + #notify_test_uni1{label= 2, value=2}))), + %% Default does not exist (nor the component defvalue) + ?match(false, eval(T5, any:create(notify_test_uni2:tc(), + #notify_test_uni2{label= 100, value=2}))), + %% Both wrong + ?match(false, eval(T5, any:create(notify_test_uni2:tc(), + #notify_test_uni2{label= 2, value=2}))), + + {ok,T6} = ?match({ok, _}, create_filter("default $._d and $.(-8) == 2")), + ?match(true, eval(T6, any:create(notify_test_uni1:tc(), + #notify_test_uni1{label= 100, value=2}))), + %% label not default. + ?match(false, eval(T6, any:create(notify_test_uni1:tc(), + #notify_test_uni1{label= 2, value=2}))), + %% Default does not exist (nor the component defvalue) + ?match(false, eval(T6, any:create(notify_test_uni2:tc(), + #notify_test_uni2{label= 100, value=2}))), + %% Both wrong + ?match(false, eval(T6, any:create(notify_test_uni2:tc(), + #notify_test_uni2{label= 2, value=2}))), + %% the same as the above, but we try to access a label that is not default + {ok,T7} = ?match({ok, _}, create_filter("default $._d and $.(2) == 2")), + ?match({error, _}, eval(T7, any:create(notify_test_uni1:tc(), + #notify_test_uni1{label= 100, value=2}))), + + %% Must be a default-union with its 'defvalue' set to 2. + {ok,T8} = ?match({ok, _}, create_filter("default $._d and $.('defvalue') == 2")), + ?match(true, eval(T8, any:create(notify_test_uni1:tc(), + #notify_test_uni1{label= 100, value=2}))), + %% label not default. + ?match(false, eval(T8, any:create(notify_test_uni1:tc(), + #notify_test_uni1{label= 2, value=2}))), + %% Default does not exist (nor the component defvalue) + ?match(false, eval(T8, any:create(notify_test_uni2:tc(), + #notify_test_uni2{label= 100, value=2}))), + %% Both wrong + ?match(false, eval(T8, any:create(notify_test_uni2:tc(), + #notify_test_uni2{label= 2, value=2}))), + + %% Must be a default-union with its value set to 2. + {ok,T9} = ?match({ok, _}, create_filter("default $._d and $.(+100) == 2")), + ?match(true, eval(T9, any:create(notify_test_uni1:tc(), + #notify_test_uni1{label= 100, value=2}))), + %% label not default. + ?match(false, eval(T9, any:create(notify_test_uni1:tc(), + #notify_test_uni1{label= 2, value=2}))), + %% Default does not exist (nor the component defvalue) + ?match(false, eval(T9, any:create(notify_test_uni2:tc(), + #notify_test_uni2{label= 100, value=2}))), + %% Both wrong + ?match(false, eval(T9, any:create(notify_test_uni2:tc(), + #notify_test_uni2{label= 2, value=2}))), + + %% So far, we have only tested to access the union itself. No will use more + %% complex union members. + %% T10 and T11 is "equal" + {ok,T10} = ?match({ok, _}, create_filter("$.M < 54")), + {ok,T11} = ?match({ok, _}, create_filter("$.(5) < 54")), + ?match(false, eval(T10, any:create(notify_test_K:tc(), + #notify_test_K{label= 5, value=54}))), + ?match(false, eval(T11, any:create(notify_test_K:tc(), + #notify_test_K{label= 5, value=54}))), + ?match(true, eval(T10, any:create(notify_test_K:tc(), + #notify_test_K{label= 5, value=50}))), + ?match(true, eval(T11, any:create(notify_test_K:tc(), + #notify_test_K{label= 5, value=50}))), + ?match({error,_}, eval(T10, any:create(notify_test_K:tc(), + #notify_test_K{label= -1, value=50}))), + ?match({error,_}, eval(T11, any:create(notify_test_K:tc(), + #notify_test_K{label= -1, value=50}))), + + %% T12 and T13 is "equal" + {ok,T12} = ?match({ok, _}, create_filter("$.L.C < 128")), + {ok,T13} = ?match({ok, _}, create_filter("$.(3).2 < 128")), + ?match(true, eval(T12, any:create(notify_test_K:tc(), + #notify_test_K{label= 3, value= + #notify_test_X{'A' = 1, + 'B' = "string", + 'C' = 120}}))), + ?match(true, eval(T13, any:create(notify_test_K:tc(), + #notify_test_K{label= 3, value= + #notify_test_X{'A' = 1, + 'B' = "string", + 'C' = 120}}))), + ?match(false, eval(T12, any:create(notify_test_K:tc(), + #notify_test_K{label= 3, value= + #notify_test_X{'A' = 1, + 'B' = "string", + 'C' = 200}}))), + ?match(false, eval(T13, any:create(notify_test_K:tc(), + #notify_test_K{label= 3, value= + #notify_test_X{'A' = 1, + 'B' = "string", + 'C' = 200}}))), + + %% Test if 'putty' is a substring of K + {ok,T15} = ?match({ok, _}, create_filter("'putty' ~ $.(2)")), + {ok,T16} = ?match({ok, _}, create_filter("'putty' ~ $.K")), + ?match(true, eval(T15, any:create(notify_test_K:tc(), + #notify_test_K{label= 2, value= "isputtyok"}))), + ?match(true, eval(T16, any:create(notify_test_K:tc(), + #notify_test_K{label= 2, value= "isputtyok"}))), + ?match(false, eval(T15, any:create(notify_test_K:tc(), + #notify_test_K{label= 2, value= "notputtok"}))), + ?match(false, eval(T16, any:create(notify_test_K:tc(), + #notify_test_K{label= 2, value= "notputtok"}))), + + {ok,_T17} = ?match({ok, _}, create_filter("'putty' ~ $.(3).1")), + {ok,_T18} = ?match({ok, _}, create_filter("'putty' ~ $.L.B")), + ?match(true, eval(T12, any:create(notify_test_K:tc(), + #notify_test_K{label= 3, value= + #notify_test_X{'A' = 1, + 'B' = "isputtyok", + 'C' = 120}}))), + ?match(true, eval(T13, any:create(notify_test_K:tc(), + #notify_test_K{label= 3, value= + #notify_test_X{'A' = 1, + 'B' = "isputtyok", + 'C' = 120}}))), + ?match(false, eval(T12, any:create(notify_test_K:tc(), + #notify_test_K{label= 3, value= + #notify_test_X{'A' = 1, + 'B' = "notputtok", + 'C' = 200}}))), + ?match(false, eval(T13, any:create(notify_test_K:tc(), + #notify_test_K{label= 3, value= + #notify_test_X{'A' = 1, + 'B' = "notputtok", + 'C' = 200}}))), + + %% Please observe that the switch 0 and 2 is defined to be equivalent. + {ok,T19} = ?match({ok, _}, create_filter("$._d == 2 and $.(0) != 'hoob'")), + {ok,T20} = ?match({ok, _}, create_filter("$._d == 2 and $.(2) != 'hoob'")), + ?match(true, eval(T19, any:create(notify_test_K:tc(), + #notify_test_K{label= 2, value= "nothoob"}))), + ?match(true, eval(T20, any:create(notify_test_K:tc(), + #notify_test_K{label= 2, value= "nothoob"}))), + ?match(false, eval(T19, any:create(notify_test_K:tc(), + #notify_test_K{label= 2, value= "hoob"}))), + ?match(false, eval(T20, any:create(notify_test_K:tc(), + #notify_test_K{label= 2, value= "hoob"}))), + + ?match(false, eval(T19, any:create(notify_test_K:tc(), + #notify_test_K{label= 5, value= 55}))), + ?match(false, eval(T20, any:create(notify_test_K:tc(), + #notify_test_K{label= 5, value= 55}))), + + ?match(false, eval(T19, any:create(notify_test_K:tc(), + #notify_test_K{label= 100, value= "nothoob"}))), + ?match(false, eval(T20, any:create(notify_test_K:tc(), + #notify_test_K{label= 100, value= "nothoob"}))), + + {ok,T21} = ?match({ok, _}, create_filter("exist $.K")), + {ok,T22} = ?match({ok, _}, create_filter("exist $.(0) or exist $.(2)")), + ?match(true, eval(T21, any:create(notify_test_K:tc(), + #notify_test_K{label= 0, value= "hoob"}))), + ?match(true, eval(T22, any:create(notify_test_K:tc(), + #notify_test_K{label= 0, value= "hoob"}))), + ?match(true, eval(T21, any:create(notify_test_K:tc(), + #notify_test_K{label= 2, value= "hoob"}))), + ?match(true, eval(T22, any:create(notify_test_K:tc(), + #notify_test_K{label= 2, value= "hoob"}))), + ?match(false, eval(T21, any:create(notify_test_K:tc(), + #notify_test_K{label= 5, value= 55}))), + ?match(false, eval(T22, any:create(notify_test_K:tc(), + #notify_test_K{label= 5, value= 55}))), + + + %% Please observe that the switch 0 and 2 is defined to be equivalent. + {ok,T23} = ?match({ok, _}, create_filter("exist $.(2)")), + {ok,T24} = ?match({ok, _}, create_filter("exist $.(0)")), + ?match(true, eval(T23, any:create(notify_test_K:tc(), + #notify_test_K{label= 2, value= "hoob"}))), + ?match(false, eval(T24, any:create(notify_test_K:tc(), + #notify_test_K{label= 2, value= "hoob"}))), + ?match(false, eval(T23, any:create(notify_test_K:tc(), + #notify_test_K{label= 0, value= "hoob"}))), + ?match(true, eval(T24, any:create(notify_test_K:tc(), + #notify_test_K{label= 0, value= "hoob"}))), + ?match(false, eval(T23, any:create(notify_test_K:tc(), + #notify_test_K{label= 5, value= 55}))), + ?match(false, eval(T24, any:create(notify_test_K:tc(), + #notify_test_K{label= 5, value= 55}))), + + ok. + +%%----------------------------------------------------------------- +%% Variables grammar tests +%%----------------------------------------------------------------- +variable_api(doc) -> ["CosNotification variables grammar tests", ""]; +variable_api(suite) -> []; +variable_api(_Config) -> + %% Accept all "CommunicationsAlarm" events + {ok,T0} = ?match({ok, _}, create_filter("$type_name == 'CommunicationsAlarm'")), + + ?match(true, eval(T0, ?not_CreateSE("DomainName","CommunicationsAlarm", + "EventName",[],[], + any:create(orber_tc:null(), null)))), + ?match(false, eval(T0, ?not_CreateSE("DomainName","CommunicationsOK", + "EventName", [],[], + any:create(orber_tc:null(), null)))), + ?match(true, eval(T0, ?not_CreateSE("DomainName","CommunicationsAlarm", + "EventName", [],[], + any:create(orber_tc:alias("IFRId", "type_name", + orber_tc:string(0)), + "CommunicationsOK")))), + + ?match(true, eval(T0, any:create(orber_tc:alias("IFRId", "type_name", + orber_tc:string(0)), + "CommunicationsAlarm"))), + ?match(false, eval(T0, any:create(orber_tc:alias("IFRId", "type_name", + orber_tc:string(0)), + "CommunicationsOK"))), + + + %% Accept all "CommunicationsAlarm" events but no "lost_packet" messages. + {ok,T1} = ?match({ok, _}, create_filter("$type_name == 'CommunicationsAlarm' and not ($event_name == 'lost_packet')")), + + ?match(true, eval(T1, ?not_CreateSE("DomainName","CommunicationsAlarm", + "EventName",[],[], + any:create(orber_tc:null(), null)))), + ?match(false, eval(T1, ?not_CreateSE("DomainName","CommunicationsAlarm", + "lost_packet", [],[], + any:create(orber_tc:null(), null)))), + ?match(true, + eval(T1, any:create(orber_tc:sequence('CosNotification_Property':tc(),0), + [#'CosNotification_Property'{name="type_name", + value=any:create(orber_tc:string(0), "CommunicationsAlarm")}, + #'CosNotification_Property'{name="event_name", + value=any:create(orber_tc:string(0), "EventName")}]))), + ?match(false, + eval(T1, any:create(orber_tc:sequence('CosNotification_Property':tc(),0), + [#'CosNotification_Property'{name="type_name", + value=any:create(orber_tc:string(0), "CommunicationsAlarm")}, + #'CosNotification_Property'{name="event_name", + value=any:create(orber_tc:string(0), "lost_packet")}]))), + + + %% Accept "CommunicationsAlarm" events with priorities ranging from 1 to 5. + {ok,T2} = ?match({ok, _}, create_filter("$type_name == 'CommunicationsAlarm' and $priority >= 1 and $priority <= 5")), + ?match(true, eval(T2, ?not_CreateSE("DomainName","CommunicationsAlarm", + "EventName", + [#'CosNotification_Property'{name="priority", + value=any:create(orber_tc:short(), 2)}], + [], any:create(orber_tc:null(), null)))), + ?match(false, eval(T2, ?not_CreateSE("DomainName","CommunicationsAlarm", + "EventName", + [#'CosNotification_Property'{name="priority", + value=any:create(orber_tc:short(), 20)}], + [], any:create(orber_tc:null(), null)))), + + %% Select "MOVIE" events featuring at least 3 of the Marx Brothers. + {ok,T3} = ?match({ok, _}, create_filter("$type_name == 'MOVIE' and (('groucho' in $starlist) + ('chico' in $starlist) + ('harpo' in $starlist) + ('zeppo' in $starlist) + ('gummo' in $starlist)) > 2")), + ?match(true, eval(T3, ?not_CreateSE("DomainName","MOVIE", + "EventName", + [#'CosNotification_Property'{name="starlist", + value=any:create(orber_tc:sequence(orber_tc:string(0),0), + ["groucho", "harpo", "sam", "gummo"])}], + [], any:create(orber_tc:null(), null)))), + ?match(false, eval(T3, ?not_CreateSE("DomainName","MOVIE", + "EventName", + [#'CosNotification_Property'{name="starlist", + value=any:create(orber_tc:sequence(orber_tc:string(0),0), + ["frodo", "bilbo", "sam", "gummo"])}], + [], any:create(orber_tc:null(), null)))), + %% Accept students that took all 3 tests and had an average score of at least 80%. + {ok,T4} = ?match({ok, _}, create_filter("$test._length == 3 and ($test[0].score + $test[1].score + $test[2].score)/3 >=80")), + ?match(true, eval(T4, ?not_CreateSE("DomainName","TypeName", + "EventName", [], + [#'CosNotification_Property'{name="test", + value=any:create(orber_tc:array(notify_test_data:tc(),0), + {#notify_test_data{score=75}, + #notify_test_data{score=80}, + #notify_test_data{score=85}})}], + any:create(orber_tc:null(), null)))), + ?match(false, eval(T4, ?not_CreateSE("DomainName","TypeName", + "EventName", [], + [#'CosNotification_Property'{name="test", + value=any:create(orber_tc:array(notify_test_data:tc(),0), + {#notify_test_data{score=75}, + #notify_test_data{score=80}, + #notify_test_data{score=80}})}], + any:create(orber_tc:null(), null)))), + ?match(false, eval(T4, ?not_CreateSE("DomainName","TypeName", + "EventName", [], + [#'CosNotification_Property'{name="test", + value=any:create(orber_tc:array(notify_test_data:tc(),0), + {#notify_test_data{score=75}, + #notify_test_data{score=85}})}], + any:create(orber_tc:null(), null)))), + %% Select processes that exceed a certain usage threshold. + {ok,T5} = ?match({ok, _}, create_filter("$memsize / 5.5 + $cputime * 1275.0 + $filesize * 1.25 > 500000.0")), + ?match(true, eval(T5, ?not_CreateSE("DomainName","TypeName", + "EventName", [], + [#'CosNotification_Property'{name="memsize", + value=any:create(orber_tc:float(), 5.5)}, + #'CosNotification_Property'{name="cputime", + value=any:create(orber_tc:float(), 0.00078431137)}, + #'CosNotification_Property'{name="filesize", + value=any:create(orber_tc:float(), 500000)}], + any:create(orber_tc:null(), null)))), + ?match(false, eval(T5, ?not_CreateSE("DomainName","TypeName", + "EventName", [], + [#'CosNotification_Property'{name="memsize", + value=any:create(orber_tc:float(), 5.5)}, + #'CosNotification_Property'{name="cputime", + value=any:create(orber_tc:float(), 0.00078431137)}, + #'CosNotification_Property'{name="filesize", + value=any:create(orber_tc:float(), 500)}], + any:create(orber_tc:null(), null)))), + ?match({error, _}, eval(T5, ?not_CreateSE("DomainName","TypeName", + "EventName", [], + [#'CosNotification_Property'{name="memsize", + value=any:create(orber_tc:float(), 5.5)}, + #'CosNotification_Property'{name="filesize", + value=any:create(orber_tc:float(), 500)}], + any:create(orber_tc:null(), null)))), + + ?match(true, eval(T5, ?not_CreateSE("DomainName","TypeName", + "EventName", [], [], + any:create(orber_tc:sequence('CosNotification_Property':tc(),0), + [#'CosNotification_Property'{name="memsize", + value=any:create(orber_tc:float(), 5.5)}, + #'CosNotification_Property'{name="cputime", + value=any:create(orber_tc:float(), 0.00078431137)}, + #'CosNotification_Property'{name="filesize", + value=any:create(orber_tc:float(), 500000)}])))), + ?match(false, eval(T5, ?not_CreateSE("DomainName","TypeName", + "EventName", [], [], + any:create(orber_tc:sequence('CosNotification_Property':tc(),0), + [#'CosNotification_Property'{name="memsize", + value=any:create(orber_tc:float(), 5.5)}, + #'CosNotification_Property'{name="cputime", + value=any:create(orber_tc:float(), 0.00078431137)}, + #'CosNotification_Property'{name="filesize", + value=any:create(orber_tc:float(), 500)}])))), + ?match({error, _}, eval(T5, ?not_CreateSE("DomainName","TypeName", + "EventName", [], [], + any:create(orber_tc:sequence('CosNotification_Property':tc(),0), + [#'CosNotification_Property'{name="memsize", + value=any:create(orber_tc:float(), 5.5)}, + #'CosNotification_Property'{name="filesize", + value=any:create(orber_tc:float(), 500)}])))), + + ?match(true, eval(T5, any:create(orber_tc:sequence('CosNotification_Property':tc(),0), + [#'CosNotification_Property'{name="memsize", + value=any:create(orber_tc:float(), 5.5)}, + #'CosNotification_Property'{name="cputime", + value=any:create(orber_tc:float(), 0.00078431137)}, + #'CosNotification_Property'{name="filesize", + value=any:create(orber_tc:float(), 500000)}]))), + ?match(false, eval(T5, any:create(orber_tc:sequence('CosNotification_Property':tc(),0), + [#'CosNotification_Property'{name="memsize", + value=any:create(orber_tc:float(), 5.5)}, + #'CosNotification_Property'{name="cputime", + value=any:create(orber_tc:float(), 0.00078431137)}, + #'CosNotification_Property'{name="filesize", + value=any:create(orber_tc:float(), 500)}]))), + ?match({error, _}, eval(T5, any:create(orber_tc:sequence('CosNotification_Property':tc(),0), + [#'CosNotification_Property'{name="memsize", + value=any:create(orber_tc:float(), 5.5)}, + #'CosNotification_Property'{name="filesize", + value=any:create(orber_tc:float(), 500)}]))), + + %% Accept events where a threshold has the unscoped type name 'data'. + {ok,T6} = ?match({ok, _}, create_filter("exist $threshold._type_id and $threshold._type_id == 'data'")), + ?match(true, eval(T6, any:create(orber_tc:alias(notify_test_data:id(), + "threshold", + notify_test_data:tc()), + #notify_test_data{score = 10, name = "Erlang"}))), + + + + ?match(true, eval(T6, ?not_CreateSE("DomainName","TypeName", + "EventName", [], + [#'CosNotification_Property' + {name="threshold", + value=any:create(notify_test_data:tc(), + #notify_test_data + {score = 10, + name = "Erlang"})}], + any:create(orber_tc:null(), null)))), + + + ?match(true, eval(T6, ?not_CreateSE("DomainName","TypeName", + "EventName", [], + [#'CosNotification_Property' + {name="NotThreshold", + value=any:create(notify_test_data:tc(), + #notify_test_data + {score = 10, + name = "Erlang"})}], + any:create(orber_tc:alias(notify_test_data:id(), + "threshold", + notify_test_data:tc()), + #notify_test_data{score = 10, name = "Erlang"})))), + + + + %% Accept events with a serviceUser property of the correct standard type. + {ok,T7} = ?match({ok, _}, create_filter("$violation(TestData)._repos_id == 'IDL:notify_test/data:1.0'")), + ?match(true, eval(T7, ?not_CreateSE("DomainName","TypeName", + "EventName", [], + [#'CosNotification_Property' + {name="violation", + value=any:create(orber_tc:array('CosNotification_Property':tc(),0), + [#'CosNotification_Property' + {name="TestData", + value=any:create(notify_test_data:tc(), + #notify_test_data + {score=100, + name="perfect score"})}])}], + any:create(orber_tc:null(), null)))), + + {ok,T8} = ?match({ok, _}, create_filter("$type_name == 'CommunicationsAlarm' and $event_name == 'lost_packet' and $priority < 2")), + %% All correct + Event1 = ?not_CreateSE("DomainName","CommunicationsAlarm", + "lost_packet", + [#'CosNotification_Property'{name="priority", + value=any:create(orber_tc:short(), 1)}], + [], any:create(orber_tc:null(), null)), + %% Priority to high + Event2 = ?not_CreateSE("DomainName","CommunicationsAlarm", + "lost_packet", + [#'CosNotification_Property'{name="priority", + value=any:create(orber_tc:short(), 2)}], + [], any:create(orber_tc:null(), null)), + %% Misspell event_name, i.e., lost_packets instead of lost_packet + Event3 = ?not_CreateSE("DomainName","CommunicationsAlarm", + "lost_packets", + [#'CosNotification_Property'{name="priority", + value=any:create(orber_tc:short(), 1)}], + [], any:create(orber_tc:null(), null)), + %% Another type_name + Event4 = ?not_CreateSE("DomainName","TemperatureAlarm", + "lost_packets", + [#'CosNotification_Property'{name="priority", + value=any:create(orber_tc:short(), 1)}], + [], any:create(orber_tc:null(), null)), + + ?match(true, eval(T8, Event1)), + ?match(false, eval(T8, Event2)), + ?match(false, eval(T8, Event3)), + ?match(false, eval(T8, Event4)), + + {ok,T9} = ?match({ok, _}, create_filter("$gpa < 80 or $tests(midterm) > $tests(final) or $monthly_attendance[3] < 10")), + + %% midterm > final yields true, the others false + Event5 = ?not_CreateSE("DomainName","TypeName", + "EventName", [], + [#'CosNotification_Property' + {name="tests", + value=any:create(orber_tc:array('CosNotification_Property':tc(),0), + [#'CosNotification_Property'{name="midterm", + value=any:create(orber_tc:short(), 70)}, + #'CosNotification_Property'{name="final", + value=any:create(orber_tc:short(), 60)}])}, + #'CosNotification_Property'{name="monthly_attendance", + value=any:create(orber_tc:array(orber_tc:short(), 0), + {0,1,2,10})}, + #'CosNotification_Property'{name="gpa", + value=any:create(orber_tc:short(), 90)}], + any:create(orber_tc:null(), null)), + + %% monthly_attendance[3] < 10 yields true, the others false + Event6 = ?not_CreateSE("DomainName","TypeName", + "EventName", [], + [#'CosNotification_Property'{name="tests", + value=any:create(orber_tc:array('CosNotification_Property':tc(),0), + [#'CosNotification_Property'{name="midterm", + value=any:create(orber_tc:short(), 70)}, + #'CosNotification_Property'{name="final", + value=any:create(orber_tc:short(), 80)}])}, + #'CosNotification_Property'{name="monthly_attendance", + value=any:create(orber_tc:array(orber_tc:short(), 0), + {0,1,2,9})}, + #'CosNotification_Property'{name="gpa", + value=any:create(orber_tc:short(), 90)}], + any:create(orber_tc:null(), null)), + + %% gpa < 80 true, rest false. + Event7 = ?not_CreateSE("DomainName","TypeName", + "EventName", [], + [#'CosNotification_Property'{name="tests", + value=any:create(orber_tc:array('CosNotification_Property':tc(),0), + [#'CosNotification_Property'{name="midterm", + value=any:create(orber_tc:short(), 70)}, + #'CosNotification_Property'{name="final", + value=any:create(orber_tc:short(), 80)}])}, + #'CosNotification_Property'{name="monthly_attendance", + value=any:create(orber_tc:array(orber_tc:short(), 0), + {0,1,2,10})}, + #'CosNotification_Property'{name="gpa", + value=any:create(orber_tc:short(), 70)}], + any:create(orber_tc:null(), null)), + + %% All false + Event8 = ?not_CreateSE("DomainName","TypeName", + "EventName", [], + [#'CosNotification_Property'{name="tests", + value=any:create(orber_tc:array('CosNotification_Property':tc(),0), + [#'CosNotification_Property'{name="midterm", + value=any:create(orber_tc:short(), 70)}, + #'CosNotification_Property'{name="final", + value=any:create(orber_tc:short(), 80)}])}, + #'CosNotification_Property'{name="monthly_attendance", + value=any:create(orber_tc:array(orber_tc:short(), 0), + {0,1,2,10})}, + #'CosNotification_Property'{name="gpa", + value=any:create(orber_tc:short(), 80)}], + any:create(orber_tc:null(), null)), + + ?match(true, eval(T9, Event5)), + ?match(true, eval(T9, Event6)), + ?match(true, eval(T9, Event7)), + ?match(false, eval(T9, Event8)), + ok. + +%%----------------------------------------------------------------- +%% Misc grammar tests +%%----------------------------------------------------------------- +positional_api(doc) -> ["CosNotification positional notation grammar tests", ""]; +positional_api(suite) -> []; +positional_api(_Config) -> + {ok,T1} = ?match({ok, _}, create_filter("$.3 < 80 or $.1(midterm) > $.1(final) or $.2[3] < 10")), + + %% midterm > final yields true, the others false + Event1 = any:create(notify_test_studies:tc(), #notify_test_studies + {gpa = 90, + tests = [#'CosNotification_Property' + {name="midterm", value=any:create(orber_tc:short(), 70)}, + #'CosNotification_Property' + {name="final", value=any:create(orber_tc:short(), 60)}], + monthly_attendance = {0,1,2,10}}), + %% monthly_attendance[3] < 10 yields true, the others false + Event2 = any:create(notify_test_studies:tc(), #notify_test_studies + {gpa = 90, + tests = [#'CosNotification_Property' + {name="midterm", value=any:create(orber_tc:short(), 70)}, + #'CosNotification_Property' + {name="final", value=any:create(orber_tc:short(), 80)}], + monthly_attendance = {0,1,2,9}}), + %% gpa < 80 true, rest false. + Event3 = any:create(notify_test_studies:tc(), #notify_test_studies + {gpa = 70, + tests = [#'CosNotification_Property' + {name="midterm", value=any:create(orber_tc:short(), 70)}, + #'CosNotification_Property' + {name="final", value=any:create(orber_tc:short(), 80)}], + monthly_attendance = {0,1,2,10}}), + %% All false + Event4 = any:create(notify_test_studies:tc(), #notify_test_studies + {gpa = 80, + tests = [#'CosNotification_Property' + {name="midterm", value=any:create(orber_tc:short(), 70)}, + #'CosNotification_Property' + {name="final", value=any:create(orber_tc:short(), 80)}], + monthly_attendance = {0,1,2,10}}), + + ?match(true, eval(T1, Event1)), + ?match(true, eval(T1, Event2)), + ?match(true, eval(T1, Event3)), + ?match(false, eval(T1, Event4)), + + {ok,T2} = ?match({ok, _}, create_filter("$.0.0.0.1 == 'CommunicationsAlarm'")), + + Event5 = ?not_CreateSE("DomainName","CommunicationsAlarm", + "lost_packet", [], [], + any:create(orber_tc:null(), null)), + + ?match(true, eval(T2, Event5)), + + ok. + +%%----------------------------------------------------------------- +%% Components grammar tests +%%----------------------------------------------------------------- +components_api(doc) -> ["CosNotification components grammar tests", ""]; +components_api(suite) -> []; +components_api(_Config) -> + {ok,T1} = ?match({ok, _}, create_filter("$ == 2")), + ?match(true, eval(T1, ?not_CreateSE("DomainName","TypeName","EventName", + [],[], any:create(orber_tc:short(), 2)))), + ?match(true, eval(T1, any:create(orber_tc:short(), 2))), + ?match(false, eval(T1, ?not_CreateSE("DomainName","TypeName","EventName", + [],[], any:create(orber_tc:short(), 3)))), + ?match(false, eval(T1, any:create(orber_tc:short(), 3))), + + %% Select "MOVIE" events featuring at least 3 of the Marx Brothers. + {ok,T2} = ?match({ok, _}, create_filter("$type_name == 'MOVIE' and (('groucho' in $.starlist) + ('chico' in $.starlist) + ('harpo' in $.starlist) + ('zeppo' in $.starlist) + ('gummo' in $.starlist)) > 2")), + ?match(true, eval(T2, ?not_CreateSE("DomainName","MOVIE", "EventName", [], [], + any:create(orber_tc:alias("IFRId","starlist",tk_any), + any:create(orber_tc:sequence(orber_tc:string(0),0), + ["groucho", "harpo", "sam", "gummo"]))))), + ?match(false, eval(T2, ?not_CreateSE("DomainName","MOVIE", "EventName", [], [], + any:create(orber_tc:alias("IFRId","starlist",tk_any), + any:create(orber_tc:sequence(orber_tc:string(0),0), + ["frodo", "bilbo", "sam", "gummo"]))))), + + %% Accept only recent events (e.g., generated within the last 15 minutes or so). + {ok,_T3} = ?match({ok, _}, create_filter("$origination_timestamp.high + 2 < $curtime.high")), + + + %% Accept students that took all 3 tests and had an average score of at least 80%. + {ok,T4} = ?match({ok, _}, create_filter("$.test._length == 3 and ($.test[0].score + $.test[1].score + $.test[2].score)/3 >=80")), + ?match(true, eval(T4, ?not_CreateSE("DomainName","TypeName", "EventName", [], [], + any:create(orber_tc:alias("IFRId","test",tk_any), + any:create(orber_tc:array(notify_test_data:tc(),0), + {#notify_test_data{score=75}, + #notify_test_data{score=80}, + #notify_test_data{score=85}}))))), + ?match(false, eval(T4, ?not_CreateSE("DomainName","TypeName", "EventName", [], [], + any:create(orber_tc:alias("IFRId","test",tk_any), + any:create(orber_tc:array(notify_test_data:tc(),0), + {#notify_test_data{score=75}, + #notify_test_data{score=80}, + #notify_test_data{score=80}}))))), + ?match(false, eval(T4, ?not_CreateSE("DomainName","TypeName", "EventName", [], [], + any:create(orber_tc:alias("IFRId","test",tk_any), + any:create(orber_tc:array(notify_test_data:tc(),0), + {#notify_test_data{score=75}, + #notify_test_data{score=80}}))))), + + %% Select processes that exceed a certain usage threshold. + {ok,T5} = ?match({ok, _}, create_filter("$.memsize / 5.5 + $.cputime * 1275.0 + $.filesize * 1.25 > 500000.0")), + ?match(true, eval(T5, ?not_CreateSE("DomainName","TypeName", "EventName", [], [], + any:create(notify_test_computer:tc(), + #notify_test_computer + {memsize=5.5, + cputime = 0.00078431137, + filesize = 500000})))), + ?match(false, eval(T5, ?not_CreateSE("DomainName","TypeName", "EventName", [], [], + any:create(notify_test_computer:tc(), + #notify_test_computer + {memsize=5.5, + cputime = 0.00078431137, + filesize = 500})))), + ?match({error,_}, eval(T5, ?not_CreateSE("DomainName","TypeName", "EventName", [], [], + any:create(notify_test_computer:tc(), + #notify_test_computer + {memsize=5.5, + cputime = 0.00078431137})))), + + %% Accept only Notification Service structured events. + {ok,T6} = ?match({ok, _}, create_filter("$._repos_id == 'IDL:omg.org/CosNotification/StructuredEvent:1.0'")), + ?match(true, eval(T6, ?not_CreateSE("DomainName","CommunicationsAlarm", + "EventName", + [], [], any:create(orber_tc:null(), null)))), + + + + %% Accept only those events that have a specified security "rights list". + {ok,T7} = ?match({ok, _}, create_filter("exist $.header.variable_header(required_rights)")), + ?match(false, eval(T7, ?not_CreateSE("DomainName","CommunicationsAlarm", + "lost_packet", + [#'CosNotification_Property'{name="priority", + value=any:create(orber_tc:short(), 1)}], + [], any:create(orber_tc:null(), null)))), + ?match(true, eval(T7, ?not_CreateSE("DomainName","CommunicationsAlarm", + "lost_packet", + [#'CosNotification_Property'{name="required_rights", + value=any:create(orber_tc:short(), 1)}], + [], any:create(orber_tc:null(), null)))), + + + {ok,T8} = ?match({ok, _}, create_filter("$.header.fixed_header.event_type.type_name == 'CommunicationsAlarm' and $.header.fixed_header.event_name == 'lost_packet' and $.header.variable_header(priority) < 2")), + %% All correct + Event1 = ?not_CreateSE("DomainName","CommunicationsAlarm", + "lost_packet", + [#'CosNotification_Property'{name="priority", + value=any:create(orber_tc:short(), 1)}], + [], any:create(orber_tc:null(), null)), + %% Priority to high + Event2 = ?not_CreateSE("DomainName","CommunicationsAlarm", + "lost_packet", + [#'CosNotification_Property'{name="priority", + value=any:create(orber_tc:short(), 2)}], + [], any:create(orber_tc:null(), null)), + %% Misspell event_name, i.e., lost_packets instead of lost_packet + Event3 = ?not_CreateSE("DomainName","CommunicationsAlarm", + "lost_packets", + [#'CosNotification_Property'{name="priority", + value=any:create(orber_tc:short(), 1)}], + [], any:create(orber_tc:null(), null)), + %% Another type_name + Event4 = ?not_CreateSE("DomainName","TemperatureAlarm", + "lost_packets", + [#'CosNotification_Property'{name="priority", + value=any:create(orber_tc:short(), 1)}], + [], any:create(orber_tc:null(), null)), + + ?match(true, eval(T8, Event1)), + ?match(false, eval(T8, Event2)), + ?match(false, eval(T8, Event3)), + ?match(false, eval(T8, Event4)), + + + {ok,T9} = ?match({ok, _}, create_filter("$.gpa < 80 or $.tests(midterm) > $.tests(final) or $.monthly_attendance[3] < 10")), + + %% midterm > final yields true, the others false + Event5 = ?not_CreateSE("DomainName","TypeName", + "EventName", [], [], + any:create(notify_test_studies:tc(), #notify_test_studies + {gpa = 90, + tests = [#'CosNotification_Property' + {name="midterm", value=any:create(orber_tc:short(), 70)}, + #'CosNotification_Property' + {name="final", value=any:create(orber_tc:short(), 60)}], + monthly_attendance = {0,1,2,10}})), + %% monthly_attendance[3] < 10 yields true, the others false + Event6 = ?not_CreateSE("DomainName","TypeName", + "EventName", [], [], + any:create(notify_test_studies:tc(), #notify_test_studies + {gpa = 90, + tests = [#'CosNotification_Property' + {name="midterm", value=any:create(orber_tc:short(), 70)}, + #'CosNotification_Property' + {name="final", value=any:create(orber_tc:short(), 80)}], + monthly_attendance = {0,1,2,9}})), + %% gpa < 80 true, rest false. + Event7 = ?not_CreateSE("DomainName","TypeName", + "EventName", [], [], + any:create(notify_test_studies:tc(), #notify_test_studies + {gpa = 70, + tests = [#'CosNotification_Property' + {name="midterm", value=any:create(orber_tc:short(), 70)}, + #'CosNotification_Property' + {name="final", value=any:create(orber_tc:short(), 80)}], + monthly_attendance = {0,1,2,10}})), + %% All false + Event8 = ?not_CreateSE("DomainName","TypeName", + "EventName", [], [], + any:create(notify_test_studies:tc(), #notify_test_studies + {gpa = 80, + tests = [#'CosNotification_Property' + {name="midterm", value=any:create(orber_tc:short(), 70)}, + #'CosNotification_Property' + {name="final", value=any:create(orber_tc:short(), 80)}], + monthly_attendance = {0,1,2,10}})), + + ?match(true, eval(T9, Event5)), + ?match(true, eval(T9, Event6)), + ?match(true, eval(T9, Event7)), + ?match(false, eval(T9, Event8)), + ok. + + +%%----------------------------------------------------------------- +%% Internal functions +%%----------------------------------------------------------------- + +%%-------------------- End of Module ------------------------------ diff --git a/lib/cosNotification/test/notification_SUITE.erl b/lib/cosNotification/test/notification_SUITE.erl new file mode 100644 index 0000000000..e2c560e4de --- /dev/null +++ b/lib/cosNotification/test/notification_SUITE.erl @@ -0,0 +1,2185 @@ +%%-------------------------------------------------------------------- +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +%% +%%-------------------------------------------------------------------- +%% File : notification_SUITE.erl +%% Purpose : +%%-------------------------------------------------------------------- + +-module(notification_SUITE). + +%%--------------- INCLUDES ----------------------------------- +-include_lib("orber/include/corba.hrl"). +-include_lib("orber/include/ifr_types.hrl"). +%% cosEvent files. +-include_lib("cosEvent/include/CosEventChannelAdmin.hrl"). +%% Application files +-include_lib("cosNotification/include/CosNotification.hrl"). +-include_lib("cosNotification/include/CosNotifyChannelAdmin.hrl"). +-include_lib("cosNotification/include/CosNotifyComm.hrl"). +-include_lib("cosNotification/include/CosNotifyFilter.hrl"). + +-include_lib("cosNotification/src/CosNotification_Definitions.hrl"). + +-include("idl_output/notify_test.hrl"). + +-include("test_server.hrl"). + +%%--------------- DEFINES ------------------------------------ +-define(default_timeout, ?t:minutes(20)). +-define(match(ExpectedRes, Expr), + fun() -> + AcTuAlReS = (catch (Expr)), + case AcTuAlReS of + ExpectedRes -> + io:format("------ CORRECT RESULT ------~n~p~n", + [AcTuAlReS]), + AcTuAlReS; + _ -> + io:format("###### ERROR ERROR ######~n~p~n", + [AcTuAlReS]), + ?line exit(AcTuAlReS) + end + end()). + +-define(defaultQoS, + [#'CosNotification_Property'{name='CosNotification':'MaximumBatchSize'(), + value=any:create(orber_tc:long(), 100)}, + #'CosNotification_Property'{name='CosNotification':'PacingInterval'(), + value=any:create(orber_tc:unsigned_long_long(), + 20000000)}, + #'CosNotification_Property'{name='CosNotification':'OrderPolicy'(), + value=any:create(orber_tc:short(), + 'CosNotification':'AnyOrder'())}, + #'CosNotification_Property'{name='CosNotification':'EventReliability'(), + value=any:create(orber_tc:short(), + 'CosNotification':'BestEffort'())}, + #'CosNotification_Property'{name='CosNotification':'ConnectionReliability'(), + value=any:create(orber_tc:short(), + 'CosNotification':'BestEffort'())}, + #'CosNotification_Property'{name='CosNotification':'DiscardPolicy'(), + value=any:create(orber_tc:short(), + 'CosNotification':'AnyOrder'())}, + #'CosNotification_Property'{name='CosNotification':'StartTimeSupported'(), + value=any:create(orber_tc:boolean(), false)}, + #'CosNotification_Property'{name='CosNotification':'StopTimeSupported'(), + value=any:create(orber_tc:boolean(), false)}, + #'CosNotification_Property'{name='CosNotification':'Priority'(), + value=any:create(orber_tc:short(), + 'CosNotification':'DefaultPriority'())}]). +-define(defaultQoS2, + [#'CosNotification_Property'{name='CosNotification':'MaximumBatchSize'(), + value=any:create(orber_tc:long(), 1)}, + #'CosNotification_Property'{name='CosNotification':'PacingInterval'(), + value=any:create(orber_tc:unsigned_long_long(), + 0)}, + #'CosNotification_Property'{name='CosNotification':'OrderPolicy'(), + value=any:create(orber_tc:short(), + 'CosNotification':'AnyOrder'())}, + #'CosNotification_Property'{name='CosNotification':'EventReliability'(), + value=any:create(orber_tc:short(), + 'CosNotification':'BestEffort'())}, + #'CosNotification_Property'{name='CosNotification':'ConnectionReliability'(), + value=any:create(orber_tc:short(), + 'CosNotification':'BestEffort'())}, + #'CosNotification_Property'{name='CosNotification':'DiscardPolicy'(), + value=any:create(orber_tc:short(), + 'CosNotification':'AnyOrder'())}, + #'CosNotification_Property'{name='CosNotification':'StartTimeSupported'(), + value=any:create(orber_tc:boolean(), false)}, + #'CosNotification_Property'{name='CosNotification':'StopTimeSupported'(), + value=any:create(orber_tc:boolean(), false)}, + #'CosNotification_Property'{name='CosNotification':'Priority'(), + value=any:create(orber_tc:short(), + 'CosNotification':'DefaultPriority'())}]). +-define(defaultAdm, + [#'CosNotification_Property'{name='CosNotification':'MaxQueueLength'(), + value=any:create(orber_tc:long(), 100)}, + #'CosNotification_Property'{name='CosNotification':'MaxConsumers'(), + value=any:create(orber_tc:long(), 100)}, + #'CosNotification_Property'{name='CosNotification':'MaxSuppliers'(), + value=any:create(orber_tc:long(), 100)}]). + +-define(FAC_OPT, []). + + +%%----------------------------------------------------------------- +%% External exports +%%----------------------------------------------------------------- +-export([all/1, cases/0, init_all/1, finish_all/1, qos_api/1, adm_api/1, + cosevent_api/1, filter_adm_api/1, events_api/1, events2_api/1, + event_qos_api/1, filter_api/1, mapping_filter_api/1, subscription_api/1, + init_per_testcase/2, fin_per_testcase/2, persistent_max_events_api/1, + persistent_timeout_events_api/1, persistent_recover_events_api/1, + app_test/1]). + +-export([terminated/1]). + +%%----------------------------------------------------------------- +%% Func: all/1 +%% Args: +%% Returns: +%%----------------------------------------------------------------- +all(doc) -> ["API tests for the cosNotification interfaces", ""]; +all(suite) -> {req, + [mnesia, orber], + {conf, init_all, cases(), finish_all}}. + +cases() -> + [persistent_max_events_api, persistent_timeout_events_api, + persistent_recover_events_api, mapping_filter_api, filter_api, filter_adm_api, + event_qos_api, qos_api, adm_api, cosevent_api, subscription_api, + events_api, events2_api, app_test]. + + + +%%----------------------------------------------------------------- +%% Init and cleanup functions. +%%----------------------------------------------------------------- + +init_per_testcase(_Case, Config) -> + Path = code:which(?MODULE), + code:add_pathz(filename:join(filename:dirname(Path), "idl_output")), + ?line Dog=test_server:timetrap(?default_timeout), + [{watchdog, Dog}|Config]. + + +fin_per_testcase(_Case, Config) -> + Path = code:which(?MODULE), + code:del_path(filename:join(filename:dirname(Path), "idl_output")), + Dog = ?config(watchdog, Config), + test_server:timetrap_cancel(Dog), + ok. + +init_all(Config) -> + Path = code:which(?MODULE), + code:add_pathz(filename:join(filename:dirname(Path), "idl_output")), + ok = corba:orb_init([{flags, 16#02}, {orber_debug_level, 10}]), + orber:jump_start(), + cosNotificationApp:install_event(), + cosNotificationApp:install(), + 'oe_notify_test_server':'oe_register'(), + cosNotificationApp:start(), + if + is_list(Config) -> + Config; + true -> + exit("Config not a list") + end. + +finish_all(Config) -> + cosNotificationApp:stop(), + Path = code:which(?MODULE), + code:del_path(filename:join(filename:dirname(Path), "idl_output")), + 'oe_notify_test_server':'oe_unregister'(), + cosNotificationApp:uninstall(), + cosNotificationApp:uninstall_event(), + orber:jump_stop(), + Config. + + +%%----------------------------------------------------------------- +%% Tests app file +%%----------------------------------------------------------------- +app_test(doc) -> []; +app_test(suite) -> []; +app_test(_Config) -> + ok=test_server:app_test(cosNotification), + ok. + + +%%----------------------------------------------------------------- +%% Persistent events max limit +%%----------------------------------------------------------------- +persistent_max_events_api(doc) -> ["CosNotification QoS EventReliability Persistent", + ""]; +persistent_max_events_api(suite) -> []; +persistent_max_events_api(_Config) -> + QoSPersistent = + [#'CosNotification_Property'{name='CosNotification':'ConnectionReliability'(), + value=any:create(orber_tc:short(), + 'CosNotification':'Persistent'())}], + QoSEventPersistent = + [#'CosNotification_Property'{name='CosNotification':'EventReliability'(), + value=any:create(orber_tc:short(), + 'CosNotification':'Persistent'())}], + application:set_env(cosNotification, notify, ?MODULE), + application:set_env(cosNotification, max_events, 2), + application:set_env(cosNotification, timeout_events, 300000), + application:set_env(cosNotification, interval_events, 10000), + %% Initialize the application. + Fac = (catch cosNotificationApp:start_global_factory(?FAC_OPT)), + ?match({_,key,_,_,_,_}, Fac), + {Ch, _Id1} = (catch 'CosNotifyChannelAdmin_EventChannelFactory':create_channel(Fac, ?defaultQoS2, ?defaultAdm)), + ?match({_,key,_,_,_,_}, Ch), + + ?match(ok, 'CosNotification_QoSAdmin':set_qos(Ch, QoSEventPersistent)), + ?match(ok, 'CosNotification_QoSAdmin':set_qos(Ch, QoSPersistent)), + + %% Create the Admin objects + {AdminSupplier, _ASID}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_EventChannel':new_for_suppliers(Ch,'AND_OP')), + {AdminConsumer, _ACID}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_EventChannel':new_for_consumers(Ch,'AND_OP')), + + %% Create Proxies and clients + {SequenceProxyPushSupplier,_ID}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_ConsumerAdmin':obtain_notification_push_supplier(AdminConsumer, 'SEQUENCE_EVENT')), + PushSeqC=?match({_,key,_,_,_,_}, 'notify_test_SeqPushC':oe_create(['PUSH_SEQUENCE',SequenceProxyPushSupplier], + [{local_typecheck, false}])), + ?match(ok, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':connect_sequence_push_consumer(SequenceProxyPushSupplier, PushSeqC)), + + {SequenceProxyPushConsumer,_ID}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_SupplierAdmin':obtain_notification_push_consumer(AdminSupplier, 'SEQUENCE_EVENT')), + PushSeqS=?match({_,key,_,_,_,_}, 'notify_test_SeqPushS':oe_create(['PUSH_SEQUENCE',SequenceProxyPushConsumer], + [{local_typecheck, false}])), + ?match(ok, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':connect_sequence_push_supplier(SequenceProxyPushConsumer, PushSeqS)), + + %% Create a couple of Events to test with. + Event = ?not_CreateSE("DomainName","CommunicationsAlarm", + "lost_packet", + [#'CosNotification_Property'{name="priority", + value=any:create(orber_tc:short(), 1)}], + [], any:create(orber_tc:null(), null)), + + ?match(ok, 'notify_test_SeqPushC':doAction(PushSeqC, {action, action})), + + %% Push and check the state. + ?match(ok,'CosNotifyChannelAdmin_SequenceProxyPushConsumer':push_structured_events(SequenceProxyPushConsumer, [Event])), + ?match([], 'notify_test_SeqPushC':doAction(PushSeqC, return_data)), + ?match(false, corba_object:non_existent(SequenceProxyPushSupplier)), + + ?match(ok,'CosNotifyChannelAdmin_SequenceProxyPushConsumer':push_structured_events(SequenceProxyPushConsumer, [Event])), + ?match([], 'notify_test_SeqPushC':doAction(PushSeqC, return_data)), + ?match(false, corba_object:non_existent(SequenceProxyPushSupplier)), + %% Now we've reached the limit. This call will terminate the proxy. + %% We cannot check for data at this point since the broken connection + %% will result in that the client terminates. + ?match(ok,'CosNotifyChannelAdmin_SequenceProxyPushConsumer':push_structured_events(SequenceProxyPushConsumer, [Event])), + timer:sleep(5000), + ?match(true, corba_object:non_existent(SequenceProxyPushSupplier)), + ?match(true, corba_object:non_existent(PushSeqC)), + + + catch corba:dispose(SequenceProxyPushConsumer), + catch corba:dispose(SequenceProxyPushSupplier), + catch corba:dispose(AdminConsumer), + catch corba:dispose(AdminSupplier), + catch corba:dispose(Ch), + catch cosNotificationApp:stop_factory(Fac), + catch corba:dispose(PushSeqS), + catch corba:dispose(PushSeqC), + application:set_env(cosNotification, notify, undefined), + application:set_env(cosNotification, max_events, undefined), + application:set_env(cosNotification, timeout_events, undefined), + application:set_env(cosNotification, interval_events, undefined), + ok. + +terminated(Items) -> + io:format("Proxy terminated due to: ~p~n", [Items]). + +%%----------------------------------------------------------------- +%% Persistent events timeout +%%----------------------------------------------------------------- +persistent_timeout_events_api(doc) -> + ["CosNotification QoS EventReliability Persistent", + ""]; +persistent_timeout_events_api(suite) -> []; +persistent_timeout_events_api(_Config) -> + QoSPersistent = + [#'CosNotification_Property'{name='CosNotification':'ConnectionReliability'(), + value=any:create(orber_tc:short(), + 'CosNotification':'Persistent'())}], + QoSEventPersistent = + [#'CosNotification_Property'{name='CosNotification':'EventReliability'(), + value=any:create(orber_tc:short(), + 'CosNotification':'Persistent'())}], + application:set_env(cosNotification, notify, ?MODULE), + application:set_env(cosNotification, max_events, 1000), + application:set_env(cosNotification, timeout_events, 4000), + application:set_env(cosNotification, interval_events, 1000), + %% Initialize the application. + Fac = (catch cosNotificationApp:start_global_factory(?FAC_OPT)), + ?match({_,key,_,_,_,_}, Fac), + {Ch, _Id1} = (catch 'CosNotifyChannelAdmin_EventChannelFactory':create_channel(Fac, ?defaultQoS2, ?defaultAdm)), + ?match({_,key,_,_,_,_}, Ch), + + ?match(ok, 'CosNotification_QoSAdmin':set_qos(Ch, QoSEventPersistent)), + ?match(ok, 'CosNotification_QoSAdmin':set_qos(Ch, QoSPersistent)), + + %% Create the Admin objects + {AdminSupplier, _ASID}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_EventChannel':new_for_suppliers(Ch,'AND_OP')), + {AdminConsumer, _ACID}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_EventChannel':new_for_consumers(Ch,'AND_OP')), + + %% Create Proxies and clients + {SequenceProxyPushSupplier,_ID}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_ConsumerAdmin':obtain_notification_push_supplier(AdminConsumer, 'SEQUENCE_EVENT')), + PushSeqC=?match({_,key,_,_,_,_}, 'notify_test_SeqPushC':oe_create(['PUSH_SEQUENCE',SequenceProxyPushSupplier], + [{local_typecheck, false}])), + ?match(ok, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':connect_sequence_push_consumer(SequenceProxyPushSupplier, PushSeqC)), + + {SequenceProxyPushConsumer,_ID}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_SupplierAdmin':obtain_notification_push_consumer(AdminSupplier, 'SEQUENCE_EVENT')), + PushSeqS=?match({_,key,_,_,_,_}, 'notify_test_SeqPushS':oe_create(['PUSH_SEQUENCE',SequenceProxyPushConsumer], + [{local_typecheck, false}])), + ?match(ok, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':connect_sequence_push_supplier(SequenceProxyPushConsumer, PushSeqS)), + + %% Create a couple of Events to test with. + Event = ?not_CreateSE("DomainName","CommunicationsAlarm", + "lost_packet", + [#'CosNotification_Property'{name="priority", + value=any:create(orber_tc:short(), 1)}], + [], any:create(orber_tc:null(), null)), + + ?match(ok, 'notify_test_SeqPushC':doAction(PushSeqC, {action, action})), + + %% Push and check the state. + ?match(ok,'CosNotifyChannelAdmin_SequenceProxyPushConsumer':push_structured_events(SequenceProxyPushConsumer, [Event])), + ?match([], 'notify_test_SeqPushC':doAction(PushSeqC, return_data)), + ?match(false, corba_object:non_existent(SequenceProxyPushSupplier)), + + %% Now we've reached the limit. This call will terminate the proxy. + %% We cannot check for data at this point since the broken connection + %% will result in that the client terminates. + ?match(ok,'CosNotifyChannelAdmin_SequenceProxyPushConsumer':push_structured_events(SequenceProxyPushConsumer, [Event])), + timer:sleep(10000), + ?match(true, corba_object:non_existent(SequenceProxyPushSupplier)), + ?match(true, corba_object:non_existent(PushSeqC)), + + + catch corba:dispose(SequenceProxyPushConsumer), + catch corba:dispose(SequenceProxyPushSupplier), + catch corba:dispose(AdminConsumer), + catch corba:dispose(AdminSupplier), + catch corba:dispose(Ch), + catch cosNotificationApp:stop_factory(Fac), + catch corba:dispose(PushSeqS), + catch corba:dispose(PushSeqC), + application:set_env(cosNotification, notify, undefined), + application:set_env(cosNotification, max_events, undefined), + application:set_env(cosNotification, timeout_events, undefined), + application:set_env(cosNotification, interval_events, undefined), + ok. + +%%----------------------------------------------------------------- +%% Persistent events max limit +%%----------------------------------------------------------------- +persistent_recover_events_api(doc) -> + ["CosNotification QoS EventReliability Persistent", + ""]; +persistent_recover_events_api(suite) -> []; +persistent_recover_events_api(_Config) -> + QoSPersistent = + [#'CosNotification_Property'{name='CosNotification':'ConnectionReliability'(), + value=any:create(orber_tc:short(), + 'CosNotification':'Persistent'())}], + QoSEventPersistent = + [#'CosNotification_Property'{name='CosNotification':'EventReliability'(), + value=any:create(orber_tc:short(), + 'CosNotification':'Persistent'())}], + application:set_env(cosNotification, notify, ?MODULE), + application:set_env(cosNotification, max_events, 1000), + application:set_env(cosNotification, timeout_events, 100000), + application:set_env(cosNotification, interval_events, 1000), + %% Initialize the application. + Fac = (catch cosNotificationApp:start_global_factory(?FAC_OPT)), + ?match({_,key,_,_,_,_}, Fac), + {Ch, _Id1} = (catch 'CosNotifyChannelAdmin_EventChannelFactory':create_channel(Fac, ?defaultQoS2, ?defaultAdm)), + ?match({_,key,_,_,_,_}, Ch), + + ?match(ok, 'CosNotification_QoSAdmin':set_qos(Ch, QoSEventPersistent)), + ?match(ok, 'CosNotification_QoSAdmin':set_qos(Ch, QoSPersistent)), + + %% Create the Admin objects + {AdminSupplier, _ASID}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_EventChannel':new_for_suppliers(Ch,'AND_OP')), + {AdminConsumer, _ACID}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_EventChannel':new_for_consumers(Ch,'AND_OP')), + + %% Create Proxies and clients + {SequenceProxyPushSupplier,_ID}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_ConsumerAdmin':obtain_notification_push_supplier(AdminConsumer, 'SEQUENCE_EVENT')), + PushSeqC=?match({_,key,_,_,_,_}, 'notify_test_SeqPushC':oe_create(['PUSH_SEQUENCE',SequenceProxyPushSupplier], + [{local_typecheck, false}])), + ?match(ok, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':connect_sequence_push_consumer(SequenceProxyPushSupplier, PushSeqC)), + + {SequenceProxyPushConsumer,_ID}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_SupplierAdmin':obtain_notification_push_consumer(AdminSupplier, 'SEQUENCE_EVENT')), + PushSeqS=?match({_,key,_,_,_,_}, 'notify_test_SeqPushS':oe_create(['PUSH_SEQUENCE',SequenceProxyPushConsumer], + [{local_typecheck, false}])), + ?match(ok, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':connect_sequence_push_supplier(SequenceProxyPushConsumer, PushSeqS)), + + %% Create a couple of Events to test with. + Event = ?not_CreateSE("DomainName","CommunicationsAlarm", + "lost_packet", + [#'CosNotification_Property'{name="priority", + value=any:create(orber_tc:short(), 1)}], + [], any:create(orber_tc:null(), null)), + + ?match(ok, 'notify_test_SeqPushC':doAction(PushSeqC, {action, action})), + + %% Push and check the state. + ?match(ok,'CosNotifyChannelAdmin_SequenceProxyPushConsumer':push_structured_events(SequenceProxyPushConsumer, [Event])), + ?match([], 'notify_test_SeqPushC':doAction(PushSeqC, return_data)), + ?match(false, corba_object:non_existent(SequenceProxyPushSupplier)), + %% Allow the proxy to try a few times and then change the client behavior + timer:sleep(4000), + ?match(ok, 'notify_test_SeqPushC':doAction(PushSeqC, {action, undefined})), + %% Wait some time so that the proxy timeout has kicked in. + timer:sleep(4000), + + %% Now the communication should work again. + ?match([Event], 'notify_test_SeqPushC':doAction(PushSeqC, return_data)), + ?match(false, corba_object:non_existent(SequenceProxyPushSupplier)), + + ?match(ok,'CosNotifyChannelAdmin_SequenceProxyPushConsumer':push_structured_events(SequenceProxyPushConsumer, [Event])), + timer:sleep(4000), + ?match([Event], 'notify_test_SeqPushC':doAction(PushSeqC, return_data)), + + catch corba:dispose(SequenceProxyPushConsumer), + catch corba:dispose(SequenceProxyPushSupplier), + catch corba:dispose(AdminConsumer), + catch corba:dispose(AdminSupplier), + catch corba:dispose(Ch), + catch cosNotificationApp:stop_factory(Fac), + catch corba:dispose(PushSeqS), + catch corba:dispose(PushSeqC), + application:set_env(cosNotification, notify, undefined), + application:set_env(cosNotification, max_events, undefined), + application:set_env(cosNotification, timeout_events, undefined), + application:set_env(cosNotification, interval_events, undefined), + ok. + + +%%----------------------------------------------------------------- +%% CosNotifyFilter::Filter API tests +%%----------------------------------------------------------------- +mapping_filter_api(doc) -> ["CosNotifyFilter::MappingFilter API tests.", ""]; +mapping_filter_api(suite) -> []; +mapping_filter_api(_Config) -> + FiFac = 'CosNotifyFilter_FilterFactory':oe_create(), + ?match({_,key,_,_,_,_}, FiFac), + + Filter = 'CosNotifyFilter_FilterFactory':create_mapping_filter(FiFac, + "EXTENDED_TCL", + any:create(orber_tc:short(), 10)), + ?match({_,key,_,_,_,_}, Filter), + + ?match("EXTENDED_TCL", 'CosNotifyFilter_MappingFilter':'_get_constraint_grammar'(Filter)), + + %% Test before we add any constarints. + ?match([], 'CosNotifyFilter_MappingFilter':get_all_mapping_constraints(Filter)), + ?match({'EXCEPTION', {'CosNotifyFilter_ConstraintNotFound', _, 1}}, + 'CosNotifyFilter_MappingFilter':get_mapping_constraints(Filter, [1])), + ?match(ok, 'CosNotifyFilter_MappingFilter':remove_all_mapping_constraints(Filter)), + + %% Try adding an incorrect constraint_expr + ?match({'EXCEPTION',{'CosNotifyFilter_InvalidConstraint',_,_}}, + 'CosNotifyFilter_MappingFilter':add_mapping_constraints(Filter, + [#'CosNotifyFilter_MappingConstraintPair' + {constraint_expression = #'CosNotifyFilter_ConstraintExp' + {event_types = [#'CosNotification_EventType' + {domain_name = "name", + type_name = "type"}], + constraint_expr = "2==2 and 3<"}, + result_to_set = any:create(orber_tc:short(), 10)}])), + %% Try adding two correct constraint_expr + ?line[{_,_,CID1,_},{_,_,CID2,_}]= + ?match([{'CosNotifyFilter_MappingConstraintInfo',_,_,_}, {'CosNotifyFilter_MappingConstraintInfo',_,_,_}], + 'CosNotifyFilter_MappingFilter':add_mapping_constraints(Filter, + [#'CosNotifyFilter_MappingConstraintPair' + {constraint_expression = #'CosNotifyFilter_ConstraintExp' + {event_types = [#'CosNotification_EventType' + {domain_name = "name", + type_name = "type"}], + constraint_expr = "2==2 and 3<4"}, + result_to_set = any:create(orber_tc:short(), 10)}, + #'CosNotifyFilter_MappingConstraintPair' + {constraint_expression = #'CosNotifyFilter_ConstraintExp' + {event_types = [#'CosNotification_EventType' + {domain_name = "name2", + type_name = "type2"}], + constraint_expr = "$.test._length == 3 and ($.test[0].score + $.test[1].score + $.test[2].score)/3 >=80"}, + result_to_set = any:create(orber_tc:short(), 10)}])), + + ?match([{'CosNotifyFilter_MappingConstraintInfo',_,CID2,_}, {'CosNotifyFilter_MappingConstraintInfo',_,CID1,_}], + 'CosNotifyFilter_MappingFilter':get_all_mapping_constraints(Filter)), + ?match([{'CosNotifyFilter_MappingConstraintInfo',_,CID1,_}], + 'CosNotifyFilter_MappingFilter':get_mapping_constraints(Filter, [CID1])), + ?match(ok, 'CosNotifyFilter_MappingFilter':remove_all_mapping_constraints(Filter)), + ?match([], 'CosNotifyFilter_MappingFilter':get_all_mapping_constraints(Filter)), + + %% Try adding a constraint_expr with using invalid value, i.e., not short. + ?match({'EXCEPTION',{'CosNotifyFilter_InvalidValue',_,_,_}}, + 'CosNotifyFilter_MappingFilter':add_mapping_constraints(Filter, + [#'CosNotifyFilter_MappingConstraintPair' + {constraint_expression = #'CosNotifyFilter_ConstraintExp' + {event_types = [#'CosNotification_EventType' + {domain_name = "name", + type_name = "type"}], + constraint_expr = "2==2 and 3<8"}, + result_to_set = any:create(orber_tc:long(), 10)}])), + + %% Try adding one correct and one incorrect constraint_expr + ?match({'EXCEPTION',{'CosNotifyFilter_InvalidConstraint',_,_}}, + 'CosNotifyFilter_MappingFilter':add_mapping_constraints(Filter, + [#'CosNotifyFilter_MappingConstraintPair' + {constraint_expression = #'CosNotifyFilter_ConstraintExp' + {event_types = [#'CosNotification_EventType' + {domain_name = "name", + type_name = "type"}], + constraint_expr = "2==2 and 3<"}, + result_to_set = any:create(orber_tc:short(), 10)}, + #'CosNotifyFilter_MappingConstraintPair' + {constraint_expression = #'CosNotifyFilter_ConstraintExp' + {event_types = [#'CosNotification_EventType' + {domain_name = "name2", + type_name = "type2"}], + constraint_expr = "$.test._length == 3 and ($.test[0].score + $.test[1].score + $.test[2].score)/3 >=80"}, + result_to_set = any:create(orber_tc:short(), 10)}])), + + %% Following testcases test different domain_name and type_name, e.g., + %% wildcards etc. + [{_,ConInfoData,CID3,_}] = + ?match([{'CosNotifyFilter_MappingConstraintInfo',_,_,_}], + 'CosNotifyFilter_MappingFilter':add_mapping_constraints(Filter, + [#'CosNotifyFilter_MappingConstraintPair' + {constraint_expression = #'CosNotifyFilter_ConstraintExp' + {event_types = [#'CosNotification_EventType' + {domain_name = "domain", + type_name = ""}, + #'CosNotification_EventType' + {domain_name = "*", + type_name = "type"}], + constraint_expr = "2==2 and 3<4"}, + result_to_set = any:create(orber_tc:short(), 10)}])), + + %% Try removing a constraint + ?match(ok, 'CosNotifyFilter_MappingFilter':modify_mapping_constraints(Filter,[CID3],[])), + ?match([], 'CosNotifyFilter_MappingFilter':get_all_mapping_constraints(Filter)), + + %% Add e new constraint + [{_,_,CID4,_}] = + ?match([{'CosNotifyFilter_MappingConstraintInfo',_,_,_}], + 'CosNotifyFilter_MappingFilter':add_mapping_constraints(Filter, + [#'CosNotifyFilter_MappingConstraintPair' + {constraint_expression = #'CosNotifyFilter_ConstraintExp' + {event_types = [#'CosNotification_EventType' + {domain_name = "domain1", + type_name = ""}, + #'CosNotification_EventType' + {domain_name = "domain2", + type_name = "*"}], + constraint_expr = "2==2 and 3<4"}, + result_to_set = any:create(orber_tc:short(), 10)}])), + + %% Try to update the constraint associated with CID4 to equal CID3. + ?match(ok, 'CosNotifyFilter_MappingFilter':modify_mapping_constraints(Filter,[], + [#'CosNotifyFilter_MappingConstraintInfo' + {constraint_expression= + #'CosNotifyFilter_ConstraintExp' + {event_types =[#'CosNotification_EventType' + {domain_name = "domain", + type_name = ""}, + #'CosNotification_EventType' + {domain_name = "*", + type_name = "type"}], + constraint_expr = "2==2 and 3<4"}, + constraint_id=CID4, + value = any:create(orber_tc:short(), 10)}])), + + ?match([{_,ConInfoData,CID4,_}], 'CosNotifyFilter_MappingFilter':get_all_mapping_constraints(Filter)), + + ?match({'EXCEPTION', {'CosNotifyFilter_ConstraintNotFound', _, CID3}}, + 'CosNotifyFilter_MappingFilter':get_mapping_constraints(Filter, [CID3])), + ?match(ok, 'CosNotifyFilter_MappingFilter':remove_all_mapping_constraints(Filter)), + ?match([], 'CosNotifyFilter_MappingFilter':get_all_mapping_constraints(Filter)), + + ?match([{'CosNotifyFilter_MappingConstraintInfo',_,_,_}], + 'CosNotifyFilter_MappingFilter':add_mapping_constraints(Filter, + [#'CosNotifyFilter_MappingConstraintPair' + {constraint_expression = #'CosNotifyFilter_ConstraintExp' + {event_types = [#'CosNotification_EventType' + {domain_name = "", + type_name = "type1"}, + #'CosNotification_EventType' + {domain_name = "*", + type_name = "type2"}], + constraint_expr = "2==2 and 3<4"}, + result_to_set = any:create(orber_tc:short(), 10)}])), + + ?match([{'CosNotifyFilter_MappingConstraintInfo',_,_,_}], + 'CosNotifyFilter_MappingFilter':add_mapping_constraints(Filter, + [#'CosNotifyFilter_MappingConstraintPair' + {constraint_expression = #'CosNotifyFilter_ConstraintExp' + {event_types = [#'CosNotification_EventType' + {domain_name = "domain1", + type_name = "type1"}, + #'CosNotification_EventType' + {domain_name = "domain2", + type_name = "type2"}], + constraint_expr = "2==2 and 3<4"}, + result_to_set = any:create(orber_tc:short(), 10)}])), + + ?match([{'CosNotifyFilter_MappingConstraintInfo',_,_,_}], + 'CosNotifyFilter_MappingFilter':add_mapping_constraints(Filter, + [#'CosNotifyFilter_MappingConstraintPair' + {constraint_expression = #'CosNotifyFilter_ConstraintExp' + {event_types = [#'CosNotification_EventType' + {domain_name = "dom*", + type_name = "type1"}, + #'CosNotification_EventType' + {domain_name = "domain2", + type_name = "typ*"}], + constraint_expr = "2==2 and 3<4"}, + result_to_set = any:create(orber_tc:short(), 10)}])), + + ?match([{'CosNotifyFilter_MappingConstraintInfo',_,_,_}], + 'CosNotifyFilter_MappingFilter':add_mapping_constraints(Filter, + [#'CosNotifyFilter_MappingConstraintPair' + {constraint_expression = #'CosNotifyFilter_ConstraintExp' + {event_types = [#'CosNotification_EventType' + {domain_name = "dom*1", + type_name = "type1"}, + #'CosNotification_EventType' + {domain_name = "domain2", + type_name = "typ*2"}], + constraint_expr = "2==2 and 3<4"}, + result_to_set = any:create(orber_tc:short(), 10)}])), + + catch corba:dispose(FiFac), + catch corba:dispose(Filter), + ok. + + +%%----------------------------------------------------------------- +%% CosNotifyFilter::Filter API tests +%%----------------------------------------------------------------- +filter_api(doc) -> ["CosNotifyFilter::Filter API tests.", ""]; +filter_api(suite) -> []; +filter_api(_Config) -> + Fac = cosNotificationApp:start_global_factory(?FAC_OPT), + ?match({_,key,_,_,_,_}, Fac), + {Ch, _Id1} = 'CosNotifyChannelAdmin_EventChannelFactory':create_channel(Fac, ?defaultQoS, ?defaultAdm), + AC= 'CosNotifyChannelAdmin_EventChannel':for_consumers(Ch), + + FiFac = 'CosNotifyFilter_FilterFactory':oe_create(), + ?match({_,key,_,_,_,_}, FiFac), + + Filter = 'CosNotifyFilter_FilterFactory':create_filter(FiFac,"EXTENDED_TCL"), + ?match({_,key,_,_,_,_}, Filter), + + ?match("EXTENDED_TCL", 'CosNotifyFilter_Filter':'_get_constraint_grammar'(Filter)), + + %% Test Callback management. + ?match({'EXCEPTION',{'BAD_PARAM',_,_,_}}, + 'CosNotifyFilter_Filter':attach_callback(Filter, Ch)), + ?match([], 'CosNotifyFilter_Filter':get_callbacks(Filter)), + ?match({'EXCEPTION',{'CosNotifyFilter_CallbackNotFound',_}}, + 'CosNotifyFilter_Filter':detach_callback(Filter, 0)), + ID='CosNotifyFilter_Filter':attach_callback(Filter, AC), + ?match([ID], 'CosNotifyFilter_Filter':get_callbacks(Filter)), + ?match(ok, 'CosNotifyFilter_Filter':detach_callback(Filter, ID)), + ?match([], 'CosNotifyFilter_Filter':get_callbacks(Filter)), + + %% This callback is just attached so we can test that we can call notify_subscribe. + _ID2='CosNotifyFilter_Filter':attach_callback(Filter, AC), + + %% Test before we add any constarints. + ?match([], 'CosNotifyFilter_Filter':get_all_constraints(Filter)), + ?match({'EXCEPTION', {'CosNotifyFilter_ConstraintNotFound', _, 1}}, + 'CosNotifyFilter_Filter':get_constraints(Filter, [1])), + ?match(ok, 'CosNotifyFilter_Filter':remove_all_constraints(Filter)), + + %% Try adding an incorrect constraint_expr + ?match({'EXCEPTION',{'CosNotifyFilter_InvalidConstraint',_,_}}, + 'CosNotifyFilter_Filter':add_constraints(Filter, + [#'CosNotifyFilter_ConstraintExp'{event_types = + [#'CosNotification_EventType'{ + domain_name = "name", + type_name = "type"}], + constraint_expr = "2==2 and 3<"}])), + %% Try adding two correct constraint_expr + ?line[{_,_,CID1},{_,_,CID2}]= + ?match([{'CosNotifyFilter_ConstraintInfo',_,_}, {'CosNotifyFilter_ConstraintInfo',_,_}], + 'CosNotifyFilter_Filter':add_constraints(Filter, + [#'CosNotifyFilter_ConstraintExp'{event_types = + [#'CosNotification_EventType'{ + domain_name = "name", + type_name = "type"}], + constraint_expr = "2==2 and 3<4"}, + #'CosNotifyFilter_ConstraintExp'{event_types = + [#'CosNotification_EventType'{ + domain_name = "name2", + type_name = "type2"}], + constraint_expr = "$.test._length == 3 and ($.test[0].score + $.test[1].score + $.test[2].score)/3 >=80"}])), + + ?match([{'CosNotifyFilter_ConstraintInfo',_,CID2}, {'CosNotifyFilter_ConstraintInfo',_,CID1}], + 'CosNotifyFilter_Filter':get_all_constraints(Filter)), + ?match([{'CosNotifyFilter_ConstraintInfo',_,CID1}], + 'CosNotifyFilter_Filter':get_constraints(Filter, [CID1])), + ?match(ok, 'CosNotifyFilter_Filter':remove_all_constraints(Filter)), + ?match([], 'CosNotifyFilter_Filter':get_all_constraints(Filter)), + + %% Try adding one correct and one incorrect constraint_expr + ?match({'EXCEPTION',{'CosNotifyFilter_InvalidConstraint',_,_}}, + 'CosNotifyFilter_Filter':add_constraints(Filter, + [#'CosNotifyFilter_ConstraintExp'{event_types = + [#'CosNotification_EventType'{ + domain_name = "name", + type_name = "type"}], + constraint_expr = "2==2 and 3<"}, + #'CosNotifyFilter_ConstraintExp'{event_types = + [#'CosNotification_EventType'{ + domain_name = "name2", + type_name = "type2"}], + constraint_expr = "$.test._length == 3 and ($.test[0].score + $.test[1].score + $.test[2].score)/3 >=80"}])), + + %% Following testcases test different domain_name and type_name, e.g., + %% wildcards etc. + [{_,ConInfoData,CID3}] = + ?match([{'CosNotifyFilter_ConstraintInfo',_,_}], + 'CosNotifyFilter_Filter':add_constraints(Filter, + [#'CosNotifyFilter_ConstraintExp'{event_types = + [#'CosNotification_EventType'{ + domain_name = "domain", + type_name = ""}, + #'CosNotification_EventType'{ + domain_name = "*", + type_name = "type"}], + constraint_expr = "2==2 and 3<4"}])), + + %% Try removing a constraint + ?match(ok, 'CosNotifyFilter_Filter':modify_constraints(Filter,[CID3],[])), + ?match([], 'CosNotifyFilter_Filter':get_all_constraints(Filter)), + + %% Add e new constraint + [{_,_,CID4}] = + ?match([{'CosNotifyFilter_ConstraintInfo',_,_}], + 'CosNotifyFilter_Filter':add_constraints(Filter, + [#'CosNotifyFilter_ConstraintExp'{event_types = + [#'CosNotification_EventType'{ + domain_name = "domain1", + type_name = ""}, + #'CosNotification_EventType'{ + domain_name = "domain2", + type_name = "*"}], + constraint_expr = "2==2 and 3<4"}])), + + %% Try to update the constraint associated with CID4 to equal CID3. + ?match(ok, 'CosNotifyFilter_Filter':modify_constraints(Filter,[], + [#'CosNotifyFilter_ConstraintInfo'{constraint_expression= + #'CosNotifyFilter_ConstraintExp'{event_types = + [#'CosNotification_EventType'{ + domain_name = "domain", + type_name = ""}, + #'CosNotification_EventType'{ + domain_name = "*", + type_name = "type"}], + constraint_expr = "2==2 and 3<4"}, + constraint_id=CID4}])), + + ?match([{_,ConInfoData,CID4}], 'CosNotifyFilter_Filter':get_all_constraints(Filter)), + + ?match({'EXCEPTION', {'CosNotifyFilter_ConstraintNotFound', _, CID3}}, + 'CosNotifyFilter_Filter':get_constraints(Filter, [CID3])), + ?match(ok, 'CosNotifyFilter_Filter':remove_all_constraints(Filter)), + ?match([], 'CosNotifyFilter_Filter':get_all_constraints(Filter)), + + ?match([{'CosNotifyFilter_ConstraintInfo',_,_}], + 'CosNotifyFilter_Filter':add_constraints(Filter, + [#'CosNotifyFilter_ConstraintExp'{event_types = + [#'CosNotification_EventType'{ + domain_name = "", + type_name = "type1"}, + #'CosNotification_EventType'{ + domain_name = "*", + type_name = "type2"}], + constraint_expr = "2==2 and 3<4"}])), + + ?match([{'CosNotifyFilter_ConstraintInfo',_,_}], + 'CosNotifyFilter_Filter':add_constraints(Filter, + [#'CosNotifyFilter_ConstraintExp'{event_types = + [#'CosNotification_EventType'{ + domain_name = "domain1", + type_name = "type1"}, + #'CosNotification_EventType'{ + domain_name = "domain2", + type_name = "type2"}], + constraint_expr = "2==2 and 3<4"}])), + + ?match([{'CosNotifyFilter_ConstraintInfo',_,_}], + 'CosNotifyFilter_Filter':add_constraints(Filter, + [#'CosNotifyFilter_ConstraintExp'{event_types = + [#'CosNotification_EventType'{ + domain_name = "dom*", + type_name = "type1"}, + #'CosNotification_EventType'{ + domain_name = "domain2", + type_name = "typ*"}], + constraint_expr = "2==2 and 3<4"}])), + + ?match([{'CosNotifyFilter_ConstraintInfo',_,_}], + 'CosNotifyFilter_Filter':add_constraints(Filter, + [#'CosNotifyFilter_ConstraintExp'{event_types = + [#'CosNotification_EventType'{ + domain_name = "dom*1", + type_name = "type1"}, + #'CosNotification_EventType'{ + domain_name = "domain2", + type_name = "typ*2"}], + constraint_expr = "2==2 and 3<4"}])), + + catch corba:dispose(FiFac), + catch corba:dispose(Filter), + catch corba:dispose(AC), + catch corba:dispose(Ch), + catch corba:dispose(Fac), + ok. + +%%----------------------------------------------------------------- +%% Subscription handling API tests +%%----------------------------------------------------------------- +subscription_api(doc) -> ["CosNotification subscription handling", ""]; +subscription_api(suite) -> []; +subscription_api(_Config) -> + %% Initialize the application. + Fac = (catch cosNotificationApp:start_global_factory(?FAC_OPT)), + ?match({_,key,_,_,_,_}, Fac), + {Ch, _Id1} = (catch 'CosNotifyChannelAdmin_EventChannelFactory':create_channel(Fac, ?defaultQoS, ?defaultAdm)), + ?match({_,key,_,_,_,_}, Ch), + + %% Create the Admin objects + {AdminSupplier, _ASID}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_EventChannel':new_for_suppliers(Ch,'OR_OP')), + {AdminConsumer, _ACID}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_EventChannel':new_for_consumers(Ch,'OR_OP')), + + %% Create Suppliers Proxies + {StructuredProxyPullSupplier,_}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_ConsumerAdmin':obtain_notification_pull_supplier(AdminConsumer, 'STRUCTURED_EVENT')), + {StructuredProxyPushSupplier,_}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_ConsumerAdmin':obtain_notification_push_supplier(AdminConsumer, 'STRUCTURED_EVENT')), + + %% Now we must create a Client for each proxy and connect them. + PushStrC=?match({_,key,_,_,_,_}, 'notify_test_StrPushC':oe_create(['PUSH_STRUCTURED',StructuredProxyPushSupplier], + [{local_typecheck, false}])), + ?match(ok, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':connect_structured_push_consumer(StructuredProxyPushSupplier, PushStrC)), + PullStrC=?match({_,key,_,_,_,_}, 'notify_test_StrPullC':oe_create(['PULL_STRUCTURED',StructuredProxyPullSupplier], + [{local_typecheck, false}])), + ?match(ok, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':connect_structured_pull_consumer(StructuredProxyPullSupplier, PullStrC)), + + %% Create Consumers Proxies + {StructuredProxyPullConsumer,_}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_SupplierAdmin':obtain_notification_pull_consumer(AdminSupplier, 'STRUCTURED_EVENT')), + {StructuredProxyPushConsumer,_}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_SupplierAdmin':obtain_notification_push_consumer(AdminSupplier, 'STRUCTURED_EVENT')), + + %% Now we must create a Client for each proxy and connect them. + PushStrS=?match({_,key,_,_,_,_}, 'notify_test_StrPushS':oe_create(['PUSH_STRUCTURED',StructuredProxyPushConsumer], + [{local_typecheck, false}])), + ?match(ok, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':connect_structured_push_supplier(StructuredProxyPushConsumer, PushStrS)), + + PullStrS=?match({_,key,_,_,_,_}, 'notify_test_StrPullS':oe_create(['PULL_STRUCTURED',StructuredProxyPullConsumer], + [{local_typecheck, false}])), + ?match(ok, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':connect_structured_pull_supplier(StructuredProxyPullConsumer, PullStrS)), + + ES1=[#'CosNotification_EventType'{domain_name = "name1", type_name = "type1"}, + #'CosNotification_EventType'{domain_name = "name2", type_name = "type2"}], + ES2=[#'CosNotification_EventType'{domain_name = "name3", type_name = "type3"}, + #'CosNotification_EventType'{domain_name = "name4", type_name = "type4"}], + + %% Initially it should have no associated types. Test that and set that + %% all updates should be forwarded to client. + ?match([], 'CosNotifyChannelAdmin_StructuredProxyPushConsumer': + obtain_subscription_types(StructuredProxyPushConsumer, + 'ALL_NOW_UPDATES_ON')), + ?match([], 'CosNotifyChannelAdmin_StructuredProxyPullConsumer': + obtain_subscription_types(StructuredProxyPullConsumer, + 'ALL_NOW_UPDATES_ON')), + + %% Update the offered types. + ?match(ok, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer': + offer_change(StructuredProxyPushConsumer, ES1, [])), + ?match(ok, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer': + offer_change(StructuredProxyPullConsumer, ES1, [])), + + %% To be sure, wait a couple of seconds. + timer:sleep(5000), + ?match([{'CosNotification_EventType',_,_}, + {'CosNotification_EventType',_,_}], + 'notify_test_StrPushC':doAction(PushStrS, return_data)), + ?match([{'CosNotification_EventType',_,_}, + {'CosNotification_EventType',_,_}], + 'notify_test_StrPullC':doAction(PullStrS, return_data)), + + %% Update the offered types. Remove ES1 and add ES2. + ?match(ok, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer': + offer_change(StructuredProxyPushConsumer, ES2, ES1)), + ?match(ok, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer': + offer_change(StructuredProxyPullConsumer, ES2, ES1)), + + %% To be sure, wait a couple of seconds. + timer:sleep(5000), + ?match([{'CosNotification_EventType',_,_}, + {'CosNotification_EventType',_,_}], + 'notify_test_StrPushC':doAction(PushStrS, return_data)), + ?match([{'CosNotification_EventType',_,_}, + {'CosNotification_EventType',_,_}], + 'notify_test_StrPullC':doAction(PullStrS, return_data)), + + %% Now, the objects should only contain 'ES2'. Test it. + ?match([{'CosNotification_EventType',_,_}, + {'CosNotification_EventType',_,_}], + 'CosNotifyChannelAdmin_StructuredProxyPushConsumer': + obtain_subscription_types(StructuredProxyPushConsumer, + 'ALL_NOW_UPDATES_ON')), + ?match([{'CosNotification_EventType',_,_}, + {'CosNotification_EventType',_,_}], + 'CosNotifyChannelAdmin_StructuredProxyPullConsumer': + obtain_subscription_types(StructuredProxyPullConsumer, + 'ALL_NOW_UPDATES_ON')), + + %% Now we will use wildcards, empty strings and test if they really + %% are ignored if so requested. + ES3=[#'CosNotification_EventType'{domain_name = "name1", type_name = "*"}, + #'CosNotification_EventType'{domain_name = "*", type_name = "type2"}], + ES4=[#'CosNotification_EventType'{domain_name = "name1", type_name = "*"}, + #'CosNotification_EventType'{domain_name = "name2", type_name = ""}], + ES5=[#'CosNotification_EventType'{domain_name = "na*", type_name = "type1"}], + ES6=[#'CosNotification_EventType'{domain_name = "n*1", type_name = "type1"}], + ES7=[#'CosNotification_EventType'{domain_name = "*1", type_name = "type1"}], + ES8=[#'CosNotification_EventType'{domain_name = "n*m*1", type_name = "type1"}], + ES9=[#'CosNotification_EventType'{domain_name = "n**1", type_name = "type1"}], + ES10=[#'CosNotification_EventType'{domain_name = "nam*1", type_name = "type1"}], + + Event1 = ?not_CreateSE("name1","type1", + "event_name", + [#'CosNotification_Property'{name="property_name", + value=any:create(orber_tc:short(), 1)}], + [], any:create(orber_tc:null(), null)), + Event2 = ?not_CreateSE("name2","type1", + "event_name", + [#'CosNotification_Property'{name="property_name", + value=any:create(orber_tc:short(), 1)}], + [], any:create(orber_tc:null(), null)), + Event3 = ?not_CreateSE("mame1","type1", + "event_name", + [#'CosNotification_Property'{name="property_name", + value=any:create(orber_tc:short(), 1)}], + [], any:create(orber_tc:null(), null)), + Event4 = ?not_CreateSE("naame1","type1", + "event_name", + [#'CosNotification_Property'{name="property_name", + value=any:create(orber_tc:short(), 1)}], + [], any:create(orber_tc:null(), null)), + Event5 = ?not_CreateSE("nname1","type1", + "event_name", + [#'CosNotification_Property'{name="property_name", + value=any:create(orber_tc:short(), 1)}], + [], any:create(orber_tc:null(), null)), + Event6 = ?not_CreateSE("name12","type1", + "event_name", + [#'CosNotification_Property'{name="property_name", + value=any:create(orber_tc:short(), 1)}], + [], any:create(orber_tc:null(), null)), + + ?match(ok, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier': + subscription_change(StructuredProxyPullSupplier, ES3, [])), + + ?match(ok,'CosNotifyChannelAdmin_StructuredProxyPushConsumer':push_structured_event(StructuredProxyPushConsumer, Event1)), + + ?match(Event1, 'notify_test_StrPullC':doAction(PullStrC, pull_str)), + + ?match(ok, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier': + subscription_change(StructuredProxyPullSupplier, ES4, ES3)), + ?match(ok,'CosNotifyChannelAdmin_StructuredProxyPushConsumer':push_structured_event(StructuredProxyPushConsumer, Event1)), + ?match(Event1, 'notify_test_StrPullC':doAction(PullStrC, pull_str)), + + ?match(ok, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier': + subscription_change(StructuredProxyPullSupplier, ES5, ES4)), + ?match(ok,'CosNotifyChannelAdmin_StructuredProxyPushConsumer':push_structured_event(StructuredProxyPushConsumer, Event1)), + ?match(Event1, 'notify_test_StrPullC':doAction(PullStrC, pull_str)), + + ?match(ok, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier': + subscription_change(StructuredProxyPullSupplier, ES6, ES5)), + ?match(ok,'CosNotifyChannelAdmin_StructuredProxyPushConsumer':push_structured_event(StructuredProxyPushConsumer, Event1)), + ?match(Event1, 'notify_test_StrPullC':doAction(PullStrC, pull_str)), + + ?match(ok, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier': + subscription_change(StructuredProxyPullSupplier, ES7, ES6)), + ?match(ok,'CosNotifyChannelAdmin_StructuredProxyPushConsumer':push_structured_event(StructuredProxyPushConsumer, Event1)), + ?match(Event1, 'notify_test_StrPullC':doAction(PullStrC, pull_str)), + + ?match(ok, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier': + subscription_change(StructuredProxyPullSupplier, ES8, ES7)), + ?match(ok,'CosNotifyChannelAdmin_StructuredProxyPushConsumer':push_structured_event(StructuredProxyPushConsumer, Event1)), + ?match(Event1, 'notify_test_StrPullC':doAction(PullStrC, pull_str)), + + ?match(ok, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier': + subscription_change(StructuredProxyPullSupplier, ES9, ES8)), + ?match(ok,'CosNotifyChannelAdmin_StructuredProxyPushConsumer':push_structured_event(StructuredProxyPushConsumer, Event1)), + ?match(Event1, 'notify_test_StrPullC':doAction(PullStrC, pull_str)), + + ?match(ok,'CosNotifyChannelAdmin_StructuredProxyPushConsumer':push_structured_event(StructuredProxyPushConsumer, Event2)), + ?match(ok,'CosNotifyChannelAdmin_StructuredProxyPushConsumer':push_structured_event(StructuredProxyPushConsumer, Event3)), + + timer:sleep(5000), + ?match({_NilStrEvent,false}, 'notify_test_StrPullC':doAction(PullStrC, try_pull_str)), + + ?match(ok, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier': + subscription_change(StructuredProxyPullSupplier, ES10, ES9)), + ?match(ok,'CosNotifyChannelAdmin_StructuredProxyPushConsumer':push_structured_event(StructuredProxyPushConsumer, Event1)), + ?match(Event1, 'notify_test_StrPullC':doAction(PullStrC, pull_str)), + + ?match(ok,'CosNotifyChannelAdmin_StructuredProxyPushConsumer':push_structured_event(StructuredProxyPushConsumer, Event4)), + ?match(ok,'CosNotifyChannelAdmin_StructuredProxyPushConsumer':push_structured_event(StructuredProxyPushConsumer, Event5)), + ?match(ok,'CosNotifyChannelAdmin_StructuredProxyPushConsumer':push_structured_event(StructuredProxyPushConsumer, Event6)), + + timer:sleep(5000), + ?match({_NilStrEvent,false}, 'notify_test_StrPullC':doAction(PullStrC, try_pull_str)), + + + catch corba:dispose(StructuredProxyPushConsumer), + catch corba:dispose(StructuredProxyPullConsumer), + catch corba:dispose(StructuredProxyPushSupplier), + catch corba:dispose(StructuredProxyPullSupplier), + catch corba:dispose(AdminConsumer), + catch corba:dispose(AdminSupplier), + catch corba:dispose(Ch), + catch cosNotificationApp:stop_factory(Fac), + + timer:sleep(5000), + ?match(true, corba_object:non_existent(PullStrS)), + ?match(true, corba_object:non_existent(PushStrS)), + ?match(true, corba_object:non_existent(PullStrC)), + ?match(true, corba_object:non_existent(PushStrC)), + + ok. + +%%----------------------------------------------------------------- +%% Filter admin API tests +%%----------------------------------------------------------------- +filter_adm_api(doc) -> ["CosNotification filter admin tests", ""]; +filter_adm_api(suite) -> []; +filter_adm_api(_Config) -> + Fac = (catch cosNotificationApp:start_global_factory(?FAC_OPT)), + ?match({_,key,_,_,_,_}, Fac), + {Ch, _Id1} = (catch 'CosNotifyChannelAdmin_EventChannelFactory':create_channel(Fac, ?defaultQoS, ?defaultAdm)), + ?match({_,key,_,_,_,_}, Ch), + + FiFac = 'CosNotifyFilter_FilterFactory':oe_create(), + ?match({_,key,_,_,_,_}, FiFac), + + Filter = 'CosNotifyFilter_FilterFactory':create_filter(FiFac,"EXTENDED_TCL"), + ?match({_,key,_,_,_,_}, Filter), + + AC=?match({_,key,_,_,_,_}, + 'CosNotifyChannelAdmin_EventChannel':for_consumers(Ch)), + filter_tests('CosNotifyChannelAdmin_ConsumerAdmin', AC, Filter, Ch), + + AS=?match({_,key,_,_,_,_}, + 'CosNotifyChannelAdmin_EventChannel':for_suppliers(Ch)), + filter_tests('CosNotifyChannelAdmin_SupplierAdmin', AS, Filter, Ch), + + PushS=?match({_,key,_,_,_,_}, + 'CosNotifyChannelAdmin_ConsumerAdmin':obtain_push_supplier(AC)), + filter_tests('CosNotifyChannelAdmin_ProxyPushSupplier', PushS, Filter, Ch), + + PullS=?match({_,key,_,_,_,_}, + 'CosNotifyChannelAdmin_ConsumerAdmin':obtain_pull_supplier(AC)), + filter_tests('CosNotifyChannelAdmin_ProxyPullSupplier', PullS, Filter, Ch), + + PushC=?match({_,key,_,_,_,_}, + 'CosNotifyChannelAdmin_SupplierAdmin':obtain_push_consumer(AS)), + filter_tests('CosNotifyChannelAdmin_ProxyPushConsumer', PushC, Filter, Ch), + + PullC=?match({_,key,_,_,_,_}, + 'CosNotifyChannelAdmin_SupplierAdmin':obtain_pull_consumer(AS)), + filter_tests('CosNotifyChannelAdmin_ProxyPullConsumer', PullC, Filter, Ch), + + catch corba:dispose(FiFac), + catch corba:dispose(Filter), + catch corba:dispose(PushS), + catch corba:dispose(PullS), + catch corba:dispose(PushC), + catch corba:dispose(PullC), + catch corba:dispose(AC), + catch corba:dispose(AS), + catch corba:dispose(Ch), + catch cosNotificationApp:stop_factory(Fac), + ok. + +filter_tests(Mod, Obj, Filter, Ch) -> + io:format("############ TESTING MODULE ~p FILTER ############~n", [Mod]), + %% No filter added. + ?match([], Mod:get_all_filters(Obj)), + ?match(ok, Mod:remove_all_filters(Obj)), + ?match({'EXCEPTION',{'CosNotifyFilter_FilterNotFound',_}}, + Mod:get_filter(Obj, 0)), + %% Try add a Filter which is not a filter. + ?match({'EXCEPTION',{'BAD_PARAM',_,_,_}}, Mod:add_filter(Obj, Ch)), + %% Try to remove a single filter. + ?match({'EXCEPTION',{'CosNotifyFilter_FilterNotFound',_}}, + Mod:remove_filter(Obj, 0)), + ID = Mod:add_filter(Obj, Filter), + ?match([ID], Mod:get_all_filters(Obj)), + ?match(Filter, Mod:get_filter(Obj, ID)), + ?match(ok, Mod:remove_filter(Obj, ID)), + ?match([], Mod:get_all_filters(Obj)), + ID2 = Mod:add_filter(Obj, Filter), + ?match([ID2], Mod:get_all_filters(Obj)), + ?match(ok, Mod:remove_all_filters(Obj)), + ?match([], Mod:get_all_filters(Obj)), + ok. + +%%----------------------------------------------------------------- +%% Creating different event pushing and pulling API tests +%%----------------------------------------------------------------- +events_api(doc) -> ["CosNotification event pushing and pulling tests", ""]; +events_api(suite) -> []; +events_api(_Config) -> + %% Initialize the application. + Fac = (catch cosNotificationApp:start_global_factory(?FAC_OPT)), + ?match({_,key,_,_,_,_}, Fac), + {Ch, Id1} = (catch 'CosNotifyChannelAdmin_EventChannelFactory':create_channel(Fac, ?defaultQoS, ?defaultAdm)), + ?match({_,key,_,_,_,_}, Ch), + events_api_helper(Fac, Ch, Id1). + +events2_api(doc) -> ["CosNotification event pushing and pulling tests II", ""]; +events2_api(suite) -> []; +events2_api(_Config) -> + %% Initialize the application. + Fac = (catch cosNotificationApp:start_global_factory(?FAC_OPT)), + ?match({_,key,_,_,_,_}, Fac), + {Ch, Id1} = (catch 'CosNotifyChannelAdmin_EventChannelFactory':create_channel(Fac, ?defaultQoS2, ?defaultAdm)), + ?match({_,key,_,_,_,_}, Ch), + events_api_helper(Fac, Ch, Id1). + +events_api_helper(Fac, Ch, _Id1) -> + %% Now we will set up a test environment, with the following structure: + %% + %% Channel + %% / \ + %% Supplier Adm Consumer Adm + %% / \ + %% 1 proxy of each possible type + %% To each proxy we will connect a test client + %% The events will flow in ===>> direction. + %% + %% For the supplier Admins this include: + %% - ProxyPushConsumer + %% - SequenceProxyPushConsumer + %% - StructuredProxyPushConsumer + %% - ProxyPullConsumer + %% - SequenceProxyPullConsumer + %% - StructuredProxyPullConsumer + %% + %% For the consumer Admins this include: + %% - ProxyPushSupplier + %% - SequenceProxyPushSupplier + %% - StructuredProxyPushSupplier + %% - ProxyPullSupplier + %% - SequenceProxyPullSupplier + %% - StructuredProxyPullSupplier + %% + %% + %% We will not use any Filters to begin with, just want to make sure we can + %% deliver events from all start- to end-points. + + %% Create the Admin objects + {AdminSupplier, _ASID}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_EventChannel':new_for_suppliers(Ch,'AND_OP')), + {AdminConsumer, _ACID}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_EventChannel':new_for_consumers(Ch,'AND_OP')), + + %% Create Suppliers Proxies + {ProxyPullSupplier,_ID1}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_ConsumerAdmin':obtain_notification_pull_supplier(AdminConsumer, 'ANY_EVENT')), + {StructuredProxyPullSupplier,_ID2}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_ConsumerAdmin':obtain_notification_pull_supplier(AdminConsumer, 'STRUCTURED_EVENT')), + {SequenceProxyPullSupplier,_ID3}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_ConsumerAdmin':obtain_notification_pull_supplier(AdminConsumer, 'SEQUENCE_EVENT')), + + {ProxyPushSupplier,_I4D}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_ConsumerAdmin':obtain_notification_push_supplier(AdminConsumer, 'ANY_EVENT')), + {StructuredProxyPushSupplier,_ID5}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_ConsumerAdmin':obtain_notification_push_supplier(AdminConsumer, 'STRUCTURED_EVENT')), + {SequenceProxyPushSupplier,_ID6}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_ConsumerAdmin':obtain_notification_push_supplier(AdminConsumer, 'SEQUENCE_EVENT')), + + %% Now we must create a Client for each proxy and connect them. + PushAnyC=?match({_,key,_,_,_,_}, 'notify_test_AnyPushC':oe_create(['PUSH_ANY', ProxyPushSupplier], + [{local_typecheck, false}])), + ?match(ok, 'CosNotifyChannelAdmin_ProxyPushSupplier':connect_any_push_consumer(ProxyPushSupplier, PushAnyC)), + + PushStrC=?match({_,key,_,_,_,_}, 'notify_test_StrPushC':oe_create(['PUSH_STRUCTURED',StructuredProxyPushSupplier], + [{local_typecheck, false}])), + ?match(ok, 'CosNotifyChannelAdmin_StructuredProxyPushSupplier':connect_structured_push_consumer(StructuredProxyPushSupplier, PushStrC)), + + PushSeqC=?match({_,key,_,_,_,_}, 'notify_test_SeqPushC':oe_create(['PUSH_SEQUENCE',SequenceProxyPushSupplier], + [{local_typecheck, false}])), + ?match(ok, 'CosNotifyChannelAdmin_SequenceProxyPushSupplier':connect_sequence_push_consumer(SequenceProxyPushSupplier, PushSeqC)), + + PullAnyC=?match({_,key,_,_,_,_}, 'notify_test_AnyPullC':oe_create(['PULL_ANY', ProxyPullSupplier], + [{local_typecheck, false}])), + ?match(ok, 'CosNotifyChannelAdmin_ProxyPullSupplier':connect_any_pull_consumer(ProxyPullSupplier, PullAnyC)), + + PullStrC=?match({_,key,_,_,_,_}, 'notify_test_StrPullC':oe_create(['PULL_STRUCTURED',StructuredProxyPullSupplier], + [{local_typecheck, false}])), + ?match(ok, 'CosNotifyChannelAdmin_StructuredProxyPullSupplier':connect_structured_pull_consumer(StructuredProxyPullSupplier, PullStrC)), + + PullSeqC=?match({_,key,_,_,_,_}, 'notify_test_SeqPullC':oe_create(['PULL_SEQUENCE',SequenceProxyPullSupplier], + [{local_typecheck, false}])), + ?match(ok, 'CosNotifyChannelAdmin_SequenceProxyPullSupplier':connect_sequence_pull_consumer(SequenceProxyPullSupplier, PullSeqC)), + + + %% Create Consumers Proxies + {ProxyPullConsumer,_ID7}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_SupplierAdmin':obtain_notification_pull_consumer(AdminSupplier, 'ANY_EVENT')), + {StructuredProxyPullConsumer,_ID8}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_SupplierAdmin':obtain_notification_pull_consumer(AdminSupplier, 'STRUCTURED_EVENT')), + {SequenceProxyPullConsumer,_ID9}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_SupplierAdmin':obtain_notification_pull_consumer(AdminSupplier, 'SEQUENCE_EVENT')), + + {ProxyPushConsumer,_ID10}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_SupplierAdmin':obtain_notification_push_consumer(AdminSupplier, 'ANY_EVENT')), + {StructuredProxyPushConsumer,_ID11}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_SupplierAdmin':obtain_notification_push_consumer(AdminSupplier, 'STRUCTURED_EVENT')), + {SequenceProxyPushConsumer,_ID12}=?match({{_,key,_,_,_,_},_}, + 'CosNotifyChannelAdmin_SupplierAdmin':obtain_notification_push_consumer(AdminSupplier, 'SEQUENCE_EVENT')), + + %% Now we must create a Client for each proxy and connect them. + PushAnyS=?match({_,key,_,_,_,_}, 'notify_test_AnyPushS':oe_create(['PUSH_ANY', ProxyPushConsumer], + [{local_typecheck, false}])), + ?match(ok, 'CosNotifyChannelAdmin_ProxyPushConsumer':connect_any_push_supplier(ProxyPushConsumer, PushAnyS)), + + PushStrS=?match({_,key,_,_,_,_}, 'notify_test_StrPushS':oe_create(['PUSH_STRUCTURED',StructuredProxyPushConsumer], + [{local_typecheck, false}])), + ?match(ok, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':connect_structured_push_supplier(StructuredProxyPushConsumer, PushStrS)), + + PushSeqS=?match({_,key,_,_,_,_}, 'notify_test_SeqPushS':oe_create(['PUSH_SEQUENCE',SequenceProxyPushConsumer], + [{local_typecheck, false}])), + ?match(ok, 'CosNotifyChannelAdmin_SequenceProxyPushConsumer':connect_sequence_push_supplier(SequenceProxyPushConsumer, PushSeqS)), + + PullAnyS=?match({_,key,_,_,_,_}, 'notify_test_AnyPullS':oe_create(['PULL_ANY', ProxyPullConsumer], + [{local_typecheck, false}])), + ?match(ok, 'CosNotifyChannelAdmin_ProxyPullConsumer':connect_any_pull_supplier(ProxyPullConsumer, PullAnyS)), + + PullStrS=?match({_,key,_,_,_,_}, 'notify_test_StrPullS':oe_create(['PULL_STRUCTURED',StructuredProxyPullConsumer], + [{local_typecheck, false}])), + ?match(ok, 'CosNotifyChannelAdmin_StructuredProxyPullConsumer':connect_structured_pull_supplier(StructuredProxyPullConsumer, PullStrS)), + + PullSeqS=?match({_,key,_,_,_,_}, 'notify_test_SeqPullS':oe_create(['PULL_SEQUENCE',SequenceProxyPullConsumer], + [{local_typecheck, false}])), + ?match(ok, 'CosNotifyChannelAdmin_SequenceProxyPullConsumer':connect_sequence_pull_supplier(SequenceProxyPullConsumer, PullSeqS)), + + + %% Create a couple of Events to test with. + Event = ?not_CreateSE("DomainName","CommunicationsAlarm", + "lost_packet", + [#'CosNotification_Property'{name="priority", + value=any:create(orber_tc:short(), 1)}], + [], any:create(orber_tc:null(), null)), + + Event2 = ?not_CreateSE("DomainName","TemperatureAlarm", + "over_heated", + [#'CosNotification_Property'{name="priority", + value=any:create(orber_tc:short(), 10)}], + [], any:create(orber_tc:null(), null)), + + + AnyEvent = any:create(orber_tc:long(), 100), + + StrEvent = ?not_CreateSE("","%ANY","",[],[],AnyEvent), + NilAnyEvent = any:create(orber_tc:null(), null), + NilStrEvent = ?not_CreateSE("","","",[],[],NilAnyEvent), + + ConvertedStr = any:create('CosNotification_StructuredEvent':tc(), Event), + + io:format("###################### PUSH STRUCTURED ########################"), + + %% Test with pushing a structured event. + ?match(ok,'CosNotifyChannelAdmin_StructuredProxyPushConsumer':push_structured_event(StructuredProxyPushConsumer, Event)), + + %% Wait for a while so we are sure that all events have been delivered as far + %% as the Notification service can automatically. + timer:sleep(5000), + + %% Check if the Clients have received and stored the events. + ?match([{any,_,Event}], 'notify_test_AnyPushC':doAction(PushAnyC, return_data)), + ?match([Event], 'notify_test_StrPushC':doAction(PushStrC, return_data)), + ?match([Event], 'notify_test_SeqPushC':doAction(PushSeqC, return_data)), + + %% Instruct the Clients to pull the events and check if they match. + ?match({any,_,Event}, 'notify_test_AnyPullC':doAction(PullAnyC, pull_any)), + ?match(Event, 'notify_test_StrPullC':doAction(PullStrC, pull_str)), + ?match([Event], 'notify_test_SeqPullC':doAction(PullSeqC, {pull_seq,1})), + + io:format("###################### PUSH SEQUENCE ########################"), + + %% Create an Event Sequence and push it. + EventSeq = [Event, Event2], + + %% Test with pushing a event sequence. + ?match(ok,'CosNotifyChannelAdmin_SequenceProxyPushConsumer':push_structured_events(SequenceProxyPushConsumer, EventSeq)), + + %% Wait for a while so we are sure that all events have been delivered as far + %% as the Notification service can automatically. + timer:sleep(5000), + + %% Instruct the Clients to pull the events and check if they match. + ?match({any,_,Event}, 'notify_test_AnyPullC':doAction(PullAnyC, pull_any)), + ?match(Event, 'notify_test_StrPullC':doAction(PullStrC, pull_str)), + ?match([Event,Event2], 'notify_test_SeqPullC':doAction(PullSeqC, {pull_seq,2})), + ?match({any,_,Event2}, 'notify_test_AnyPullC':doAction(PullAnyC, pull_any)), + ?match(Event2, 'notify_test_StrPullC':doAction(PullStrC, pull_str)), + + %% Check if the Push Clients have received and stored the events. + ?match([{any,_,Event}, {any,_,Event2}], 'notify_test_AnyPushC':doAction(PushAnyC, return_data)), + ?match([Event, Event2], 'notify_test_StrPushC':doAction(PushStrC, return_data)), + ?match([Event, Event2], 'notify_test_SeqPushC':doAction(PushSeqC, return_data)), + + io:format("###################### PUSH ANY ########################"), + + %% Test with pushing an any event. + ?match(ok,'CosEventChannelAdmin_ProxyPushConsumer':push(ProxyPushConsumer, AnyEvent)), + + %% Wait for a while so we are sure that all events have been delivered as far + %% as the Notification service can automatically. + timer:sleep(5000), + + %% Check if the Clients have received and stored the events. + ?match([AnyEvent], 'notify_test_AnyPushC':doAction(PushAnyC, return_data)), + ?match([StrEvent], 'notify_test_StrPushC':doAction(PushStrC, return_data)), + ?match([StrEvent], 'notify_test_SeqPushC':doAction(PushSeqC, return_data)), + + %% Instruct the Clients to pull the events and check if they match. + ?match(AnyEvent, 'notify_test_AnyPullC':doAction(PullAnyC, pull_any)), + ?match(StrEvent, 'notify_test_StrPullC':doAction(PullStrC, pull_str)), + ?match([StrEvent], 'notify_test_SeqPullC':doAction(PullSeqC, {pull_seq,10})), + + + + io:format("###################### PUSH CONVERTED ANY #############"), + + %% Test with pushing a structured event. + ?match(ok,'CosNotifyChannelAdmin_StructuredProxyPushConsumer':push_structured_event(StructuredProxyPushConsumer, StrEvent)), + + %% Wait for a while so we are sure that all events have been delivered as far + %% as the Notification service can automatically. + timer:sleep(5000), + + %% Check if the Clients have received and stored the events. + ?match([AnyEvent], 'notify_test_AnyPushC':doAction(PushAnyC, return_data)), + ?match([StrEvent], 'notify_test_StrPushC':doAction(PushStrC, return_data)), + ?match([StrEvent], 'notify_test_SeqPushC':doAction(PushSeqC, return_data)), + + %% Instruct the Clients to pull the events and check if they match. + ?match(AnyEvent, 'notify_test_AnyPullC':doAction(PullAnyC, pull_any)), + ?match(StrEvent, 'notify_test_StrPullC':doAction(PullStrC, pull_str)), + ?match([StrEvent], 'notify_test_SeqPullC':doAction(PullSeqC, {pull_seq,1})), + + + io:format("###################### PUSH CONVERTED STRUCTURED ########"), + + %% Test with pushing an any event. + ?match(ok,'CosEventChannelAdmin_ProxyPushConsumer':push(ProxyPushConsumer, ConvertedStr)), + + %% Wait for a while so we are sure that all events have been delivered as far + %% as the Notification service can automatically. + timer:sleep(5000), + + %% Check if the Clients have received and stored the events. + ?match([ConvertedStr], 'notify_test_AnyPushC':doAction(PushAnyC, return_data)), + ?match([Event], 'notify_test_StrPushC':doAction(PushStrC, return_data)), + ?match([Event], 'notify_test_SeqPushC':doAction(PushSeqC, return_data)), + + %% Instruct the Clients to pull the events and check if they match. + ?match(ConvertedStr, 'notify_test_AnyPullC':doAction(PullAnyC, pull_any)), + ?match(Event, 'notify_test_StrPullC':doAction(PullStrC, pull_str)), + ?match([Event], 'notify_test_SeqPullC':doAction(PullSeqC, {pull_seq,10})), + + + io:format("###################### TRY PULL ########################"), + + %% Now we will push an any event after a delay. This means that try_pull-functions, + %% since it's not blocking, will return, [], NilAny or NilStructured events and + %% the Boolean false. + spawn(notify_test_impl, delay, [ProxyPushConsumer, AnyEvent, 20000, + 'CosEventChannelAdmin_ProxyPushConsumer',push]), + ?match([], 'notify_test_AnyPushC':doAction(PushAnyC, return_data)), + ?match([], 'notify_test_StrPushC':doAction(PushStrC, return_data)), + ?match([], 'notify_test_SeqPushC':doAction(PushSeqC, return_data)), + + %% Instruct the Clients to pull the events and check if they match. + ?match({NilAnyEvent,false}, 'notify_test_AnyPullC':doAction(PullAnyC, try_pull_any)), + ?match({NilStrEvent,false}, 'notify_test_StrPullC':doAction(PullStrC, try_pull_str)), + ?match({[],false}, 'notify_test_SeqPullC':doAction(PullSeqC, {try_pull_seq,10})), + + + %% Instruct the Clients to pull the events and check if they match. + %% Pull is blocking so in the print-out we should see that nothing + %% is returned until the pushed event reaches the end proxies. + ?match(AnyEvent, 'notify_test_AnyPullC':doAction(PullAnyC, pull_any)), + ?match(StrEvent, 'notify_test_StrPullC':doAction(PullStrC, pull_str)), + ?match([StrEvent], 'notify_test_SeqPullC':doAction(PullSeqC, {pull_seq,1})), + + %% To make sure there are no other circumstanses which lead to a delay we + %% hold for some time. + timer:sleep(5000), + %% Check if the Clients have received and stored the events. + ?match([AnyEvent], 'notify_test_AnyPushC':doAction(PushAnyC, return_data)), + ?match([StrEvent], 'notify_test_StrPushC':doAction(PushStrC, return_data)), + ?match([StrEvent], 'notify_test_SeqPushC':doAction(PushSeqC, return_data)), + + %% Test with pushing a event sequence but only pull sequences of length 1. + ?match(ok,'CosNotifyChannelAdmin_SequenceProxyPushConsumer':push_structured_events(SequenceProxyPushConsumer, EventSeq)), + + %% Wait for a while so we are sure that all events have been delivered as far + %% as the Notification service can automatically. + timer:sleep(5000), + %% Pull 1 event at a time. + ?match([Event], 'notify_test_SeqPullC':doAction(PullSeqC, {pull_seq,1})), + ?match([Event2], 'notify_test_SeqPullC':doAction(PullSeqC, {pull_seq,1})), + + %% Following cases already tested; done for clean up. + ?match({any,_,Event}, 'notify_test_AnyPullC':doAction(PullAnyC, pull_any)), + ?match(Event, 'notify_test_StrPullC':doAction(PullStrC, pull_str)), + ?match({any,_,Event2}, 'notify_test_AnyPullC':doAction(PullAnyC, pull_any)), + ?match(Event2, 'notify_test_StrPullC':doAction(PullStrC, pull_str)), + ?match([{any,_,Event}, {any,_,Event2}], 'notify_test_AnyPushC':doAction(PushAnyC, return_data)), + ?match([Event, Event2], 'notify_test_StrPushC':doAction(PushStrC, return_data)), + ?match([Event, Event2], 'notify_test_SeqPushC':doAction(PushSeqC, return_data)), + %% clean up done + + + io:format("###################### PROXY PULLER ########################"), + + %% Now we will just add Events to a cleint and wait for the Notification service + %% to pull the events and forward them to the consumer clients. + ?match(ok, 'notify_test_SeqPushC':doAction(PullAnyS, {set_data, [AnyEvent]})), + + + %% Instruct the Clients to pull the events and check if they match. + %% Pull is blocking so in the print-out we should see that nothing + %% is returned until the pushed event reaches the end proxies. + ?match(AnyEvent, 'notify_test_AnyPullC':doAction(PullAnyC, pull_any)), + ?match(StrEvent, 'notify_test_StrPullC':doAction(PullStrC, pull_str)), + ?match([StrEvent], 'notify_test_SeqPullC':doAction(PullSeqC, {pull_seq,10})), + + %% To make sure there are no other circumstanses which lead to a delay we + %% hold for some time. + timer:sleep(5000), + %% Check if the Clients have received and stored the events. + ?match([AnyEvent], 'notify_test_AnyPushC':doAction(PushAnyC, return_data)), + ?match([StrEvent], 'notify_test_StrPushC':doAction(PushStrC, return_data)), + ?match([StrEvent], 'notify_test_SeqPushC':doAction(PushSeqC, return_data)), + + io:format("###################### SUSPENDED CONNECTION ################"), + + + %% Suspend the connections + ?match(ok,'CosNotifyChannelAdmin_SequenceProxyPushSupplier':suspend_connection(SequenceProxyPushSupplier)), + ?match(ok,'CosNotifyChannelAdmin_StructuredProxyPushSupplier':suspend_connection(StructuredProxyPushSupplier)), + + %% Test with pushing a event sequence. + ?match(ok,'CosNotifyChannelAdmin_SequenceProxyPushConsumer':push_structured_events(SequenceProxyPushConsumer, EventSeq)), + + %% Wait for a while so we are sure that all events have been delivered as far + %% as the Notification service can automatically. + timer:sleep(5000), + + %% Instruct the Clients to pull the events and check if they match. + ?match({any,_,Event}, 'notify_test_AnyPullC':doAction(PullAnyC, pull_any)), + ?match(Event, 'notify_test_StrPullC':doAction(PullStrC, pull_str)), + ?match([Event,Event2], 'notify_test_SeqPullC':doAction(PullSeqC, {pull_seq,2})), + ?match({any,_,Event2}, 'notify_test_AnyPullC':doAction(PullAnyC, pull_any)), + ?match(Event2, 'notify_test_StrPullC':doAction(PullStrC, pull_str)), + + %% Check if the Any Client have received and stored the events. + ?match([{any,_,Event}, {any,_,Event2}], 'notify_test_AnyPushC':doAction(PushAnyC, return_data)), + + %% Check if the other Clients have received any events. Error if have. + ?match([], 'notify_test_StrPushC':doAction(PushStrC, return_data)), + ?match([], 'notify_test_SeqPushC':doAction(PushSeqC, return_data)), + + ?match(ok,'CosNotifyChannelAdmin_SequenceProxyPushSupplier':resume_connection(SequenceProxyPushSupplier)), + ?match(ok,'CosNotifyChannelAdmin_StructuredProxyPushSupplier':resume_connection(StructuredProxyPushSupplier)), + + %% To be sure the test case don't fail due to time-race, sleep. + timer:sleep(5000), + + ?match([Event, Event2], 'notify_test_StrPushC':doAction(PushStrC, return_data)), + ?match([Event, Event2], 'notify_test_SeqPushC':doAction(PushSeqC, return_data)), + + + io:format("###################### FILTER EVENTS #######################"), + + %% Now we will add filters and see if the system behaves correctly. + FiFac = 'CosNotifyFilter_FilterFactory':oe_create(), + Filter = 'CosNotifyFilter_FilterFactory':create_filter(FiFac,"EXTENDED_TCL"), + %% Add constraints to the Filter + ?line[{_,_,CID1},{_,_,CID2}]= + ?match([{'CosNotifyFilter_ConstraintInfo',_,_}, {'CosNotifyFilter_ConstraintInfo',_,_}], + 'CosNotifyFilter_Filter':add_constraints(Filter, + [#'CosNotifyFilter_ConstraintExp'{event_types = + [#'CosNotification_EventType'{ + domain_name = "Spare*", + type_name = "MOVIE"}], + constraint_expr = "$type_name == 'MOVIE' and (('groucho' in $starlist) + ('chico' in $starlist) + ('harpo' in $starlist) + ('zeppo' in $starlist) + ('gummo' in $starlist)) > 2"}, + #'CosNotifyFilter_ConstraintExp'{event_types = + [#'CosNotification_EventType'{ + domain_name = "*", + type_name = "TestResults"}], + constraint_expr = "$test._length == 3 and ($test[0].score + $test[1].score + $test[2].score)/3 >=80"}])), + + ?match([{'CosNotifyFilter_ConstraintInfo',_,CID2}, {'CosNotifyFilter_ConstraintInfo',_,CID1}], + 'CosNotifyFilter_Filter':get_all_constraints(Filter)), + ?match([{'CosNotifyFilter_ConstraintInfo',_,CID1}], + 'CosNotifyFilter_Filter':get_constraints(Filter, [CID1])), + + %% Associate the Filter with different objects. + %% Since we use the same filter for both objects the events will never reach the admin. + _FilterID = 'CosNotifyChannelAdmin_ConsumerAdmin':add_filter(AdminConsumer, Filter), + + _FilterID2 = 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':add_filter(StructuredProxyPushConsumer, Filter), + event_filtering(FiFac, Filter, AdminConsumer, StructuredProxyPushConsumer, PushAnyC, + PushStrC, PushSeqC, PullAnyC, PullStrC, PullSeqC), + %% Remove the proxy filter so we can check if the events are filtered correctly by the admin. + ?match(ok, 'CosNotifyChannelAdmin_StructuredProxyPushConsumer':remove_all_filters(StructuredProxyPushConsumer)), + event_filtering(FiFac, Filter, AdminConsumer, StructuredProxyPushConsumer, PushAnyC, + PushStrC, PushSeqC, PullAnyC, PullStrC, PullSeqC), + + + catch corba:dispose(Filter), + catch corba:dispose(FiFac), + catch corba:dispose(SequenceProxyPushConsumer), + catch corba:dispose(StructuredProxyPushConsumer), + catch corba:dispose(ProxyPushConsumer), + catch corba:dispose(SequenceProxyPullConsumer), + catch corba:dispose(StructuredProxyPullConsumer), + catch corba:dispose(ProxyPullConsumer), + catch corba:dispose(SequenceProxyPushSupplier), + catch corba:dispose(StructuredProxyPushSupplier), + catch corba:dispose(ProxyPushSupplier), + catch corba:dispose(SequenceProxyPullSupplier), + catch corba:dispose(StructuredProxyPullSupplier), + catch corba:dispose(ProxyPullSupplier), + catch corba:dispose(AdminConsumer), + catch corba:dispose(AdminSupplier), + catch corba:dispose(Ch), + catch cosNotificationApp:stop_factory(Fac), + %% The Clients should have terminated by now. Check if it is so. + timer:sleep(5000), + ?match(true, corba_object:non_existent(PullSeqS)), + ?match(true, corba_object:non_existent(PullStrS)), + ?match(true, corba_object:non_existent(PullAnyS)), + ?match(true, corba_object:non_existent(PushSeqS)), + ?match(true, corba_object:non_existent(PushStrS)), + ?match(true, corba_object:non_existent(PushAnyS)), + ?match(true, corba_object:non_existent(PullSeqC)), + ?match(true, corba_object:non_existent(PullStrC)), + ?match(true, corba_object:non_existent(PullAnyC)), + ?match(true, corba_object:non_existent(PushSeqC)), + ?match(true, corba_object:non_existent(PushStrC)), + ?match(true, corba_object:non_existent(PushAnyC)), + ok. + +event_filtering(_FiFac, _Filter, _AdminConsumer, StructuredProxyPushConsumer, PushAnyC, PushStrC, PushSeqC, PullAnyC, PullStrC, PullSeqC) -> + NilAnyEvent = any:create(orber_tc:null(), null), + NilStrEvent = ?not_CreateSE("","","",[],[],NilAnyEvent), + + TrueEvent1 = ?not_CreateSE("SpareTime","MOVIE", + "EventName", + [#'CosNotification_Property'{name="starlist", + value=any:create(orber_tc:sequence(orber_tc:string(0),0), + ["groucho", "harpo", "sam", "gummo"])}], + [], any:create(orber_tc:null(), null)), + TrueEvent2 = ?not_CreateSE("Studies","TestResults", + "EventName", [], + [#'CosNotification_Property'{name="test", + value=any:create(orber_tc:array(notify_test_data:tc(),3), + {#notify_test_data{score=75, + name="name"}, + #notify_test_data{score=80, + name="name"}, + #notify_test_data{score=85, + name="name"}})}], + any:create(orber_tc:null(), null)), + + FalseEvent1 = ?not_CreateSE("SpareTime","MOVIE", + "EventName", + [#'CosNotification_Property'{name="starlist", + value=any:create(orber_tc:sequence(orber_tc:string(0),0), + ["frodo", "bilbo", "sam", "gummo"])}], + [], any:create(orber_tc:null(), null)), + FalseEvent2 = ?not_CreateSE("Studies","TestResults", + "EventName", [], + [#'CosNotification_Property'{name="test", + value=any:create(orber_tc:array(notify_test_data:tc(),3), + {#notify_test_data{score=75, + name="name"}, + #notify_test_data{score=80, + name="name"}, + #notify_test_data{score=80, + name="name"}})}], + any:create(orber_tc:null(), null)), + %% Test with pushing the first structured event that should not be filtered away. + ?match(ok,'CosNotifyChannelAdmin_StructuredProxyPushConsumer':push_structured_event(StructuredProxyPushConsumer, TrueEvent1)), + + %% Wait for a while so we are sure that all events have been delivered as far + %% as the Notification service can automatically. + timer:sleep(5000), + + %% Check if the Clients have received and stored the events. + ?match([{any,_,TrueEvent1}], 'notify_test_AnyPushC':doAction(PushAnyC, return_data)), + ?match([TrueEvent1], 'notify_test_StrPushC':doAction(PushStrC, return_data)), + ?match([TrueEvent1], 'notify_test_SeqPushC':doAction(PushSeqC, return_data)), + + %% Instruct the Clients to pull the events and check if they match. + ?match({any,_,TrueEvent1}, 'notify_test_AnyPullC':doAction(PullAnyC, pull_any)), + ?match(TrueEvent1, 'notify_test_StrPullC':doAction(PullStrC, pull_str)), + ?match([TrueEvent1], 'notify_test_SeqPullC':doAction(PullSeqC, {pull_seq,1})), + + %% Test with pushing the second structured event that should not be filtered away. + ?match(ok,'CosNotifyChannelAdmin_StructuredProxyPushConsumer':push_structured_event(StructuredProxyPushConsumer, TrueEvent2)), + + %% Wait for a while so we are sure that all events have been delivered as far + %% as the Notification service can automatically. + timer:sleep(5000), + + %% Check if the Clients have received and stored the events. + ?match([{any,_,TrueEvent2}], 'notify_test_AnyPushC':doAction(PushAnyC, return_data)), + ?match([TrueEvent2], 'notify_test_StrPushC':doAction(PushStrC, return_data)), + ?match([TrueEvent2], 'notify_test_SeqPushC':doAction(PushSeqC, return_data)), + + %% Instruct the Clients to pull the events and check if they match. + ?match({any,_,TrueEvent2}, 'notify_test_AnyPullC':doAction(PullAnyC, pull_any)), + ?match(TrueEvent2, 'notify_test_StrPullC':doAction(PullStrC, pull_str)), + ?match([TrueEvent2], 'notify_test_SeqPullC':doAction(PullSeqC, {pull_seq,1})), + + %% Test with pushing the first structured event that should be filtered away. + ?match(ok,'CosNotifyChannelAdmin_StructuredProxyPushConsumer':push_structured_event(StructuredProxyPushConsumer, FalseEvent1)), + + %% Wait for a while so we are sure that all events have been delivered as far + %% as the Notification service can automatically. + timer:sleep(5000), + + %% Check if the Clients have received and stored the events. + ?match([], 'notify_test_AnyPushC':doAction(PushAnyC, return_data)), + ?match([], 'notify_test_StrPushC':doAction(PushStrC, return_data)), + ?match([], 'notify_test_SeqPushC':doAction(PushSeqC, return_data)), + + %% Instruct the Clients to pull the events and check if they match. + ?match({NilAnyEvent,false}, 'notify_test_AnyPullC':doAction(PullAnyC, try_pull_any)), + ?match({NilStrEvent,false}, 'notify_test_StrPullC':doAction(PullStrC, try_pull_str)), + ?match({[],false}, 'notify_test_SeqPullC':doAction(PullSeqC, {try_pull_seq,10})), + + %% Test with pushing the second structured event that should be filtered away. + ?match(ok,'CosNotifyChannelAdmin_StructuredProxyPushConsumer':push_structured_event(StructuredProxyPushConsumer, FalseEvent2)), + + %% Wait for a while so we are sure that all events have been delivered as far + %% as the Notification service can automatically. + timer:sleep(5000), + + %% Check if the Clients have received and stored the events. + ?match([], 'notify_test_AnyPushC':doAction(PushAnyC, return_data)), + ?match([], 'notify_test_StrPushC':doAction(PushStrC, return_data)), + ?match([], 'notify_test_SeqPushC':doAction(PushSeqC, return_data)), + + %% Instruct the Clients to pull the events and check if they match. + ?match({NilAnyEvent,false}, 'notify_test_AnyPullC':doAction(PullAnyC, try_pull_any)), + ?match({NilStrEvent,false}, 'notify_test_StrPullC':doAction(PullStrC, try_pull_str)), + ?match({[],false}, 'notify_test_SeqPullC':doAction(PullSeqC, {try_pull_seq,10})). + + + +%%----------------------------------------------------------------- +%% Creating different cosEvent API tests +%%----------------------------------------------------------------- +cosevent_api(doc) -> ["CosNotification Objects tested with CosEvent API", ""]; +cosevent_api(suite) -> []; +cosevent_api(_Config) -> + Fac = (catch cosNotificationApp:start_global_factory(?FAC_OPT)), + ?match({_,key,_,_,_,_}, Fac), + {Ch, _Id1} = (catch 'CosNotifyChannelAdmin_EventChannelFactory':create_channel(Fac, ?defaultQoS, ?defaultAdm)), + ?match({_,key,_,_,_,_}, Ch), + AC=?match({_,key,_,_,_,_}, + 'CosEventChannelAdmin_EventChannel':for_consumers(Ch)), + AS=?match({_,key,_,_,_,_}, + 'CosEventChannelAdmin_EventChannel':for_suppliers(Ch)), + + PushS=?match({_,key,_,_,_,_}, + 'CosEventChannelAdmin_ConsumerAdmin':obtain_push_supplier(AC)), + PullS=?match({_,key,_,_,_,_}, + 'CosEventChannelAdmin_ConsumerAdmin':obtain_pull_supplier(AC)), + + PushC=?match({_,key,_,_,_,_}, + 'CosEventChannelAdmin_SupplierAdmin':obtain_push_consumer(AS)), + PullC=?match({_,key,_,_,_,_}, + 'CosEventChannelAdmin_SupplierAdmin':obtain_pull_consumer(AS)), + + PushAnyC=?match({_,key,_,_,_,_}, + 'notify_test_AnyPushC':oe_create(['PUSH_ANY', PushC], + [{local_typecheck, false}])), + PushStrC=?match({_,key,_,_,_,_}, + 'notify_test_StrPushC':oe_create(['PUSH_STRUCTURED',false], + [{local_typecheck, false}])), + PushSeqC=?match({_,key,_,_,_,_}, + 'notify_test_SeqPushC':oe_create(['PUSH_SEQUENCE',false], + [{local_typecheck, false}])), + + PullAnyC=?match({_,key,_,_,_,_}, + 'notify_test_AnyPullC':oe_create(['PULL_ANY', PullC], + [{local_typecheck, false}])), + PullStrC=?match({_,key,_,_,_,_}, + 'notify_test_StrPullC':oe_create(['PULL_STRUCTURED',false], + [{local_typecheck, false}])), + PullSeqC=?match({_,key,_,_,_,_}, + 'notify_test_SeqPullC':oe_create(['PULL_SEQUENCE',false], + [{local_typecheck, false}])), + + PushAnyS=?match({_,key,_,_,_,_}, + 'notify_test_AnyPushS':oe_create(['PUSH_ANY', PushC], + [{local_typecheck, false}])), + PushStrS=?match({_,key,_,_,_,_}, + 'notify_test_StrPushS':oe_create(['PUSH_STRUCTURED',false], + [{local_typecheck, false}])), + PushSeqS=?match({_,key,_,_,_,_}, + 'notify_test_SeqPushS':oe_create(['PUSH_SEQUENCE',false], + [{local_typecheck, false}])), + + PullAnyS=?match({_,key,_,_,_,_}, + 'notify_test_AnyPullS':oe_create(['PULL_ANY', PullS], + [{local_typecheck, false}])), + PullStrS=?match({_,key,_,_,_,_}, + 'notify_test_StrPullS':oe_create(['PULL_STRUCTURED',false], + [{local_typecheck, false}])), + PullSeqS=?match({_,key,_,_,_,_}, + 'notify_test_SeqPullS':oe_create(['PULL_SEQUENCE',false], + [{local_typecheck, false}])), + + %% In the OMG specification Proxies do not inherrit from CosEvent. Must use + %% Notify interface. + ?match({'EXCEPTION',{'BAD_PARAM',_,_,_}}, + 'CosEventChannelAdmin_ProxyPullConsumer':connect_pull_supplier(PullC, PushStrS)), + + ?match(ok, + 'CosEventChannelAdmin_ProxyPushSupplier':connect_push_consumer(PushS, PushAnyC)), + ?match(ok, + 'CosEventChannelAdmin_ProxyPullSupplier':connect_pull_consumer(PullS, PullAnyC)), + + ?match(ok, + 'CosEventChannelAdmin_ProxyPushConsumer':connect_push_supplier(PushC, PushAnyS)), + ?match(ok, + 'CosEventChannelAdmin_ProxyPullConsumer':connect_pull_supplier(PullC, PullAnyS)), + + ?match({'EXCEPTION',{'CosEventChannelAdmin_AlreadyConnected',_}}, + 'CosEventChannelAdmin_ProxyPullConsumer':connect_pull_supplier(PullC, PullAnyS)), + + ?match({'EXCEPTION',{'CosEventChannelAdmin_AlreadyConnected',_}}, + 'CosNotifyChannelAdmin_ProxyPullConsumer':connect_pull_supplier(PullC, PullAnyS)), + + ?match(true, corba_object:is_a(PushS, "IDL:omg.org/CosNotifyChannelAdmin/ProxyPushSupplier:1.0")), + ?match(true, corba_object:is_a(PushS, "IDL:omg.org/CosEventChannelAdmin/ProxyPushSupplier:1.0")), + + catch corba:dispose(PushStrC), + catch corba:dispose(PushSeqC), + catch corba:dispose(PullStrC), + catch corba:dispose(PullSeqC), + catch corba:dispose(PushStrS), + catch corba:dispose(PushSeqS), + catch corba:dispose(PullStrS), + catch corba:dispose(PullSeqS), + catch corba:dispose(PushS), + catch corba:dispose(PullS), + catch corba:dispose(PushC), + catch corba:dispose(PullC), + catch corba:dispose(AC), + catch corba:dispose(AS), + catch corba:dispose(Ch), + catch cosNotificationApp:stop_factory(Fac), + + %% The Clients should have terminated by now. Check if it is so. + timer:sleep(5000), + ?match(true, corba_object:non_existent(PullAnyS)), + ?match(true, corba_object:non_existent(PushAnyS)), + ?match(true, corba_object:non_existent(PullAnyC)), + ?match(true, corba_object:non_existent(PushAnyC)), + + + ok. + +%%----------------------------------------------------------------- +%% AdminPropertiesAdmin API tests +%%----------------------------------------------------------------- +adm_api(doc) -> ["CosNotification AdminPropertiesAdmin tests", ""]; +adm_api(suite) -> []; +adm_api(_Config) -> + Fac = (catch cosNotificationApp:start_global_factory(?FAC_OPT)), + ?match({_,key,_,_,_,_}, Fac), + + %% We need a few AdminProp:s to "play" with. + MQ0 = [#'CosNotification_Property'{name='CosNotification':'MaxQueueLength'(), + value=any:create(orber_tc:long(), 0)}], + MC0 = [#'CosNotification_Property'{name='CosNotification':'MaxConsumers'(), + value=any:create(orber_tc:long(), 0)}], + MS0 = [#'CosNotification_Property'{name='CosNotification':'MaxSuppliers'(), + value=any:create(orber_tc:long(), 0)}], + MQError1 = [#'CosNotification_Property'{name='CosNotification':'MaxQueueLength'(), + value=any:create(orber_tc:'float'(), 1.5)}], + MQError2 = [#'CosNotification_Property'{name='CosNotification':'MaxQueueLength'(), + value=any:create(orber_tc:long(), -1)}], + + {Ch, _Id1} = (catch 'CosNotifyChannelAdmin_EventChannelFactory':create_channel(Fac, ?defaultQoS, ?defaultAdm)), + ?match({_,key,_,_,_,_}, Ch), + + %% Set new admin + ?match(ok, 'CosNotification_AdminPropertiesAdmin':set_admin(Ch, MQ0)), + %% It should be a list of three items. If we support more admin:s this + %% must be updated. + ?match([_,_,_], 'CosNotification_AdminPropertiesAdmin':get_admin(Ch)), + + %% Try to set admin with an uncorrect value, i.e., not integer >= 0. + ?match({'EXCEPTION',{'CosNotification_UnsupportedAdmin',_,_}}, + 'CosNotification_AdminPropertiesAdmin':set_admin(Ch, MQError1)), + ?match({'EXCEPTION',{'CosNotification_UnsupportedAdmin',_,_}}, + 'CosNotification_AdminPropertiesAdmin':set_admin(Ch, MQError2)), + + %% Try setting the other two admins and chech if the value is correct. + ?match(ok, 'CosNotification_AdminPropertiesAdmin':set_admin(Ch, MC0)), + ?match([_,_,_], 'CosNotification_AdminPropertiesAdmin':get_admin(Ch)), + + ?match(ok, 'CosNotification_AdminPropertiesAdmin':set_admin(Ch, MS0)), + ?match([_,_,_], 'CosNotification_AdminPropertiesAdmin':get_admin(Ch)), + + catch corba:dispose(Ch), + catch cosNotificationApp:stop_factory(Fac), + ok. + + +%%----------------------------------------------------------------- +%% QoSAdm API tests +%%----------------------------------------------------------------- +qos_api(doc) -> ["CosNotification QoSAdmin tests", ""]; +qos_api(suite) -> []; +qos_api(_Config) -> + Fac = (catch cosNotificationApp:start_global_factory(?FAC_OPT)), + ?match({_,key,_,_,_,_}, Fac), + + {Ch, _Id1} = (catch 'CosNotifyChannelAdmin_EventChannelFactory':create_channel(Fac, ?defaultQoS, ?defaultAdm)), + ?match({_,key,_,_,_,_}, Ch), + + + QoSPersistent = [#'CosNotification_Property'{name='CosNotification':'ConnectionReliability'(), + value=any:create(orber_tc:short(), + 'CosNotification':'Persistent'())}], + QoSBestEffort = [#'CosNotification_Property'{name='CosNotification':'ConnectionReliability'(), + value=any:create(orber_tc:short(), + 'CosNotification':'BestEffort'())}], + + QoSEventPersistent = [#'CosNotification_Property'{name='CosNotification':'EventReliability'(), + value=any:create(orber_tc:short(), + 'CosNotification':'Persistent'())}], + QoSEventBestEffort = [#'CosNotification_Property'{name='CosNotification':'EventReliability'(), + value=any:create(orber_tc:short(), + 'CosNotification':'BestEffort'())}], + + QoSOKMaxBatchSize = [#'CosNotification_Property'{name='CosNotification':'MaximumBatchSize'(), + value=any:create(orber_tc:long(), 200)}], + QoSToHighMaxBatchSize = [#'CosNotification_Property'{name='CosNotification':'MaximumBatchSize'(), + value=any:create(orber_tc:long(), 100000000)}], + + QoSToLowMaxBatchSize = [#'CosNotification_Property'{name='CosNotification':'MaximumBatchSize'(), + value=any:create(orber_tc:long(), -1)}], + + QoSOKStopTimeSupp = [#'CosNotification_Property'{name='CosNotification':'StopTimeSupported'(), + value=any:create(orber_tc:boolean(), true)}], + QoSWrongStopTimeSupp = [#'CosNotification_Property'{name="StopTimeSupp", + value=any:create(orber_tc:boolean(), true)}], + + QoSOKStartTimeSupp = [#'CosNotification_Property'{name='CosNotification':'StartTimeSupported'(), + value=any:create(orber_tc:boolean(), true)}], + QoSWrongStartTimeSupp = [#'CosNotification_Property'{name="StartTimeSupp", + value=any:create(orber_tc:boolean(), true)}], + QoSOKTimout = [#'CosNotification_Property'{name='CosNotification':'Timeout'(), + value=any:create(orber_tc:unsigned_long_long(), 100)}], + + + %% The most complex QoS to set is ConnectionReliability, and the reason for this + %% is that we cannot set the Channel to offer best effort while its children + %% offer persistent. A child may only offer Persistent if its parent do, which + %% is why we must check the following: + %% + %% # Persistent Change to Best Effort + %% _____ + %% | | (1) -> Check if children BE + %% |Chann| (2) ok <- + %% ----- + %% | + %% _____ + %% | | (3) -> Check if children BE + %% |Admin| (4) Check if parent Pers. <- + %% ----- + %% | + %% _____ + %% | | (5) -> ok + %% |Proxy| (6) Check if parent Pers. <- + %% ----- + %% NOTE: a parent always exists but we may change the QoS before creating any + %% childrens. The cases (2) and (5) is always ok, i.e., no need to confirm + %% with parent or children. + + %% We only have a channel. At the moment we can set ConnectionReliability + %% without asking anyone. + Q1='CosNotification_QoSAdmin':get_qos(Ch), + ?match({ok, _}, 'CosNotification_QoSAdmin':validate_qos(Ch, QoSBestEffort)), + + ?match(ok, 'CosNotification_QoSAdmin':set_qos(Ch, QoSPersistent)), + %% Match if no problems occur if we try to set QoS as is. + ?match(ok, 'CosNotification_QoSAdmin':set_qos(Ch, QoSPersistent)), + + %% Check validate. + ?match(ok, 'CosNotification_QoSAdmin':set_qos(Ch, QoSEventPersistent)), + ?match({ok, _}, 'CosNotification_QoSAdmin':validate_qos(Ch, QoSOKTimout)), + ?match({ok, _}, 'CosNotification_QoSAdmin':validate_qos(Ch, QoSEventBestEffort)), + ?match(ok, 'CosNotification_QoSAdmin':set_qos(Ch, QoSEventBestEffort)), + ?match({ok, _}, 'CosNotification_QoSAdmin':validate_qos(Ch, QoSOKTimout)), + + Q2='CosNotification_QoSAdmin':get_qos(Ch), + ?match(ok, 'CosNotification_QoSAdmin':set_qos(Ch, QoSBestEffort)), + ?match(Q1, 'CosNotification_QoSAdmin':get_qos(Ch)), + + %% Now we add an Admin object. An Admin object cannot switch ConnectionReliability + %% to BestEffort without checking with its children or Persistent without + %% confirming this with its Parent. At the moment, however, we only have a parent. + {CAdm, Id2} = 'CosNotifyChannelAdmin_EventChannel':new_for_consumers(Ch, 'AND_OP'), + ?match(Q1,'CosNotification_QoSAdmin':get_qos(CAdm)), + ?match({'EXCEPTION',{'CosNotification_UnsupportedQoS',_,_}}, + 'CosNotification_QoSAdmin':set_qos(CAdm, QoSPersistent)), + ?match(Q1, 'CosNotification_QoSAdmin':get_qos(CAdm)), + ?match(ok, 'CosNotification_QoSAdmin':set_qos(CAdm, QoSBestEffort)), + ?match(Q1, 'CosNotification_QoSAdmin':get_qos(CAdm)), + + %% Check if we can extract the Admin from the channel correctly. + ?match([0,Id2],'CosNotifyChannelAdmin_EventChannel':get_all_consumeradmins(Ch)), + ?match(CAdm,'CosNotifyChannelAdmin_EventChannel':get_consumeradmin(Ch, Id2)), + ?match(Ch, 'CosNotifyChannelAdmin_ConsumerAdmin':'_get_MyChannel'(CAdm)), + ?match(Id2, 'CosNotifyChannelAdmin_ConsumerAdmin':'_get_MyID'(CAdm)), + + %% Change the channel to provide Persistent service. Now we can set the + %% Admin service to Persistent to. (4) + ?match(ok, 'CosNotification_QoSAdmin':set_qos(Ch, QoSPersistent)), + ?match(ok, 'CosNotification_QoSAdmin':set_qos(CAdm, QoSPersistent)), + ?match(Q2, 'CosNotification_QoSAdmin':get_qos(CAdm)), + + %% Since the Admin object now provide Persistent the Channel cannot switch + %% to BestEffort. (1) + ?match({'EXCEPTION',{'CosNotification_UnsupportedQoS',_,_}}, + 'CosNotification_QoSAdmin':set_qos(Ch, QoSBestEffort)), + %% Should still match Persistent. + ?match(Q2, 'CosNotification_QoSAdmin':get_qos(Ch)), + {PSup, _Id3} = 'CosNotifyChannelAdmin_ConsumerAdmin':obtain_notification_push_supplier(CAdm, 'ANY_EVENT'), + ?match(Q2, 'CosNotification_QoSAdmin':get_qos(CAdm)), + ?match('PUSH_ANY', 'CosNotifyChannelAdmin_ProxyPushConsumer':'_get_MyType'(PSup)), + ?match(CAdm, 'CosNotifyChannelAdmin_ProxyPushConsumer':'_get_MyAdmin'(PSup)), + ?match(Q2, 'CosNotification_QoSAdmin':get_qos(PSup)), + + %% At this point they all offer persistent connection, which means we have + %% to start with the proxy if we want to change to Best Effort. Hence, + %% the following two cases will fail. + ?match({'EXCEPTION',{'CosNotification_UnsupportedQoS',_,_}}, + 'CosNotification_QoSAdmin':set_qos(Ch, QoSBestEffort)), + ?match({'EXCEPTION',{'CosNotification_UnsupportedQoS',_,_}}, + 'CosNotification_QoSAdmin':set_qos(CAdm, QoSBestEffort)), + ?match(ok, 'CosNotification_QoSAdmin':set_qos(PSup, QoSBestEffort)), + %% Still not possible to change channel to Best Effort. + ?match({'EXCEPTION',{'CosNotification_UnsupportedQoS',_,_}}, + 'CosNotification_QoSAdmin':set_qos(Ch, QoSBestEffort)), + ?match(ok, 'CosNotification_QoSAdmin':set_qos(CAdm, QoSBestEffort)), + %% Now we change the channel to Best Effort. + ?match(ok, 'CosNotification_QoSAdmin':set_qos(Ch, QoSBestEffort)), + + %% Test if really are Best Effort + ?match(Q1, 'CosNotification_QoSAdmin':get_qos(Ch)), + ?match(Q1, 'CosNotification_QoSAdmin':get_qos(CAdm)), + ?match(Q1, 'CosNotification_QoSAdmin':get_qos(PSup)), + + %% Testing MaximumBatchSize (The highest value is defined in + %% CosNotification_Common.erl + ?match(ok, 'CosNotification_QoSAdmin':set_qos(Ch, QoSOKMaxBatchSize)), + ?match({'EXCEPTION',{'CosNotification_UnsupportedQoS',_,_}}, + 'CosNotification_QoSAdmin':set_qos(Ch, QoSToHighMaxBatchSize)), + ?match({'EXCEPTION',{'CosNotification_UnsupportedQoS',_,_}}, + 'CosNotification_QoSAdmin':set_qos(Ch, QoSToLowMaxBatchSize)), + + ?match(ok, 'CosNotification_QoSAdmin':set_qos(Ch, QoSOKStartTimeSupp)), + ?match(ok, 'CosNotification_QoSAdmin':set_qos(Ch, QoSOKStopTimeSupp)), + ?match({'EXCEPTION',{'CosNotification_UnsupportedQoS',_,_}}, + 'CosNotification_QoSAdmin':set_qos(Ch, QoSWrongStartTimeSupp)), + ?match({'EXCEPTION',{'CosNotification_UnsupportedQoS',_,_}}, + 'CosNotification_QoSAdmin':set_qos(Ch, QoSWrongStopTimeSupp)), + + catch corba:dispose(CAdm), + catch corba:dispose(PSup), + catch corba:dispose(Ch), + cosNotificationApp:stop_factory(Fac), + ok. + +%%----------------------------------------------------------------- +%% QoSAdm API tests +%%----------------------------------------------------------------- +event_qos_api(doc) -> ["CosNotification QoSAdmin tests", ""]; +event_qos_api(suite) -> []; +event_qos_api(_Config) -> + Fac = (catch cosNotificationApp:start_global_factory(?FAC_OPT)), + ?match({_,key,_,_,_,_}, Fac), + + %% Create some objects to test with. We start with default settings. + {Ch, _Id1} = (catch 'CosNotifyChannelAdmin_EventChannelFactory':create_channel(Fac, ?defaultQoS, ?defaultAdm)), + {CAdm, _Id2} = 'CosNotifyChannelAdmin_EventChannel':new_for_consumers(Ch, 'AND_OP'), + {PSup, _Id3} = 'CosNotifyChannelAdmin_ConsumerAdmin':obtain_notification_push_supplier(CAdm, 'ANY_EVENT'), + + %% Try setting an unsupported QoS. + ?match({'EXCEPTION',{'CosNotification_UnsupportedQoS',_,_}}, + 'CosNotifyChannelAdmin_ProxyConsumer': + validate_event_qos(PSup, + [#'CosNotification_Property'{name="Unsupported QoS", + value=any:create(orber_tc:short(), 1)}])), + %% Try setting min and max priority. + ?match({ok, _}, 'CosNotifyChannelAdmin_ProxyConsumer': + validate_event_qos(PSup, + [#'CosNotification_Property'{name=?not_Priority, + value=any:create(orber_tc:short(), + ?not_LowestPriority)}, + #'CosNotification_Property'{name=?not_Priority, + value=any:create(orber_tc:short(), + ?not_HighestPriority)}])), + %% Try setting priority values which are 1 to high and 1 to low respectively. + ?match({'EXCEPTION',{'MARSHAL',_,_,_}}, + 'CosNotifyChannelAdmin_ProxyConsumer': + validate_event_qos(PSup, + [#'CosNotification_Property'{name=?not_Priority, + value=any:create(orber_tc:short(), + ?not_LowestPriority-1)}, + #'CosNotification_Property'{name=?not_Priority, + value=any:create(orber_tc:short(), + ?not_HighestPriority+1)}])), + %% Try setting start- and stop-time (false default). Note the value associated + %% with this property is not really a short but that is not what we are testing + %% here so... + ?match({'EXCEPTION',{'CosNotification_UnsupportedQoS',_,_}}, + 'CosNotifyChannelAdmin_ProxyConsumer': + validate_event_qos(PSup, + [#'CosNotification_Property'{name=?not_StartTime, + value=any:create(orber_tc:short(), 0)}])), + ?match({'EXCEPTION',{'CosNotification_UnsupportedQoS',_,_}}, + 'CosNotifyChannelAdmin_ProxyConsumer': + validate_event_qos(PSup, + [#'CosNotification_Property'{name=?not_StopTime, + value=any:create(orber_tc:short(), 0)}])), + %% Allow StopTime + ?match(ok, 'CosNotification_QoSAdmin':set_qos(PSup, [#'CosNotification_Property'{name='CosNotification':'StopTimeSupported'(), + value=any:create(orber_tc:boolean(), true)}])), + ?match({ok,_}, + 'CosNotifyChannelAdmin_ProxyConsumer': + validate_event_qos(PSup, + [#'CosNotification_Property'{name=?not_StopTime, + value=any:create(orber_tc:short(), 0)}])), + %% Allow StartTime + ?match(ok, 'CosNotification_QoSAdmin':set_qos(PSup, [#'CosNotification_Property'{name='CosNotification':'StartTimeSupported'(), + value=any:create(orber_tc:boolean(), true)}])), + ?match({ok,_}, + 'CosNotifyChannelAdmin_ProxyConsumer': + validate_event_qos(PSup, + [#'CosNotification_Property'{name=?not_StopTime, + value=any:create(orber_tc:short(), 0)}, + #'CosNotification_Property'{name=?not_StartTime, + value=any:create(orber_tc:short(), 0)}])), + + %% We must reset StopTime since we cannot guarantee that an event will be delivered + %% if risk beeing discarded due to a delay. + ?match(ok, 'CosNotification_QoSAdmin':set_qos(PSup, [#'CosNotification_Property'{name='CosNotification':'StopTimeSupported'(), + value=any:create(orber_tc:boolean(), false)}])), + %% Does it accept Best Effort EventReliability? Must always be true. + ?match({ok,_}, + 'CosNotifyChannelAdmin_ProxyConsumer': + validate_event_qos(PSup, + [#'CosNotification_Property'{name=?not_EventReliability, + value=any:create(orber_tc:short(), ?not_BestEffort)}])), + %% Default is Best Effort; test if we can set Persistent EventReliability. + ?match({'EXCEPTION',{'CosNotification_UnsupportedQoS',_,_}}, + 'CosNotifyChannelAdmin_ProxyConsumer': + validate_event_qos(PSup, + [#'CosNotification_Property'{name=?not_EventReliability, + value=any:create(orber_tc:short(), ?not_Persistent)}])), + + %% Set Persistent + QoSPersistent = [#'CosNotification_Property'{name='CosNotification':'ConnectionReliability'(), + value=any:create(orber_tc:short(), + 'CosNotification':'Persistent'())}], + ?match(ok, 'CosNotification_QoSAdmin':set_qos(Ch, QoSPersistent)), + ?match(ok, 'CosNotification_QoSAdmin':set_qos(CAdm, QoSPersistent)), + ?match(ok, 'CosNotification_QoSAdmin':set_qos(PSup, QoSPersistent)), + + %% Does it accept Best Effort EventReliability? Must always be true. + ?match({ok, _}, + 'CosNotifyChannelAdmin_ProxyConsumer': + validate_event_qos(PSup, + [#'CosNotification_Property'{name=?not_EventReliability, + value=any:create(orber_tc:short(), ?not_BestEffort)}])), + %% Test if we can use Persistent EventReliability. + ?match({'EXCEPTION',{'CosNotification_UnsupportedQoS',_,_}}, + 'CosNotifyChannelAdmin_ProxyConsumer': + validate_event_qos(PSup, + [#'CosNotification_Property'{name=?not_EventReliability, + value=any:create(orber_tc:short(), ?not_Persistent)}])), + QoSEventPersistent = [#'CosNotification_Property'{name='CosNotification':'EventReliability'(), + value=any:create(orber_tc:short(), + 'CosNotification':'Persistent'())}], + ?match(ok, 'CosNotification_QoSAdmin':set_qos(Ch, QoSEventPersistent)), + ?match({'EXCEPTION',{'CosNotification_UnsupportedQoS',_,_}}, + 'CosNotification_QoSAdmin':set_qos(CAdm, QoSEventPersistent)), + ?match({'EXCEPTION',{'CosNotification_UnsupportedQoS',_,_}}, + 'CosNotification_QoSAdmin':set_qos(PSup, QoSEventPersistent)), + + ?match(ok, 'CosNotification_QoSAdmin':set_qos(PSup, [#'CosNotification_Property'{name='CosNotification':'StopTimeSupported'(), + value=any:create(orber_tc:boolean(), true)}])), + ?match({ok,_}, + 'CosNotifyChannelAdmin_ProxyConsumer': + validate_event_qos(PSup, + [#'CosNotification_Property'{name=?not_StopTime, + value=any:create(orber_tc:short(), 0)}, + #'CosNotification_Property'{name=?not_StartTime, + value=any:create(orber_tc:short(), 0)}])), + catch corba:dispose(CAdm), + catch corba:dispose(PSup), + catch corba:dispose(Ch), + cosNotificationApp:stop_factory(Fac), + ok. + +%%----------------------------------------------------------------- +%% Internal functions +%%----------------------------------------------------------------- + +%%-------------------- End of Module ------------------------------ diff --git a/lib/cosNotification/test/notify_test_impl.erl b/lib/cosNotification/test/notify_test_impl.erl new file mode 100644 index 0000000000..483610befd --- /dev/null +++ b/lib/cosNotification/test/notify_test_impl.erl @@ -0,0 +1,299 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +%% +%%---------------------------------------------------------------------- +%% File : notify_test_impl.erl +%%---------------------------------------------------------------------- + +-module(notify_test_impl). + +-include_lib("orber/include/corba.hrl"). +-include("idl_output/notify_test.hrl"). + +%%--------------- specified functions ------------------------ +-export([stop_normal/2, + stop_brutal/2, + print/2, + doAction/3, + delay/5, + %% Exports from CosNotifyComm::StructuredPushConsumer + push_structured_event/3, disconnect_structured_push_consumer/2, + %% Exports from "CosNotifyComm::SequencePushConsumer" + push_structured_events/3, disconnect_sequence_push_consumer/2, + %% Exports from CosEventComm::PushConsumer + push/3, disconnect_push_consumer/2, + %% Exports from CosNotifyComm::NotifyPublish + disconnect_sequence_pull_consumer/2, + %% Exports from CosNotifyComm::StructuredPullConsumer + disconnect_structured_pull_consumer/2, + %% Exports from CosEventComm::PullConsumer + disconnect_pull_consumer/2, + %% Exports from CosNotifyComm::SequencePushSupplier + disconnect_sequence_push_supplier/2, + %% Exports from CosNotifyComm::StructuredPushSupplier + disconnect_structured_push_supplier/2, + %% Exports from CosEventComm::PushSupplier + disconnect_push_supplier/2, + %% Exports from CosNotifyComm::SequencePullSupplier + pull_structured_events/3, + try_pull_structured_events/3, + disconnect_sequence_pull_supplier/2, + %% Exports from CosNotifyComm::StructuredPullSupplier + pull_structured_event/2, + try_pull_structured_event/2, + disconnect_structured_pull_supplier/2, + %% Exports from CosEventComm::PullSupplier + pull/2, + try_pull/2, + disconnect_pull_supplier/2, + %% Exports from CosNotifyComm::SequencePullConsumer + offer_change/4, + %% Exports from CosNotifyComm::NotifySubscribe + subscription_change/4]). + +%%--------------- gen_server specific ------------------------ +-export([init/1, terminate/2]). +-export([handle_call/3, handle_cast/2, handle_info/2, code_change/3]). +%% Data structures +-record(state, {myType, proxy, data, action}). + +%%--------------- LOCAL DATA --------------------------------- + +%%------------------------------------------------------------ +%% function : init, terminate +%%------------------------------------------------------------ +init([MyType, Proxy]) -> + process_flag(trap_exit,true), + {ok, #state{myType=MyType, proxy=Proxy, data=[]}}. + +terminate(Reason, State) -> + io:format("notify_test:terminate(~p ~p)~n",[Reason, State#state.myType]), + ok. + +code_change(_OldVsn, State, _Extra) -> + {ok, State}. +handle_call(_,_, State) -> + {noreply, State}. +handle_cast(_, State) -> + {noreply, State}. +handle_info(_Info, State) -> + {noreply, State}. + +%%--------------- SERVER FUNCTIONS --------------------------- + +print(Self, State) -> + io:format("notify_test:print(~p ~p)~n",[Self, State]), + {reply, ok, State}. + +doAction(_Self, State, {set_data, Data}) -> + io:format("notify_test:doAction(add_data) ~p~n",[Data]), + {reply, ok, State#state{data=Data}}; +doAction(_Self, State, {add_data, Data}) -> + io:format("notify_test:doAction(add_data) ~p~n",[Data]), + {reply, ok, State#state{data=State#state.data++Data}}; +doAction(_Self, State, return_data) -> + io:format("notify_test:doAction(return_data)~n",[]), + {reply, State#state.data, State#state{data=[]}}; +doAction(_Self, State, clear_data) -> + io:format("notify_test:doAction(return_data)~n",[]), + {reply, ok, State#state{data=[]}}; +doAction(_Self, State, pull_any) -> + io:format("notify_test:doAction(pull_any)~n",[]), + Event='CosNotifyChannelAdmin_ProxyPullSupplier':pull(State#state.proxy), + {reply, Event, State}; +doAction(_Self, State, {pull_seq, Max}) -> + io:format("notify_test:doAction(pull_sequence)~n",[]), + Event='CosNotifyChannelAdmin_SequenceProxyPullSupplier':pull_structured_events(State#state.proxy, Max), + {reply, Event, State}; +doAction(_Self, State, pull_str) -> + Event='CosNotifyChannelAdmin_StructuredProxyPullSupplier':pull_structured_event(State#state.proxy), + io:format("notify_test:doAction(pull_structured)~n",[]), + {reply, Event, State}; +doAction(_Self, State, try_pull_any) -> + io:format("notify_test:doAction(try_pull_any)~n",[]), + Event='CosNotifyChannelAdmin_ProxyPullSupplier':try_pull(State#state.proxy), + {reply, Event, State}; +doAction(_Self, State, {try_pull_seq, Max}) -> + io:format("notify_test:doAction(try_pull_sequence)~n",[]), + Event='CosNotifyChannelAdmin_SequenceProxyPullSupplier':try_pull_structured_events(State#state.proxy, Max), + {reply, Event, State}; +doAction(_Self, State, try_pull_str) -> + Event='CosNotifyChannelAdmin_StructuredProxyPullSupplier':try_pull_structured_event(State#state.proxy), + io:format("notify_test:doAction(try_pull_structured)~n",[]), + {reply, Event, State}; +doAction(_Self, State, {action, Action}) -> + io:format("notify_test:doAction(~p)~n",[Action]), + {reply, ok, State#state{action = Action}}; + +doAction(_, State, _) -> + {reply, nop, State}. + +stop_normal(_Self, State) -> + {stop, normal, ok, State}. + +stop_brutal(_Self, _State) -> + exit("killed_brutal"). + + + +%%--------------- CosNotifyComm::NotifyPublish -------- +offer_change(_Self, State, Added, Removed) -> + ND=loop(Removed, State#state.data), + ND2=Added++ND, + {reply, ok, State#state{data=ND2}}. + +loop([],Data) -> + Data; +loop([H|T], Data) -> + ND=lists:delete(H,Data), + loop(T, ND). + +%%--------------- CosNotifyComm::NotifySubscribe -------- +subscription_change(_Self, State, Added, Removed) -> + ND=loop(Removed, State#state.data), + ND2=Added++ND, + {reply, ok, State#state{data=ND2}}. + +%%--------------- CosNotifyComm::SequencePushConsumer -------- +push_structured_events(_Self, #state{action = undefined} = State, Event) -> + io:format("notify_test:push_structured_events(~p)~n",[Event]), + {reply, ok, State#state{data=State#state.data++Event}}; +push_structured_events(_Self, #state{action = Action} = State, Event) -> + io:format("notify_test:push_structured_events(~p)~nAction: ~p~n", + [Event, Action]), + corba:raise(#'INTERNAL'{completion_status=?COMPLETED_NO}), + {reply, ok, State#state{data=State#state.data++Event}}. +disconnect_sequence_push_consumer(_Self, State) -> + io:format("disconnect_sequence_push_consumer~n",[]), + {stop, normal, ok, State}. + +%%--------------- CosNotifyComm::StructuredPushConsumer -------- +push_structured_event(_Self, State, Event) -> + io:format("notify_test:push_structured_event(~p)~n",[Event]), + {reply, ok, State#state{data=State#state.data++[Event]}}. +disconnect_structured_push_consumer(_Self, State) -> + io:format("disconnect_structured_push_consumer~n",[]), + {stop, normal, ok, State}. + +%%--------------- CosEventComm::PushConsumer -------- +push(_Self, State, Event) -> + io:format("notify_test:push(~p)~n",[Event]), + {reply, ok, State#state{data=State#state.data++[Event]}}. +disconnect_push_consumer(_Self, State) -> + io:format("disconnect_push_consumer~n",[]), + {stop, normal, ok, State}. + +%%--------------- CosNotifyComm::SequencePullConsumer -------- +disconnect_sequence_pull_consumer(_Self, State) -> + io:format("disconnect_sequence_pull_consumer~n",[]), + {stop, normal, ok, State}. + +%%--------------- CosNotifyComm::StructuredPullConsumer -------- +disconnect_structured_pull_consumer(_Self, State) -> + io:format("disconnect_structured_pull_consumer~n",[]), + {stop, normal, ok, State}. + +%%--------------- CosEventComm::PullConsumer -------- +disconnect_pull_consumer(_Self, State) -> + io:format("disconnect_pull_consumer~n",[]), + {stop, normal, ok, State}. + +%%--------------- CosNotifyComm::SequencePushSupplier -------- +disconnect_sequence_push_supplier(_Self, State) -> + io:format("disconnect_sequence_push_supplier~n",[]), + {stop, normal, ok, State}. + +%%--------------- CosNotifyComm::StructuredPushSupplier -------- +disconnect_structured_push_supplier(_Self, State) -> + io:format("disconnect_structured_push_supplier~n",[]), + {stop, normal, ok, State}. + +%%--------------- CosEventComm::PushSupplier -------- +disconnect_push_supplier(_Self, State) -> + io:format("disconnect_push_supplier~n",[]), + {stop, normal, ok, State}. + +%%--------------- CosNotifyComm::SequencePullSupplier -------- +pull_structured_events(_Self, State, _Max) -> + io:format("notify_test:pullstructured_events()~n",[]), + {reply, ok, State}. +try_pull_structured_events(_Self, State, Max) -> + io:format("notify_test:try_pull_structured_events()~n",[]), + case State#state.data of + [] -> + {reply, {[],false}, State}; + List -> + R = split(List,Max), + {reply, {lists:sublist(List, Max), true}, State#state{data=R}} + end. + +split([],_) -> + []; +split(R,0) -> + R; +split([_H|T],Max) -> + split(T, Max-1). + +disconnect_sequence_pull_supplier(_Self, State) -> + io:format("disconnect_sequence_pull_supplier~n",[]), + {stop, normal, ok, State}. + +%%--------------- CosNotifyComm::StructuredPullSupplier -------- +pull_structured_event(_Self, State) -> + io:format("notify_test:pull_structured_event()~n",[]), + {reply, ok, State}. +try_pull_structured_event(_Self, State) -> + io:format("notify_test:try_pull_structured_event()~n",[]), + case State#state.data of + [] -> + {reply, {[],false}, State}; + [H|T] -> + {reply, {H, true}, State#state{data=T}} + end. +disconnect_structured_pull_supplier(_Self, State) -> + io:format("disconnect_structured_pull_supplier~n",[]), + {stop, normal, ok, State}. + +%%--------------- CosEventComm::PullSupplier -------- +pull(_Self, State) -> + io:format("notify_test:pull()~n",[]), + {reply, 'CosEventComm_PullSupplier':pull(State#state.proxy), State}. +try_pull(_Self, State) -> + io:format("notify_test:try_pull()~n",[]), + case State#state.data of + [] -> + {reply, {[],false}, State}; + [H|T] -> + {reply, {H, true}, State#state{data=T}} + end. +disconnect_pull_supplier(_Self, State) -> + io:format("disconnect_pull_supplier~n",[]), + {stop, normal, ok, State}. + +%%--------------- LOCAL FUNCTIONS ---------------------------- + +delay(Obj, Event, Time, Mod, F) -> + io:format("notify_test:delay(~p) TIME: ~p~n",[Event, now()]), + timer:sleep(Time), + Mod:F(Obj, Event), + io:format("notify_test:delay() DONE: ~p~n",[now()]), + ok. + +%%--------------- END OF MODULE ------------------------------ + diff --git a/lib/cosNotification/test/notify_test_server.cfg b/lib/cosNotification/test/notify_test_server.cfg new file mode 100644 index 0000000000..8621327b57 --- /dev/null +++ b/lib/cosNotification/test/notify_test_server.cfg @@ -0,0 +1,54 @@ +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. +%% +%% The contents of this file are subject to the Erlang Public License, +%% Version 1.1, (the "License"); you may not use this file except in +%% compliance with the License. You should have received a copy of the +%% Erlang Public License along with this software. If not, it can be +%% retrieved online at http://www.erlang.org/. +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and limitations +%% under the License. +%% +%% %CopyrightEnd% +%% +{this, "notify_test::SeqPushC"}. +{{handle_info, "notify_test::SeqPushC"}, true}. +{{impl, "notify_test::SeqPushC"}, "notify_test_impl"}. +{this, "notify_test::StrPushC"}. +{{handle_info, "notify_test::StrPushC"}, true}. +{{impl, "notify_test::StrPushC"}, "notify_test_impl"}. +{this, "notify_test::AnyPushC"}. +{{handle_info, "notify_test::AnyPushC"}, true}. +{{impl, "notify_test::AnyPushC"}, "notify_test_impl"}. +{this, "notify_test::SeqPullC"}. +{{handle_info, "notify_test::SeqPullC"}, true}. +{{impl, "notify_test::SeqPullC"}, "notify_test_impl"}. +{this, "notify_test::StrPullC"}. +{{handle_info, "notify_test::StrPullC"}, true}. +{{impl, "notify_test::StrPullC"}, "notify_test_impl"}. +{this, "notify_test::AnyPullC"}. +{{handle_info, "notify_test::AnyPullC"}, true}. +{{impl, "notify_test::AnyPullC"}, "notify_test_impl"}. +{this, "notify_test::SeqPushS"}. +{{handle_info, "notify_test::SeqPushS"}, true}. +{{impl, "notify_test::SeqPushS"}, "notify_test_impl"}. +{this, "notify_test::StrPushS"}. +{{handle_info, "notify_test::StrPushS"}, true}. +{{impl, "notify_test::StrPushS"}, "notify_test_impl"}. +{this, "notify_test::AnyPushS"}. +{{handle_info, "notify_test::AnyPushS"}, true}. +{{impl, "notify_test::AnyPushS"}, "notify_test_impl"}. +{this, "notify_test::SeqPullS"}. +{{handle_info, "notify_test::SeqPullS"}, true}. +{{impl, "notify_test::SeqPullS"}, "notify_test_impl"}. +{this, "notify_test::StrPullS"}. +{{handle_info, "notify_test::StrPullS"}, true}. +{{impl, "notify_test::StrPullS"}, "notify_test_impl"}. +{this, "notify_test::AnyPullS"}. +{{handle_info, "notify_test::AnyPullS"}, true}. +{{impl, "notify_test::AnyPullS"}, "notify_test_impl"}. diff --git a/lib/cosNotification/test/notify_test_server.idl b/lib/cosNotification/test/notify_test_server.idl new file mode 100644 index 0000000000..4dc0202890 --- /dev/null +++ b/lib/cosNotification/test/notify_test_server.idl @@ -0,0 +1,113 @@ +// +// %CopyrightBegin% +// +// Copyright Ericsson AB 1999-2010. All Rights Reserved. +// +// The contents of this file are subject to the Erlang Public License, +// Version 1.1, (the "License"); you may not use this file except in +// compliance with the License. You should have received a copy of the +// Erlang Public License along with this software. If not, it can be +// retrieved online at http://www.erlang.org/. +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +// the License for the specific language governing rights and limitations +// under the License. +// +// %CopyrightEnd% +// + +#ifndef _NOTIFY_TEST_SERVER_IDL +#define _NOTIFY_TEST_SERVER_IDL + +#include +#include + +module notify_test { + + enum action {PULL_SEQ, PULL_STR, PULL_ANY, PUSH_SEQ, PUSH_STR, PUSH_ANY}; + + struct data { + short score; + string name; + }; + + struct computer { + float memsize; + float cputime; + float filesize; + }; + + struct X { + long A; + string B; + short C; + }; + + + union K switch(short) { + case -1: short neg; + case 0: + case 2: string K; + case 3: X L; + case 5: long M; + default: short N; + }; + + union uni1 switch(long) { + case 1: + case 2: long lo; + case 3: short sh; + default: short defvalue; + }; + + union uni2 switch(long) { + case 1: + case 2: long lo; + case 3: short sh; + }; + + typedef any namedAny; + typedef short ShortArray[4]; + struct studies { + uni1 uni1; + CosNotification::PropertySeq tests; + ShortArray monthly_attendance; + short gpa; + }; + + interface funcs { + void print(); + void doAction(in action Act); + }; + + // interface server + interface SeqPushC : funcs, CosNotifyComm::SequencePushConsumer { + }; + interface StrPushC : funcs, CosNotifyComm::StructuredPushConsumer { + }; + interface AnyPushC : funcs, CosEventComm::PushConsumer { + }; + interface SeqPullC : funcs, CosNotifyComm::SequencePullConsumer { + }; + interface StrPullC : funcs, CosNotifyComm::StructuredPullConsumer { + }; + interface AnyPullC : funcs, CosEventComm::PullConsumer { + }; + + interface SeqPushS : funcs, CosNotifyComm::SequencePushSupplier { + }; + interface StrPushS : funcs, CosNotifyComm::StructuredPushSupplier { + }; + interface AnyPushS : funcs, CosEventComm::PushSupplier { + }; + interface SeqPullS : funcs, CosNotifyComm::SequencePullSupplier { + }; + interface StrPullS : funcs, CosNotifyComm::StructuredPullSupplier { + }; + interface AnyPullS : funcs, CosEventComm::PullSupplier { + }; + +}; + +#endif -- cgit v1.2.3