diff --git a/BUILD.gn b/BUILD.gn index 808c63e8fe..91e4611645 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -23,7 +23,6 @@ group("ten_framework_all") { "//packages/core_extensions", "//packages/core_protocols", "//packages/example_apps", - "//packages/example_extension_groups", "//packages/example_extensions", "//third_party", ] diff --git a/core/src/ten_manager/src/dev_server/addons/test_data_embed/app_property.json b/core/src/ten_manager/src/dev_server/addons/test_data_embed/app_property.json index e1e1347da3..58194f17e6 100644 --- a/core/src/ten_manager/src/dev_server/addons/test_data_embed/app_property.json +++ b/core/src/ten_manager/src/dev_server/addons/test_data_embed/app_property.json @@ -49,11 +49,6 @@ "name": "addon_not_found", "auto_start": false, "nodes": [ - { - "type": "extension_group", - "name": "default", - "addon": "default_extension_group" - }, { "type": "extension", "name": "extension_1", diff --git a/core/src/ten_manager/src/dev_server/graphs/test_data_embed/app_property.json b/core/src/ten_manager/src/dev_server/graphs/test_data_embed/app_property.json index e1e1347da3..58194f17e6 100644 --- a/core/src/ten_manager/src/dev_server/graphs/test_data_embed/app_property.json +++ b/core/src/ten_manager/src/dev_server/graphs/test_data_embed/app_property.json @@ -49,11 +49,6 @@ "name": "addon_not_found", "auto_start": false, "nodes": [ - { - "type": "extension_group", - "name": "default", - "addon": "default_extension_group" - }, { "type": "extension", "name": "extension_1", diff --git a/core/src/ten_runtime/app/predefined_graph.c b/core/src/ten_runtime/app/predefined_graph.c index f7bc79c42c..20ec3b46a6 100644 --- a/core/src/ten_runtime/app/predefined_graph.c +++ b/core/src/ten_runtime/app/predefined_graph.c @@ -385,10 +385,6 @@ bool ten_app_get_predefined_graphs_from_property(ten_app_t *self) { ten_extension_info_node_from_value( predefined_graph_info_node_item_value, &predefined_graph_info->extensions_info, NULL); - } else if (!strcmp(type, TEN_STR_EXTENSION_GROUP)) { - ten_extension_group_info_from_value( - predefined_graph_info_node_item_value, - &predefined_graph_info->extension_groups_info, NULL); } else { ten_predefined_graph_info_destroy(predefined_graph_info); result = false; diff --git a/core/src/ten_runtime/binding/python/native/BUILD.gn b/core/src/ten_runtime/binding/python/native/BUILD.gn index 1bb8f4136b..a2e2956dfb 100644 --- a/core/src/ten_runtime/binding/python/native/BUILD.gn +++ b/core/src/ten_runtime/binding/python/native/BUILD.gn @@ -15,10 +15,12 @@ config("ten_runtime_python_config") { include_dirs = ten_runtime_common_includes + python_version = "3" # "3" by default + cflags = exec_script("//build/common/python/python_config.py", [ "--python-version", - "3", + python_version, "--target-os", target_os_arg, "--config-type", @@ -34,7 +36,7 @@ config("ten_runtime_python_config") { ldflags = exec_script("//build/common/python/python_config.py", [ "--python-version", - "3", + python_version, "--target-os", target_os_arg, "--config-type", @@ -75,7 +77,7 @@ config("ten_runtime_python_config") { libs = exec_script("//build/common/python/python_config.py", [ "--python-version", - "3", + python_version, "--target-os", target_os_arg, "--config-type", diff --git a/core/src/ten_runtime/extension/extension_info/extension_info.c b/core/src/ten_runtime/extension/extension_info/extension_info.c index 505c8e6f96..40fcbb72c1 100644 --- a/core/src/ten_runtime/extension/extension_info/extension_info.c +++ b/core/src/ten_runtime/extension/extension_info/extension_info.c @@ -170,13 +170,13 @@ ten_shared_ptr_t *get_extension_info_in_extensions_info( "'%s'", extension_instance_name, extension_addon_name, ten_string_get_raw_str(&extension_info->extension_addon_name)); - } - - TEN_ASSERT(0, + } else { + TEN_ASSERT(0, "extension '%s' is associated with different addon '%s', " "'%s'", extension_instance_name, extension_addon_name, ten_string_get_raw_str(&extension_info->extension_addon_name)); + } return NULL; } diff --git a/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/cmd.c b/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/cmd.c index 2ebad2fa77..dae2b0a032 100644 --- a/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/cmd.c +++ b/core/src/ten_runtime/msg/cmd_base/cmd/start_graph/cmd.c @@ -338,7 +338,7 @@ static void ten_raw_cmd_start_graph_add_missing_extension_group_node( } if (group_found) { - return; + continue; } ten_extension_group_info_t *extension_group_info = diff --git a/core/src/ten_rust/src/json_schema/data/property.schema.json b/core/src/ten_rust/src/json_schema/data/property.schema.json index f77b6fb1c6..fd71aee932 100644 --- a/core/src/ten_rust/src/json_schema/data/property.schema.json +++ b/core/src/ten_rust/src/json_schema/data/property.schema.json @@ -186,8 +186,7 @@ "type": { "type": "string", "enum": [ - "extension", - "extension_group" + "extension" ] }, "name": { diff --git a/core/src/ten_rust/src/json_schema/mod.rs b/core/src/ten_rust/src/json_schema/mod.rs index a0b6e193e3..a8e960026d 100644 --- a/core/src/ten_rust/src/json_schema/mod.rs +++ b/core/src/ten_rust/src/json_schema/mod.rs @@ -183,11 +183,6 @@ mod tests { { "name": "default", "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "default_extension_cpp", @@ -218,10 +213,6 @@ mod tests { { "name": "default", "nodes": [{ - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - },{ "type": "extension", "name": "default_extension_cpp", "addon": "default_extension_cpp", @@ -266,10 +257,6 @@ mod tests { { "name": "default", "nodes": [{ - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - },{ "type": "extension", "name": "default_extension_cpp", "addon": "default_extension_cpp", @@ -309,11 +296,6 @@ mod tests { { "name": "default", "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "default_extension_cpp", @@ -343,11 +325,6 @@ mod tests { { "name": "default", "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "default_extension_cpp", @@ -960,10 +937,6 @@ mod tests { "name": "default", "auto_start": false, "nodes": [{ - "type": "extension_group", - "name": "result_mapping_1__extension_group", - "addon": "default_extension_group" - },{ "type": "extension", "name": "test_extension_1", "addon": "result_mapping_1__test_extension_1", @@ -1025,10 +998,6 @@ mod tests { { "name": "default", "nodes": [{ - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - },{ "type": "extension", "name": "default_extension_cpp", "addon": "default_extension_cpp", diff --git a/core/src/ten_rust/src/pkg_info/graph/test_data_embed/predefined_graph_connection_dest_not_found.json b/core/src/ten_rust/src/pkg_info/graph/test_data_embed/predefined_graph_connection_dest_not_found.json index 3e9e467839..4d1d84180f 100644 --- a/core/src/ten_rust/src/pkg_info/graph/test_data_embed/predefined_graph_connection_dest_not_found.json +++ b/core/src/ten_rust/src/pkg_info/graph/test_data_embed/predefined_graph_connection_dest_not_found.json @@ -16,11 +16,6 @@ "name": "some_extension_1", "addon": "default_extension_go", "extension_group": "some_group" - }, - { - "type": "extension_group", - "addon": "default_extension_group", - "name": "some_group" } ], "connections": [ diff --git a/core/src/ten_rust/src/pkg_info/graph/test_data_embed/predefined_graph_connection_src_not_found.json b/core/src/ten_rust/src/pkg_info/graph/test_data_embed/predefined_graph_connection_src_not_found.json index 2ff0e04be0..cd7038cabd 100644 --- a/core/src/ten_rust/src/pkg_info/graph/test_data_embed/predefined_graph_connection_src_not_found.json +++ b/core/src/ten_rust/src/pkg_info/graph/test_data_embed/predefined_graph_connection_src_not_found.json @@ -10,11 +10,6 @@ "name": "some_extension", "addon": "default_extension_go", "extension_group": "some_group" - }, - { - "type": "extension_group", - "addon": "default_extension_group", - "name": "some_group" } ], "connections": [ diff --git a/core/src/ten_rust/src/pkg_info/graph/test_data_embed/predefined_graph_current_app_no_extensions.json b/core/src/ten_rust/src/pkg_info/graph/test_data_embed/predefined_graph_current_app_no_extensions.json index 52ab44d045..e44e9843c4 100644 --- a/core/src/ten_rust/src/pkg_info/graph/test_data_embed/predefined_graph_current_app_no_extensions.json +++ b/core/src/ten_rust/src/pkg_info/graph/test_data_embed/predefined_graph_current_app_no_extensions.json @@ -11,12 +11,6 @@ "addon": "default_extension_cpp", "name": "some_ext", "app": "http://localhost:8002" - }, - { - "type": "extension_group", - "addon": "default_extension_group", - "name": "some_group", - "app": "http://localhost:8002" } ] } diff --git a/core/src/ten_rust/src/pkg_info/graph/test_data_embed/predefined_graph_has_duplicated_ext_group.json b/core/src/ten_rust/src/pkg_info/graph/test_data_embed/predefined_graph_has_duplicated_ext_group.json index fea0d29ecd..e2a39a420c 100644 --- a/core/src/ten_rust/src/pkg_info/graph/test_data_embed/predefined_graph_has_duplicated_ext_group.json +++ b/core/src/ten_rust/src/pkg_info/graph/test_data_embed/predefined_graph_has_duplicated_ext_group.json @@ -10,16 +10,6 @@ "name": "some_extension", "addon": "default_extension_go", "extension_group": "some_group" - }, - { - "type": "extension_group", - "addon": "default_extension_group", - "name": "some_group" - }, - { - "type": "extension_group", - "addon": "default_extension_group_1", - "name": "some_group" } ] } diff --git a/core/src/ten_rust/src/pkg_info/graph/test_data_embed/predefined_graph_no_extensions.json b/core/src/ten_rust/src/pkg_info/graph/test_data_embed/predefined_graph_no_extensions.json index d568e6c089..4ced6010fb 100644 --- a/core/src/ten_rust/src/pkg_info/graph/test_data_embed/predefined_graph_no_extensions.json +++ b/core/src/ten_rust/src/pkg_info/graph/test_data_embed/predefined_graph_no_extensions.json @@ -4,13 +4,7 @@ { "name": "default", "auto_start": false, - "nodes": [ - { - "type": "extension_group", - "addon": "default_extension_group", - "name": "some_group" - } - ] + "nodes": [] } ], "uri": "http://localhost:8001" diff --git a/core/src/ten_rust/src/pkg_info/graph/test_data_embed/predefined_graph_unused_ext_group.json b/core/src/ten_rust/src/pkg_info/graph/test_data_embed/predefined_graph_unused_ext_group.json index 18d99e5a39..e2a39a420c 100644 --- a/core/src/ten_rust/src/pkg_info/graph/test_data_embed/predefined_graph_unused_ext_group.json +++ b/core/src/ten_rust/src/pkg_info/graph/test_data_embed/predefined_graph_unused_ext_group.json @@ -10,16 +10,6 @@ "name": "some_extension", "addon": "default_extension_go", "extension_group": "some_group" - }, - { - "type": "extension_group", - "addon": "default_extension_group", - "name": "some_group" - }, - { - "type": "extension_group", - "addon": "default_extension_group", - "name": "some_group_1" } ] } diff --git a/packages/example_extension_groups/BUILD.gn b/packages/example_extension_groups/BUILD.gn deleted file mode 100644 index 00b7422dde..0000000000 --- a/packages/example_extension_groups/BUILD.gn +++ /dev/null @@ -1,14 +0,0 @@ -# -# This file is part of TEN Framework, an open source project. -# Licensed under the Apache License, Version 2.0. -# See the LICENSE file for more information. -# -import("//build/ten_runtime/options.gni") - -group("example_extension_groups") { - deps = [] - - if (ten_enable_ffmpeg_extensions) { - deps += [ "ffmpeg_extension_group" ] - } -} diff --git a/packages/example_extension_groups/ffmpeg_extension_group/BUILD.gn b/packages/example_extension_groups/ffmpeg_extension_group/BUILD.gn deleted file mode 100644 index 86db423ba8..0000000000 --- a/packages/example_extension_groups/ffmpeg_extension_group/BUILD.gn +++ /dev/null @@ -1,49 +0,0 @@ -# -# This file is part of TEN Framework, an open source project. -# Licensed under the Apache License, Version 2.0. -# See the LICENSE file for more information. -# -import("//build/feature/ten_package.gni") -import("//build/ten_runtime/feature/publish.gni") -import("//build/ten_runtime/glob.gni") -import("//build/ten_runtime/options.gni") - -ten_package("ffmpeg_extension_group") { - enable_build = true - - package_kind = "extension_group" - - resources = [ - "manifest.json", - "property.json", - ] - - sources = exec_script( - "//.gnfiles/build/scripts/glob_file.py", - [ - "--dir", - rebase_path( - "//example_extension_groups/ffmpeg_extension_group/src/*.cc"), - ], - "list lines") - sources += exec_script( - "//.gnfiles/build/scripts/glob_file.py", - [ - "--dir", - rebase_path( - "//example_extension_groups/ffmpeg_extension_group/src/*.h"), - ], - "list lines") - - sources = [ "src/main.cc" ] - include_dirs = [ "//core/src" ] - deps = [ "//core/src/ten_runtime" ] -} - -if (ten_enable_package_manager) { - ten_package_publish("upload_ffmpeg_extension_group_to_server") { - base_dir = rebase_path( - "${root_out_dir}/ten_packages/extension_group/ffmpeg_extension_group") - deps = [ ":ffmpeg_extension_group" ] - } -} diff --git a/packages/example_extension_groups/ffmpeg_extension_group/LICENSE b/packages/example_extension_groups/ffmpeg_extension_group/LICENSE deleted file mode 100644 index e37872ecc6..0000000000 --- a/packages/example_extension_groups/ffmpeg_extension_group/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright © 2024 Agora - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/packages/example_extension_groups/ffmpeg_extension_group/manifest.json b/packages/example_extension_groups/ffmpeg_extension_group/manifest.json deleted file mode 100644 index 1d944f6a11..0000000000 --- a/packages/example_extension_groups/ffmpeg_extension_group/manifest.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "extension_group", - "name": "ffmpeg_extension_group", - "version": "0.1.0", - "dependencies": [] -} \ No newline at end of file diff --git a/packages/example_extension_groups/ffmpeg_extension_group/property.json b/packages/example_extension_groups/ffmpeg_extension_group/property.json deleted file mode 100644 index 9e26dfeeb6..0000000000 --- a/packages/example_extension_groups/ffmpeg_extension_group/property.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/packages/example_extension_groups/ffmpeg_extension_group/src/main.cc b/packages/example_extension_groups/ffmpeg_extension_group/src/main.cc deleted file mode 100644 index 354d8e00d4..0000000000 --- a/packages/example_extension_groups/ffmpeg_extension_group/src/main.cc +++ /dev/null @@ -1,85 +0,0 @@ -// -// This file is part of TEN Framework, an open source project. -// Licensed under the Apache License, Version 2.0. -// See the LICENSE file for more information. -// -#include -#include -#include - -#include "ten_runtime/binding/cpp/ten.h" - -namespace ten { -namespace ffmpeg_extension { - -class ffmpeg_extension_group_t : public extension_group_t { - public: - explicit ffmpeg_extension_group_t(const char *name) - : extension_group_t(name) {} - - ~ffmpeg_extension_group_t() override = default; - - ffmpeg_extension_group_t(const ffmpeg_extension_group_t &other) = delete; - ffmpeg_extension_group_t(ffmpeg_extension_group_t &&other) = delete; - - ffmpeg_extension_group_t &operator=(const ffmpeg_extension_group_t &other) = - delete; - ffmpeg_extension_group_t &operator=(ffmpeg_extension_group_t &&other) = - delete; - - void on_create_extensions(ten::ten_env_t &ten_env) override { - auto extensions = std::make_shared>(); - - // Create 'ffmpeg muxer' extension. - if (!ten_env.addon_create_extension_async( - "ffmpeg_muxer", "ffmpeg_muxer", - [extensions](ten::ten_env_t &ten_env, ten::extension_t &extension) { - extensions->push_back(&extension); - - if (extensions->size() == 2) { - ten_env.on_create_extensions_done(*extensions); - } - })) { - TEN_LOGE("Failed to find the addon for extension ffmpeg_muxer"); -#if defined(_DEBUG) - TEN_ASSERT(0, "Should not happen."); -#endif - } - - // Create 'ffmpeg demuxer' extension. - if (!ten_env.addon_create_extension_async( - "ffmpeg_demuxer", "ffmpeg_demuxer", - [extensions](ten::ten_env_t &ten_env, ten::extension_t &extension) { - extensions->push_back(&extension); - - if (extensions->size() == 2) { - ten_env.on_create_extensions_done(*extensions); - } - })) { - TEN_LOGE("Failed to find the addon for extension ffmpeg_demuxer"); -#if defined(_DEBUG) - TEN_ASSERT(0, "Should not happen."); -#endif - } - } - - void on_destroy_extensions( - ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } - - private: - void on_addon_create_extension_done(ten::ten_env_t &ten_env, - ten::extension_t &extension, - void *user_data) {} -}; - -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(ffmpeg_extension_group, - ffmpeg_extension_group_t); - -} // namespace ffmpeg_extension -} // namespace ten diff --git a/tests/ten_runtime/integration/cpp/ffmpeg_basic/ffmpeg_basic_app_source/property.json b/tests/ten_runtime/integration/cpp/ffmpeg_basic/ffmpeg_basic_app_source/property.json index 9219cf7ede..c294dd0ab1 100644 --- a/tests/ten_runtime/integration/cpp/ffmpeg_basic/ffmpeg_basic_app_source/property.json +++ b/tests/ten_runtime/integration/cpp/ffmpeg_basic/ffmpeg_basic_app_source/property.json @@ -7,21 +7,6 @@ "name": "default", "auto_start": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, - { - "type": "extension_group", - "name": "muxer_group", - "addon": "default_extension_group" - }, - { - "type": "extension_group", - "name": "demuxer_group", - "addon": "default_extension_group" - }, { "type": "extension", "addon": "ffmpeg_client", diff --git a/tests/ten_runtime/integration/cpp/ffmpeg_bypass/ffmpeg_bypass_app_source/property.json b/tests/ten_runtime/integration/cpp/ffmpeg_bypass/ffmpeg_bypass_app_source/property.json index f0ad81d320..25383de0cf 100644 --- a/tests/ten_runtime/integration/cpp/ffmpeg_bypass/ffmpeg_bypass_app_source/property.json +++ b/tests/ten_runtime/integration/cpp/ffmpeg_bypass/ffmpeg_bypass_app_source/property.json @@ -7,21 +7,6 @@ "name": "default", "auto_start": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, - { - "type": "extension_group", - "name": "demuxer_group", - "addon": "default_extension_group" - }, - { - "type": "extension_group", - "name": "muxer_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "ffmpeg_client", diff --git a/tests/ten_runtime/integration/cpp/graph_env_var_1/client/client.cc b/tests/ten_runtime/integration/cpp/graph_env_var_1/client/client.cc index cde7e383bb..c5a28089ce 100644 --- a/tests/ten_runtime/integration/cpp/graph_env_var_1/client/client.cc +++ b/tests/ten_runtime/integration/cpp/graph_env_var_1/client/client.cc @@ -19,11 +19,6 @@ int main(int argc, char **argv) { "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension", "addon": "default_extension_cpp", diff --git a/tests/ten_runtime/integration/cpp/graph_env_var_2/client/client.cc b/tests/ten_runtime/integration/cpp/graph_env_var_2/client/client.cc index cde7e383bb..c5a28089ce 100644 --- a/tests/ten_runtime/integration/cpp/graph_env_var_2/client/client.cc +++ b/tests/ten_runtime/integration/cpp/graph_env_var_2/client/client.cc @@ -19,11 +19,6 @@ int main(int argc, char **argv) { "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension", "addon": "default_extension_cpp", diff --git a/tests/ten_runtime/integration/cpp/graph_env_var_3/client/client.cc b/tests/ten_runtime/integration/cpp/graph_env_var_3/client/client.cc index ad5526deb0..9fa8b10476 100644 --- a/tests/ten_runtime/integration/cpp/graph_env_var_3/client/client.cc +++ b/tests/ten_runtime/integration/cpp/graph_env_var_3/client/client.cc @@ -19,11 +19,6 @@ int main(int argc, char **argv) { "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension", "addon": "default_extension_cpp", diff --git a/tests/ten_runtime/integration/cpp/hello_world/client/client.cc b/tests/ten_runtime/integration/cpp/hello_world/client/client.cc index ec5994c8e8..d83e1af449 100644 --- a/tests/ten_runtime/integration/cpp/hello_world/client/client.cc +++ b/tests/ten_runtime/integration/cpp/hello_world/client/client.cc @@ -19,11 +19,6 @@ int main(int argc, char **argv) { "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension", "addon": "default_extension_cpp", diff --git a/tests/ten_runtime/integration/cpp/hello_world/hello_world_app_source/property.json b/tests/ten_runtime/integration/cpp/hello_world/hello_world_app_source/property.json index 14af408271..95a06ca723 100644 --- a/tests/ten_runtime/integration/cpp/hello_world/hello_world_app_source/property.json +++ b/tests/ten_runtime/integration/cpp/hello_world/hello_world_app_source/property.json @@ -6,11 +6,6 @@ "name": "default", "auto_start": false, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "default_extension_cpp", diff --git a/tests/ten_runtime/integration/cpp/http_basic/restful_app_source/property.json b/tests/ten_runtime/integration/cpp/http_basic/restful_app_source/property.json index eca7eb44a1..91ed0a2028 100644 --- a/tests/ten_runtime/integration/cpp/http_basic/restful_app_source/property.json +++ b/tests/ten_runtime/integration/cpp/http_basic/restful_app_source/property.json @@ -5,11 +5,6 @@ "name": "http_service", "auto_start": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "simple_http_server_cpp", diff --git a/tests/ten_runtime/integration/cpp/large_result/large_result_source/property.json b/tests/ten_runtime/integration/cpp/large_result/large_result_source/property.json index ca23794a53..a5096146de 100644 --- a/tests/ten_runtime/integration/cpp/large_result/large_result_source/property.json +++ b/tests/ten_runtime/integration/cpp/large_result/large_result_source/property.json @@ -5,11 +5,6 @@ "name": "default", "auto_start": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "simple_http_server_cpp", diff --git a/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/property.json b/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/property.json index 4e11813d66..f809b7b370 100644 --- a/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/property.json +++ b/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/property.json @@ -9,9 +9,10 @@ "singleton": true, "nodes": [ { - "type": "extension_group", - "name": "nodetest", - "addon": "nodetest" + "type": "extension", + "name": "A", + "addon": "extension_a", + "extension_group": "nodetest" } ] } diff --git a/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/ten_packages/extension/default_extension_go/extension.go b/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/ten_packages/extension/default_extension_go/extension.go index 32ff300281..259b501655 100644 --- a/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/ten_packages/extension/default_extension_go/extension.go +++ b/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/ten_packages/extension/default_extension_go/extension.go @@ -42,6 +42,10 @@ type aExtension struct { baseExtension } +func newAExtension(name string) ten.Extension { + return &aExtension{} +} + func (p *aExtension) OnCmd( tenEnv ten.TenEnv, cmd ten.Cmd, @@ -218,8 +222,11 @@ func (p *nodeTestGroup) OnCreateExtensions( func init() { // Register addon - ten.RegisterAddonAsExtensionGroup( - "nodetest", - ten.NewDefaultExtensionGroupAddon(newNodeTestGroup), + err := ten.RegisterAddonAsExtension( + "extension_a", + ten.NewDefaultExtensionAddon(newAExtension), ) + if err != nil { + panic("register addon failed") + } } diff --git a/tests/ten_runtime/integration/go/close_app_go/close_app_go_app/property.json b/tests/ten_runtime/integration/go/close_app_go/close_app_go_app/property.json index 8d63cb8728..015f39a1ba 100644 --- a/tests/ten_runtime/integration/go/close_app_go/close_app_go_app/property.json +++ b/tests/ten_runtime/integration/go/close_app_go/close_app_go_app/property.json @@ -9,11 +9,6 @@ "auto_start": true, "singleton": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "default_extension_go", diff --git a/tests/ten_runtime/integration/go/exit_signal/exit_signal_app/property.json b/tests/ten_runtime/integration/go/exit_signal/exit_signal_app/property.json index 23a337d1d4..a90afe0164 100644 --- a/tests/ten_runtime/integration/go/exit_signal/exit_signal_app/property.json +++ b/tests/ten_runtime/integration/go/exit_signal/exit_signal_app/property.json @@ -5,11 +5,6 @@ "name": "default", "auto_start": true, "nodes": [ - { - "type": "extension_group", - "name": "default", - "addon": "default_extension_group" - }, { "type": "extension", "extension_group": "default", diff --git a/tests/ten_runtime/integration/go/expired_ten_go/expired_ten_go_app/property.json b/tests/ten_runtime/integration/go/expired_ten_go/expired_ten_go_app/property.json index 1f2c83bf08..37d2599a40 100644 --- a/tests/ten_runtime/integration/go/expired_ten_go/expired_ten_go_app/property.json +++ b/tests/ten_runtime/integration/go/expired_ten_go/expired_ten_go_app/property.json @@ -8,11 +8,6 @@ "auto_start": true, "singleton": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "extension_a", diff --git a/tests/ten_runtime/integration/go/frequently_cgo_call_go/frequently_cgo_call_go_app/property.json b/tests/ten_runtime/integration/go/frequently_cgo_call_go/frequently_cgo_call_go_app/property.json index 447298378c..37d2599a40 100644 --- a/tests/ten_runtime/integration/go/frequently_cgo_call_go/frequently_cgo_call_go_app/property.json +++ b/tests/ten_runtime/integration/go/frequently_cgo_call_go/frequently_cgo_call_go_app/property.json @@ -8,11 +8,6 @@ "auto_start": true, "singleton": true, "nodes": [ - { - "type": "extension_group", - "addon": "default_extension_group", - "name": "default_extension_group" - }, { "type": "extension", "name": "extension_a", diff --git a/tests/ten_runtime/integration/go/handle_error_go/handle_error_go_app/property.json b/tests/ten_runtime/integration/go/handle_error_go/handle_error_go_app/property.json index 1f2c83bf08..37d2599a40 100644 --- a/tests/ten_runtime/integration/go/handle_error_go/handle_error_go_app/property.json +++ b/tests/ten_runtime/integration/go/handle_error_go/handle_error_go_app/property.json @@ -8,11 +8,6 @@ "auto_start": true, "singleton": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "extension_a", diff --git a/tests/ten_runtime/integration/go/prepare_to_stop_go/prepare_to_stop_go_app/property.json b/tests/ten_runtime/integration/go/prepare_to_stop_go/prepare_to_stop_go_app/property.json index ead4ff8bdf..d6fd89c849 100644 --- a/tests/ten_runtime/integration/go/prepare_to_stop_go/prepare_to_stop_go_app/property.json +++ b/tests/ten_runtime/integration/go/prepare_to_stop_go/prepare_to_stop_go_app/property.json @@ -8,11 +8,6 @@ "auto_start": true, "singleton": true, "nodes": [ - { - "type": "extension_group", - "name": "nodetest_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "A", diff --git a/tests/ten_runtime/integration/go/return_result_go/return_result_go_app/property.json b/tests/ten_runtime/integration/go/return_result_go/return_result_go_app/property.json index 1f2c83bf08..37d2599a40 100644 --- a/tests/ten_runtime/integration/go/return_result_go/return_result_go_app/property.json +++ b/tests/ten_runtime/integration/go/return_result_go/return_result_go_app/property.json @@ -8,11 +8,6 @@ "auto_start": true, "singleton": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "extension_a", diff --git a/tests/ten_runtime/integration/go/return_value_go/return_value_go_app/property.json b/tests/ten_runtime/integration/go/return_value_go/return_value_go_app/property.json index 1f2c83bf08..37d2599a40 100644 --- a/tests/ten_runtime/integration/go/return_value_go/return_value_go_app/property.json +++ b/tests/ten_runtime/integration/go/return_value_go/return_value_go_app/property.json @@ -8,11 +8,6 @@ "auto_start": true, "singleton": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "extension_a", diff --git a/tests/ten_runtime/integration/go/send_json_go/send_json_go_app/property.json b/tests/ten_runtime/integration/go/send_json_go/send_json_go_app/property.json index a8908c1ddb..5ba7982861 100644 --- a/tests/ten_runtime/integration/go/send_json_go/send_json_go_app/property.json +++ b/tests/ten_runtime/integration/go/send_json_go/send_json_go_app/property.json @@ -8,11 +8,6 @@ "auto_start": true, "singleton": true, "nodes": [ - { - "type": "extension_group", - "name": "nodetest_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "A", diff --git a/tests/ten_runtime/integration/go/start_app_sync_go/start_app_sync_go_app/property.json b/tests/ten_runtime/integration/go/start_app_sync_go/start_app_sync_go_app/property.json index 068bc7abff..0c0c33d467 100644 --- a/tests/ten_runtime/integration/go/start_app_sync_go/start_app_sync_go_app/property.json +++ b/tests/ten_runtime/integration/go/start_app_sync_go/start_app_sync_go_app/property.json @@ -8,11 +8,6 @@ "auto_start": true, "singleton": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "default_extension_go", diff --git a/tests/ten_runtime/integration/go/three_extension_cmd_go/client/client.cc b/tests/ten_runtime/integration/go/three_extension_cmd_go/client/client.cc index 1cf0391800..2c3d87f93a 100644 --- a/tests/ten_runtime/integration/go/three_extension_cmd_go/client/client.cc +++ b/tests/ten_runtime/integration/go/three_extension_cmd_go/client/client.cc @@ -19,12 +19,6 @@ int main(TEN_UNUSED int argc, TEN_UNUSED char **argv) { "type": "start_graph", "seq_id": "156", "nodes": [ - { - "type": "extension_group", - "app": "msgpack://127.0.0.1:8007/", - "addon": "default_extension_group", - "name": "nodetest_group" - }, { "type": "extension", "app": "msgpack://127.0.0.1:8007/", diff --git a/tests/ten_runtime/integration/go/transfer_pointer_go/transfer_pointer_go_app/property.json b/tests/ten_runtime/integration/go/transfer_pointer_go/transfer_pointer_go_app/property.json index 1f2c83bf08..37d2599a40 100644 --- a/tests/ten_runtime/integration/go/transfer_pointer_go/transfer_pointer_go_app/property.json +++ b/tests/ten_runtime/integration/go/transfer_pointer_go/transfer_pointer_go_app/property.json @@ -8,11 +8,6 @@ "auto_start": true, "singleton": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "extension_a", diff --git a/tests/ten_runtime/integration/go/two_extension_one_group_cmd_go/client/client.cc b/tests/ten_runtime/integration/go/two_extension_one_group_cmd_go/client/client.cc index 0d46794c98..a6bfcb88e0 100644 --- a/tests/ten_runtime/integration/go/two_extension_one_group_cmd_go/client/client.cc +++ b/tests/ten_runtime/integration/go/two_extension_one_group_cmd_go/client/client.cc @@ -18,12 +18,6 @@ int main(TEN_UNUSED int argc, TEN_UNUSED char **argv) { "type": "start_graph", "seq_id": "156", "nodes": [ - { - "app": "msgpack://127.0.0.1:8007/", - "type": "extension_group", - "addon": "nodetest", - "name": "nodetest" - }, { "type": "extension", "app": "msgpack://127.0.0.1:8007/", diff --git a/tests/ten_runtime/integration/python/aio_http_server_python/aio_http_server_python_app/property.json b/tests/ten_runtime/integration/python/aio_http_server_python/aio_http_server_python_app/property.json index 8a644fda18..a18433525f 100644 --- a/tests/ten_runtime/integration/python/aio_http_server_python/aio_http_server_python_app/property.json +++ b/tests/ten_runtime/integration/python/aio_http_server_python/aio_http_server_python_app/property.json @@ -6,16 +6,6 @@ "name": "default", "auto_start": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, - { - "type": "extension_group", - "name": "test", - "addon": "default_extension_group" - }, { "type": "extension", "name": "aio_http_server_python", diff --git a/tests/ten_runtime/integration/python/async_io_basic_python/async_io_basic_python_app/property.json b/tests/ten_runtime/integration/python/async_io_basic_python/async_io_basic_python_app/property.json index 0b10c4c2a7..3a8f23fac0 100644 --- a/tests/ten_runtime/integration/python/async_io_basic_python/async_io_basic_python_app/property.json +++ b/tests/ten_runtime/integration/python/async_io_basic_python/async_io_basic_python_app/property.json @@ -6,16 +6,6 @@ "name": "default", "auto_start": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, - { - "type": "extension_group", - "name": "test", - "addon": "default_extension_group" - }, { "type": "extension", "name": "simple_http_server_cpp", diff --git a/tests/ten_runtime/integration/python/cpp_app_multi_process_python/cpp_app_multi_process_python_app_source/property.json b/tests/ten_runtime/integration/python/cpp_app_multi_process_python/cpp_app_multi_process_python_app_source/property.json index ca9bf7e4c1..0a465a6a1f 100644 --- a/tests/ten_runtime/integration/python/cpp_app_multi_process_python/cpp_app_multi_process_python_app_source/property.json +++ b/tests/ten_runtime/integration/python/cpp_app_multi_process_python/cpp_app_multi_process_python_app_source/property.json @@ -6,11 +6,6 @@ "name": "default", "auto_start": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "simple_http_server_cpp", diff --git a/tests/ten_runtime/integration/python/cpp_app_python/cpp_app_python_app_source/property.json b/tests/ten_runtime/integration/python/cpp_app_python/cpp_app_python_app_source/property.json index a1bbb8e2f1..92ecb6a82c 100644 --- a/tests/ten_runtime/integration/python/cpp_app_python/cpp_app_python_app_source/property.json +++ b/tests/ten_runtime/integration/python/cpp_app_python/cpp_app_python_app_source/property.json @@ -6,11 +6,6 @@ "name": "default", "auto_start": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "simple_http_server_cpp", diff --git a/tests/ten_runtime/integration/python/get_set_prop_python/get_set_prop_python_app/property.json b/tests/ten_runtime/integration/python/get_set_prop_python/get_set_prop_python_app/property.json index 41c9c02b96..6bb79856f3 100644 --- a/tests/ten_runtime/integration/python/get_set_prop_python/get_set_prop_python_app/property.json +++ b/tests/ten_runtime/integration/python/get_set_prop_python/get_set_prop_python_app/property.json @@ -6,16 +6,6 @@ "name": "default", "auto_start": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, - { - "type": "extension_group", - "name": "echo_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "simple_http_server_cpp", diff --git a/tests/ten_runtime/integration/python/go_app_cythonize/go_app_cythonize_app/property.json b/tests/ten_runtime/integration/python/go_app_cythonize/go_app_cythonize_app/property.json index 3631a072e9..d0ccbb78a6 100644 --- a/tests/ten_runtime/integration/python/go_app_cythonize/go_app_cythonize_app/property.json +++ b/tests/ten_runtime/integration/python/go_app_cythonize/go_app_cythonize_app/property.json @@ -6,11 +6,6 @@ "name": "default", "auto_start": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "simple_http_server_cpp", diff --git a/tests/ten_runtime/integration/python/go_app_partially_cythonize/go_app_partially_cythonize_app/property.json b/tests/ten_runtime/integration/python/go_app_partially_cythonize/go_app_partially_cythonize_app/property.json index 3631a072e9..d0ccbb78a6 100644 --- a/tests/ten_runtime/integration/python/go_app_partially_cythonize/go_app_partially_cythonize_app/property.json +++ b/tests/ten_runtime/integration/python/go_app_partially_cythonize/go_app_partially_cythonize_app/property.json @@ -6,11 +6,6 @@ "name": "default", "auto_start": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "simple_http_server_cpp", diff --git a/tests/ten_runtime/integration/python/go_app_python/go_app_python_app/property.json b/tests/ten_runtime/integration/python/go_app_python/go_app_python_app/property.json index 3631a072e9..d0ccbb78a6 100644 --- a/tests/ten_runtime/integration/python/go_app_python/go_app_python_app/property.json +++ b/tests/ten_runtime/integration/python/go_app_python/go_app_python_app/property.json @@ -6,11 +6,6 @@ "name": "default", "auto_start": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "simple_http_server_cpp", diff --git a/tests/ten_runtime/integration/python/large_json_python/large_json_python_app/property.json b/tests/ten_runtime/integration/python/large_json_python/large_json_python_app/property.json index 1f19ded1af..bf321144b2 100644 --- a/tests/ten_runtime/integration/python/large_json_python/large_json_python_app/property.json +++ b/tests/ten_runtime/integration/python/large_json_python/large_json_python_app/property.json @@ -6,16 +6,6 @@ "name": "default", "auto_start": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, - { - "type": "extension_group", - "name": "test", - "addon": "default_extension_group" - }, { "type": "extension", "name": "simple_http_server_cpp", diff --git a/tests/ten_runtime/integration/python/multi_process_python/multi_process_python_app/property.json b/tests/ten_runtime/integration/python/multi_process_python/multi_process_python_app/property.json index ca9bf7e4c1..0a465a6a1f 100644 --- a/tests/ten_runtime/integration/python/multi_process_python/multi_process_python_app/property.json +++ b/tests/ten_runtime/integration/python/multi_process_python/multi_process_python_app/property.json @@ -6,11 +6,6 @@ "name": "default", "auto_start": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "simple_http_server_cpp", diff --git a/tests/ten_runtime/integration/python/multiple_results_python/multiple_results_python_app/property.json b/tests/ten_runtime/integration/python/multiple_results_python/multiple_results_python_app/property.json index bc8b70a5af..a0dc31ad96 100644 --- a/tests/ten_runtime/integration/python/multiple_results_python/multiple_results_python_app/property.json +++ b/tests/ten_runtime/integration/python/multiple_results_python/multiple_results_python_app/property.json @@ -6,21 +6,6 @@ "name": "default", "auto_start": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, - { - "type": "extension_group", - "name": "test1", - "addon": "default_extension_group" - }, - { - "type": "extension_group", - "name": "test2", - "addon": "default_extension_group" - }, { "type": "extension", "name": "simple_http_server_cpp", diff --git a/tests/ten_runtime/integration/python/resp_handler_yield_python/resp_handler_yield_python_app/property.json b/tests/ten_runtime/integration/python/resp_handler_yield_python/resp_handler_yield_python_app/property.json index 0b10c4c2a7..3a8f23fac0 100644 --- a/tests/ten_runtime/integration/python/resp_handler_yield_python/resp_handler_yield_python_app/property.json +++ b/tests/ten_runtime/integration/python/resp_handler_yield_python/resp_handler_yield_python_app/property.json @@ -6,16 +6,6 @@ "name": "default", "auto_start": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, - { - "type": "extension_group", - "name": "test", - "addon": "default_extension_group" - }, { "type": "extension", "name": "simple_http_server_cpp", diff --git a/tests/ten_runtime/integration/python/send_cmd_discard_result_python/send_cmd_discard_result_python_app/property.json b/tests/ten_runtime/integration/python/send_cmd_discard_result_python/send_cmd_discard_result_python_app/property.json index dc0afba4a1..74f3bea7bb 100644 --- a/tests/ten_runtime/integration/python/send_cmd_discard_result_python/send_cmd_discard_result_python_app/property.json +++ b/tests/ten_runtime/integration/python/send_cmd_discard_result_python/send_cmd_discard_result_python_app/property.json @@ -6,21 +6,6 @@ "name": "default", "auto_start": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, - { - "type": "extension_group", - "name": "test1", - "addon": "default_extension_group" - }, - { - "type": "extension_group", - "name": "test2", - "addon": "default_extension_group" - }, { "type": "extension", "name": "simple_http_server_cpp", diff --git a/tests/ten_runtime/integration/python/send_cmd_python/send_cmd_python_app/property.json b/tests/ten_runtime/integration/python/send_cmd_python/send_cmd_python_app/property.json index 0b10c4c2a7..3a8f23fac0 100644 --- a/tests/ten_runtime/integration/python/send_cmd_python/send_cmd_python_app/property.json +++ b/tests/ten_runtime/integration/python/send_cmd_python/send_cmd_python_app/property.json @@ -6,16 +6,6 @@ "name": "default", "auto_start": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, - { - "type": "extension_group", - "name": "test", - "addon": "default_extension_group" - }, { "type": "extension", "name": "simple_http_server_cpp", diff --git a/tests/ten_runtime/integration/python/send_data_python/send_data_python_app/property.json b/tests/ten_runtime/integration/python/send_data_python/send_data_python_app/property.json index 282b22b194..0d1809c4ad 100644 --- a/tests/ten_runtime/integration/python/send_data_python/send_data_python_app/property.json +++ b/tests/ten_runtime/integration/python/send_data_python/send_data_python_app/property.json @@ -6,11 +6,6 @@ "name": "default", "auto_start": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "simple_http_server_cpp", diff --git a/tests/ten_runtime/integration/python/send_json_python/send_json_python_app/property.json b/tests/ten_runtime/integration/python/send_json_python/send_json_python_app/property.json index 0b10c4c2a7..3a8f23fac0 100644 --- a/tests/ten_runtime/integration/python/send_json_python/send_json_python_app/property.json +++ b/tests/ten_runtime/integration/python/send_json_python/send_json_python_app/property.json @@ -6,16 +6,6 @@ "name": "default", "auto_start": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, - { - "type": "extension_group", - "name": "test", - "addon": "default_extension_group" - }, { "type": "extension", "name": "simple_http_server_cpp", diff --git a/tests/ten_runtime/integration/python/send_recv_image_python/send_recv_image_python_app/property.json b/tests/ten_runtime/integration/python/send_recv_image_python/send_recv_image_python_app/property.json index 4b4c799995..c86d6fdfcb 100644 --- a/tests/ten_runtime/integration/python/send_recv_image_python/send_recv_image_python_app/property.json +++ b/tests/ten_runtime/integration/python/send_recv_image_python/send_recv_image_python_app/property.json @@ -6,11 +6,6 @@ "name": "default", "auto_start": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "simple_http_server_cpp", diff --git a/tests/ten_runtime/integration/python/send_recv_pcm_python/send_recv_pcm_python_app/property.json b/tests/ten_runtime/integration/python/send_recv_pcm_python/send_recv_pcm_python_app/property.json index 63ef27777a..58bef9bb8e 100644 --- a/tests/ten_runtime/integration/python/send_recv_pcm_python/send_recv_pcm_python_app/property.json +++ b/tests/ten_runtime/integration/python/send_recv_pcm_python/send_recv_pcm_python_app/property.json @@ -6,11 +6,6 @@ "name": "default", "auto_start": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "simple_http_server_cpp", diff --git a/tests/ten_runtime/integration/python/unused_addon_python/unused_addon_python_app/property.json b/tests/ten_runtime/integration/python/unused_addon_python/unused_addon_python_app/property.json index 75192c5eef..762e84c187 100644 --- a/tests/ten_runtime/integration/python/unused_addon_python/unused_addon_python_app/property.json +++ b/tests/ten_runtime/integration/python/unused_addon_python/unused_addon_python_app/property.json @@ -6,11 +6,6 @@ "name": "default", "auto_start": true, "nodes": [ - { - "type": "extension_group", - "name": "default_extension_group", - "addon": "default_extension_group" - }, { "type": "extension", "name": "simple_http_server_cpp", diff --git a/tests/ten_runtime/smoke/audio_frame_test/basic.cc b/tests/ten_runtime/smoke/audio_frame_test/basic.cc index 02362a25e5..c88637718d 100644 --- a/tests/ten_runtime/smoke/audio_frame_test/basic.cc +++ b/tests/ten_runtime/smoke/audio_frame_test/basic.cc @@ -100,11 +100,6 @@ TEST(AudioFrameTest, Basic) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "audio_frame_basic__test_extension_1", diff --git a/tests/ten_runtime/smoke/audio_frame_test/create_from_json.cc b/tests/ten_runtime/smoke/audio_frame_test/create_from_json.cc index 5489cde344..3008abf905 100644 --- a/tests/ten_runtime/smoke/audio_frame_test/create_from_json.cc +++ b/tests/ten_runtime/smoke/audio_frame_test/create_from_json.cc @@ -121,11 +121,6 @@ TEST(AudioFrameTest, CreateFromJson) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "audio_frame_create_from_json__test_extension_1", diff --git a/tests/ten_runtime/smoke/audio_frame_test/from_json.cc b/tests/ten_runtime/smoke/audio_frame_test/from_json.cc index aa7d4b2cec..85c52c7983 100644 --- a/tests/ten_runtime/smoke/audio_frame_test/from_json.cc +++ b/tests/ten_runtime/smoke/audio_frame_test/from_json.cc @@ -120,11 +120,6 @@ TEST(AudioFrameTest, FromJson) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "audio_frame_from_json__test_extension_1", diff --git a/tests/ten_runtime/smoke/audio_frame_test/multi_dest_pcm_frame.cc b/tests/ten_runtime/smoke/audio_frame_test/multi_dest_pcm_frame.cc index f9fbc2fb38..bf4d97d5d4 100644 --- a/tests/ten_runtime/smoke/audio_frame_test/multi_dest_pcm_frame.cc +++ b/tests/ten_runtime/smoke/audio_frame_test/multi_dest_pcm_frame.cc @@ -181,11 +181,6 @@ TEST(AudioFrameTest, MultiDestAudioFrame) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "extension 1", "addon": "multi_dest_audio_frame__extension_1", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_connect_cmd.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_connect_cmd.cc index ff2dc50332..160231a876 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_connect_cmd.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_connect_cmd.cc @@ -46,28 +46,6 @@ class test_extension_2 : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - extensions.push_back(new test_extension_2("test_extension_2")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -96,9 +74,10 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - cmd_mapping_start_graph_cmd_extension_1__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(cmd_conversion_connect_cmd_extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(cmd_conversion_connect_cmd_extension_2, + test_extension_2); } // namespace @@ -117,20 +96,27 @@ TEST(CmdConversionTest, CmdConversionConnectCmd) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "cmd_mapping_start_graph_cmd_extension_1", - "addon": "cmd_mapping_start_graph_cmd_extension_1__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "app": "msgpack://127.0.0.1:8001/", + "addon": "cmd_conversion_connect_cmd_extension_1", + "extension_group": "cmd_conversion_connect_cmd_extension_group" + },{ + "type": "extension", + "name": "test_extension_2", + "app": "msgpack://127.0.0.1:8001/", + "addon": "cmd_conversion_connect_cmd_extension_2", + "extension_group": "cmd_conversion_connect_cmd_extension_group" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", - "extension_group": "cmd_mapping_start_graph_cmd_extension_1", + "extension_group": "cmd_conversion_connect_cmd_extension_group", "extension": "test_extension_1", "cmd": [{ "name": "hello_world", "dest": [{ "app": "msgpack://127.0.0.1:8001/", - "extension_group": "cmd_mapping_start_graph_cmd_extension_1", + "extension_group": "cmd_conversion_connect_cmd_extension_group", "extension": "test_extension_2", "msg_conversion": { "type": "per_property", @@ -155,7 +141,7 @@ TEST(CmdConversionTest, CmdConversionConnectCmd) { // NOLINT "seq_id": "137", "dest": [{ "app": "msgpack://127.0.0.1:8001/", - "extension_group": "cmd_mapping_start_graph_cmd_extension_1", + "extension_group": "cmd_conversion_connect_cmd_extension_group", "extension": "test_extension_1" }] } diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_data.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_data.cc index 3cc2d1b0ee..360bbe5a2e 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_data.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_data.cc @@ -76,28 +76,6 @@ class test_extension_2 : public ten::extension_t { bool data_received = false; }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - extensions.push_back(new test_extension_2("test_extension_2")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -124,19 +102,25 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "cmd_mapping_graph_extension_1", - "addon": "cmd_mapping_data_extension_1__extension_group" + "type": "extension", + "name": "test_extension_1", + "addon": "cmd_mapping_data_extension_1", + "extension_group": "cmd_mapping_data_extension_group" + },{ + "type": "extension", + "name": "test_extension_2", + "addon": "cmd_mapping_data_extension_2", + "extension_group": "cmd_mapping_data_extension_group" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", - "extension_group": "cmd_mapping_graph_extension_1", + "extension_group": "cmd_mapping_data_extension_group", "extension": "test_extension_1", "data": [{ "name": "aaa", "dest": [{ "app": "msgpack://127.0.0.1:8001/", - "extension_group": "cmd_mapping_graph_extension_1", + "extension_group": "cmd_mapping_data_extension_group", "extension": "test_extension_2", "msg_conversion": { "type": "per_property", @@ -181,8 +165,10 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - cmd_mapping_data_extension_1__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(cmd_mapping_data_extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(cmd_mapping_data_extension_2, + test_extension_2); } // namespace @@ -203,7 +189,7 @@ TEST(CmdConversionTest, CmdConversionData) { // NOLINT "dest": [{ "app": "msgpack://127.0.0.1:8001/", "graph": "default", - "extension_group": "cmd_mapping_graph_extension_1", + "extension_group": "cmd_mapping_data_extension_group", "extension": "test_extension_1" }] } @@ -219,7 +205,7 @@ TEST(CmdConversionTest, CmdConversionData) { // NOLINT "dest": [{ "app": "msgpack://127.0.0.1:8001/", "graph": "default", - "extension_group": "cmd_mapping_graph_extension_1", + "extension_group": "cmd_mapping_data_extension_group", "extension": "test_extension_2" }] } diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_graph.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_graph.cc index ca0a8627f1..76054e941c 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_graph.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_graph.cc @@ -46,28 +46,6 @@ class test_extension_2 : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - extensions.push_back(new test_extension_2("test_extension_2")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -94,19 +72,25 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "cmd_mapping_graph_extension_1", - "addon": "cmd_mapping_graph_extension_1__extension_group" + "type": "extension", + "name": "test_extension_1", + "addon": "cmd_conversion_graph__extension_1", + "extension_group": "default_extension_group" + },{ + "type": "extension", + "name": "test_extension_2", + "addon": "cmd_conversion_graph__extension_2", + "extension_group": "default_extension_group" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", - "extension_group": "cmd_mapping_graph_extension_1", + "extension_group": "default_extension_group", "extension": "test_extension_1", "cmd": [{ "name": "hello_world", "dest": [{ "app": "msgpack://127.0.0.1:8001/", - "extension_group": "cmd_mapping_graph_extension_1", + "extension_group": "default_extension_group", "extension": "test_extension_2", "msg_conversion": { "type": "per_property", @@ -138,8 +122,8 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - cmd_mapping_graph_extension_1__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(cmd_conversion_graph__extension_1, test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(cmd_conversion_graph__extension_2, test_extension_2); } // namespace @@ -160,7 +144,7 @@ TEST(CmdConversionTest, CmdConversionGraph) { // NOLINT "dest": [{ "app": "msgpack://127.0.0.1:8001/", "graph": "default", - "extension_group": "cmd_mapping_graph_extension_1", + "extension_group": "default_extension_group", "extension": "test_extension_1" }] } diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_graph_default_uri.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_graph_default_uri.cc index 87eab0408f..115cefedd7 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_graph_default_uri.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_graph_default_uri.cc @@ -45,28 +45,6 @@ class test_extension_2 : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - extensions.push_back(new test_extension_2("test_extension_2")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -93,17 +71,23 @@ class test_app : public ten::app_t { "auto_start": true, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "cmd_mapping_graph_default_uri_extension_1", - "addon": "cmd_mapping_graph_default_uri_extension_1__extension_group" + "type": "extension", + "name": "test_extension_1", + "addon": "cmd_conversion_graph_default_uri_extension_1", + "extension_group": "cmd_conversion_graph_default_uri_extension_group" + },{ + "type": "extension", + "name": "test_extension_2", + "addon": "cmd_conversion_graph_default_uri_extension_2", + "extension_group": "cmd_conversion_graph_default_uri_extension_group" }], "connections": [{ - "extension_group": "cmd_mapping_graph_default_uri_extension_1", + "extension_group": "cmd_conversion_graph_default_uri_extension_group", "extension": "test_extension_1", "cmd": [{ "name": "hello_world", "dest": [{ - "extension_group": "cmd_mapping_graph_default_uri_extension_1", + "extension_group": "cmd_conversion_graph_default_uri_extension_group", "extension": "test_extension_2", "msg_conversion": { "type": "per_property", @@ -116,7 +100,7 @@ class test_app : public ten::app_t { }] }] },{ - "extension_group": "cmd_mapping_graph_default_uri_extension_1", + "extension_group": "cmd_conversion_graph_default_uri_extension_group", "extension": "test_extension_1" }] }] @@ -138,9 +122,10 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - cmd_mapping_graph_default_uri_extension_1__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + cmd_conversion_graph_default_uri_extension_1, test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + cmd_conversion_graph_default_uri_extension_2, test_extension_2); } // namespace @@ -161,7 +146,7 @@ TEST(CmdConversionTest, CmdConversionGraphDefaultUri) { // NOLINT "dest": [{ "app": "msgpack://127.0.0.1:8001/", "graph": "default", - "extension_group": "cmd_mapping_graph_default_uri_extension_1", + "extension_group": "cmd_conversion_graph_default_uri_extension_group", "extension": "test_extension_1" }] } diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path.cc index 36d4109d6a..182fa09e02 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path.cc @@ -71,10 +71,6 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "cmd_mapping_path__extension_group", - "addon": "default_extension_group" - },{ "type": "extension", "name": "test_extension_1", "addon": "cmd_mapping_path__test_extension_1", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_1.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_1.cc index 4a9b1e6538..268fc44021 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_1.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_1.cc @@ -71,10 +71,6 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "cmd_mapping_path_array_1__extension_group", - "addon": "default_extension_group" - },{ "type": "extension", "name": "test_extension_1", "addon": "cmd_mapping_path_array_1__test_extension_1", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_2.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_2.cc index f5a61a0844..e857860c09 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_2.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_2.cc @@ -73,10 +73,6 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "cmd_mapping_path_array_2__extension_group", - "addon": "default_extension_group" - },{ "type": "extension", "name": "test_extension_1", "addon": "cmd_mapping_path_array_2__test_extension_1", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_3.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_3.cc index 483a90f3a7..d893d638ad 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_3.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_3.cc @@ -73,10 +73,6 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "cmd_mapping_path_array_3__extension_group", - "addon": "default_extension_group" - },{ "type": "extension", "name": "test_extension_1", "addon": "cmd_mapping_path_array_3__test_extension_1", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_4.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_4.cc index d9e3d9ee42..a211f3b76b 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_4.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_4.cc @@ -74,10 +74,6 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "cmd_mapping_path_array_4__extension_group", - "addon": "default_extension_group" - },{ "type": "extension", "name": "test_extension_1", "addon": "cmd_mapping_path_array_4__test_extension_1", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_5.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_5.cc index b5092a6766..7ba846fc5e 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_5.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_5.cc @@ -74,10 +74,6 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "cmd_mapping_path_array_5__extension_group", - "addon": "default_extension_group" - },{ "type": "extension", "name": "test_extension_1", "addon": "cmd_mapping_path_array_5__test_extension_1", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_6.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_6.cc index fc0c674c78..c942c4e00a 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_6.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_6.cc @@ -74,10 +74,6 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "cmd_mapping_path_array_6__extension_group", - "addon": "default_extension_group" - },{ "type": "extension", "name": "test_extension_1", "addon": "cmd_mapping_path_array_6__test_extension_1", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_7.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_7.cc index 0ca5abdee3..466a116cb4 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_7.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_array_7.cc @@ -74,10 +74,6 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "cmd_mapping_path_array_7__extension_group", - "addon": "default_extension_group" - },{ "type": "extension", "name": "test_extension_1", "addon": "cmd_mapping_path_array_7__test_extension_1", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_keep_original.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_keep_original.cc index b586733e39..8a5b26e997 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_keep_original.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_keep_original.cc @@ -73,10 +73,6 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "cmd_mapping_path_keep_original__extension_group", - "addon": "default_extension_group" - },{ "type": "extension", "name": "test_extension_1", "addon": "cmd_mapping_path_keep_original__test_extension_1", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_1.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_1.cc index d923b2a015..cce21b818f 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_1.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_1.cc @@ -73,10 +73,6 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "cmd_mapping_path_nested_1__extension_group", - "addon": "default_extension_group" - },{ "type": "extension", "name": "test_extension_1", "addon": "cmd_mapping_path_nested_1__test_extension_1", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_2.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_2.cc index 690561b11b..cc1f4b4d7f 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_2.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_2.cc @@ -73,10 +73,6 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "cmd_mapping_path_nested_2__extension_group", - "addon": "default_extension_group" - },{ "type": "extension", "name": "test_extension_1", "addon": "cmd_mapping_path_nested_2__test_extension_1", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_3.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_3.cc index 6af4f089d9..e2ce37b88f 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_3.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_3.cc @@ -73,10 +73,6 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "cmd_mapping_path_nested_3__extension_group", - "addon": "default_extension_group" - },{ "type": "extension", "name": "test_extension_1", "addon": "cmd_mapping_path_nested_3__test_extension_1", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_4.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_4.cc index 76baf8aeb7..58419f7fed 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_4.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_4.cc @@ -73,10 +73,6 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "cmd_mapping_path_nested_4__extension_group", - "addon": "default_extension_group" - },{ "type": "extension", "name": "test_extension_1", "addon": "cmd_mapping_path_nested_4__test_extension_1", diff --git a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_5.cc b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_5.cc index afdcbb72e5..31270c07f6 100644 --- a/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_5.cc +++ b/tests/ten_runtime/smoke/cmd_conversion/cmd_conversion_path_nested_5.cc @@ -75,10 +75,6 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "cmd_mapping_path_nested_5__extension_group", - "addon": "default_extension_group" - },{ "type": "extension", "name": "test_extension_1", "addon": "cmd_mapping_path_nested_5__test_extension_1", diff --git a/tests/ten_runtime/smoke/cmd_result_test/multiple_result.cc b/tests/ten_runtime/smoke/cmd_result_test/multiple_result.cc index c167d4d3f8..c872747971 100644 --- a/tests/ten_runtime/smoke/cmd_result_test/multiple_result.cc +++ b/tests/ten_runtime/smoke/cmd_result_test/multiple_result.cc @@ -112,11 +112,6 @@ TEST(CmdResultTest, MultipleResult) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "multiple_result__test_extension_1", diff --git a/tests/ten_runtime/smoke/data_test/basic.cc b/tests/ten_runtime/smoke/data_test/basic.cc index 9d70e1aaa2..57d3120503 100644 --- a/tests/ten_runtime/smoke/data_test/basic.cc +++ b/tests/ten_runtime/smoke/data_test/basic.cc @@ -50,27 +50,6 @@ class test_extension : public ten::extension_t { bool received{}; }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -99,8 +78,7 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(data_basic__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(data_basic__extension, test_extension); } // namespace @@ -119,18 +97,19 @@ TEST(DataTest, Basic) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "data_basic", - "addon": "data_basic__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension", + "addon": "data_basic__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "default_extension_group" }] } })"_json); ten_test::check_status_code_is(resp, TEN_STATUS_CODE_OK); const char *str = DATA; - client->send_data("", "data_basic", "test_extension", (void *)str, - strlen(str) + 1); + client->send_data("", "default_extension_group", "test_extension", + (void *)str, strlen(str) + 1); resp = client->send_json_and_recv_resp_in_json( R"({ @@ -139,7 +118,7 @@ TEST(DataTest, Basic) { // NOLINT "seq_id": "137", "dest":[{ "app": "msgpack://127.0.0.1:8001/", - "extension_group": "data_basic", + "extension_group": "default_extension_group", "extension": "test_extension" }] } diff --git a/tests/ten_runtime/smoke/data_test/basic_2.cc b/tests/ten_runtime/smoke/data_test/basic_2.cc index ad232d1442..b990838258 100644 --- a/tests/ten_runtime/smoke/data_test/basic_2.cc +++ b/tests/ten_runtime/smoke/data_test/basic_2.cc @@ -99,11 +99,6 @@ TEST(DataTest, Basic2) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "data_basic_2__test_extension_1", diff --git a/tests/ten_runtime/smoke/data_test/create_from_json.cc b/tests/ten_runtime/smoke/data_test/create_from_json.cc index ecef664eef..4c5548d292 100644 --- a/tests/ten_runtime/smoke/data_test/create_from_json.cc +++ b/tests/ten_runtime/smoke/data_test/create_from_json.cc @@ -110,11 +110,6 @@ TEST(DataTest, CreateFromJson) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "data_create_from_json__test_extension_1", diff --git a/tests/ten_runtime/smoke/data_test/from_json.cc b/tests/ten_runtime/smoke/data_test/from_json.cc index 77125517c5..a77b08de8c 100644 --- a/tests/ten_runtime/smoke/data_test/from_json.cc +++ b/tests/ten_runtime/smoke/data_test/from_json.cc @@ -108,11 +108,6 @@ TEST(DataTest, FromJson) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "data_from_json__test_extension_1", diff --git a/tests/ten_runtime/smoke/data_test/multi_dest_data.cc b/tests/ten_runtime/smoke/data_test/multi_dest_data.cc index 4487945a67..bfc4915a10 100644 --- a/tests/ten_runtime/smoke/data_test/multi_dest_data.cc +++ b/tests/ten_runtime/smoke/data_test/multi_dest_data.cc @@ -170,11 +170,6 @@ TEST(DataTest, MultiDestData) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "extension 1", "addon": "multi_dest_data__extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_extensions_init_dependency.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_extensions_init_dependency.cc index 16e6f225eb..ed8bc30d34 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_extensions_init_dependency.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_extensions_init_dependency.cc @@ -120,28 +120,6 @@ class test_extension_2 : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - extensions.push_back(new test_extension_2("test_extension_2")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -170,8 +148,8 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - basic_extensions_init_dependency__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(basic_extensions_init_dependency__extension_1, test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(basic_extensions_init_dependency__extension_2, test_extension_2); } // namespace @@ -190,18 +168,15 @@ TEST(ExtensionTest, BasicExtensionsInitDependency) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extensions_init_dependency", - "addon": "basic_extensions_init_dependency__extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", + "addon": "basic_extensions_init_dependency__extension_1", "extension_group": "basic_extensions_init_dependency", "app": "msgpack://127.0.0.1:8001/" },{ "type": "extension", "name": "test_extension_2", + "addon": "basic_extensions_init_dependency__extension_2", "extension_group": "basic_extensions_init_dependency", "app": "msgpack://127.0.0.1:8001/" }], diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_hello_world_1.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_hello_world_1.cc index 2c296aa3a7..018a5136fc 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_hello_world_1.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_hello_world_1.cc @@ -79,11 +79,6 @@ TEST(ExtensionTest, BasicHelloWorld1) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension", "addon": "basic_hello_world_1__test_extension", diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_hello_world_2.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_hello_world_2.cc index 9a818e86a0..1bec52e9d2 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_hello_world_2.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_hello_world_2.cc @@ -30,27 +30,6 @@ class test_extension : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -79,8 +58,8 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(basic_hello_world_2__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(basic_hello_world_2__extension, + test_extension); } // namespace @@ -98,13 +77,9 @@ TEST(ExtensionTest, BasicHelloWorld2) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "basic_hello_world_2__extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension", + "addon": "basic_hello_world_2__extension", "extension_group": "test_extension_group", "app": "msgpack://127.0.0.1:8001/" }] diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_loop.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_loop.cc index 2275a507a7..62d0ddc800 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_loop.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_loop.cc @@ -86,28 +86,6 @@ class test_extension_2 : public ten::extension_t { std::unique_ptr pending_request; }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - extensions.push_back(new test_extension_2("test_extension_2")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -136,8 +114,10 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(basic_loop__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(basic_loop__extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(basic_loop__extension_2, + test_extension_2); } // namespace @@ -155,10 +135,17 @@ TEST(ExtensionTest, BasicLoop) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "basic_loop__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "addon": "basic_loop__extension_1", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "test_extension_group" + },{ + "type": "extension", + "name": "test_extension_2", + "addon": "basic_loop__extension_2", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "test_extension_group" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_loop_cmd.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_loop_cmd.cc index bf73dceb26..3818480494 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_loop_cmd.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_loop_cmd.cc @@ -88,28 +88,6 @@ class test_extension_2 : public ten::extension_t { std::unique_ptr pending_request; }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - extensions.push_back(new test_extension_2("test_extension_2")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -138,8 +116,10 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(basic_loop_cmd__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(basic_loop_cmd__extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(basic_loop_cmd__extension_2, + test_extension_2); } // namespace @@ -157,10 +137,17 @@ TEST(ExtensionTest, BasicLoopCmd) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "basic_loop_cmd__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "addon": "basic_loop_cmd__extension_1", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "test_extension_group" + },{ + "type": "extension", + "name": "test_extension_2", + "addon": "basic_loop_cmd__extension_2", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "test_extension_group" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_loop_cmd_snap_shot.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_loop_cmd_snap_shot.cc index 313afedadd..7f08c2b322 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_loop_cmd_snap_shot.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_loop_cmd_snap_shot.cc @@ -88,28 +88,6 @@ class test_extension_2 : public ten::extension_t { std::unique_ptr pending_request; }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - extensions.push_back(new test_extension_2("test_extension_2")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -138,8 +116,10 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - basic_loop_cmd_snapshot__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(basic_loop_cmd_snapshot__extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(basic_loop_cmd_snapshot__extension_2, + test_extension_2); } // namespace @@ -157,10 +137,17 @@ TEST(ExtensionTest, BasicLoopCmdSnapShot) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "basic_loop_cmd_snapshot__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "addon": "basic_loop_cmd_snapshot__extension_1", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "test_extension_group" + },{ + "type": "extension", + "name": "test_extension_2", + "addon": "basic_loop_cmd_snapshot__extension_2", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "test_extension_group" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_msg_property_to_prop_store.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_msg_property_to_prop_store.cc index 14fca8bacf..e46b35546a 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_msg_property_to_prop_store.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_msg_property_to_prop_store.cc @@ -100,11 +100,6 @@ TEST(ExtensionTest, BasicMsgPropertyToPropStore) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "basic_msg_property_to_property_store__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_multi_app.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_multi_app.cc index 605d9ada30..484171891d 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_multi_app.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_multi_app.cc @@ -48,48 +48,6 @@ class test_extension_2 : public ten::extension_t { } }; -class test_extension_group_1 : public ten::extension_group_t { - public: - explicit test_extension_group_1(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - -class test_extension_group_2 : public ten::extension_group_t { - public: - explicit test_extension_group_2(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_2("test_extension_2")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app_1 : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -162,10 +120,10 @@ void *app_thread_2_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(basic_multi_app__extension_group_1, - test_extension_group_1); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(basic_multi_app__extension_group_2, - test_extension_group_2); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(basic_multi_app__extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(basic_multi_app__extension_2, + test_extension_2); } // namespace @@ -206,15 +164,17 @@ TEST(ExtensionTest, BasicMultiApp) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group 1", - "addon": "basic_multi_app__extension_group_1", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "addon": "basic_multi_app__extension_1", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "test_extension_group 1" },{ - "type": "extension_group", - "name": "test_extension_group 2", - "addon": "basic_multi_app__extension_group_2", - "app": "msgpack://127.0.0.1:8002/" + "type": "extension", + "name": "test_extension_2", + "addon": "basic_multi_app__extension_2", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "test_extension_group 2" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_multi_app_close_through_engine.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_multi_app_close_through_engine.cc index 7d1982dae9..b92af23a9a 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_multi_app_close_through_engine.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_multi_app_close_through_engine.cc @@ -47,48 +47,6 @@ class test_extension_2 : public ten::extension_t { } }; -class test_extension_group_1 : public ten::extension_group_t { - public: - explicit test_extension_group_1(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - -class test_extension_group_2 : public ten::extension_group_t { - public: - explicit test_extension_group_2(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_2("test_extension_2")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app_1 : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -161,12 +119,10 @@ void *app_thread_2_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - basic_multi_app_close_through_engine__extension_group_1, - test_extension_group_1); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - basic_multi_app_close_through_engine__extension_group_2, - test_extension_group_2); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + basic_multi_app_close_through_engine__extension_1, test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + basic_multi_app_close_through_engine__extension_2, test_extension_2); } // namespace @@ -193,15 +149,17 @@ TEST(ExtensionTest, BasicMultiAppCloseThroughEngine) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group 1", - "addon": "basic_multi_app_close_through_engine__extension_group_1", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "addon": "basic_multi_app_close_through_engine__extension_1", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "test_extension_group 1" },{ - "type": "extension_group", - "name": "test_extension_group 2", - "addon": "basic_multi_app_close_through_engine__extension_group_2", - "app": "msgpack://127.0.0.1:8002/" + "type": "extension", + "name": "test_extension_2", + "addon": "basic_multi_app_close_through_engine__extension_2", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "test_extension_group 2" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_multi_extension.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_multi_extension.cc index ab885515ac..be8d17c499 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_multi_extension.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_multi_extension.cc @@ -46,28 +46,6 @@ class test_extension_2 : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - extensions.push_back(new test_extension_2("test_extension_2")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -96,8 +74,10 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - basic_multi_extension__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(basic_multi_extension__extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(basic_multi_extension__extension_2, + test_extension_2); } // namespace @@ -116,20 +96,17 @@ TEST(ExtensionTest, BasicMultiExtension) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_multi_extension", - "addon": "basic_multi_extension__extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "extension_group": "basic_multi_extension", - "app": "msgpack://127.0.0.1:8001/" + "app": "msgpack://127.0.0.1:8001/", + "addon": "basic_multi_extension__extension_1" },{ "type": "extension", "name": "test_extension_2", "extension_group": "basic_multi_extension", - "app": "msgpack://127.0.0.1:8001/" + "app": "msgpack://127.0.0.1:8001/", + "addon": "basic_multi_extension__extension_2" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_multi_extension_group.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_multi_extension_group.cc index 61a0b09055..c8f2f12304 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_multi_extension_group.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_multi_extension_group.cc @@ -43,48 +43,6 @@ class test_extension_2 : public ten::extension_t { } }; -class test_extension_group_1 : public ten::extension_group_t { - public: - explicit test_extension_group_1(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - -class test_extension_group_2 : public ten::extension_group_t { - public: - explicit test_extension_group_2(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_2("test_extension_2")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -113,10 +71,10 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - basic_multi_extension_group__extension_group_1, test_extension_group_1); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - basic_multi_extension_group__extension_group_2, test_extension_group_2); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(basic_multi_extension_group__extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(basic_multi_extension_group__extension_2, + test_extension_2); } // namespace @@ -135,15 +93,17 @@ TEST(ExtensionTest, BasicMultiExtensionGroup) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_multi_extension_group__extension_group_1", - "addon": "basic_multi_extension_group__extension_group_1", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "addon": "basic_multi_extension_group__extension_1", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "basic_multi_extension_group__extension_group_1" },{ - "type": "extension_group", - "name": "basic_multi_extension_group__extension_group_2", - "addon": "basic_multi_extension_group__extension_group_2", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_2", + "addon": "basic_multi_extension_group__extension_2", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "basic_multi_extension_group__extension_group_2" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_no_init_extension_group.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_no_init_extension_group.cc index 0e881858d6..7e39d40c75 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_no_init_extension_group.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_no_init_extension_group.cc @@ -31,27 +31,6 @@ class test_extension : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -80,8 +59,8 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - basic_no_init_extension_group__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(basic_no_init_extension_group__extension, + test_extension); } // namespace @@ -99,15 +78,11 @@ TEST(ExtensionTest, BasicNoInitExtensionGroup) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_no_init_extension_group", - "addon": "basic_no_init_extension_group__extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension", "app": "msgpack://127.0.0.1:8001/", - "extension_group": "basic_no_init_extension_group" + "extension_group": "basic_no_init_extension_group", + "addon": "basic_no_init_extension_group__extension" }] } })"_json); diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_throw_exception_in_extension.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_throw_exception_in_extension.cc index 1e66be1132..20aac24b31 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_throw_exception_in_extension.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_throw_exception_in_extension.cc @@ -73,70 +73,6 @@ class test_extension_4 : public ten::extension_t { } }; -class test_extension_group_1 : public ten::extension_group_t { - public: - explicit test_extension_group_1(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - -class test_extension_group_2 : public ten::extension_group_t { - public: - explicit test_extension_group_2(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_2("test_extension_2")); - extensions.push_back(new test_extension_3("test_extension_3")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - -class test_extension_group_3 : public ten::extension_group_t { - public: - explicit test_extension_group_3(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_4("test_extension_4")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app_1 : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -146,7 +82,7 @@ class test_app_1 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8001/", "long_running_mode": true, - "log_level": 2 + "log_level": 1 } })" // clang-format on @@ -167,7 +103,7 @@ class test_app_2 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8002/", "long_running_mode": true, - "log_level": 2 + "log_level": 1 } })" // clang-format on @@ -188,7 +124,7 @@ class test_app_3 : public ten::app_t { "_ten": { "uri": "msgpack://127.0.0.1:8003/", "long_running_mode": true, - "log_level": 2 + "log_level": 1 } })" // clang-format on @@ -224,15 +160,14 @@ void *app_thread_3_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - basic_throw_exception_in_extension__extension_group_1, - test_extension_group_1); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - basic_throw_exception_in_extension__extension_group_2, - test_extension_group_2); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - basic_throw_exception_in_extension__extension_group_3, - test_extension_group_3); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(basic_throw_exception_in_extension__extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(basic_throw_exception_in_extension__extension_2, + test_extension_2); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(basic_throw_exception_in_extension__extension_3, + test_extension_3); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(basic_throw_exception_in_extension__extension_4, + test_extension_4); } // namespace @@ -261,20 +196,29 @@ TEST(ExtensionTest, BasicThrowExceptionInExtension) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_throw_exception_in_extension_1", - "addon": "basic_throw_exception_in_extension__extension_group_1", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "addon": "basic_throw_exception_in_extension__extension_1", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "basic_throw_exception_in_extension_1" },{ - "type": "extension_group", - "name": "basic_throw_exception_in_extension_2", - "addon": "basic_throw_exception_in_extension__extension_group_2", - "app": "msgpack://127.0.0.1:8002/" + "type": "extension", + "name": "test_extension_2", + "addon": "basic_throw_exception_in_extension__extension_2", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "basic_throw_exception_in_extension_2" + },{ + "type": "extension", + "name": "test_extension_3", + "addon": "basic_throw_exception_in_extension__extension_3", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "basic_throw_exception_in_extension_2" },{ - "type": "extension_group", - "name": "basic_throw_exception_in_extension_3", - "addon": "basic_throw_exception_in_extension__extension_group_3", - "app": "msgpack://127.0.0.1:8003/" + "type": "extension", + "name": "test_extension_4", + "addon": "basic_throw_exception_in_extension__extension_4", + "app": "msgpack://127.0.0.1:8003/", + "extension_group": "basic_throw_exception_in_extension_3" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_two_extensions.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_two_extensions.cc index b60662fe4e..de1d888322 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_two_extensions.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_two_extensions.cc @@ -92,11 +92,6 @@ TEST(ExtensionTest, BasicTwoExtensions) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "basic_two_extensions__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_two_standalone_extension_1.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_two_standalone_extension_1.cc index 1c9fa932b6..08103ba8b4 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_two_standalone_extension_1.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_two_standalone_extension_1.cc @@ -90,11 +90,6 @@ TEST(ExtensionTest, BasicTwoStandaloneExtension1) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "basic_two_standalone_extension_1__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/basic/basic_two_standalone_extension_2.cc b/tests/ten_runtime/smoke/extension_test/basic/basic_two_standalone_extension_2.cc index bb77aa7ed0..19481932d3 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_two_standalone_extension_2.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_two_standalone_extension_2.cc @@ -90,21 +90,11 @@ TEST(ExtensionTest, BasicTwoStandaloneExtension2) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group 1", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "basic_two_standalone_extension_2__test_extension_1", "extension_group": "test_extension_group 1", "app": "msgpack://127.0.0.1:8001/" - },{ - "type": "extension_group", - "name": "test_extension_group 2", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" },{ "type": "extension", "name": "test_extension_2", diff --git a/tests/ten_runtime/smoke/extension_test/command/command_check_cmd_out.cc b/tests/ten_runtime/smoke/extension_test/command/command_check_cmd_out.cc index f88f900b7a..fd2be2ce9d 100644 --- a/tests/ten_runtime/smoke/extension_test/command/command_check_cmd_out.cc +++ b/tests/ten_runtime/smoke/extension_test/command/command_check_cmd_out.cc @@ -54,28 +54,6 @@ class test_extension_2 : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - extensions.push_back(new test_extension_2("test_extension_2")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -102,9 +80,15 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "command_check_cmd_out_extension_1", - "addon": "command_check_cmd_out_extension_1__extension_group" + "type": "extension", + "name": "test_extension_1", + "addon": "command_check_cmd_out_extension_1__extension_1", + "extension_group": "command_check_cmd_out_extension_1" + },{ + "type": "extension", + "name": "test_extension_2", + "addon": "command_check_cmd_out_extension_1__extension_2", + "extension_group": "command_check_cmd_out_extension_1" }], "connections": [{ "extension_group": "command_check_cmd_out_extension_1", @@ -136,8 +120,10 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - command_check_cmd_out_extension_1__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(command_check_cmd_out_extension_1__extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(command_check_cmd_out_extension_1__extension_2, + test_extension_2); } // namespace diff --git a/tests/ten_runtime/smoke/extension_test/command/command_invalid_extension.cc b/tests/ten_runtime/smoke/extension_test/command/command_invalid_extension.cc index ca0d7bb2a7..31f139322d 100644 --- a/tests/ten_runtime/smoke/extension_test/command/command_invalid_extension.cc +++ b/tests/ten_runtime/smoke/extension_test/command/command_invalid_extension.cc @@ -31,27 +31,6 @@ class test_extension : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -80,8 +59,8 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - command_invalid_extension__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(command_invalid_extension__extension, + test_extension); } // namespace @@ -99,10 +78,11 @@ TEST(ExtensionTest, CommandInvalidExtension) { "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "command_invalid_extension__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension", + "addon": "command_invalid_extension__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "test_extension_group" }] } })"_json); diff --git a/tests/ten_runtime/smoke/extension_test/command/command_invalid_extension_2.cc b/tests/ten_runtime/smoke/extension_test/command/command_invalid_extension_2.cc index d03a01af5e..47f8a3f922 100644 --- a/tests/ten_runtime/smoke/extension_test/command/command_invalid_extension_2.cc +++ b/tests/ten_runtime/smoke/extension_test/command/command_invalid_extension_2.cc @@ -61,27 +61,6 @@ class test_extension : public ten::extension_t { std::unique_ptr requested_cmd; }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -110,8 +89,8 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - command_invalid_extension_2__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(command_invalid_extension_2__extension, + test_extension); } // namespace @@ -129,10 +108,11 @@ TEST(ExtensionTest, CommandInvalidExtension2) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "command_invalid_extension_2__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension", + "addon": "command_invalid_extension_2__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "test_extension_group" }] } })"_json); diff --git a/tests/ten_runtime/smoke/extension_test/command/command_invalid_extension_group.cc b/tests/ten_runtime/smoke/extension_test/command/command_invalid_extension_group.cc index 1bda2b212f..65b58454d9 100644 --- a/tests/ten_runtime/smoke/extension_test/command/command_invalid_extension_group.cc +++ b/tests/ten_runtime/smoke/extension_test/command/command_invalid_extension_group.cc @@ -31,27 +31,6 @@ class test_extension : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -80,8 +59,8 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - command_invalid_extension_group__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(command_invalid_extension_group__extension, + test_extension); } // namespace @@ -99,10 +78,11 @@ TEST(ExtensionTest, CommandInvalidExtensionGroup) { "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "command_invalid_extension_group__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension", + "addon": "command_invalid_extension_group__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "test_group" }] } })"_json); diff --git a/tests/ten_runtime/smoke/extension_test/command/command_send_enum.cc b/tests/ten_runtime/smoke/extension_test/command/command_send_enum.cc index 8c1c01dc87..02a63facf6 100644 --- a/tests/ten_runtime/smoke/extension_test/command/command_send_enum.cc +++ b/tests/ten_runtime/smoke/extension_test/command/command_send_enum.cc @@ -120,16 +120,6 @@ TEST(ExtensionTest, CommandSendEnum) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "command_send_enum__extension_group_1", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ - "type": "extension_group", - "name": "command_send_enum__extension_group_2", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "command_send_enum__extension_1", "addon": "command_send_enum__extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/command/command_send_ptr.cc b/tests/ten_runtime/smoke/extension_test/command/command_send_ptr.cc index b9b465b672..3c2a928a6e 100644 --- a/tests/ten_runtime/smoke/extension_test/command/command_send_ptr.cc +++ b/tests/ten_runtime/smoke/extension_test/command/command_send_ptr.cc @@ -114,16 +114,6 @@ TEST(ExtensionTest, CommandSendPtr) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "command_send_ptr__extension_group_1", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ - "type": "extension_group", - "name": "command_send_ptr__extension_group_2", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "command_send_ptr__extension_1", "addon": "command_send_ptr__extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/command/command_send_ptr_through_cmd.cc b/tests/ten_runtime/smoke/extension_test/command/command_send_ptr_through_cmd.cc index 10c48ee086..f0956c1d3e 100644 --- a/tests/ten_runtime/smoke/extension_test/command/command_send_ptr_through_cmd.cc +++ b/tests/ten_runtime/smoke/extension_test/command/command_send_ptr_through_cmd.cc @@ -116,16 +116,6 @@ TEST(ExtensionTest, CommandSendPtrThroughCmd) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "command_send_ptr_through_cmd__extension_group_1", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ - "type": "extension_group", - "name": "command_send_ptr_through_cmd__extension_group_2", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "command_send_ptr_through_cmd__extension_1", "addon": "command_send_ptr_through_cmd__extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively.cc b/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively.cc index 197c8ba6ba..21cb74d11f 100644 --- a/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively.cc +++ b/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively.cc @@ -86,70 +86,6 @@ class test_extension_4 : public ten::extension_t { } }; -class test_extension_group_1 : public ten::extension_group_t { - public: - explicit test_extension_group_1(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - -class test_extension_group_2 : public ten::extension_group_t { - public: - explicit test_extension_group_2(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_2("test_extension_2")); - extensions.push_back(new test_extension_3("test_extension_3")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - -class test_extension_group_3 : public ten::extension_group_t { - public: - explicit test_extension_group_3(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_4("test_extension_4")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app_1 : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -235,12 +171,14 @@ void *app_thread_3_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - command_stop_graph_actively__extension_group_1, test_extension_group_1); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - command_stop_graph_actively__extension_group_2, test_extension_group_2); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - command_stop_graph_actively__extension_group_3, test_extension_group_3); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(command_stop_graph_actively__extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(command_stop_graph_actively__extension_2, + test_extension_2); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(command_stop_graph_actively__extension_3, + test_extension_3); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(command_stop_graph_actively__extension_4, + test_extension_4); } // namespace @@ -269,20 +207,29 @@ TEST(ExtensionTest, CommandStopGraphActively) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "command_stop_graph_actively_1", - "addon": "command_stop_graph_actively__extension_group_1", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "addon": "command_stop_graph_actively__extension_1", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "command_stop_graph_actively_1" + },{ + "type": "extension", + "name": "test_extension_2", + "addon": "command_stop_graph_actively__extension_2", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "command_stop_graph_actively_2" },{ - "type": "extension_group", - "name": "command_stop_graph_actively_2", - "addon": "command_stop_graph_actively__extension_group_2", - "app": "msgpack://127.0.0.1:8002/" + "type": "extension", + "name": "test_extension_3", + "addon": "command_stop_graph_actively__extension_3", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "command_stop_graph_actively_2" },{ - "type": "extension_group", - "name": "command_stop_graph_actively_3", - "addon": "command_stop_graph_actively__extension_group_3", - "app": "msgpack://127.0.0.1:8003/" + "type": "extension", + "name": "test_extension_4", + "addon": "command_stop_graph_actively__extension_4", + "app": "msgpack://127.0.0.1:8003/", + "extension_group": "command_stop_graph_actively_3" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively_through_cmd.cc b/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively_through_cmd.cc index 0e8c794b05..ec1dc10d89 100644 --- a/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively_through_cmd.cc +++ b/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively_through_cmd.cc @@ -85,70 +85,6 @@ class test_extension_4 : public ten::extension_t { } }; -class test_extension_group_1 : public ten::extension_group_t { - public: - explicit test_extension_group_1(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - -class test_extension_group_2 : public ten::extension_group_t { - public: - explicit test_extension_group_2(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_2("test_extension_2")); - extensions.push_back(new test_extension_3("test_extension_3")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - -class test_extension_group_3 : public ten::extension_group_t { - public: - explicit test_extension_group_3(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_4("test_extension_4")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app_1 : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -234,15 +170,14 @@ void *app_thread_3_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - command_stop_graph_actively_through_cmd__extension_group_1, - test_extension_group_1); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - command_stop_graph_actively_through_cmd__extension_group_2, - test_extension_group_2); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - command_stop_graph_actively_through_cmd__extension_group_3, - test_extension_group_3); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + command_stop_graph_actively_through_cmd__extension_1, test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + command_stop_graph_actively_through_cmd__extension_2, test_extension_2); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + command_stop_graph_actively_through_cmd__extension_3, test_extension_3); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + command_stop_graph_actively_through_cmd__extension_4, test_extension_4); } // namespace @@ -271,20 +206,29 @@ TEST(ExtensionTest, CommandStopGraphActivelyThroughCmd) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "command_stop_graph_actively_through_cmd_1", - "addon": "command_stop_graph_actively_through_cmd__extension_group_1", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "addon": "command_stop_graph_actively_through_cmd__extension_1", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "command_stop_graph_actively_through_cmd_1" + },{ + "type": "extension", + "name": "test_extension_2", + "addon": "command_stop_graph_actively_through_cmd__extension_2", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "command_stop_graph_actively_through_cmd_2" },{ - "type": "extension_group", - "name": "command_stop_graph_actively_through_cmd_2", - "addon": "command_stop_graph_actively_through_cmd__extension_group_2", - "app": "msgpack://127.0.0.1:8002/" + "type": "extension", + "name": "test_extension_3", + "addon": "command_stop_graph_actively_through_cmd__extension_3", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "command_stop_graph_actively_through_cmd_2" },{ - "type": "extension_group", - "name": "command_stop_graph_actively_through_cmd_3", - "addon": "command_stop_graph_actively_through_cmd__extension_group_3", - "app": "msgpack://127.0.0.1:8003/" + "type": "extension", + "name": "test_extension_4", + "addon": "command_stop_graph_actively_through_cmd__extension_4", + "app": "msgpack://127.0.0.1:8003/", + "extension_group": "command_stop_graph_actively_through_cmd_3" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively_through_cmd_dest.cc b/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively_through_cmd_dest.cc index eadf83514e..2576e095c1 100644 --- a/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively_through_cmd_dest.cc +++ b/tests/ten_runtime/smoke/extension_test/command/command_stop_graph_actively_through_cmd_dest.cc @@ -76,70 +76,6 @@ class test_extension_4 : public ten::extension_t { } }; -class test_extension_group_1 : public ten::extension_group_t { - public: - explicit test_extension_group_1(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - -class test_extension_group_2 : public ten::extension_group_t { - public: - explicit test_extension_group_2(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_2("test_extension_2")); - extensions.push_back(new test_extension_3("test_extension_3")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - -class test_extension_group_3 : public ten::extension_group_t { - public: - explicit test_extension_group_3(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_4("test_extension_4")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app_1 : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -225,15 +161,14 @@ void *app_thread_3_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - command_stop_graph_actively_through_cmd_dest__extension_group_1, - test_extension_group_1); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - command_stop_graph_actively_through_cmd_dest__extension_group_2, - test_extension_group_2); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - command_stop_graph_actively_through_cmd_dest__extension_group_3, - test_extension_group_3); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(command_stop_graph_actively_through_cmd_dest__extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(command_stop_graph_actively_through_cmd_dest__extension_2, + test_extension_2); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(command_stop_graph_actively_through_cmd_dest__extension_3, + test_extension_3); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(command_stop_graph_actively_through_cmd_dest__extension_4, + test_extension_4); } // namespace @@ -262,20 +197,29 @@ TEST(ExtensionTest, CommandStopGraphActivelyThroughCmdDest) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "command_stop_graph_actively_through_cmd_dest_1", - "addon": "command_stop_graph_actively_through_cmd_dest__extension_group_1", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "addon": "command_stop_graph_actively_through_cmd_dest__extension_1", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "command_stop_graph_actively_through_cmd_dest_1" + },{ + "type": "extension", + "name": "test_extension_2", + "addon": "command_stop_graph_actively_through_cmd_dest__extension_2", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "command_stop_graph_actively_through_cmd_dest_2" },{ - "type": "extension_group", - "name": "command_stop_graph_actively_through_cmd_dest_2", - "addon": "command_stop_graph_actively_through_cmd_dest__extension_group_2", - "app": "msgpack://127.0.0.1:8002/" + "type": "extension", + "name": "test_extension_3", + "addon": "command_stop_graph_actively_through_cmd_dest__extension_3", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "command_stop_graph_actively_through_cmd_dest_2" },{ - "type": "extension_group", - "name": "command_stop_graph_actively_through_cmd_dest_3", - "addon": "command_stop_graph_actively_through_cmd_dest__extension_group_3", - "app": "msgpack://127.0.0.1:8003/" + "type": "extension", + "name": "test_extension_4", + "addon": "command_stop_graph_actively_through_cmd_dest__extension_4", + "app": "msgpack://127.0.0.1:8003/", + "extension_group": "command_stop_graph_actively_through_cmd_dest_3" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/concurrent/multi_app_concurrent.cc b/tests/ten_runtime/smoke/extension_test/concurrent/multi_app_concurrent.cc index 75fd431266..2369fd7dff 100644 --- a/tests/ten_runtime/smoke/extension_test/concurrent/multi_app_concurrent.cc +++ b/tests/ten_runtime/smoke/extension_test/concurrent/multi_app_concurrent.cc @@ -47,48 +47,6 @@ class test_extension_2 : public ten::extension_t { } }; -class test_extension_group_1 : public ten::extension_group_t { - public: - explicit test_extension_group_1(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - -class test_extension_group_2 : public ten::extension_group_t { - public: - explicit test_extension_group_2(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_2("test_extension_2")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app_1 : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -159,10 +117,10 @@ void *app_thread_2_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - multi_app_concurrent__extension_group_1, test_extension_group_1); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - multi_app_concurrent__extension_group_2, test_extension_group_2); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(multi_app_concurrent__extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(multi_app_concurrent__extension_2, + test_extension_2); void *client_thread_main(TEN_UNUSED void *args) { ten::msgpack_tcp_client_t *client = nullptr; @@ -190,15 +148,17 @@ void *client_thread_main(TEN_UNUSED void *args) { "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group 1", - "addon": "multi_app_concurrent__extension_group_1", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "addon": "multi_app_concurrent__extension_1", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "test_extension_group 1" },{ - "type": "extension_group", - "name": "test_extension_group 2", - "addon": "multi_app_concurrent__extension_group_2", - "app": "msgpack://127.0.0.1:8002/" + "type": "extension", + "name": "test_extension_2", + "addon": "multi_app_concurrent__extension_2", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "test_extension_group 2" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/concurrent/multi_app_sequential.cc b/tests/ten_runtime/smoke/extension_test/concurrent/multi_app_sequential.cc index c163b90b9a..fbb6d5f65a 100644 --- a/tests/ten_runtime/smoke/extension_test/concurrent/multi_app_sequential.cc +++ b/tests/ten_runtime/smoke/extension_test/concurrent/multi_app_sequential.cc @@ -47,48 +47,6 @@ class test_extension_2 : public ten::extension_t { } }; -class test_extension_group_1 : public ten::extension_group_t { - public: - explicit test_extension_group_1(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - -class test_extension_group_2 : public ten::extension_group_t { - public: - explicit test_extension_group_2(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_2("test_extension_2")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app_1 : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -159,10 +117,10 @@ void *app_thread_2_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - multi_app_sequential__extension_group_1, test_extension_group_1); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - multi_app_sequential__extension_group_2, test_extension_group_2); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(multi_app_sequential__extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(multi_app_sequential__extension_2, + test_extension_2); } // namespace @@ -201,15 +159,17 @@ TEST(ExtensionTest, MultiAppSequential) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group 1", - "addon": "multi_app_concurrent__extension_group_1", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "addon": "multi_app_sequential__extension_1", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "test_extension_group 1" },{ - "type": "extension_group", - "name": "test_extension_group 2", - "addon": "multi_app_concurrent__extension_group_2", - "app": "msgpack://127.0.0.1:8002/" + "type": "extension", + "name": "test_extension_2", + "addon": "multi_app_sequential__extension_2", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "test_extension_group 2" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/concurrent/one_engine_concurrent.cc b/tests/ten_runtime/smoke/extension_test/concurrent/one_engine_concurrent.cc index 4497ac3236..40da8e75b7 100644 --- a/tests/ten_runtime/smoke/extension_test/concurrent/one_engine_concurrent.cc +++ b/tests/ten_runtime/smoke/extension_test/concurrent/one_engine_concurrent.cc @@ -173,16 +173,6 @@ TEST(ExtensionTest, OneEngineConcurrent) { // NOLINT "long_running_mode": true, "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "extension_group_A", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ - "type": "extension_group", - "name": "extension_group_B", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8002/" - },{ "type": "extension", "name": "A", "addon": "one_engine_concurrent__extension_A", diff --git a/tests/ten_runtime/smoke/extension_test/dest/specify_dest.cc b/tests/ten_runtime/smoke/extension_test/dest/specify_dest.cc index 7f0b74e1b4..7a2d6a9de0 100644 --- a/tests/ten_runtime/smoke/extension_test/dest/specify_dest.cc +++ b/tests/ten_runtime/smoke/extension_test/dest/specify_dest.cc @@ -193,10 +193,6 @@ class business_app : public ten::app_t { "auto_start": true, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "specify_dest_group", - "addon": "default_extension_group" - },{ "type": "extension", "name": "business_extension", "addon": "specify_dest__business_extension", diff --git a/tests/ten_runtime/smoke/extension_test/engine/batch_send_msgs_in_migration.cc b/tests/ten_runtime/smoke/extension_test/engine/batch_send_msgs_in_migration.cc index 4d85ea95d5..3494023f80 100644 --- a/tests/ten_runtime/smoke/extension_test/engine/batch_send_msgs_in_migration.cc +++ b/tests/ten_runtime/smoke/extension_test/engine/batch_send_msgs_in_migration.cc @@ -24,27 +24,6 @@ class test_migration : public ten::extension_t { } }; -class test_migration_group : public ten::extension_group_t { - public: - explicit test_migration_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_migration("migration")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -72,9 +51,10 @@ class test_app : public ten::app_t { "auto_start": true, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "migration_group", - "addon": "batch_send_msgs_in_migration__migration_group" + "type": "extension", + "name": "migration", + "addon": "batch_send_msgs_in_migration__extension", + "extension_group": "migration_group" }] }] } @@ -95,8 +75,8 @@ void *app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - batch_send_msgs_in_migration__migration_group, test_migration_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(batch_send_msgs_in_migration__extension, + test_migration); } // namespace diff --git a/tests/ten_runtime/smoke/extension_test/engine/engine_long_running_mode.cc b/tests/ten_runtime/smoke/extension_test/engine/engine_long_running_mode.cc index 739a8dfba8..5cdf99de77 100644 --- a/tests/ten_runtime/smoke/extension_test/engine/engine_long_running_mode.cc +++ b/tests/ten_runtime/smoke/extension_test/engine/engine_long_running_mode.cc @@ -20,7 +20,7 @@ namespace { class ExtensionA : public ten::extension_t { public: - ExtensionA() : ten::extension_t("A") {} + ExtensionA(const std::string &name) : ten::extension_t(name) {} void on_cmd(ten::ten_env_t &ten_env, std::unique_ptr cmd) override { @@ -30,7 +30,7 @@ class ExtensionA : public ten::extension_t { class ExtensionB : public ten::extension_t { public: - ExtensionB() : ten::extension_t("B") {} + ExtensionB(const std::string &name) : ten::extension_t(name) {} void on_cmd(ten::ten_env_t &ten_env, std::unique_ptr cmd) override { @@ -42,48 +42,6 @@ class ExtensionB : public ten::extension_t { } }; -class ExtensionGroupA : public ten::extension_group_t { - public: - explicit ExtensionGroupA(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new ExtensionA()); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - -class ExtensionGroupB : public ten::extension_group_t { - public: - explicit ExtensionGroupB(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new ExtensionB()); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app_a : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -105,8 +63,10 @@ class test_app_a : public ten::app_t { } }; -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - engine_long_running_mode__extension_group_A, ExtensionGroupA); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(engine_long_running_mode__extension_a, + ExtensionA); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(engine_long_running_mode__extension_b, + ExtensionB); test_app_a *app_a = nullptr; @@ -138,9 +98,6 @@ class test_app_b : public ten::app_t { } }; -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - engine_long_running_mode__extension_group_B, ExtensionGroupB); - test_app_b *app_b = nullptr; void *app_thread_2_main(TEN_UNUSED void *args) { @@ -178,15 +135,17 @@ TEST(ExtensionTest, EngineLongRunningMode) { // NOLINT "long_running_mode": true, "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "engine_long_running_mode__extension_group_A", - "addon": "engine_long_running_mode__extension_group_A", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "A", + "addon": "engine_long_running_mode__extension_a", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "engine_long_running_mode__extension_group_A" },{ - "type": "extension_group", - "name": "engine_long_running_mode__extension_group_B", - "addon": "engine_long_running_mode__extension_group_B", - "app": "msgpack://127.0.0.1:8002/" + "type": "extension", + "name": "B", + "addon": "engine_long_running_mode__extension_b", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "engine_long_running_mode__extension_group_B" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/engine/engine_one_loop_per_engine.cc b/tests/ten_runtime/smoke/extension_test/engine/engine_one_loop_per_engine.cc index 41780447ab..dde52b9f0e 100644 --- a/tests/ten_runtime/smoke/extension_test/engine/engine_one_loop_per_engine.cc +++ b/tests/ten_runtime/smoke/extension_test/engine/engine_one_loop_per_engine.cc @@ -31,27 +31,6 @@ class test_extension : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -80,8 +59,8 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - engine_one_loop_per_engine__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(engine_one_loop_per_engine__extension, + test_extension); } // namespace @@ -100,10 +79,11 @@ TEST(ExtensionTest, EngineOneLoopPerEngine) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "engine_one_loop_per_engine", - "addon": "engine_one_loop_per_engine__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension", + "addon": "engine_one_loop_per_engine__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "engine_one_loop_per_engine" }] } })"_json); diff --git a/tests/ten_runtime/smoke/extension_test/engine/extension_send_msg_to_incorrect_engine.cc b/tests/ten_runtime/smoke/extension_test/engine/extension_send_msg_to_incorrect_engine.cc index ddfc24033a..0554e49b74 100644 --- a/tests/ten_runtime/smoke/extension_test/engine/extension_send_msg_to_incorrect_engine.cc +++ b/tests/ten_runtime/smoke/extension_test/engine/extension_send_msg_to_incorrect_engine.cc @@ -51,27 +51,6 @@ class test_extension : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -100,9 +79,8 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - extension_send_msg_to_incorrect_engine__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + extension_send_msg_to_incorrect_engine__extension, test_extension); } // namespace @@ -121,10 +99,11 @@ TEST(ExtensionTest, ExtensionSendMsgToIncorrectEngine) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "extension_send_msg_to_incorrect_engine", - "addon": "extension_send_msg_to_incorrect_engine__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension", + "addon": "extension_send_msg_to_incorrect_engine__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "extension_send_msg_to_incorrect_engine" }] } })"_json); diff --git a/tests/ten_runtime/smoke/extension_test/engine/wrong_engine_then_correct_in_migration.cc b/tests/ten_runtime/smoke/extension_test/engine/wrong_engine_then_correct_in_migration.cc index 281cfe16f5..36db18db8b 100644 --- a/tests/ten_runtime/smoke/extension_test/engine/wrong_engine_then_correct_in_migration.cc +++ b/tests/ten_runtime/smoke/extension_test/engine/wrong_engine_then_correct_in_migration.cc @@ -25,27 +25,6 @@ class test_migration : public ten::extension_t { } }; -class test_migration_group : public ten::extension_group_t { - public: - explicit test_migration_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_migration("migration")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -73,9 +52,10 @@ class test_app : public ten::app_t { "auto_start": true, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "migration_group", - "addon": "wrong_engine_then_correct_in_migration__migration_group" + "type": "extension", + "name": "migration", + "addon": "wrong_engine_then_correct_in_migration__extension", + "extension_group": "migration_group" }] }] } @@ -96,9 +76,8 @@ void *app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - wrong_engine_then_correct_in_migration__migration_group, - test_migration_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + wrong_engine_then_correct_in_migration__extension, test_migration); } // namespace diff --git a/tests/ten_runtime/smoke/extension_test/error/error_client_send_json.cc b/tests/ten_runtime/smoke/extension_test/error/error_client_send_json.cc index 3535f688ec..2aeab237a6 100644 --- a/tests/ten_runtime/smoke/extension_test/error/error_client_send_json.cc +++ b/tests/ten_runtime/smoke/extension_test/error/error_client_send_json.cc @@ -73,18 +73,6 @@ TEST(ExtensionTest, ErrorClientSendJson) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes":[ - { - "type": "extension_group", - "name": "extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - }, - { - "type": "extension_group", - "name": "extension_group", - "addon": "default_extension_group_1", - "app": "msgpack://127.0.0.1:8001/" - }, { "type": "extension", "name": "extension_1", @@ -94,7 +82,7 @@ TEST(ExtensionTest, ErrorClientSendJson) { // NOLINT }, { "type": "extension", - "name": "extension_2", + "name": "extension_1", "addon": "error_client_send_json__extension_2", "app": "msgpack://127.0.0.1:8001/", "extension_group": "extension_group" @@ -112,8 +100,9 @@ TEST(ExtensionTest, ErrorClientSendJson) { // NOLINT EXPECT_EQ(resp, nullptr); EXPECT_STREQ(ten_error_errmsg(err), - "extension group 'extension_group' is associated with different " - "addon 'default_extension_group_1', 'default_extension_group'"); + "extension 'extension_1' is associated with different addon " + "'error_client_send_json__extension_2', " + "'error_client_send_json__extension_1'"); ten_error_destroy(err); ten_json_destroy(graph); diff --git a/tests/ten_runtime/smoke/extension_test/error/invalid_extension_group.cc b/tests/ten_runtime/smoke/extension_test/error/invalid_extension_group.cc deleted file mode 100644 index b12a6f032b..0000000000 --- a/tests/ten_runtime/smoke/extension_test/error/invalid_extension_group.cc +++ /dev/null @@ -1,83 +0,0 @@ -// -// Copyright © 2024 Agora -// This file is part of TEN Framework, an open source project. -// Licensed under the Apache License, Version 2.0, with certain conditions. -// Refer to the "LICENSE" file in the root directory for more information. -// -#include -#include - -#include "gtest/gtest.h" -#include "include_internal/ten_runtime/binding/cpp/ten.h" -#include "ten_utils/lib/thread.h" -#include "tests/common/client/cpp/msgpack_tcp.h" -#include "tests/ten_runtime/smoke/extension_test/util/binding/cpp/check.h" - -namespace { - -class test_app : public ten::app_t { - public: - void on_configure(ten::ten_env_t &ten_env) override { - bool rc = ten_env.init_property_from_json( - // clang-format off - R"({ - "_ten": { - "uri": "msgpack://127.0.0.1:8001/", - "log_level": 2 - } - })" - // clang-format on - , - nullptr); - ASSERT_EQ(rc, true); - - ten_env.on_configure_done(); - } -}; - -void *test_app_thread_main(TEN_UNUSED void *args) { - auto *app = new test_app(); - app->run(); - delete app; - - return nullptr; -} - -} // namespace - -TEST(ExtensionTest, InvalidExtensionGroup) { // NOLINT - auto *app_thread = - ten_thread_create("app thread", test_app_thread_main, nullptr); - - // Create a client and connect to the app. - auto *client = new ten::msgpack_tcp_client_t("msgpack://127.0.0.1:8001/"); - - // Send graph. - nlohmann::json resp = client->send_json_and_recv_resp_in_json( - R"({ - "_ten": { - "type": "start_graph", - "seq_id": "55", - "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "invalid_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ - "type": "extension", - "name": "test_extension", - "addon": "invalid_extension_group__test_extension", - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "test_extension_group" - }] - } - })"_json); - ten_test::check_status_code_is(resp, TEN_STATUS_CODE_ERROR); - ten_test::check_detail_is(resp, - "Failed to start extension system: Unable to find " - "invalid_extension_group"); - - delete client; - - ten_thread_join(app_thread, -1); -} diff --git a/tests/ten_runtime/smoke/extension_test/extension/extension_reg_extension.cc b/tests/ten_runtime/smoke/extension_test/extension/extension_reg_extension.cc index 6320ea6f16..61e880e7b9 100644 --- a/tests/ten_runtime/smoke/extension_test/extension/extension_reg_extension.cc +++ b/tests/ten_runtime/smoke/extension_test/extension/extension_reg_extension.cc @@ -78,11 +78,6 @@ TEST(ExtensionTest, ExtensionRegExtension) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "extension_reg_extension", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "extension_reg_extension", "addon": "extension_reg_extension__extension", diff --git a/tests/ten_runtime/smoke/extension_test/extension/extension_reg_extension_and_create_group.cc b/tests/ten_runtime/smoke/extension_test/extension/extension_reg_extension_and_create_group.cc index 877b5056e7..6a2c36d74d 100644 --- a/tests/ten_runtime/smoke/extension_test/extension/extension_reg_extension_and_create_group.cc +++ b/tests/ten_runtime/smoke/extension_test/extension/extension_reg_extension_and_create_group.cc @@ -35,32 +35,6 @@ class test_extension : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - ten_env.addon_create_extension_async( - "extension_reg_extension_and_create_group__extension", "test_extension", - [](ten::ten_env_t &ten_env, ten::extension_t &extension) { - std::vector extensions = {&extension}; - ten_env.on_create_extensions_done(extensions); - }); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - ten_env.addon_destroy_extension_async( - extension, [](ten::ten_env_t &ten_env) { - ten_env.on_destroy_extensions_done(); - }); - } - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -93,11 +67,6 @@ void *test_app_thread_main(TEN_UNUSED void *args) { TEN_CPP_REGISTER_ADDON_AS_EXTENSION( extension_reg_extension_and_create_group__extension, test_extension); -// In the real case, this macro is called from the app. -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - extension_reg_extension_and_create_group__extension_group, - test_extension_group); - } // namespace TEST(ExtensionTest, ExtensionRegExtensionAndCreateGroup) { // NOLINT @@ -115,10 +84,11 @@ TEST(ExtensionTest, ExtensionRegExtensionAndCreateGroup) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "extension_reg_extension_and_create_group__extension_group", - "addon": "extension_reg_extension_and_create_group__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension", + "addon": "extension_reg_extension_and_create_group__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "extension_reg_extension_and_create_group__extension_group" }] } })"_json); diff --git a/tests/ten_runtime/smoke/extension_test/extension/extension_reg_extension_group.cc b/tests/ten_runtime/smoke/extension_test/extension/extension_reg_extension_group.cc index 58b72594ef..e7d4ece8a2 100644 --- a/tests/ten_runtime/smoke/extension_test/extension/extension_reg_extension_group.cc +++ b/tests/ten_runtime/smoke/extension_test/extension/extension_reg_extension_group.cc @@ -31,27 +31,6 @@ class test_extension : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -80,8 +59,8 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - extension_reg_extension_group__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(extension_reg_extension_group__extension, + test_extension); } // namespace @@ -100,10 +79,11 @@ TEST(ExtensionTest, ExtensionRegExtensionGroup) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "extension_reg_extension_group__extension_group", - "addon": "extension_reg_extension_group__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension", + "addon": "extension_reg_extension_group__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "extension_reg_extension_group__extension_group" }] } })"_json); diff --git a/tests/ten_runtime/smoke/extension_test/extension/extension_with_same_name.cc b/tests/ten_runtime/smoke/extension_test/extension/extension_with_same_name.cc index 9e48f98b6d..238dee96bc 100644 --- a/tests/ten_runtime/smoke/extension_test/extension/extension_with_same_name.cc +++ b/tests/ten_runtime/smoke/extension_test/extension/extension_with_same_name.cc @@ -101,10 +101,8 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - extension_with_same_name__extension_group_1, test_extension_group_1); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - extension_with_same_name__extension_group_2, test_extension_group_2); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(extension_with_same_name__extension, + test_extension); } // namespace @@ -123,15 +121,17 @@ TEST(ExtensionTest, ExtensionWithSameName) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "extension_with_same_name__extension_group_1", - "addon": "extension_with_same_name__extension_group_1", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "same_name", + "addon": "extension_with_same_name__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "extension_with_same_name__extension_group_1" },{ - "type": "extension_group", - "name": "extension_with_same_name__extension_group_2", - "addon": "extension_with_same_name__extension_group_2", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "same_name", + "addon": "extension_with_same_name__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "extension_with_same_name__extension_group_2" }] } })"_json); diff --git a/tests/ten_runtime/smoke/extension_test/extension_group/extension_group_with_same_name.cc b/tests/ten_runtime/smoke/extension_test/extension_group/extension_group_with_same_name.cc index a1b5e2f417..742571902a 100644 --- a/tests/ten_runtime/smoke/extension_test/extension_group/extension_group_with_same_name.cc +++ b/tests/ten_runtime/smoke/extension_test/extension_group/extension_group_with_same_name.cc @@ -77,11 +77,6 @@ TEST(ExtensionTest, ExtensionGroupWithSameName) { "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "extension_group_with_same_name", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "extension_group_with_same_name__extension", diff --git a/tests/ten_runtime/smoke/extension_test/extension_group/extension_group_with_same_name_and_topo_info.cc b/tests/ten_runtime/smoke/extension_test/extension_group/extension_group_with_same_name_and_topo_info.cc index 824fb0db03..0c7dabc941 100644 --- a/tests/ten_runtime/smoke/extension_test/extension_group/extension_group_with_same_name_and_topo_info.cc +++ b/tests/ten_runtime/smoke/extension_test/extension_group/extension_group_with_same_name_and_topo_info.cc @@ -77,11 +77,6 @@ TEST(ExtensionTest, ExtensionGroupWithSameNameAndGraphInfo) { "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "same_name_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "extension_group_with_same_name_and_graph_info__extension", diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_lack_something_1.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_lack_something_1.cc index 3eb006f9b7..90745b2fa2 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_lack_something_1.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_lack_something_1.cc @@ -46,28 +46,6 @@ class test_extension_2 : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - extensions.push_back(new test_extension_2("test_extension_2")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -96,8 +74,10 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - graph_lack_something_1__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(graph_lack_something_1__extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(graph_lack_something_1__extension_2, + test_extension_2); } // namespace @@ -116,20 +96,17 @@ TEST(ExtensionTest, GraphLackSomething1) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "graph_lack_something_1", - "addon": "graph_lack_something_1__extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "extension_group": "graph_lack_something_1", - "app": "msgpack://127.0.0.1:8001/" + "app": "msgpack://127.0.0.1:8001/", + "addon": "graph_lack_something_1__extension_1" },{ "type": "extension", "name": "test_extension_2", "extension_group": "graph_lack_something_1", - "app": "msgpack://127.0.0.1:8001/" + "app": "msgpack://127.0.0.1:8001/", + "addon": "graph_lack_something_1__extension_2" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_lack_something_2.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_lack_something_2.cc index 7111c57aca..eca652e9fe 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_lack_something_2.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_lack_something_2.cc @@ -46,28 +46,6 @@ class test_extension_2 : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - extensions.push_back(new test_extension_2("test_extension_2")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -96,8 +74,10 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - graph_lack_something_2__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(graph_lack_something_2__extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(graph_lack_something_2__extension_2, + test_extension_2); } // namespace @@ -116,13 +96,15 @@ TEST(ExtensionTest, GraphLackSomething2) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "graph_lack_something_2", - "addon": "graph_lack_something_2__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "addon": "graph_lack_something_2__extension_1", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_lack_something_2" },{ "type": "extension", - "name": "test_extension_1", + "name": "test_extension_2", + "addon": "graph_lack_something_2__extension_2", "extension_group": "graph_lack_something_2", "app": "msgpack://127.0.0.1:8001/" }], diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_lack_something_3.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_lack_something_3.cc index 2dbe272c9b..b5683411ed 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_lack_something_3.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_lack_something_3.cc @@ -46,28 +46,6 @@ class test_extension_2 : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - extensions.push_back(new test_extension_2("test_extension_2")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -96,8 +74,10 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - graph_lack_something_3__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(graph_lack_something_3__extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(graph_lack_something_3__extension_2, + test_extension_2); } // namespace @@ -116,10 +96,17 @@ TEST(ExtensionTest, GraphLackSomething3) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "graph_lack_something_3", - "addon": "graph_lack_something_3__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "addon": "graph_lack_something_3__extension_1", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_lack_something_3" + },{ + "type": "extension", + "name": "test_extension_2", + "addon": "graph_lack_something_3__extension_2", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_lack_something_3" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_loop_in_multi_app.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_loop_in_multi_app.cc index 582259a77b..8b6bcd7823 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_loop_in_multi_app.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_loop_in_multi_app.cc @@ -76,70 +76,6 @@ class test_extension_4 : public ten::extension_t { } }; -class test_extension_group_1 : public ten::extension_group_t { - public: - explicit test_extension_group_1(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - -class test_extension_group_2 : public ten::extension_group_t { - public: - explicit test_extension_group_2(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_2("test_extension_2")); - extensions.push_back(new test_extension_3("test_extension_3")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - -class test_extension_group_3 : public ten::extension_group_t { - public: - explicit test_extension_group_3(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_4("test_extension_4")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app_1 : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -225,12 +161,14 @@ void *app_thread_3_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - graph_loop_in_multi_app__extension_group_1, test_extension_group_1); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - graph_loop_in_multi_app__extension_group_2, test_extension_group_2); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - graph_loop_in_multi_app__extension_group_3, test_extension_group_3); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(graph_loop_in_multi_app__extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(graph_loop_in_multi_app__extension_2, + test_extension_2); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(graph_loop_in_multi_app__extension_3, + test_extension_3); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(graph_loop_in_multi_app__extension_4, + test_extension_4); } // namespace @@ -260,20 +198,29 @@ TEST(ExtensionTest, GraphLoopInMultiApp) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "graph_loop_in_multi_app__extension_group_1", - "addon": "graph_loop_in_multi_app__extension_group_1", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "addon": "graph_loop_in_multi_app__extension_1", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_loop_in_multi_app__extension_group_1" },{ - "type": "extension_group", - "name": "graph_loop_in_multi_app__extension_group_2", - "addon": "graph_loop_in_multi_app__extension_group_2", - "app": "msgpack://127.0.0.1:8002/" + "type": "extension", + "name": "test_extension_2", + "addon": "graph_loop_in_multi_app__extension_2", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "graph_loop_in_multi_app__extension_group_2" },{ - "type": "extension_group", - "name": "graph_loop_in_multi_app__extension_group_3", - "addon": "graph_loop_in_multi_app__extension_group_3", - "app": "msgpack://127.0.0.1:8003/" + "type": "extension", + "name": "test_extension_3", + "addon": "graph_loop_in_multi_app__extension_3", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "graph_loop_in_multi_app__extension_group_2" + },{ + "type": "extension", + "name": "test_extension_4", + "addon": "graph_loop_in_multi_app__extension_4", + "app": "msgpack://127.0.0.1:8003/", + "extension_group": "graph_loop_in_multi_app__extension_group_3" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_loop_in_one_app.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_loop_in_one_app.cc index eae39a92ed..fcf65c9f2d 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_loop_in_one_app.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_loop_in_one_app.cc @@ -74,30 +74,6 @@ class test_extension_4 : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - extensions.push_back(new test_extension_2("test_extension_2")); - extensions.push_back(new test_extension_3("test_extension_3")); - extensions.push_back(new test_extension_4("test_extension_4")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -126,8 +102,14 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - graph_loop_in_one_app__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(graph_loop_in_one_app__extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(graph_loop_in_one_app__extension_2, + test_extension_2); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(graph_loop_in_one_app__extension_3, + test_extension_3); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(graph_loop_in_one_app__extension_4, + test_extension_4); } // namespace @@ -146,20 +128,29 @@ TEST(ExtensionTest, GraphLoopInOneApp) { "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "graph_loop_in_one_app__extension_group", - "addon": "graph_loop_in_one_app__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "addon": "graph_loop_in_one_app__extension_1", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_loop_in_one_app__extension_group" + },{ + "type": "extension", + "name": "test_extension_2", + "addon": "graph_loop_in_one_app__extension_2", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_loop_in_one_app__extension_group" },{ - "type": "extension_group", - "name": "graph_loop_in_one_app__extension_group", - "addon": "graph_loop_in_one_app__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_3", + "addon": "graph_loop_in_one_app__extension_3", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_loop_in_one_app__extension_group" },{ - "type": "extension_group", - "name": "graph_loop_in_one_app__extension_group", - "addon": "graph_loop_in_one_app__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_4", + "addon": "graph_loop_in_one_app__extension_4", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_loop_in_one_app__extension_group" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle.cc index 5554c0b2f9..bf27d928a5 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle.cc @@ -26,8 +26,13 @@ namespace { */ class test_extension : public ten::extension_t { public: - explicit test_extension(const std::string &name, int value) - : ten::extension_t(name), name_(name), value_(value) {} + explicit test_extension(const std::string &name) + : ten::extension_t(name), name_(name) {} + + void on_init(ten::ten_env_t &ten_env) override { + value_ = ten_env.get_property_int32("value"); + ten_env.on_init_done(); + } void on_cmd(ten::ten_env_t &ten_env, std::unique_ptr cmd) override { @@ -60,34 +65,10 @@ class test_extension : public ten::extension_t { private: const std::string name_; - const int value_; + int value_; int counter_ = 0; }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("A", 0)); - extensions.push_back(new test_extension("B", 1)); - extensions.push_back(new test_extension("C", 2)); - extensions.push_back(new test_extension("D", 3)); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -116,8 +97,8 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - graph_loop_multiple_circle__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + graph_loop_multiple_circle__extension, test_extension); } // namespace @@ -138,10 +119,41 @@ TEST(ExtensionTest, GraphLoopMultipleCircle) { // NOLINT "app": "msgpack://127.0.0.1:8001/" }], "nodes": [{ - "type": "extension_group", - "name": "graph_loop_multiple_circle__extension_group", - "addon": "graph_loop_multiple_circle__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "A", + "addon": "graph_loop_multiple_circle__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_loop_multiple_circle__extension_group", + "property": { + "value": 0 + } + },{ + "type": "extension", + "name": "B", + "addon": "graph_loop_multiple_circle__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_loop_multiple_circle__extension_group", + "property": { + "value": 1 + } + },{ + "type": "extension", + "name": "C", + "addon": "graph_loop_multiple_circle__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_loop_multiple_circle__extension_group", + "property": { + "value": 2 + } + },{ + "type": "extension", + "name": "D", + "addon": "graph_loop_multiple_circle__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_loop_multiple_circle__extension_group", + "property": { + "value": 3 + } }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle_through_cmd.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle_through_cmd.cc index 75d42b325b..469549ec56 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle_through_cmd.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle_through_cmd.cc @@ -26,8 +26,13 @@ namespace { */ class test_extension : public ten::extension_t { public: - explicit test_extension(const std::string &name, int value) - : ten::extension_t(name), name_(name), value_(value) {} + explicit test_extension(const std::string &name) + : ten::extension_t(name), name_(name) {} + + void on_init(ten::ten_env_t &ten_env) override { + value_ = ten_env.get_property_int32("value"); + ten_env.on_init_done(); + } void on_cmd(ten::ten_env_t &ten_env, std::unique_ptr cmd) override { @@ -60,34 +65,10 @@ class test_extension : public ten::extension_t { private: const std::string name_; - const int value_; + int value_; int counter_ = 0; }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("A", 0)); - extensions.push_back(new test_extension("B", 1)); - extensions.push_back(new test_extension("C", 2)); - extensions.push_back(new test_extension("D", 3)); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -116,9 +97,8 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - graph_loop_multiple_circle_through_cmd__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + graph_loop_multiple_circle_through_cmd__extension, test_extension); } // namespace @@ -139,10 +119,41 @@ TEST(ExtensionTest, GraphLoopMultipleCircleThroughCmd) { // NOLINT "app": "msgpack://127.0.0.1:8001/" }], "nodes": [{ - "type": "extension_group", - "name": "graph_loop_multiple_circle_through_cmd__extension_group", - "addon": "graph_loop_multiple_circle_through_cmd__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "A", + "addon": "graph_loop_multiple_circle_through_cmd__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_loop_multiple_circle_through_cmd__extension_group", + "property": { + "value": 0 + } + },{ + "type": "extension", + "name": "B", + "addon": "graph_loop_multiple_circle_through_cmd__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_loop_multiple_circle_through_cmd__extension_group", + "property": { + "value": 1 + } + },{ + "type": "extension", + "name": "C", + "addon": "graph_loop_multiple_circle_through_cmd__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_loop_multiple_circle_through_cmd__extension_group", + "property": { + "value": 2 + } + },{ + "type": "extension", + "name": "D", + "addon": "graph_loop_multiple_circle_through_cmd__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_loop_multiple_circle_through_cmd__extension_group", + "property": { + "value": 3 + } }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle_through_cmd_with_default.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle_through_cmd_with_default.cc index a7de08a6d9..1f05af5ee7 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle_through_cmd_with_default.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_loop_multiple_circle_through_cmd_with_default.cc @@ -26,8 +26,13 @@ namespace { */ class test_extension : public ten::extension_t { public: - explicit test_extension(const std::string &name, int value) - : ten::extension_t(name), name_(name), value_(value) {} + explicit test_extension(const std::string &name) + : ten::extension_t(name), name_(name) {} + + void on_init(ten::ten_env_t &ten_env) override { + value_ = ten_env.get_property_int32("value"); + ten_env.on_init_done(); + } void on_cmd(ten::ten_env_t &ten_env, std::unique_ptr cmd) override { @@ -56,34 +61,10 @@ class test_extension : public ten::extension_t { private: const std::string name_; - const int value_; + int value_; int counter_ = 0; }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("A", 0)); - extensions.push_back(new test_extension("B", 1)); - extensions.push_back(new test_extension("C", 2)); - extensions.push_back(new test_extension("D", 3)); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -112,9 +93,9 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - graph_loop_multiple_circle_through_cmd_with_default__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + graph_loop_multiple_circle_through_cmd_with_default__extension, + test_extension); } // namespace @@ -135,10 +116,41 @@ TEST(ExtensionTest, GraphLoopMultipleCircleThroughCmdWithDefault) { // NOLINT "app": "msgpack://127.0.0.1:8001/" }], "nodes": [{ - "type": "extension_group", - "name": "graph_loop_multiple_circle_through_cmd_with_default__extension_group", - "addon": "graph_loop_multiple_circle_through_cmd_with_default__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "A", + "addon": "graph_loop_multiple_circle_through_cmd_with_default__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_loop_multiple_circle_through_cmd_with_default__extension_group", + "property": { + "value": 0 + } + },{ + "type": "extension", + "name": "B", + "addon": "graph_loop_multiple_circle_through_cmd_with_default__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_loop_multiple_circle_through_cmd_with_default__extension_group", + "property": { + "value": 1 + } + },{ + "type": "extension", + "name": "C", + "addon": "graph_loop_multiple_circle_through_cmd_with_default__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_loop_multiple_circle_through_cmd_with_default__extension_group", + "property": { + "value": 2 + } + },{ + "type": "extension", + "name": "D", + "addon": "graph_loop_multiple_circle_through_cmd_with_default__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_loop_multiple_circle_through_cmd_with_default__extension_group", + "property": { + "value": 3 + } }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_multiple_polygon.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_multiple_polygon.cc index 5ebcabcca2..2f70360afb 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_multiple_polygon.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_multiple_polygon.cc @@ -33,8 +33,13 @@ namespace { */ class test_extension : public ten::extension_t { public: - explicit test_extension(const std::string &name, bool is_leaf) - : ten::extension_t(name), name_(name), is_leaf_node_(is_leaf) {} + explicit test_extension(const std::string &name) + : ten::extension_t(name), name_(name) {} + + void on_init(ten::ten_env_t &ten_env) override { + is_leaf_node_ = ten_env.get_property_bool("is_leaf"); + ten_env.on_init_done(); + } void on_cmd(ten::ten_env_t &ten_env, std::unique_ptr cmd) override { @@ -107,79 +112,11 @@ class test_extension : public ten::extension_t { private: const std::string name_; - const bool is_leaf_node_; + bool is_leaf_node_{}; int received_count = 0; int received_success_count = 0; }; -class test_extension_group_1 : public ten::extension_group_t { - public: - explicit test_extension_group_1(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("A", false)); - extensions.push_back(new test_extension("B", false)); - extensions.push_back(new test_extension("C", false)); - extensions.push_back(new test_extension("D", false)); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - -class test_extension_group_2 : public ten::extension_group_t { - public: - explicit test_extension_group_2(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("E", false)); - extensions.push_back(new test_extension("G", false)); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - -class test_extension_group_3 : public ten::extension_group_t { - public: - explicit test_extension_group_3(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("F", false)); - extensions.push_back(new test_extension("H", true)); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app_1 : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -264,12 +201,8 @@ void *app_thread_3_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - graph_multiple_polygon__extension_group_1, test_extension_group_1); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - graph_multiple_polygon__extension_group_2, test_extension_group_2); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - graph_multiple_polygon__extension_group_3, test_extension_group_3); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(graph_multiple_polygon__extension, + test_extension); } // namespace @@ -300,20 +233,77 @@ TEST(ExtensionTest, GraphMultiplePolygon) { // NOLINT "app": "msgpack://127.0.0.1:8001/" }], "nodes": [{ - "type": "extension_group", - "name": "graph_multiple_polygon_1", - "addon": "graph_multiple_polygon__extension_group_1", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "A", + "addon": "graph_multiple_polygon__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_multiple_polygon_1", + "property": { + "is_leaf": false + } + },{ + "type": "extension", + "name": "B", + "addon": "graph_multiple_polygon__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_multiple_polygon_1", + "property": { + "is_leaf": false + } + },{ + "type": "extension", + "name": "C", + "addon": "graph_multiple_polygon__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_multiple_polygon_1", + "property": { + "is_leaf": false + } + },{ + "type": "extension", + "name": "D", + "addon": "graph_multiple_polygon__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_multiple_polygon_1", + "property": { + "is_leaf": false + } + },{ + "type": "extension", + "name": "E", + "addon": "graph_multiple_polygon__extension", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "graph_multiple_polygon_2", + "property": { + "is_leaf": false + } },{ - "type": "extension_group", - "name": "graph_multiple_polygon_2", - "addon": "graph_multiple_polygon__extension_group_2", - "app": "msgpack://127.0.0.1:8002/" + "type": "extension", + "name": "G", + "addon": "graph_multiple_polygon__extension", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "graph_multiple_polygon_2", + "property": { + "is_leaf": false + } },{ - "type": "extension_group", - "name": "graph_multiple_polygon_3", - "addon": "graph_multiple_polygon__extension_group_3", - "app": "msgpack://127.0.0.1:8003/" + "type": "extension", + "name": "F", + "addon": "graph_multiple_polygon__extension", + "app": "msgpack://127.0.0.1:8003/", + "extension_group": "graph_multiple_polygon_3", + "property": { + "is_leaf": false + } + },{ + "type": "extension", + "name": "H", + "addon": "graph_multiple_polygon__extension", + "app": "msgpack://127.0.0.1:8003/", + "extension_group": "graph_multiple_polygon_3", + "property": { + "is_leaf": true + } }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_multiple_polygon_one_app.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_multiple_polygon_one_app.cc index 2275e3da03..c85433c44d 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_multiple_polygon_one_app.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_multiple_polygon_one_app.cc @@ -27,8 +27,13 @@ namespace { */ class test_extension : public ten::extension_t { public: - explicit test_extension(const std::string &name, bool is_leaf) - : ten::extension_t(name), name_(name), is_leaf_node_(is_leaf) {} + explicit test_extension(const std::string &name) + : ten::extension_t(name), name_(name) {} + + void on_init(ten::ten_env_t &ten_env) override { + is_leaf_node_ = ten_env.get_property_bool("is_leaf"); + ten_env.on_init_done(); + } void on_cmd(ten::ten_env_t &ten_env, std::unique_ptr cmd) override { @@ -99,39 +104,11 @@ class test_extension : public ten::extension_t { private: const std::string name_; - const bool is_leaf_node_; + bool is_leaf_node_; int received_count = 0; int received_success_count = 0; }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("A", false)); - extensions.push_back(new test_extension("B", false)); - extensions.push_back(new test_extension("C", false)); - extensions.push_back(new test_extension("D", false)); - extensions.push_back(new test_extension("E", false)); - extensions.push_back(new test_extension("F", false)); - extensions.push_back(new test_extension("G", false)); - extensions.push_back(new test_extension("H", true)); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -160,8 +137,8 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - graph_multiple_polygon_one_app__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(graph_multiple_polygon_one_app__extension, + test_extension); } // namespace @@ -181,10 +158,77 @@ TEST(ExtensionTest, GraphMultiplePolygonOneApp) { // NOLINT "app": "msgpack://127.0.0.1:8001/" }], "nodes": [{ - "type": "extension_group", - "name": "graph_multiple_polygon_one_app__extension_group", - "addon": "graph_multiple_polygon_one_app__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "A", + "addon": "graph_multiple_polygon_one_app__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_multiple_polygon_one_app__extension_group", + "property": { + "is_leaf": false + } + },{ + "type": "extension", + "name": "B", + "addon": "graph_multiple_polygon_one_app__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_multiple_polygon_one_app__extension_group", + "property": { + "is_leaf": false + } + },{ + "type": "extension", + "name": "C", + "addon": "graph_multiple_polygon_one_app__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_multiple_polygon_one_app__extension_group", + "property": { + "is_leaf": false + } + },{ + "type": "extension", + "name": "D", + "addon": "graph_multiple_polygon_one_app__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_multiple_polygon_one_app__extension_group", + "property": { + "is_leaf": false + } + },{ + "type": "extension", + "name": "E", + "addon": "graph_multiple_polygon_one_app__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_multiple_polygon_one_app__extension_group", + "property": { + "is_leaf": false + } + },{ + "type": "extension", + "name": "F", + "addon": "graph_multiple_polygon_one_app__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_multiple_polygon_one_app__extension_group", + "property": { + "is_leaf": false + } + },{ + "type": "extension", + "name": "G", + "addon": "graph_multiple_polygon_one_app__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_multiple_polygon_one_app__extension_group", + "property": { + "is_leaf": false + } + },{ + "type": "extension", + "name": "H", + "addon": "graph_multiple_polygon_one_app__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_multiple_polygon_one_app__extension_group", + "property": { + "is_leaf": true + } }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_out_of_order_1.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_out_of_order_1.cc index 803d1b63bd..70df37f883 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_out_of_order_1.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_out_of_order_1.cc @@ -95,16 +95,6 @@ TEST(ExtensionTest, GraphOutOfOrder1) { // NOLINT "addon": "graph_out_of_order_1__test_extension_1", "extension_group": "test_extension_group 1", "app": "msgpack://127.0.0.1:8001/" - },{ - "type": "extension_group", - "name": "test_extension_group 1", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ - "type": "extension_group", - "name": "test_extension_group 2", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" },{ "type": "extension", "name": "test_extension_2", diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_out_of_order_2.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_out_of_order_2.cc index 650fa1ab48..c35c382437 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_out_of_order_2.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_out_of_order_2.cc @@ -101,16 +101,6 @@ TEST(ExtensionTest, GraphOutOfOrder2) { // NOLINT "addon": "graph_out_of_order_2__test_extension_2", "extension_group": "test_extension_group 2", "app": "msgpack://127.0.0.1:8001/" - },{ - "type": "extension_group", - "name": "test_extension_group 1", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ - "type": "extension_group", - "name": "test_extension_group 2", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" }] } })"_json); diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_polygon_in_one_app_return_all.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_polygon_in_one_app_return_all.cc index c0e41f6bab..3ccb55abe5 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_polygon_in_one_app_return_all.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_polygon_in_one_app_return_all.cc @@ -25,8 +25,13 @@ namespace { */ class test_extension : public ten::extension_t { public: - explicit test_extension(const std::string &name, bool is_leaf) - : ten::extension_t(name), name_(name), is_leaf_node_(is_leaf) {} + explicit test_extension(const std::string &name) + : ten::extension_t(name), name_(name) {} + + void on_init(ten::ten_env_t &ten_env) override { + is_leaf_node_ = ten_env.get_property_bool("is_leaf"); + ten_env.on_init_done(); + } void on_cmd(ten::ten_env_t &ten_env, std::unique_ptr cmd) override { @@ -79,34 +84,10 @@ class test_extension : public ten::extension_t { private: const std::string name_; - const bool is_leaf_node_; + bool is_leaf_node_{}; int receive_count = 0; }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("A", false)); - extensions.push_back(new test_extension("B", false)); - extensions.push_back(new test_extension("C", false)); - extensions.push_back(new test_extension("D", true)); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -135,8 +116,8 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - graph_polygon_in_one_app_return_all__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + graph_polygon_in_one_app_return_all__extension, test_extension); } // namespace @@ -156,10 +137,41 @@ TEST(ExtensionTest, GraphPolygonInOneAppReturnAll) { // NOLINT "app": "msgpack://127.0.0.1:8001/" }], "nodes": [{ - "type": "extension_group", - "name": "graph_polygon_in_one_app_return_all__extension_group", - "addon": "graph_polygon_in_one_app_return_all__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "A", + "addon": "graph_polygon_in_one_app_return_all__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_polygon_in_one_app_return_all__extension_group", + "property": { + "is_leaf": false + } + },{ + "type": "extension", + "name": "B", + "addon": "graph_polygon_in_one_app_return_all__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_polygon_in_one_app_return_all__extension_group", + "property": { + "is_leaf": false + } + },{ + "type": "extension", + "name": "C", + "addon": "graph_polygon_in_one_app_return_all__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_polygon_in_one_app_return_all__extension_group", + "property": { + "is_leaf": false + } + },{ + "type": "extension", + "name": "D", + "addon": "graph_polygon_in_one_app_return_all__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_polygon_in_one_app_return_all__extension_group", + "property": { + "is_leaf": true + } }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_y_shape_in_multi_app.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_y_shape_in_multi_app.cc index 35efdc99cb..a5b09cce19 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_y_shape_in_multi_app.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_y_shape_in_multi_app.cc @@ -75,70 +75,6 @@ class test_extension_4 : public ten::extension_t { } }; -class test_extension_group_1 : public ten::extension_group_t { - public: - explicit test_extension_group_1(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - -class test_extension_group_2 : public ten::extension_group_t { - public: - explicit test_extension_group_2(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_2("test_extension_2")); - extensions.push_back(new test_extension_3("test_extension_3")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - -class test_extension_group_3 : public ten::extension_group_t { - public: - explicit test_extension_group_3(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_4("test_extension_4")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app_1 : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -226,12 +162,14 @@ void *app_thread_3_main(TEN_UNUSED void *args) { } // namespace -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - graph_y_shape_in_multi_app__extension_group_1, test_extension_group_1); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - graph_y_shape_in_multi_app__extension_group_2, test_extension_group_2); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - graph_y_shape_in_multi_app__extension_group_3, test_extension_group_3); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(graph_y_shape_in_multi_app__extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(graph_y_shape_in_multi_app__extension_2, + test_extension_2); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(graph_y_shape_in_multi_app__extension_3, + test_extension_3); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(graph_y_shape_in_multi_app__extension_4, + test_extension_4); TEST(ExtensionTest, GraphYShapeInMultiApp) { // NOLINT // Start app. @@ -259,20 +197,29 @@ TEST(ExtensionTest, GraphYShapeInMultiApp) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "graph_y_shape_in_multi_app__extension_group_1", - "addon": "graph_y_shape_in_multi_app__extension_group_1", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "addon": "graph_y_shape_in_multi_app__extension_1", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_y_shape_in_multi_app__extension_group_1" },{ - "type": "extension_group", - "name": "graph_y_shape_in_multi_app__extension_group_2", - "addon": "graph_y_shape_in_multi_app__extension_group_2", - "app": "msgpack://127.0.0.1:8002/" + "type": "extension", + "name": "test_extension_2", + "addon": "graph_y_shape_in_multi_app__extension_2", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "graph_y_shape_in_multi_app__extension_group_2" + },{ + "type": "extension", + "name": "test_extension_3", + "addon": "graph_y_shape_in_multi_app__extension_3", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "graph_y_shape_in_multi_app__extension_group_2" },{ - "type": "extension_group", - "name": "graph_y_shape_in_multi_app__extension_group_3", - "addon": "graph_y_shape_in_multi_app__extension_group_3", - "app": "msgpack://127.0.0.1:8003/" + "type": "extension", + "name": "test_extension_4", + "addon": "graph_y_shape_in_multi_app__extension_4", + "app": "msgpack://127.0.0.1:8003/", + "extension_group": "graph_y_shape_in_multi_app__extension_group_3" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_y_shape_in_one_app.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_y_shape_in_one_app.cc index f7484eb38d..e65634e4c2 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_y_shape_in_one_app.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_y_shape_in_one_app.cc @@ -73,30 +73,6 @@ class test_extension_4 : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - extensions.push_back(new test_extension_2("test_extension_2")); - extensions.push_back(new test_extension_3("test_extension_3")); - extensions.push_back(new test_extension_4("test_extension_4")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -125,8 +101,14 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - graph_y_shape_in_one_app__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(graph_y_shape_in_one_app__extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(graph_y_shape_in_one_app__extension_2, + test_extension_2); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(graph_y_shape_in_one_app__extension_3, + test_extension_3); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(graph_y_shape_in_one_app__extension_4, + test_extension_4); } // namespace @@ -145,10 +127,29 @@ TEST(ExtensionTest, GraphYShapeInOneApp) { "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "graph_y_shape_in_one_app__extension_group", - "addon": "graph_y_shape_in_one_app__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "addon": "graph_y_shape_in_one_app__extension_1", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_y_shape_in_one_app__extension_group" + },{ + "type": "extension", + "name": "test_extension_2", + "addon": "graph_y_shape_in_one_app__extension_2", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_y_shape_in_one_app__extension_group" + },{ + "type": "extension", + "name": "test_extension_3", + "addon": "graph_y_shape_in_one_app__extension_3", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_y_shape_in_one_app__extension_group" + },{ + "type": "extension", + "name": "test_extension_4", + "addon": "graph_y_shape_in_one_app__extension_4", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_y_shape_in_one_app__extension_group" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/graph_name/graph_name_basic.cc b/tests/ten_runtime/smoke/extension_test/graph_name/graph_name_basic.cc index f0b6077e0e..9bdeabb4e0 100644 --- a/tests/ten_runtime/smoke/extension_test/graph_name/graph_name_basic.cc +++ b/tests/ten_runtime/smoke/extension_test/graph_name/graph_name_basic.cc @@ -50,49 +50,6 @@ class test_extension : public ten::extension_t { std::string name_; }; -class test_extension_group_1 : public ten::extension_group_t { - public: - explicit test_extension_group_1(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("extension1")); - extensions.push_back(new test_extension("extension2")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - -class test_extension_group_2 : public ten::extension_group_t { - public: - explicit test_extension_group_2(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("extension3")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app_1 : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -158,10 +115,7 @@ void *app_thread_2_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(graph_id_basic__extension_group_1, - test_extension_group_1); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(graph_id_basic__extension_group_2, - test_extension_group_2); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(graph_id_basic__extension, test_extension); } // namespace @@ -190,15 +144,23 @@ TEST(ExtensionTest, GraphNameBasic) { // NOLINT "app": "msgpack://127.0.0.1:8001/" }], "nodes": [{ - "type": "extension_group", - "name": "graph_id_basic__extension_group_1", - "addon": "graph_id_basic__extension_group_1", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "extension1", + "addon": "graph_id_basic__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_id_basic__extension_group_1" },{ - "type": "extension_group", - "name": "graph_id_basic__extension_group_2", - "addon": "graph_id_basic__extension_group_2", - "app": "msgpack://127.0.0.1:8002/" + "type": "extension", + "name": "extension2", + "addon": "graph_id_basic__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "graph_id_basic__extension_group_1" + },{ + "type": "extension", + "name": "extension3", + "addon": "graph_id_basic__extension", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "graph_id_basic__extension_group_2" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/http_server_extension/http_server_extension_close_app.cc b/tests/ten_runtime/smoke/extension_test/http_server_extension/http_server_extension_close_app.cc index f1ced2a36b..f6aa20d09a 100644 --- a/tests/ten_runtime/smoke/extension_test/http_server_extension/http_server_extension_close_app.cc +++ b/tests/ten_runtime/smoke/extension_test/http_server_extension/http_server_extension_close_app.cc @@ -61,10 +61,6 @@ class test_app : public ten::app_t { "name": "default", "auto_start": true, "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "default_extension_group" - },{ "type": "extension", "name": "simple_http_server_cpp", "addon": "simple_http_server_cpp", diff --git a/tests/ten_runtime/smoke/extension_test/http_server_extension/http_server_extension_two_extensions.cc b/tests/ten_runtime/smoke/extension_test/http_server_extension/http_server_extension_two_extensions.cc index 2b1571891e..a30e3e3a01 100644 --- a/tests/ten_runtime/smoke/extension_test/http_server_extension/http_server_extension_two_extensions.cc +++ b/tests/ten_runtime/smoke/extension_test/http_server_extension/http_server_extension_two_extensions.cc @@ -60,10 +60,6 @@ class test_app : public ten::app_t { "name": "default", "auto_start": true, "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "default_extension_group" - },{ "type": "extension", "name": "simple_http_server_cpp", "addon": "simple_http_server_cpp", diff --git a/tests/ten_runtime/smoke/extension_test/lock/lock_data_1.cc b/tests/ten_runtime/smoke/extension_test/lock/lock_data_1.cc index 358e1054ad..1545c08f6d 100644 --- a/tests/ten_runtime/smoke/extension_test/lock/lock_data_1.cc +++ b/tests/ten_runtime/smoke/extension_test/lock/lock_data_1.cc @@ -172,11 +172,6 @@ TEST(ExtensionTest, LockData1) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "extension 1", "addon": "lock_data_1__extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_c_string.cc b/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_c_string.cc index d576adea86..6d62a872a4 100644 --- a/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_c_string.cc +++ b/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_c_string.cc @@ -113,16 +113,6 @@ TEST(ExtensionTest, MsgPropertySendCString) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "msg_property_send_c_string__extension_group_1", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ - "type": "extension_group", - "name": "msg_property_send_c_string__extension_group_2", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "msg_property_send_c_string__extension_1", "addon": "msg_property_send_c_string__extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_cpp_ptr.cc b/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_cpp_ptr.cc index d777a9b1ad..9d2f2f859f 100644 --- a/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_cpp_ptr.cc +++ b/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_cpp_ptr.cc @@ -138,16 +138,6 @@ TEST(ExtensionTest, MsgPropertySendCppPtr) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "msg_property_send_cpp_ptr__extension_group_1", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ - "type": "extension_group", - "name": "msg_property_send_cpp_ptr__extension_group_2", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "msg_property_send_cpp_ptr__extension_1", "addon": "msg_property_send_cpp_ptr__extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_cpp_string.cc b/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_cpp_string.cc index d1ee0883d6..81af14bbcb 100644 --- a/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_cpp_string.cc +++ b/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_cpp_string.cc @@ -111,16 +111,6 @@ TEST(ExtensionTest, MsgPropertySendCppString) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "msg_property_send_cpp_string__extension_group_1", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ - "type": "extension_group", - "name": "msg_property_send_cpp_string__extension_group_2", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "msg_property_send_cpp_string__extension_1", "addon": "msg_property_send_cpp_string__extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_float_ptr.cc b/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_float_ptr.cc index c71598647d..66e90d12e2 100644 --- a/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_float_ptr.cc +++ b/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_float_ptr.cc @@ -120,16 +120,6 @@ TEST(ExtensionTest, MsgPropertySendFloatPtr) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "msg_property_send_float_ptr__extension_group_1", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ - "type": "extension_group", - "name": "msg_property_send_float_ptr__extension_group_2", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "msg_property_send_float_ptr__extension_1", "addon": "msg_property_send_float_ptr__extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_int.cc b/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_int.cc index f474f56371..d7a52d6435 100644 --- a/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_int.cc +++ b/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_int.cc @@ -112,16 +112,6 @@ TEST(ExtensionTest, MsgPropertySendInt) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "msg_property_send_int__extension_group_1", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ - "type": "extension_group", - "name": "msg_property_send_int__extension_group_2", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "msg_property_send_int__extension_1", "addon": "msg_property_send_int__extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_int32_ptr.cc b/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_int32_ptr.cc index 42ce8c605c..f5a42d6318 100644 --- a/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_int32_ptr.cc +++ b/tests/ten_runtime/smoke/extension_test/msg_property/msg_property_send_int32_ptr.cc @@ -120,16 +120,6 @@ TEST(ExtensionTest, MsgPropertySendInt32Ptr) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "msg_property_send_int32_ptr__extension_group_1", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ - "type": "extension_group", - "name": "msg_property_send_int32_ptr__extension_group_2", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "msg_property_send_int32_ptr__extension_1", "addon": "msg_property_send_int32_ptr__extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_basic.cc b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_basic.cc index d60c84d048..bff8fa95ba 100644 --- a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_basic.cc +++ b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_basic.cc @@ -111,11 +111,6 @@ TEST(ExtensionTest, MultiDestBasic) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "extension 1", "addon": "multi_dest_basic__extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_in_multi_app.cc b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_in_multi_app.cc index 8f0a501048..2448e51dbc 100644 --- a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_in_multi_app.cc +++ b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_in_multi_app.cc @@ -57,34 +57,8 @@ return nullptr; \ } -#define ADD_EXTENSION(N) \ - extensions.push_back(new test_extension_##N("test_extension_" #N)); - -#define DEFINE_EXTENSION_GROUP(N, A, B, C) \ - class test_extension_group_##N : public ten::extension_group_t { \ - public: \ - explicit test_extension_group_##N(const std::string &name) \ - : ten::extension_group_t(name) {} \ - \ - void on_create_extensions(ten::ten_env_t &ten_env) override { \ - std::vector extensions; \ - ADD_EXTENSION(A); \ - ADD_EXTENSION(B); \ - ADD_EXTENSION(C); \ - ten_env.on_create_extensions_done(extensions); \ - } \ - \ - void on_destroy_extensions( \ - ten::ten_env_t &ten_env, \ - const std::vector &extensions) override { \ - for (auto iter = extensions.begin(); iter != extensions.end(); ++iter) { \ - delete *iter; \ - } \ - ten_env.on_destroy_extensions_done(); \ - } \ - }; \ - TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( \ - multi_dest_in_multi_app__extension_group_##N, test_extension_group_##N); +#define REGISTER_EXTENSION(N) \ + TEN_CPP_REGISTER_ADDON_AS_EXTENSION(multi_dest_in_multi_app__extension_##N, test_extension_##N); #define START_APP(N) \ auto test_app_##N##_thread = \ @@ -150,11 +124,21 @@ DEFINE_EXTENSION(13) DEFINE_EXTENSION(14) DEFINE_EXTENSION(15) -DEFINE_EXTENSION_GROUP(1, 1, 2, 3) -DEFINE_EXTENSION_GROUP(2, 4, 5, 6) -DEFINE_EXTENSION_GROUP(3, 7, 8, 9) -DEFINE_EXTENSION_GROUP(4, 10, 11, 12) -DEFINE_EXTENSION_GROUP(5, 13, 14, 15) +REGISTER_EXTENSION(1) +REGISTER_EXTENSION(2) +REGISTER_EXTENSION(3) +REGISTER_EXTENSION(4) +REGISTER_EXTENSION(5) +REGISTER_EXTENSION(6) +REGISTER_EXTENSION(7) +REGISTER_EXTENSION(8) +REGISTER_EXTENSION(9) +REGISTER_EXTENSION(10) +REGISTER_EXTENSION(11) +REGISTER_EXTENSION(12) +REGISTER_EXTENSION(13) +REGISTER_EXTENSION(14) +REGISTER_EXTENSION(15) } // namespace @@ -194,30 +178,95 @@ TEST(ExtensionTest, MultiDestInMultiApp) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "multi_dest_in_multi_app__extension_group_1", - "addon": "multi_dest_in_multi_app__extension_group_1", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "addon": "multi_dest_in_multi_app__extension_1", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "multi_dest_in_multi_app__extension_group_1" + },{ + "type": "extension", + "name": "test_extension_2", + "addon": "multi_dest_in_multi_app__extension_2", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "multi_dest_in_multi_app__extension_group_1" + },{ + "type": "extension", + "name": "test_extension_3", + "addon": "multi_dest_in_multi_app__extension_3", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "multi_dest_in_multi_app__extension_group_1" + },{ + "type": "extension", + "name": "test_extension_4", + "addon": "multi_dest_in_multi_app__extension_4", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "multi_dest_in_multi_app__extension_group_2" + },{ + "type": "extension", + "name": "test_extension_5", + "addon": "multi_dest_in_multi_app__extension_5", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "multi_dest_in_multi_app__extension_group_2" + },{ + "type": "extension", + "name": "test_extension_6", + "addon": "multi_dest_in_multi_app__extension_6", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "multi_dest_in_multi_app__extension_group_2" + },{ + "type": "extension", + "name": "test_extension_7", + "addon": "multi_dest_in_multi_app__extension_7", + "app": "msgpack://127.0.0.1:8003/", + "extension_group": "multi_dest_in_multi_app__extension_group_3" + },{ + "type": "extension", + "name": "test_extension_8", + "addon": "multi_dest_in_multi_app__extension_8", + "app": "msgpack://127.0.0.1:8003/", + "extension_group": "multi_dest_in_multi_app__extension_group_3" + },{ + "type": "extension", + "name": "test_extension_9", + "addon": "multi_dest_in_multi_app__extension_9", + "app": "msgpack://127.0.0.1:8003/", + "extension_group": "multi_dest_in_multi_app__extension_group_3" + },{ + "type": "extension", + "name": "test_extension_10", + "addon": "multi_dest_in_multi_app__extension_10", + "app": "msgpack://127.0.0.1:8004/", + "extension_group": "multi_dest_in_multi_app__extension_group_4" + },{ + "type": "extension", + "name": "test_extension_11", + "addon": "multi_dest_in_multi_app__extension_11", + "app": "msgpack://127.0.0.1:8004/", + "extension_group": "multi_dest_in_multi_app__extension_group_4" },{ - "type": "extension_group", - "name": "multi_dest_in_multi_app__extension_group_2", - "addon": "multi_dest_in_multi_app__extension_group_2", - "app": "msgpack://127.0.0.1:8002/" + "type": "extension", + "name": "test_extension_12", + "addon": "multi_dest_in_multi_app__extension_12", + "app": "msgpack://127.0.0.1:8004/", + "extension_group": "multi_dest_in_multi_app__extension_group_4" },{ - "type": "extension_group", - "name": "multi_dest_in_multi_app__extension_group_3", - "addon": "multi_dest_in_multi_app__extension_group_3", - "app": "msgpack://127.0.0.1:8003/" + "type": "extension", + "name": "test_extension_13", + "addon": "multi_dest_in_multi_app__extension_13", + "app": "msgpack://127.0.0.1:8005/", + "extension_group": "multi_dest_in_multi_app__extension_group_5" },{ - "type": "extension_group", - "name": "multi_dest_in_multi_app__extension_group_4", - "addon": "multi_dest_in_multi_app__extension_group_4", - "app": "msgpack://127.0.0.1:8004/" + "type": "extension", + "name": "test_extension_14", + "addon": "multi_dest_in_multi_app__extension_14", + "app": "msgpack://127.0.0.1:8005/", + "extension_group": "multi_dest_in_multi_app__extension_group_5" },{ - "type": "extension_group", - "name": "multi_dest_in_multi_app__extension_group_5", - "addon": "multi_dest_in_multi_app__extension_group_5", - "app": "msgpack://127.0.0.1:8005/" + "type": "extension", + "name": "test_extension_15", + "addon": "multi_dest_in_multi_app__extension_15", + "app": "msgpack://127.0.0.1:8005/", + "extension_group": "multi_dest_in_multi_app__extension_group_5" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_in_multi_app_with_response_handler.cc b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_in_multi_app_with_response_handler.cc index 29d07c6cc9..f0fc6effb9 100644 --- a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_in_multi_app_with_response_handler.cc +++ b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_in_multi_app_with_response_handler.cc @@ -57,35 +57,8 @@ return nullptr; \ } -#define ADD_EXTENSION(N) \ - extensions.push_back(new test_extension_##N("test_extension_" #N)); - -#define DEFINE_EXTENSION_GROUP(N, A, B, C) \ - class test_extension_group_##N : public ten::extension_group_t { \ - public: \ - explicit test_extension_group_##N(const std::string &name) \ - : ten::extension_group_t(name) {} \ - \ - void on_create_extensions(ten::ten_env_t &ten_env) override { \ - std::vector extensions; \ - ADD_EXTENSION(A); \ - ADD_EXTENSION(B); \ - ADD_EXTENSION(C); \ - ten_env.on_create_extensions_done(extensions); \ - } \ - \ - void on_destroy_extensions( \ - ten::ten_env_t &ten_env, \ - const std::vector &extensions) override { \ - for (auto iter = extensions.begin(); iter != extensions.end(); ++iter) { \ - delete *iter; \ - } \ - ten_env.on_destroy_extensions_done(); \ - } \ - }; \ - TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( \ - multi_dest_in_multi_app_with_result_handler__extension_group_##N, \ - test_extension_group_##N); +#define REGISTER_EXTENSION(N) \ + TEN_CPP_REGISTER_ADDON_AS_EXTENSION(multi_dest_in_multi_app_with_result_handler__extension_##N, test_extension_##N); #define START_APP(N) \ auto test_app_##N##_thread = \ @@ -151,11 +124,21 @@ DEFINE_EXTENSION(13) DEFINE_EXTENSION(14) DEFINE_EXTENSION(15) -DEFINE_EXTENSION_GROUP(1, 1, 2, 3) -DEFINE_EXTENSION_GROUP(2, 4, 5, 6) -DEFINE_EXTENSION_GROUP(3, 7, 8, 9) -DEFINE_EXTENSION_GROUP(4, 10, 11, 12) -DEFINE_EXTENSION_GROUP(5, 13, 14, 15) +REGISTER_EXTENSION(1) +REGISTER_EXTENSION(2) +REGISTER_EXTENSION(3) +REGISTER_EXTENSION(4) +REGISTER_EXTENSION(5) +REGISTER_EXTENSION(6) +REGISTER_EXTENSION(7) +REGISTER_EXTENSION(8) +REGISTER_EXTENSION(9) +REGISTER_EXTENSION(10) +REGISTER_EXTENSION(11) +REGISTER_EXTENSION(12) +REGISTER_EXTENSION(13) +REGISTER_EXTENSION(14) +REGISTER_EXTENSION(15) } // namespace @@ -195,30 +178,95 @@ TEST(ExtensionTest, MultiDestInMultiAppWithResponseHandler) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "multi_dest_in_multi_app_with_result_handler__extension_group_1", - "addon": "multi_dest_in_multi_app_with_result_handler__extension_group_1", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "addon": "multi_dest_in_multi_app_with_result_handler__extension_1", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "multi_dest_in_multi_app_with_result_handler__extension_group_1" + },{ + "type": "extension", + "name": "test_extension_2", + "addon": "multi_dest_in_multi_app_with_result_handler__extension_2", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "multi_dest_in_multi_app_with_result_handler__extension_group_1" + },{ + "type": "extension", + "name": "test_extension_3", + "addon": "multi_dest_in_multi_app_with_result_handler__extension_3", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "multi_dest_in_multi_app_with_result_handler__extension_group_1" + },{ + "type": "extension", + "name": "test_extension_4", + "addon": "multi_dest_in_multi_app_with_result_handler__extension_4", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "multi_dest_in_multi_app_with_result_handler__extension_group_2" + },{ + "type": "extension", + "name": "test_extension_5", + "addon": "multi_dest_in_multi_app_with_result_handler__extension_5", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "multi_dest_in_multi_app_with_result_handler__extension_group_2" + },{ + "type": "extension", + "name": "test_extension_6", + "addon": "multi_dest_in_multi_app_with_result_handler__extension_6", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "multi_dest_in_multi_app_with_result_handler__extension_group_2" + },{ + "type": "extension", + "name": "test_extension_7", + "addon": "multi_dest_in_multi_app_with_result_handler__extension_7", + "app": "msgpack://127.0.0.1:8003/", + "extension_group": "multi_dest_in_multi_app_with_result_handler__extension_group_3" + },{ + "type": "extension", + "name": "test_extension_8", + "addon": "multi_dest_in_multi_app_with_result_handler__extension_8", + "app": "msgpack://127.0.0.1:8003/", + "extension_group": "multi_dest_in_multi_app_with_result_handler__extension_group_3" + },{ + "type": "extension", + "name": "test_extension_9", + "addon": "multi_dest_in_multi_app_with_result_handler__extension_9", + "app": "msgpack://127.0.0.1:8003/", + "extension_group": "multi_dest_in_multi_app_with_result_handler__extension_group_3" + },{ + "type": "extension", + "name": "test_extension_10", + "addon": "multi_dest_in_multi_app_with_result_handler__extension_10", + "app": "msgpack://127.0.0.1:8004/", + "extension_group": "multi_dest_in_multi_app_with_result_handler__extension_group_4" + },{ + "type": "extension", + "name": "test_extension_11", + "addon": "multi_dest_in_multi_app_with_result_handler__extension_11", + "app": "msgpack://127.0.0.1:8004/", + "extension_group": "multi_dest_in_multi_app_with_result_handler__extension_group_4" },{ - "type": "extension_group", - "name": "multi_dest_in_multi_app_with_result_handler__extension_group_2", - "addon": "multi_dest_in_multi_app_with_result_handler__extension_group_2", - "app": "msgpack://127.0.0.1:8002/" + "type": "extension", + "name": "test_extension_12", + "addon": "multi_dest_in_multi_app_with_result_handler__extension_12", + "app": "msgpack://127.0.0.1:8004/", + "extension_group": "multi_dest_in_multi_app_with_result_handler__extension_group_4" },{ - "type": "extension_group", - "name": "multi_dest_in_multi_app_with_result_handler__extension_group_3", - "addon": "multi_dest_in_multi_app_with_result_handler__extension_group_3", - "app": "msgpack://127.0.0.1:8003/" + "type": "extension", + "name": "test_extension_13", + "addon": "multi_dest_in_multi_app_with_result_handler__extension_13", + "app": "msgpack://127.0.0.1:8005/", + "extension_group": "multi_dest_in_multi_app_with_result_handler__extension_group_5" },{ - "type": "extension_group", - "name": "multi_dest_in_multi_app_with_result_handler__extension_group_4", - "addon": "multi_dest_in_multi_app_with_result_handler__extension_group_4", - "app": "msgpack://127.0.0.1:8004/" + "type": "extension", + "name": "test_extension_14", + "addon": "multi_dest_in_multi_app_with_result_handler__extension_14", + "app": "msgpack://127.0.0.1:8005/", + "extension_group": "multi_dest_in_multi_app_with_result_handler__extension_group_5" },{ - "type": "extension_group", - "name": "multi_dest_in_multi_app_with_result_handler__extension_group_5", - "addon": "multi_dest_in_multi_app_with_result_handler__extension_group_5", - "app": "msgpack://127.0.0.1:8005/" + "type": "extension", + "name": "test_extension_15", + "addon": "multi_dest_in_multi_app_with_result_handler__extension_15", + "app": "msgpack://127.0.0.1:8005/", + "extension_group": "multi_dest_in_multi_app_with_result_handler__extension_group_5" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_in_multi_app_with_response_handler_lambda.cc b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_in_multi_app_with_response_handler_lambda.cc index a589a1ac56..fbdcec669e 100644 --- a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_in_multi_app_with_response_handler_lambda.cc +++ b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_in_multi_app_with_response_handler_lambda.cc @@ -59,35 +59,8 @@ return nullptr; \ } -#define ADD_EXTENSION(N) \ - extensions.push_back(new test_extension_##N("test_extension_" #N)); - -#define DEFINE_EXTENSION_GROUP(N, A, B, C) \ - class test_extension_group_##N : public ten::extension_group_t { \ - public: \ - explicit test_extension_group_##N(const std::string &name) \ - : ten::extension_group_t(name) {} \ - \ - void on_create_extensions(ten::ten_env_t &ten_env) override { \ - std::vector extensions; \ - ADD_EXTENSION(A); \ - ADD_EXTENSION(B); \ - ADD_EXTENSION(C); \ - ten_env.on_create_extensions_done(extensions); \ - } \ - \ - void on_destroy_extensions( \ - ten::ten_env_t &ten_env, \ - const std::vector &extensions) override { \ - for (auto iter = extensions.begin(); iter != extensions.end(); ++iter) { \ - delete *iter; \ - } \ - ten_env.on_destroy_extensions_done(); \ - } \ - }; \ - TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( \ - multi_dest_in_multi_app_with_result_handler_lambda__extension_group_##N, \ - test_extension_group_##N); +#define REGISTER_EXTENSION(N) \ + TEN_CPP_REGISTER_ADDON_AS_EXTENSION(multi_dest_in_multi_app_with_result_handler_lambda__extension_##N, test_extension_##N); #define START_APP(N) \ auto test_app_##N##_thread = \ @@ -156,11 +129,21 @@ DEFINE_EXTENSION(13) DEFINE_EXTENSION(14) DEFINE_EXTENSION(15) -DEFINE_EXTENSION_GROUP(1, 1, 2, 3) -DEFINE_EXTENSION_GROUP(2, 4, 5, 6) -DEFINE_EXTENSION_GROUP(3, 7, 8, 9) -DEFINE_EXTENSION_GROUP(4, 10, 11, 12) -DEFINE_EXTENSION_GROUP(5, 13, 14, 15) +REGISTER_EXTENSION(1) +REGISTER_EXTENSION(2) +REGISTER_EXTENSION(3) +REGISTER_EXTENSION(4) +REGISTER_EXTENSION(5) +REGISTER_EXTENSION(6) +REGISTER_EXTENSION(7) +REGISTER_EXTENSION(8) +REGISTER_EXTENSION(9) +REGISTER_EXTENSION(10) +REGISTER_EXTENSION(11) +REGISTER_EXTENSION(12) +REGISTER_EXTENSION(13) +REGISTER_EXTENSION(14) +REGISTER_EXTENSION(15) } // namespace @@ -200,30 +183,95 @@ TEST(ExtensionTest, MultiDestInMultiAppWithResponseHandlerLambda) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "multi_dest_in_multi_app_with_result_handler_lambda__extension_group_1", - "addon": "multi_dest_in_multi_app_with_result_handler_lambda__extension_group_1", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "addon": "multi_dest_in_multi_app_with_result_handler_lambda__extension_1", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "multi_dest_in_multi_app_with_result_handler_lambda__extension_group_1" + },{ + "type": "extension", + "name": "test_extension_2", + "addon": "multi_dest_in_multi_app_with_result_handler_lambda__extension_2", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "multi_dest_in_multi_app_with_result_handler_lambda__extension_group_1" + },{ + "type": "extension", + "name": "test_extension_3", + "addon": "multi_dest_in_multi_app_with_result_handler_lambda__extension_3", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "multi_dest_in_multi_app_with_result_handler_lambda__extension_group_1" + },{ + "type": "extension", + "name": "test_extension_4", + "addon": "multi_dest_in_multi_app_with_result_handler_lambda__extension_4", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "multi_dest_in_multi_app_with_result_handler_lambda__extension_group_2" + },{ + "type": "extension", + "name": "test_extension_5", + "addon": "multi_dest_in_multi_app_with_result_handler_lambda__extension_5", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "multi_dest_in_multi_app_with_result_handler_lambda__extension_group_2" + },{ + "type": "extension", + "name": "test_extension_6", + "addon": "multi_dest_in_multi_app_with_result_handler_lambda__extension_6", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "multi_dest_in_multi_app_with_result_handler_lambda__extension_group_2" + },{ + "type": "extension", + "name": "test_extension_7", + "addon": "multi_dest_in_multi_app_with_result_handler_lambda__extension_7", + "app": "msgpack://127.0.0.1:8003/", + "extension_group": "multi_dest_in_multi_app_with_result_handler_lambda__extension_group_3" + },{ + "type": "extension", + "name": "test_extension_8", + "addon": "multi_dest_in_multi_app_with_result_handler_lambda__extension_8", + "app": "msgpack://127.0.0.1:8003/", + "extension_group": "multi_dest_in_multi_app_with_result_handler_lambda__extension_group_3" + },{ + "type": "extension", + "name": "test_extension_9", + "addon": "multi_dest_in_multi_app_with_result_handler_lambda__extension_9", + "app": "msgpack://127.0.0.1:8003/", + "extension_group": "multi_dest_in_multi_app_with_result_handler_lambda__extension_group_3" + },{ + "type": "extension", + "name": "test_extension_10", + "addon": "multi_dest_in_multi_app_with_result_handler_lambda__extension_10", + "app": "msgpack://127.0.0.1:8004/", + "extension_group": "multi_dest_in_multi_app_with_result_handler_lambda__extension_group_4" + },{ + "type": "extension", + "name": "test_extension_11", + "addon": "multi_dest_in_multi_app_with_result_handler_lambda__extension_11", + "app": "msgpack://127.0.0.1:8004/", + "extension_group": "multi_dest_in_multi_app_with_result_handler_lambda__extension_group_4" },{ - "type": "extension_group", - "name": "multi_dest_in_multi_app_with_result_handler_lambda__extension_group_2", - "addon": "multi_dest_in_multi_app_with_result_handler_lambda__extension_group_2", - "app": "msgpack://127.0.0.1:8002/" + "type": "extension", + "name": "test_extension_12", + "addon": "multi_dest_in_multi_app_with_result_handler_lambda__extension_12", + "app": "msgpack://127.0.0.1:8004/", + "extension_group": "multi_dest_in_multi_app_with_result_handler_lambda__extension_group_4" },{ - "type": "extension_group", - "name": "multi_dest_in_multi_app_with_result_handler_lambda__extension_group_3", - "addon": "multi_dest_in_multi_app_with_result_handler_lambda__extension_group_3", - "app": "msgpack://127.0.0.1:8003/" + "type": "extension", + "name": "test_extension_13", + "addon": "multi_dest_in_multi_app_with_result_handler_lambda__extension_13", + "app": "msgpack://127.0.0.1:8005/", + "extension_group": "multi_dest_in_multi_app_with_result_handler_lambda__extension_group_5" },{ - "type": "extension_group", - "name": "multi_dest_in_multi_app_with_result_handler_lambda__extension_group_4", - "addon": "multi_dest_in_multi_app_with_result_handler_lambda__extension_group_4", - "app": "msgpack://127.0.0.1:8004/" + "type": "extension", + "name": "test_extension_14", + "addon": "multi_dest_in_multi_app_with_result_handler_lambda__extension_14", + "app": "msgpack://127.0.0.1:8005/", + "extension_group": "multi_dest_in_multi_app_with_result_handler_lambda__extension_group_5" },{ - "type": "extension_group", - "name": "multi_dest_in_multi_app_with_result_handler_lambda__extension_group_5", - "addon": "multi_dest_in_multi_app_with_result_handler_lambda__extension_group_5", - "app": "msgpack://127.0.0.1:8005/" + "type": "extension", + "name": "test_extension_15", + "addon": "multi_dest_in_multi_app_with_result_handler_lambda__extension_15", + "app": "msgpack://127.0.0.1:8005/", + "extension_group": "multi_dest_in_multi_app_with_result_handler_lambda__extension_group_5" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_in_one_app.cc b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_in_one_app.cc index 80b66c61a3..e506741319 100644 --- a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_in_one_app.cc +++ b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_in_one_app.cc @@ -133,64 +133,6 @@ DEFINE_TEST_EXTENSION(33) DEFINE_TEST_EXTENSION(34) DEFINE_TEST_EXTENSION(35) -#define ADD_TEST_EXTENSION(N) \ - extensions.push_back(new test_extension_##N("test_extension_" #N)); - -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - ADD_TEST_EXTENSION(1) - ADD_TEST_EXTENSION(2) - ADD_TEST_EXTENSION(3) - ADD_TEST_EXTENSION(4) - ADD_TEST_EXTENSION(5) - ADD_TEST_EXTENSION(6) - ADD_TEST_EXTENSION(7) - ADD_TEST_EXTENSION(8) - ADD_TEST_EXTENSION(9) - ADD_TEST_EXTENSION(10) - ADD_TEST_EXTENSION(11) - ADD_TEST_EXTENSION(12) - ADD_TEST_EXTENSION(13) - ADD_TEST_EXTENSION(14) - ADD_TEST_EXTENSION(15) - ADD_TEST_EXTENSION(16) - ADD_TEST_EXTENSION(17) - ADD_TEST_EXTENSION(18) - ADD_TEST_EXTENSION(19) - ADD_TEST_EXTENSION(20) - ADD_TEST_EXTENSION(21) - ADD_TEST_EXTENSION(22) - ADD_TEST_EXTENSION(23) - ADD_TEST_EXTENSION(24) - ADD_TEST_EXTENSION(25) - ADD_TEST_EXTENSION(26) - ADD_TEST_EXTENSION(27) - ADD_TEST_EXTENSION(28) - ADD_TEST_EXTENSION(29) - ADD_TEST_EXTENSION(30) - ADD_TEST_EXTENSION(31) - ADD_TEST_EXTENSION(32) - ADD_TEST_EXTENSION(33) - ADD_TEST_EXTENSION(34) - ADD_TEST_EXTENSION(35) - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -219,8 +161,45 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - multi_dest_in_one_app__extension_group, test_extension_group); +#define REGISTER_ADDON_AS_EXTENSION(N) \ + TEN_CPP_REGISTER_ADDON_AS_EXTENSION(multi_dest_in_one_app__extension_##N, \ + test_extension_##N); + +REGISTER_ADDON_AS_EXTENSION(1) +REGISTER_ADDON_AS_EXTENSION(2) +REGISTER_ADDON_AS_EXTENSION(3) +REGISTER_ADDON_AS_EXTENSION(4) +REGISTER_ADDON_AS_EXTENSION(5) +REGISTER_ADDON_AS_EXTENSION(6) +REGISTER_ADDON_AS_EXTENSION(7) +REGISTER_ADDON_AS_EXTENSION(8) +REGISTER_ADDON_AS_EXTENSION(9) +REGISTER_ADDON_AS_EXTENSION(10) +REGISTER_ADDON_AS_EXTENSION(11) +REGISTER_ADDON_AS_EXTENSION(12) +REGISTER_ADDON_AS_EXTENSION(13) +REGISTER_ADDON_AS_EXTENSION(14) +REGISTER_ADDON_AS_EXTENSION(15) +REGISTER_ADDON_AS_EXTENSION(16) +REGISTER_ADDON_AS_EXTENSION(17) +REGISTER_ADDON_AS_EXTENSION(18) +REGISTER_ADDON_AS_EXTENSION(19) +REGISTER_ADDON_AS_EXTENSION(20) +REGISTER_ADDON_AS_EXTENSION(21) +REGISTER_ADDON_AS_EXTENSION(22) +REGISTER_ADDON_AS_EXTENSION(23) +REGISTER_ADDON_AS_EXTENSION(24) +REGISTER_ADDON_AS_EXTENSION(25) +REGISTER_ADDON_AS_EXTENSION(26) +REGISTER_ADDON_AS_EXTENSION(27) +REGISTER_ADDON_AS_EXTENSION(28) +REGISTER_ADDON_AS_EXTENSION(29) +REGISTER_ADDON_AS_EXTENSION(30) +REGISTER_ADDON_AS_EXTENSION(31) +REGISTER_ADDON_AS_EXTENSION(32) +REGISTER_ADDON_AS_EXTENSION(33) +REGISTER_ADDON_AS_EXTENSION(34) +REGISTER_ADDON_AS_EXTENSION(35) } // namespace @@ -232,165 +211,44 @@ TEST(ExtensionTest, MultiDestInOneApp) { // NOLINT // Create a client and connect to the app. auto *client = new ten::msgpack_tcp_client_t("msgpack://127.0.0.1:8001/"); - // Send graph. - nlohmann::json resp = client->send_json_and_recv_resp_in_json( - R"({ + auto request = R"({ "_ten": { "type": "start_graph", "seq_id": "55", - "nodes": [{ - "type": "extension_group", - "name": "multi_dest_in_one_app__extension_group", - "addon": "multi_dest_in_one_app__extension_group", - "app": "msgpack://127.0.0.1:8001/" - }], + "nodes": [], "connections": [{ "app": "msgpack://127.0.0.1:8001/", "extension_group": "multi_dest_in_one_app__extension_group", "extension": "test_extension_1", "cmd": [{ "name": "hello_world", - "dest": [{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_2" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_3" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_4" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_5" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_6" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_7" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_8" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_9" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_10" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_11" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_12" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_13" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_14" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_15" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_16" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_17" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_18" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_19" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_20" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_21" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_22" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_23" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_24" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_25" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_26" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_27" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_28" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_29" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_30" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_31" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_32" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_33" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_34" - },{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "multi_dest_in_one_app__extension_group", - "extension": "test_extension_35" - }] + "dest": [] }] }] } - })"_json); + })"_json; + + for (int i = 1; i <= DEST_EXTENSION_MAX_ID; i++) { + request["_ten"]["nodes"].push_back({ + {"type", "extension"}, + {"name", "test_extension_" + std::to_string(i)}, + {"addon", "multi_dest_in_one_app__extension_" + std::to_string(i)}, + {"app", "msgpack://127.0.0.1:8001/"}, + {"extension_group", "multi_dest_in_one_app__extension_group"}, + }); + } + + for (int i = DEST_EXTENSION_MIN_ID; i <= DEST_EXTENSION_MAX_ID; i++) { + request["_ten"]["connections"][0]["cmd"][0]["dest"].push_back({ + {"app", "msgpack://127.0.0.1:8001/"}, // app + {"extension_group", + "multi_dest_in_one_app__extension_group"}, // extension_group + {"extension", "test_extension_" + std::to_string(i)}, // extension + }); + } + + // Send graph. + nlohmann::json resp = client->send_json_and_recv_resp_in_json(request); ten_test::check_status_code_is(resp, TEN_STATUS_CODE_OK); // Send a user-defined 'hello world' command to 'extension 1'. diff --git a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_resp_when_all.cc b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_resp_when_all.cc index b40c559472..4b11c6429a 100644 --- a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_resp_when_all.cc +++ b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_resp_when_all.cc @@ -112,11 +112,6 @@ TEST(ExtensionTest, MultiDestRespWhenAll) { "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "extension 1", "addon": "multi_dest_resp_when_all__extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_resp_when_all_in_multi_app.cc b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_resp_when_all_in_multi_app.cc index 99d880c950..ca50341d2a 100644 --- a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_resp_when_all_in_multi_app.cc +++ b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_resp_when_all_in_multi_app.cc @@ -179,32 +179,17 @@ TEST(ExtensionTest, MultiDestRespWhenAllInMultiApp) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "extension 1", "addon": "multi_dest_resp_when_all_in_multi_app__extension_1", "app": "msgpack://127.0.0.1:8001/", "extension_group": "test_extension_group" - },{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8002/" },{ "type": "extension", "name": "extension 2", "addon": "multi_dest_resp_when_all_in_multi_app__extension_2", "app": "msgpack://127.0.0.1:8002/", "extension_group": "test_extension_group" - },{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8003/" },{ "type": "extension", "name": "extension 3", diff --git a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_y_topo.cc b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_y_topo.cc index bdf8b3851e..0a7436092b 100644 --- a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_y_topo.cc +++ b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_y_topo.cc @@ -149,11 +149,6 @@ TEST(ExtensionTest, MultiDestYGraph) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "extension_1", "addon": "multi_dest_y_graph__extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/128_threads_attempt_to_suspend_1.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/128_threads_attempt_to_suspend_1.cc index b0fae358a0..59cf3acffe 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/128_threads_attempt_to_suspend_1.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/128_threads_attempt_to_suspend_1.cc @@ -1031,11 +1031,6 @@ TEST(ExtensionTest, "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "one_hundred_and_twenty_eight_threads_attempt_to_suspend_1__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/16_threads_attempt_to_suspend_1.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/16_threads_attempt_to_suspend_1.cc index 84cad92ced..5d4510d5f1 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/16_threads_attempt_to_suspend_1.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/16_threads_attempt_to_suspend_1.cc @@ -305,11 +305,6 @@ TEST(ExtensionTest, SixteenThreadsAttemptToSuspend1) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "sixteen_threads_attempt_to_suspend_1__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_1.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_1.cc index bb49ceb7e6..70b0c14c48 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_1.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_1.cc @@ -225,11 +225,6 @@ TEST(ExtensionTest, TwoThreadsAttemptToSuspend1) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "two_threads_attempt_to_suspend_1__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_2.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_2.cc index f2d89fdbbb..e7718dcdc9 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_2.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_2.cc @@ -227,11 +227,6 @@ TEST(ExtensionTest, TwoThreadsAttemptToSuspend2) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "two_threads_attempt_to_suspend_2__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_3.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_3.cc index c124886d2e..bff45849d3 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_3.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_3.cc @@ -250,11 +250,6 @@ TEST(ExtensionTest, TwoThreadsAttemptToSuspend3) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "two_threads_attempt_to_suspend_3__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_4.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_4.cc index 2dab45c6b1..a06cf5d0a4 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_4.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_4.cc @@ -260,11 +260,6 @@ TEST(ExtensionTest, TwoThreadsAttemptToSuspend4) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "two_threads_attempt_to_suspend_4__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_5.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_5.cc index 27c7b0eee8..d5fb4f463e 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_5.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_5.cc @@ -265,11 +265,6 @@ TEST(ExtensionTest, TwoThreadsAttemptToSuspend5) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "two_threads_attempt_to_suspend_5__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_6.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_6.cc index 48f41ade68..62d1ce4766 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_6.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_6.cc @@ -226,11 +226,6 @@ TEST(ExtensionTest, TwoThreadsAttemptToSuspend6) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "two_threads_attempt_to_suspend_6__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_7.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_7.cc index 1226f19148..16fe8a5e5b 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_7.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/2_threads_attempt_to_suspend_7.cc @@ -226,11 +226,6 @@ TEST(ExtensionTest, TwoThreadsAttemptToSuspend7) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "two_threads_attempt_to_suspend_7__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_1.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_1.cc index fa50b8354b..0f53d33b75 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_1.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_1.cc @@ -387,11 +387,6 @@ TEST(ExtensionTest, ThirtyTwoThreadsAttemptToSuspend1) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "thirty_two_threads_attempt_to_suspend_1__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_2.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_2.cc index a84d860697..88e2398664 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_2.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_2.cc @@ -394,11 +394,6 @@ TEST(ExtensionTest, ThirtyTwoThreadsAttemptToSuspend2) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "thirty_two_threads_attempt_to_suspend_2__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_3.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_3.cc index 96dcb4a573..6ae0120814 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_3.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_3.cc @@ -389,11 +389,6 @@ TEST(ExtensionTest, ThirtyTwoThreadsAttemptToSuspend3) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "thirty_two_threads_attempt_to_suspend_3__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_4.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_4.cc index a478471f7f..4de2e71e6c 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_4.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_4.cc @@ -399,11 +399,6 @@ TEST(ExtensionTest, ThirtyTwoThreadsAttemptToSuspend4) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "thirty_two_threads_attempt_to_suspend_4__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_5.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_5.cc index ffb44b45e5..49c529671a 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_5.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_5.cc @@ -484,11 +484,6 @@ TEST(ExtensionTest, ThirtyTwoThreadsAttemptToSuspend5) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "thirty_two_threads_attempt_to_suspend_5__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_6.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_6.cc index 8cfbd4a4e5..9d4042e783 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_6.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/32_threads_attempt_to_suspend_6.cc @@ -502,11 +502,6 @@ TEST(ExtensionTest, ThirtyTwoThreadsAttemptToSuspend6) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "thirty_two_threads_attempt_to_suspend_6__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/auto_free_out_of_scope.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/auto_free_out_of_scope.cc index 086af2c28f..f655bc4925 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/auto_free_out_of_scope.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/auto_free_out_of_scope.cc @@ -212,11 +212,6 @@ TEST(ExtensionTest, AutoFreeOutOfScope) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "auto_free_out_of_scope__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/outer_thread_send_data.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/outer_thread_send_data.cc index 49b0864942..1b6680176b 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/outer_thread_send_data.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/outer_thread_send_data.cc @@ -178,11 +178,6 @@ TEST(ExtensionTest, OuterThreadSendData) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "outer_thread_send_data__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/outer_thread/outer_thread_send_data_resp_handler.cc b/tests/ten_runtime/smoke/extension_test/outer_thread/outer_thread_send_data_resp_handler.cc index b171d03ac7..0151a6e9e7 100644 --- a/tests/ten_runtime/smoke/extension_test/outer_thread/outer_thread_send_data_resp_handler.cc +++ b/tests/ten_runtime/smoke/extension_test/outer_thread/outer_thread_send_data_resp_handler.cc @@ -203,11 +203,6 @@ TEST(ExtensionTest, OuterThreadSendDataRespHandler) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "outer_thread_send_data_resp_handler__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/path/clean_when_stopped.cc b/tests/ten_runtime/smoke/extension_test/path/clean_when_stopped.cc index 857ffc8a1f..209fa97f7a 100644 --- a/tests/ten_runtime/smoke/extension_test/path/clean_when_stopped.cc +++ b/tests/ten_runtime/smoke/extension_test/path/clean_when_stopped.cc @@ -108,11 +108,6 @@ TEST(ExtensionTest, CleanWhenStopped) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "clean_when_stopped__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/path/path_timeout.cc b/tests/ten_runtime/smoke/extension_test/path/path_timeout.cc index 87054b08f3..874adb933f 100644 --- a/tests/ten_runtime/smoke/extension_test/path/path_timeout.cc +++ b/tests/ten_runtime/smoke/extension_test/path/path_timeout.cc @@ -120,11 +120,6 @@ TEST(ExtensionTest, PathTimeout) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "path_timeout__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/path/path_timeout_2.cc b/tests/ten_runtime/smoke/extension_test/path/path_timeout_2.cc index dd7bf2b1a3..62dc515d58 100644 --- a/tests/ten_runtime/smoke/extension_test/path/path_timeout_2.cc +++ b/tests/ten_runtime/smoke/extension_test/path/path_timeout_2.cc @@ -123,11 +123,6 @@ TEST(ExtensionTest, PathTimeout2) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "path_timeout_2__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_basic_1.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_basic_1.cc index a0cb353c8c..65474919b6 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_basic_1.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_basic_1.cc @@ -26,27 +26,6 @@ class test_predefined_graph : public ten::extension_t { } }; -class test_predefined_graph_group : public ten::extension_group_t { - public: - explicit test_predefined_graph_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_predefined_graph("predefined_graph")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -73,9 +52,10 @@ class test_app : public ten::app_t { "auto_start": true, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "predefined_graph_group", - "addon": "predefined_graph_basic_1__predefined_graph_group" + "type": "extension", + "name": "predefined_graph", + "addon": "predefined_graph_basic_1__predefined_graph", + "extension_group": "predefined_graph_group" }] }] } @@ -96,9 +76,8 @@ void *app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - predefined_graph_basic_1__predefined_graph_group, - test_predefined_graph_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + predefined_graph_basic_1__predefined_graph, test_predefined_graph); } // namespace diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_basic_2.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_basic_2.cc index 976cf27349..c228f7dd2d 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_basic_2.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_basic_2.cc @@ -27,27 +27,6 @@ class test_normal_extension : public ten::extension_t { } }; -class test_normal_extension_group : public ten::extension_group_t { - public: - explicit test_normal_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_normal_extension("normal_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_predefined_graph : public ten::extension_t { public: explicit test_predefined_graph(const std::string &name) @@ -62,10 +41,11 @@ class test_predefined_graph : public ten::extension_t { "app": "msgpack://127.0.0.1:8001/" }], "nodes": [{ - "type": "extension_group", - "name": "normal_extension_group", - "addon": "predefined_graph_basic_2__normal_extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "normal_extension", + "addon": "predefined_graph_basic_2__normal_extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "normal_extension_group" }] } })"_json.dump() @@ -135,29 +115,6 @@ class test_predefined_graph : public ten::extension_t { std::unique_ptr command_1; }; -class test_predefined_graph_group : public ten::extension_group_t { - public: - explicit test_predefined_graph_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_init(ten::ten_env_t &ten_env) override { ten_env.on_init_done(); } - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_predefined_graph("predefined_graph")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -184,9 +141,10 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "predefined_graph_group", - "addon": "predefined_graph_basic_2__predefined_graph_group" + "type": "extension", + "name": "predefined_graph", + "addon": "predefined_graph_basic_2__predefined_graph", + "extension_group": "predefined_graph_group" }] }] } @@ -207,12 +165,10 @@ void *app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - predefined_graph_basic_2__predefined_graph_group, - test_predefined_graph_group); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - predefined_graph_basic_2__normal_extension_group, - test_normal_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + predefined_graph_basic_2__predefined_graph, test_predefined_graph); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + predefined_graph_basic_2__normal_extension, test_normal_extension); } // namespace diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_engine_own_eventloop.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_engine_own_eventloop.cc index e64a7ab0c5..cffddd00a0 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_engine_own_eventloop.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_engine_own_eventloop.cc @@ -29,27 +29,6 @@ class test_predefined_graph : public ten::extension_t { } }; -class test_predefined_graph_group : public ten::extension_group_t { - public: - explicit test_predefined_graph_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_predefined_graph("predefined_graph")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -76,9 +55,10 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "predefined_graph_engine_own_eventloop__extension_group", - "addon": "predefined_graph_engine_own_eventloop__extension_group" + "type": "extension", + "name": "predefined_graph", + "addon": "predefined_graph_engine_own_eventloop__extension", + "extension_group": "predefined_graph_engine_own_eventloop__extension_group" }] }] } @@ -99,9 +79,8 @@ void *app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - predefined_graph_engine_own_eventloop__extension_group, - test_predefined_graph_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + predefined_graph_engine_own_eventloop__extension, test_predefined_graph); } // namespace diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_app.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_app.cc index 145357b8df..ca8a9413be 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_app.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_app.cc @@ -72,21 +72,11 @@ class test_app_1 : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "app": "msgpack://127.0.0.1:8001/", - "addon": "default_extension_group", - "name": "predefined_graph_group" - }, { "type": "extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "predefined_graph_group", "addon": "predefined_graph_multi_app__extension_1", "name": "test_extension_1" - }, { - "type": "extension_group", - "app": "msgpack://127.0.0.1:8002/", - "addon": "default_extension_group", - "name": "predefined_graph_group" }, { "type": "extension", "app": "msgpack://127.0.0.1:8002/", diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_1.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_1.cc index 5c1ba94d26..708b074e70 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_1.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_1.cc @@ -46,28 +46,6 @@ class test_extension_2 : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - extensions.push_back(new test_extension_2("test_extension_2")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -94,9 +72,15 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "predefined_graph_multi_extension_1", - "addon": "predefined_graph_multi_extension_1__extension_group" + "type": "extension", + "name": "test_extension_1", + "addon": "predefined_graph_multi_extension_1__extension_1", + "extension_group": "predefined_graph_multi_extension_1" + },{ + "type": "extension", + "name": "test_extension_2", + "addon": "predefined_graph_multi_extension_1__extension_2", + "extension_group": "predefined_graph_multi_extension_1" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", @@ -130,8 +114,10 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - predefined_graph_multi_extension_1__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + predefined_graph_multi_extension_1__extension_1, test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + predefined_graph_multi_extension_1__extension_2, test_extension_2); } // namespace diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_2.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_2.cc index 115d308778..18474caf4f 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_2.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_2.cc @@ -46,28 +46,6 @@ class test_extension_2 : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - extensions.push_back(new test_extension_2("test_extension_2")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -94,9 +72,15 @@ class test_app : public ten::app_t { "auto_start": true, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "predefined_graph_multi_extension_2", - "addon": "predefined_graph_multi_extension_2__extension_group" + "type": "extension", + "name": "test_extension_1", + "addon": "predefined_graph_multi_extension_2__extension_1", + "extension_group": "predefined_graph_multi_extension_2" + },{ + "type": "extension", + "name": "test_extension_2", + "addon": "predefined_graph_multi_extension_2__extension_2", + "extension_group": "predefined_graph_multi_extension_2" }], "connections": [{ "extension_group": "predefined_graph_multi_extension_2", @@ -128,8 +112,10 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - predefined_graph_multi_extension_2__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + predefined_graph_multi_extension_2__extension_1, test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + predefined_graph_multi_extension_2__extension_2, test_extension_2); } // namespace diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_3.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_3.cc index 496da1469e..5e40208fcb 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_3.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_3.cc @@ -71,10 +71,6 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "predefined_graph_group", - "addon": "default_extension_group" - },{ "type": "extension", "name": "test_extension_1", "addon": "predefined_graph_multi_extension_3__extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_4.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_4.cc index 77df379f1d..a5a2b78910 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_4.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_multi_extension_4.cc @@ -64,29 +64,6 @@ class test_extension_3 : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - extensions.push_back(new test_extension_2("test_extension_2")); - extensions.push_back(new test_extension_3("test_extension_3")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -113,9 +90,20 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "predefined_graph_multi_extension_4", - "addon": "predefined_graph_multi_extension_4__extension_group" + "type": "extension", + "name": "test_extension_1", + "addon": "predefined_graph_multi_extension_4__extension_1", + "extension_group": "predefined_graph_multi_extension_4" + },{ + "type": "extension", + "name": "test_extension_2", + "addon": "predefined_graph_multi_extension_4__extension_2", + "extension_group": "predefined_graph_multi_extension_4" + },{ + "type": "extension", + "name": "test_extension_3", + "addon": "predefined_graph_multi_extension_4__extension_3", + "extension_group": "predefined_graph_multi_extension_4" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", @@ -161,8 +149,15 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - predefined_graph_multi_extension_4__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + predefined_graph_multi_extension_4__extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + predefined_graph_multi_extension_4__extension_2, + test_extension_2); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + predefined_graph_multi_extension_4__extension_3, + test_extension_3); } // namespace diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_no_auto_start.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_no_auto_start.cc index 50e0cfa140..98b4bf855c 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_no_auto_start.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_no_auto_start.cc @@ -26,29 +26,6 @@ class test_predefined_graph : public ten::extension_t { } }; -class test_predefined_graph_group : public ten::extension_group_t { - public: - explicit test_predefined_graph_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_init(ten::ten_env_t &ten_env) override { ten_env.on_init_done(); } - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_predefined_graph("predefined_graph")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -75,9 +52,10 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "predefined_graph_group", - "addon": "predefined_graph_no_auto_start__predefined_graph_group" + "type": "extension", + "name": "predefined_graph", + "addon": "predefined_graph_no_auto_start__predefined_graph_extension", + "extension_group": "predefined_graph_group" }] }] } @@ -98,9 +76,8 @@ void *app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - predefined_graph_no_auto_start__predefined_graph_group, - test_predefined_graph_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(predefined_graph_no_auto_start__predefined_graph_extension, + test_predefined_graph); } // namespace diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_two_standalone_extensions_1.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_two_standalone_extensions_1.cc index 30af50cccd..967e1161f6 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_two_standalone_extensions_1.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_two_standalone_extensions_1.cc @@ -50,10 +50,6 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "two_extensions_same_group", - "addon": "default_extension_group" - },{ "type": "extension", "name": "two_extensions_same_group_extension_1", "addon": "prebuild_two_extensions_1", diff --git a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_two_standalone_extensions_2.cc b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_two_standalone_extensions_2.cc index 0934cd92cd..01800f3b9f 100644 --- a/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_two_standalone_extensions_2.cc +++ b/tests/ten_runtime/smoke/extension_test/predefined_graph/predefined_graph_two_standalone_extensions_2.cc @@ -50,14 +50,6 @@ class test_app : public ten::app_t { "auto_start": true, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "two_extensions_group_1", - "addon": "default_extension_group" - },{ - "type": "extension_group", - "name": "two_extensions_group_2", - "addon": "default_extension_group" - },{ "type": "extension", "name": "two_extensions_group_extension_1", "addon": "prebuild_two_extensions_2", diff --git a/tests/ten_runtime/smoke/extension_test/prepare_to_stop/different_thread.cc b/tests/ten_runtime/smoke/extension_test/prepare_to_stop/different_thread.cc index cba225904d..142768aa00 100644 --- a/tests/ten_runtime/smoke/extension_test/prepare_to_stop/different_thread.cc +++ b/tests/ten_runtime/smoke/extension_test/prepare_to_stop/different_thread.cc @@ -118,11 +118,6 @@ TEST(ExtensionTest, PrepareToStopDifferentThread) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "prepare_to_stop_different_thread__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/prepare_to_stop/same_thread.cc b/tests/ten_runtime/smoke/extension_test/prepare_to_stop/same_thread.cc index c7fc580e4d..4b655d5864 100644 --- a/tests/ten_runtime/smoke/extension_test/prepare_to_stop/same_thread.cc +++ b/tests/ten_runtime/smoke/extension_test/prepare_to_stop/same_thread.cc @@ -67,28 +67,6 @@ class test_extension_2 : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - extensions.push_back(new test_extension_2("test_extension_2")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -117,8 +95,10 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - prepare_to_stop_same_thread__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(prepare_to_stop_same_thread__extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(prepare_to_stop_same_thread__extension_2, + test_extension_2); } // namespace @@ -139,10 +119,17 @@ TEST(ExtensionTest, PrepareToStopSameThread) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "prepare_to_stop_same_thread", - "addon": "prepare_to_stop_same_thread__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "addon": "prepare_to_stop_same_thread__extension_1", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "prepare_to_stop_same_thread" + },{ + "type": "extension", + "name": "test_extension_2", + "addon": "prepare_to_stop_same_thread__extension_2", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "prepare_to_stop_same_thread" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/property/property_access_app_store.cc b/tests/ten_runtime/smoke/extension_test/property/property_access_app_store.cc index a112b93310..825032fae6 100644 --- a/tests/ten_runtime/smoke/extension_test/property/property_access_app_store.cc +++ b/tests/ten_runtime/smoke/extension_test/property/property_access_app_store.cc @@ -66,14 +66,6 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "default_extension_group_1", - "addon": "default_extension_group" - },{ - "type": "extension_group", - "name": "default_extension_group_2", - "addon": "default_extension_group" - },{ "type": "extension", "name": "test_property_access_app_store_1", "addon": "test_property_access_app_store_1", diff --git a/tests/ten_runtime/smoke/extension_test/property/property_access_app_store_async.cc b/tests/ten_runtime/smoke/extension_test/property/property_access_app_store_async.cc index bd93034ca9..3b6ea18af4 100644 --- a/tests/ten_runtime/smoke/extension_test/property/property_access_app_store_async.cc +++ b/tests/ten_runtime/smoke/extension_test/property/property_access_app_store_async.cc @@ -65,14 +65,6 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "default_extension_group_1", - "addon": "default_extension_group" - },{ - "type": "extension_group", - "name": "default_extension_group_2", - "addon": "default_extension_group" - },{ "type": "extension", "name": "test_property_access_app_store_async_1", "addon": "test_property_access_app_store_async_1", diff --git a/tests/ten_runtime/smoke/extension_test/property/property_all.cc b/tests/ten_runtime/smoke/extension_test/property/property_all.cc index b7cbc14bda..fb8dd0f0ba 100644 --- a/tests/ten_runtime/smoke/extension_test/property/property_all.cc +++ b/tests/ten_runtime/smoke/extension_test/property/property_all.cc @@ -95,32 +95,6 @@ class test_extension : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - ten_env.addon_create_extension_async( - "property_all__extension", "test_extension", - [](ten::ten_env_t &ten_env, ten::extension_t &extension) { - std::vector extensions = {&extension}; - ten_env.on_create_extensions_done(extensions); - }); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - ten_env.addon_destroy_extension_async( - extension, [](ten::ten_env_t &ten_env) { - ten_env.on_destroy_extensions_done(); - }); - } - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -163,8 +137,6 @@ void *test_app_thread_main(TEN_UNUSED void *args) { } TEN_CPP_REGISTER_ADDON_AS_EXTENSION(property_all__extension, test_extension); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(property_all__extension_group, - test_extension_group); } // namespace @@ -183,20 +155,16 @@ TEST(ExtensionTest, PropertyAll) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "property_all__extension_group", - "addon": "property_all__extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension", "app": "msgpack://127.0.0.1:8001/", + "addon": "property_all__extension", "extension_group": "property_all__extension_group", "property": {} }] } })"_json; - command["_ten"]["nodes"][1]["property"][CONN_PROP_NAME] = CONN_PROP_VAL; + command["_ten"]["nodes"][0]["property"][CONN_PROP_NAME] = CONN_PROP_VAL; nlohmann::json resp = client->send_json_and_recv_resp_in_json(command); ten_test::check_status_code_is(resp, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/extension_test/property/property_connect_cmd.cc b/tests/ten_runtime/smoke/extension_test/property/property_connect_cmd.cc index bcd3fd09fb..670179b3c1 100644 --- a/tests/ten_runtime/smoke/extension_test/property/property_connect_cmd.cc +++ b/tests/ten_runtime/smoke/extension_test/property/property_connect_cmd.cc @@ -40,27 +40,6 @@ class test_extension : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -102,8 +81,8 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - property_start_graph_cmd__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(property_start_graph_cmd__extension, + test_extension); } // namespace @@ -122,20 +101,16 @@ TEST(ExtensionTest, PropertyConnectCmd) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "property_start_graph_cmd", - "addon": "property_start_graph_cmd__extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "property_start_graph_cmd", + "addon": "property_start_graph_cmd__extension", "property": {} }] } })"_json; - command["_ten"]["nodes"][1]["property"]["test_prop"] = CONNECT_CMD_PROP_VAL; + command["_ten"]["nodes"][0]["property"]["test_prop"] = CONNECT_CMD_PROP_VAL; nlohmann::json resp = client->send_json_and_recv_resp_in_json(command); ten_test::check_status_code_is(resp, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/extension_test/property/property_connect_cmd_override_extension_success.cc b/tests/ten_runtime/smoke/extension_test/property/property_connect_cmd_override_extension_success.cc index d504d51f42..cffb1cbe30 100644 --- a/tests/ten_runtime/smoke/extension_test/property/property_connect_cmd_override_extension_success.cc +++ b/tests/ten_runtime/smoke/extension_test/property/property_connect_cmd_override_extension_success.cc @@ -40,33 +40,6 @@ class test_extension : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - ten_env.addon_create_extension_async( - "property_start_graph_cmd_override_extension_success__extension", - "test_extension", - [](ten::ten_env_t &ten_env, ten::extension_t &extension) { - std::vector extensions; - extensions.push_back(&extension); - ten_env.on_create_extensions_done(extensions); - }); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto iter = extensions.begin(); iter != extensions.end(); ++iter) { - ten_env.addon_destroy_extension_async(*iter, [](ten::ten_env_t &ten_env) { - ten_env.on_destroy_extensions_done(); - }); - } - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -97,10 +70,6 @@ TEN_CPP_REGISTER_ADDON_AS_EXTENSION( property_start_graph_cmd_override_extension_success__extension, test_extension); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - property_start_graph_cmd_override_extension_success__extension_group, - test_extension_group); - } // namespace TEST(ExtensionTest, PropertyConnectCmdOverrideExtensionSuccess) { // NOLINT @@ -118,20 +87,16 @@ TEST(ExtensionTest, PropertyConnectCmdOverrideExtensionSuccess) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "property_start_graph_cmd_override_extension_success__extension_group", - "addon": "property_start_graph_cmd_override_extension_success__extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension", "app": "msgpack://127.0.0.1:8001/", + "addon": "property_start_graph_cmd_override_extension_success__extension", "extension_group": "property_start_graph_cmd_override_extension_success__extension_group", "property": {} }] } })"_json; - command["_ten"]["nodes"][1]["property"]["test_prop"] = PROP_NEW_VAL; + command["_ten"]["nodes"][0]["property"]["test_prop"] = PROP_NEW_VAL; nlohmann::json resp = client->send_json_and_recv_resp_in_json(command); ten_test::check_status_code_is(resp, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/extension_test/property/property_extension.cc b/tests/ten_runtime/smoke/extension_test/property/property_extension.cc index d4c7f23f42..20367f365f 100644 --- a/tests/ten_runtime/smoke/extension_test/property/property_extension.cc +++ b/tests/ten_runtime/smoke/extension_test/property/property_extension.cc @@ -75,33 +75,6 @@ class test_extension : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - ten_env.addon_create_extension_async( - "property_extension__extension", "test_extension", - [](ten::ten_env_t &ten_env, ten::extension_t &extension) { - std::vector extensions; - extensions.push_back(&extension); - ten_env.on_create_extensions_done(extensions); - }); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - ten_env.addon_destroy_extension_async( - extension, [](ten::ten_env_t &ten_env) { - ten_env.on_destroy_extensions_done(); - }); - } - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -145,8 +118,6 @@ void *test_app_thread_main(TEN_UNUSED void *args) { TEN_CPP_REGISTER_ADDON_AS_EXTENSION(property_extension__extension, test_extension); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(property_extension__extension_group, - test_extension_group); } // namespace @@ -165,10 +136,11 @@ TEST(ExtensionTest, PropertyExtension) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "property_extension__extension_group", - "addon": "property_extension__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension", + "addon": "property_extension__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "property_extension__extension_group" }] } })"_json); diff --git a/tests/ten_runtime/smoke/extension_test/property/property_get_float64.cc b/tests/ten_runtime/smoke/extension_test/property/property_get_float64.cc index 3c7cd9ae57..401b74b3ea 100644 --- a/tests/ten_runtime/smoke/extension_test/property/property_get_float64.cc +++ b/tests/ten_runtime/smoke/extension_test/property/property_get_float64.cc @@ -39,27 +39,6 @@ class test_extension : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -101,8 +80,8 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(property_get_float64__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(property_get_float64__extension, + test_extension); } // namespace @@ -121,10 +100,11 @@ TEST(ExtensionTest, PropertyGetFloat64) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "property_get_float64__extension_group", - "addon": "property_get_float64__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension", + "addon": "property_get_float64__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "property_get_float64__extension_group" }] } })"_json); diff --git a/tests/ten_runtime/smoke/extension_test/property/property_get_int32.cc b/tests/ten_runtime/smoke/extension_test/property/property_get_int32.cc index 17a20ccecb..780a812630 100644 --- a/tests/ten_runtime/smoke/extension_test/property/property_get_int32.cc +++ b/tests/ten_runtime/smoke/extension_test/property/property_get_int32.cc @@ -39,27 +39,6 @@ class test_extension : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -101,8 +80,8 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(property_get_int32__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(property_get_int32__extension, + test_extension); } // namespace @@ -121,10 +100,11 @@ TEST(ExtensionTest, PropertyGetInt32) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "property_get_int32__extension_group", - "addon": "property_get_int32__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension", + "addon": "property_get_int32__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "property_get_int32__extension_group" }] } })"_json); diff --git a/tests/ten_runtime/smoke/extension_test/property/property_not_exist.cc b/tests/ten_runtime/smoke/extension_test/property/property_not_exist.cc index 5aa9e54444..94b01e6ed1 100644 --- a/tests/ten_runtime/smoke/extension_test/property/property_not_exist.cc +++ b/tests/ten_runtime/smoke/extension_test/property/property_not_exist.cc @@ -38,27 +38,6 @@ class test_extension : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -87,8 +66,8 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(property_not_exist__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(property_not_exist__extension, + test_extension); } // namespace @@ -107,10 +86,11 @@ TEST(ExtensionTest, PropertyNotExist) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "property_not_exist__extension_group", - "addon": "property_not_exist__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension", + "addon": "property_not_exist__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "property_not_exist__extension_group" }] } })"_json); diff --git a/tests/ten_runtime/smoke/extension_test/property/property_prebuilt_graph.cc b/tests/ten_runtime/smoke/extension_test/property/property_prebuilt_graph.cc index 47243fca0d..bc776e8e94 100644 --- a/tests/ten_runtime/smoke/extension_test/property/property_prebuilt_graph.cc +++ b/tests/ten_runtime/smoke/extension_test/property/property_prebuilt_graph.cc @@ -62,10 +62,6 @@ class test_app : public ten::app_t { "auto_start": true, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "property_predefined_graph", - "addon": "default_extension_group" - },{ "type": "extension", "name": "property_predefined_graph", "addon": "property_predefined_graph__extension", diff --git a/tests/ten_runtime/smoke/extension_test/property/property_set_float32.cc b/tests/ten_runtime/smoke/extension_test/property/property_set_float32.cc index f059c4479c..9b0e72d1af 100644 --- a/tests/ten_runtime/smoke/extension_test/property/property_set_float32.cc +++ b/tests/ten_runtime/smoke/extension_test/property/property_set_float32.cc @@ -66,27 +66,6 @@ class test_extension : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -119,9 +98,8 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } - -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(property_set_float32__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(property_set_float32__extension, + test_extension); } // namespace @@ -140,10 +118,11 @@ TEST(ExtensionTest, PropertySetFloat32) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "property_set_float32__extension_group", - "addon": "property_set_float32__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension", + "addon": "property_set_float32__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "property_set_float32__extension_group" }] } })"_json); diff --git a/tests/ten_runtime/smoke/extension_test/property/property_set_int32.cc b/tests/ten_runtime/smoke/extension_test/property/property_set_int32.cc index 2b8eafe688..cbb06fb11e 100644 --- a/tests/ten_runtime/smoke/extension_test/property/property_set_int32.cc +++ b/tests/ten_runtime/smoke/extension_test/property/property_set_int32.cc @@ -64,27 +64,6 @@ class test_extension : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -118,8 +97,8 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(property_set_int32__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(property_set_int32__extension, + test_extension); } // namespace @@ -138,10 +117,11 @@ TEST(ExtensionTest, PropertySetInt32) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "property_set_int32__extension_group", - "addon": "property_set_int32__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension", + "addon": "property_set_int32__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "property_set_int32__extension_group" }] } })"_json); diff --git a/tests/ten_runtime/smoke/extension_test/resp_handler/resp_handler_async_basic.cc b/tests/ten_runtime/smoke/extension_test/resp_handler/resp_handler_async_basic.cc index 3cc99c9787..eafd0aa820 100644 --- a/tests/ten_runtime/smoke/extension_test/resp_handler/resp_handler_async_basic.cc +++ b/tests/ten_runtime/smoke/extension_test/resp_handler/resp_handler_async_basic.cc @@ -118,28 +118,6 @@ class test_extension_2 : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - extensions.push_back(new test_extension_2("test_extension_2")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -168,8 +146,10 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - resp_handler_async_basic__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(resp_handler_async_basic__extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(resp_handler_async_basic__extension_2, + test_extension_2); } // namespace @@ -188,10 +168,17 @@ TEST(ExtensionTest, RespHandlerAsyncBasic) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "resp_handler_async_basic__extension_group", - "addon": "resp_handler_async_basic__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "addon": "resp_handler_async_basic__extension_1", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "resp_handler_async_basic__extension_group" + },{ + "type": "extension", + "name": "test_extension_2", + "addon": "resp_handler_async_basic__extension_2", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "resp_handler_async_basic__extension_group" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/resp_handler/resp_handler_basic.cc b/tests/ten_runtime/smoke/extension_test/resp_handler/resp_handler_basic.cc index ae8ae09625..44ce710024 100644 --- a/tests/ten_runtime/smoke/extension_test/resp_handler/resp_handler_basic.cc +++ b/tests/ten_runtime/smoke/extension_test/resp_handler/resp_handler_basic.cc @@ -125,28 +125,6 @@ class test_extension_2 : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - extensions.push_back(new test_extension_2("test_extension_2")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -175,8 +153,10 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(resp_handler_basic__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(resp_handler_basic__extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(resp_handler_basic__extension_2, + test_extension_2); } // namespace @@ -195,10 +175,17 @@ TEST(ExtensionTest, RespHandlerBasic) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "resp_handler_basic__extension_group", - "addon": "resp_handler_basic__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "addon": "resp_handler_basic__extension_1", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "resp_handler_basic__extension_group" + },{ + "type": "extension", + "name": "test_extension_2", + "addon": "resp_handler_basic__extension_2", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "resp_handler_basic__extension_group" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/resp_handler/resp_handler_basic_wait_in_on_start.cc b/tests/ten_runtime/smoke/extension_test/resp_handler/resp_handler_basic_wait_in_on_start.cc index b99a17267d..d87db721ad 100644 --- a/tests/ten_runtime/smoke/extension_test/resp_handler/resp_handler_basic_wait_in_on_start.cc +++ b/tests/ten_runtime/smoke/extension_test/resp_handler/resp_handler_basic_wait_in_on_start.cc @@ -131,28 +131,6 @@ class test_extension_2 : public ten::extension_t { } }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension_1("test_extension_1")); - extensions.push_back(new test_extension_2("test_extension_2")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -181,8 +159,10 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - resp_handler_basic_wait_in_on_start__extension_group, test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(resp_handler_basic_wait_in_on_start__extension_1, + test_extension_1); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(resp_handler_basic_wait_in_on_start__extension_2, + test_extension_2); } // namespace @@ -201,10 +181,17 @@ TEST(ExtensionTest, RespHandlerBasicWaitInOnStart) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "resp_handler_basic_wait_in_on_start__extension_group", - "addon": "resp_handler_basic_wait_in_on_start__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension_1", + "addon": "resp_handler_basic_wait_in_on_start__extension_1", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "resp_handler_basic_wait_in_on_start__extension_group" + },{ + "type": "extension", + "name": "test_extension_2", + "addon": "resp_handler_basic_wait_in_on_start__extension_2", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "resp_handler_basic_wait_in_on_start__extension_group" }], "connections": [{ "app": "msgpack://127.0.0.1:8001/", diff --git a/tests/ten_runtime/smoke/extension_test/return/return_1.cc b/tests/ten_runtime/smoke/extension_test/return/return_1.cc index 73b9f687e7..50a84503fa 100644 --- a/tests/ten_runtime/smoke/extension_test/return/return_1.cc +++ b/tests/ten_runtime/smoke/extension_test/return/return_1.cc @@ -116,11 +116,6 @@ TEST(ExtensionTest, Return1) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "return_1__extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/return/return_2.cc b/tests/ten_runtime/smoke/extension_test/return/return_2.cc index 1002de9333..e7acf810f8 100644 --- a/tests/ten_runtime/smoke/extension_test/return/return_2.cc +++ b/tests/ten_runtime/smoke/extension_test/return/return_2.cc @@ -116,11 +116,6 @@ TEST(ExtensionTest, Return2) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group 1", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "return_2__extension_1", @@ -132,11 +127,6 @@ TEST(ExtensionTest, Return2) { // NOLINT "addon": "return_2__extension_2", "app": "msgpack://127.0.0.1:8001/", "extension_group": "test_extension_group 1" - },{ - "type": "extension_group", - "name": "test_extension_group 2", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" },{ "type": "extension", "name": "test_extension_3", diff --git a/tests/ten_runtime/smoke/extension_test/return/return_3.cc b/tests/ten_runtime/smoke/extension_test/return/return_3.cc index 9682756f00..0733a6e70b 100644 --- a/tests/ten_runtime/smoke/extension_test/return/return_3.cc +++ b/tests/ten_runtime/smoke/extension_test/return/return_3.cc @@ -144,11 +144,6 @@ TEST(ExtensionTest, Return3) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group 1", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "return_3__extension_1", @@ -160,11 +155,6 @@ TEST(ExtensionTest, Return3) { // NOLINT "addon": "return_3__extension_2", "app": "msgpack://127.0.0.1:8001/", "extension_group": "test_extension_group 1" - },{ - "type": "extension_group", - "name": "test_extension_group 2", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" },{ "type": "extension", "name": "test_extension_3", diff --git a/tests/ten_runtime/smoke/extension_test/return/return_4.cc b/tests/ten_runtime/smoke/extension_test/return/return_4.cc index e4fd86fc3c..340ea1c46e 100644 --- a/tests/ten_runtime/smoke/extension_test/return/return_4.cc +++ b/tests/ten_runtime/smoke/extension_test/return/return_4.cc @@ -144,11 +144,6 @@ TEST(ExtensionTest, Return4) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "return_4__extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/same_thread_ext_on_xxx/same_thread_ext_on_data.cc b/tests/ten_runtime/smoke/extension_test/same_thread_ext_on_xxx/same_thread_ext_on_data.cc index cc5064374c..b5e1201e41 100644 --- a/tests/ten_runtime/smoke/extension_test/same_thread_ext_on_xxx/same_thread_ext_on_data.cc +++ b/tests/ten_runtime/smoke/extension_test/same_thread_ext_on_xxx/same_thread_ext_on_data.cc @@ -118,11 +118,6 @@ TEST(ExtensionTest, SameThreadExtOnData) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "same_thread_ext_on_data__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/same_thread_ext_on_xxx/same_thread_ext_on_xxx_basic.cc b/tests/ten_runtime/smoke/extension_test/same_thread_ext_on_xxx/same_thread_ext_on_xxx_basic.cc index f87baedd5e..123fb678ef 100644 --- a/tests/ten_runtime/smoke/extension_test/same_thread_ext_on_xxx/same_thread_ext_on_xxx_basic.cc +++ b/tests/ten_runtime/smoke/extension_test/same_thread_ext_on_xxx/same_thread_ext_on_xxx_basic.cc @@ -126,11 +126,6 @@ TEST(ExtensionTest, SameThreadExtOnXxxBasic) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "same_thread_ext_on_xxx_basic__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/start_graph/start_graph_and_communicate.cc b/tests/ten_runtime/smoke/extension_test/start_graph/start_graph_and_communicate.cc index 7863fc253f..6b58484851 100644 --- a/tests/ten_runtime/smoke/extension_test/start_graph/start_graph_and_communicate.cc +++ b/tests/ten_runtime/smoke/extension_test/start_graph/start_graph_and_communicate.cc @@ -42,10 +42,11 @@ class test_predefined_graph : public ten::extension_t { "app": "localhost" }], "nodes": [{ - "type": "extension_group", - "name": "start_graph_and_communication__normal_extension_group", - "addon": "start_graph_and_communication__normal_extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "normal_extension", + "addon": "start_graph_and_communication__normal_extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "start_graph_and_communication__normal_extension_group" }] } })"_json.dump() @@ -114,48 +115,6 @@ class test_predefined_graph : public ten::extension_t { std::unique_ptr test_cmd; }; -class test_normal_extension_group : public ten::extension_group_t { - public: - explicit test_normal_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_normal_extension("normal_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - -class test_predefined_graph_group : public ten::extension_group_t { - public: - explicit test_predefined_graph_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_predefined_graph("predefined_graph")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -182,9 +141,10 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "start_graph_and_communication__predefined_graph_group", - "addon": "start_graph_and_communication__predefined_graph_group" + "type": "extension", + "name": "predefined_graph", + "addon": "start_graph_and_communication__predefined_graph_extension", + "extension_group": "start_graph_and_communication__predefined_graph_group" }] }] } @@ -205,12 +165,11 @@ void *app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - start_graph_and_communication__predefined_graph_group, - test_predefined_graph_group); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - start_graph_and_communication__normal_extension_group, - test_normal_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + start_graph_and_communication__predefined_graph_extension, + test_predefined_graph); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + start_graph_and_communication__normal_extension, test_normal_extension); } // namespace diff --git a/tests/ten_runtime/smoke/extension_test/start_graph/start_graph_from_extension.cc b/tests/ten_runtime/smoke/extension_test/start_graph/start_graph_from_extension.cc index 7bc2743fb2..661ab785a1 100644 --- a/tests/ten_runtime/smoke/extension_test/start_graph/start_graph_from_extension.cc +++ b/tests/ten_runtime/smoke/extension_test/start_graph/start_graph_from_extension.cc @@ -32,10 +32,11 @@ class test_predefined_graph : public ten::extension_t { "app": "localhost" }], "nodes": [{ - "type": "extension_group", - "name": "start_graph_from_extension__normal_extension_group", - "addon": "start_graph_from_extension__normal_extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "normal_extension", + "addon": "start_graph_from_extension__normal_extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "start_graph_from_extension__normal_extension_group" }] } })"_json.dump() @@ -83,48 +84,6 @@ class test_predefined_graph : public ten::extension_t { std::unique_ptr test_cmd; }; -class test_normal_extension_group : public ten::extension_group_t { - public: - explicit test_normal_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_normal_extension("normal_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - -class test_predefined_graph_group : public ten::extension_group_t { - public: - explicit test_predefined_graph_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_predefined_graph("predefined_graph")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -151,9 +110,10 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "start_graph_from_extension__predefined_graph_group", - "addon": "start_graph_from_extension__predefined_graph_group" + "type": "extension", + "name": "predefined_graph", + "addon": "start_graph_from_extension__predefined_graph_extension", + "extension_group": "start_graph_from_extension__predefined_graph_group" }] }] } @@ -174,12 +134,11 @@ void *app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - start_graph_from_extension__predefined_graph_group, - test_predefined_graph_group); -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP( - start_graph_from_extension__normal_extension_group, - test_normal_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + start_graph_from_extension__predefined_graph_extension, + test_predefined_graph); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION( + start_graph_from_extension__normal_extension, test_normal_extension); } // namespace diff --git a/tests/ten_runtime/smoke/extension_test/suspend_resume/suspend_resume_1.cc b/tests/ten_runtime/smoke/extension_test/suspend_resume/suspend_resume_1.cc index b7821f926b..d7ccfe8941 100644 --- a/tests/ten_runtime/smoke/extension_test/suspend_resume/suspend_resume_1.cc +++ b/tests/ten_runtime/smoke/extension_test/suspend_resume/suspend_resume_1.cc @@ -190,11 +190,6 @@ TEST(ExtensionTest, SuspendResume1) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "suspend_resume_1__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/suspend_resume/suspend_resume_2.cc b/tests/ten_runtime/smoke/extension_test/suspend_resume/suspend_resume_2.cc index 7530ab52a6..308919c631 100644 --- a/tests/ten_runtime/smoke/extension_test/suspend_resume/suspend_resume_2.cc +++ b/tests/ten_runtime/smoke/extension_test/suspend_resume/suspend_resume_2.cc @@ -198,11 +198,6 @@ TEST(ExtensionTest, SuspendResume2) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "suspend_resume_2__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/ten_proxy/ten_proxy_1.cc b/tests/ten_runtime/smoke/extension_test/ten_proxy/ten_proxy_1.cc index 9eb26b3968..e46357927a 100644 --- a/tests/ten_runtime/smoke/extension_test/ten_proxy/ten_proxy_1.cc +++ b/tests/ten_runtime/smoke/extension_test/ten_proxy/ten_proxy_1.cc @@ -143,11 +143,6 @@ TEST(ExtensionTest, TenEnvProxy1) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "ten_proxy_1__test_extension_1", diff --git a/tests/ten_runtime/smoke/extension_test/timer/timer_one_shot.cc b/tests/ten_runtime/smoke/extension_test/timer/timer_one_shot.cc index c36c49ae87..d822ff668d 100644 --- a/tests/ten_runtime/smoke/extension_test/timer/timer_one_shot.cc +++ b/tests/ten_runtime/smoke/extension_test/timer/timer_one_shot.cc @@ -105,8 +105,7 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(timer_one_shot__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(timer_one_shot__extension, test_extension); } // namespace @@ -124,11 +123,11 @@ TEST(ExtensionTest, TimerOneShot) { "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "timer_one_shot__extension_group", - "addon": "timer_one_shot__extension_group", + "type": "extension", + "name": "test_extension", + "addon": "timer_one_shot__extension", "app": "msgpack://127.0.0.1:8001/", - "extension": "test_extension" + "extension_group": "timer_one_shot__extension_group" }] } })"_json); diff --git a/tests/ten_runtime/smoke/extension_test/timer/timer_ten_shot.cc b/tests/ten_runtime/smoke/extension_test/timer/timer_ten_shot.cc index 41ef31762d..80ba0f754e 100644 --- a/tests/ten_runtime/smoke/extension_test/timer/timer_ten_shot.cc +++ b/tests/ten_runtime/smoke/extension_test/timer/timer_ten_shot.cc @@ -60,27 +60,6 @@ class test_extension : public ten::extension_t { size_t timer_shots_cnt{}; }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -109,8 +88,7 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(timer_ten_shot__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(timer_ten_shot__extension, test_extension); } // namespace @@ -128,10 +106,11 @@ TEST(ExtensionTest, TimerTenShot) { "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "timer_ten_shot__extension_group", - "addon": "timer_ten_shot__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension", + "addon": "timer_ten_shot__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "timer_ten_shot__extension_group" }] } })"_json); diff --git a/tests/ten_runtime/smoke/extension_test/timer/timer_two_shot.cc b/tests/ten_runtime/smoke/extension_test/timer/timer_two_shot.cc index 2f3b084029..ce424f2574 100644 --- a/tests/ten_runtime/smoke/extension_test/timer/timer_two_shot.cc +++ b/tests/ten_runtime/smoke/extension_test/timer/timer_two_shot.cc @@ -59,27 +59,6 @@ class test_extension : public ten::extension_t { size_t timer_shots_cnt{}; }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -108,8 +87,7 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(timer_two_shot__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(timer_two_shot__extension, test_extension); } // namespace @@ -127,10 +105,11 @@ TEST(ExtensionTest, TimerTwoShot) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "timer_two_shot__extension_group", - "addon": "timer_two_shot__extension_group", - "app": "msgpack://127.0.0.1:8001/" + "type": "extension", + "name": "test_extension", + "addon": "timer_two_shot__extension", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "timer_two_shot__extension_group" }] } })"_json); diff --git a/tests/ten_runtime/smoke/interface_test/interface_out_cmd_in_schema.cc b/tests/ten_runtime/smoke/interface_test/interface_out_cmd_in_schema.cc index 5f2c558e54..727ffb218c 100644 --- a/tests/ten_runtime/smoke/interface_test/interface_out_cmd_in_schema.cc +++ b/tests/ten_runtime/smoke/interface_test/interface_out_cmd_in_schema.cc @@ -124,11 +124,6 @@ TEST(InterfaceTest, OutCmdInSchema) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "interface_out_cmd_in_schema__test_extension_1", diff --git a/tests/ten_runtime/smoke/interface_test/interface_out_cmd_not_in_schema.cc b/tests/ten_runtime/smoke/interface_test/interface_out_cmd_not_in_schema.cc index 9d0e04ee72..c261c3d118 100644 --- a/tests/ten_runtime/smoke/interface_test/interface_out_cmd_not_in_schema.cc +++ b/tests/ten_runtime/smoke/interface_test/interface_out_cmd_not_in_schema.cc @@ -124,11 +124,6 @@ TEST(InterfaceTest, OutCmdNotInSchema) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "interface_out_cmd_not_in_schema__test_extension_1", diff --git a/tests/ten_runtime/smoke/interface_test/interface_out_result_error.cc b/tests/ten_runtime/smoke/interface_test/interface_out_result_error.cc index b7212ae702..209756981d 100644 --- a/tests/ten_runtime/smoke/interface_test/interface_out_result_error.cc +++ b/tests/ten_runtime/smoke/interface_test/interface_out_result_error.cc @@ -166,11 +166,6 @@ TEST(InterfaceTest, OutResultError) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "interface_out_result_error__test_extension_1", diff --git a/tests/ten_runtime/smoke/msg_test/msg_1.cc b/tests/ten_runtime/smoke/msg_test/msg_1.cc index cc82be6721..958784ecc8 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_1.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_1.cc @@ -56,27 +56,6 @@ class test_extension : public ten::extension_t { std::unique_ptr hello_world_cmd; }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -105,8 +84,7 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(msg_1__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(msg_1__extension, test_extension); } // namespace @@ -124,11 +102,11 @@ TEST(MsgTest, Msg1) { "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "msg_1__extension_group", - "addon": "msg_1__extension_group", + "type": "extension", + "name": "test_extension", + "addon": "msg_1__extension", "app": "msgpack://127.0.0.1:8001/", - "extension": "test_extension" + "extension_group": "msg_1__extension_group" }] } })"_json); diff --git a/tests/ten_runtime/smoke/msg_test/msg_10.cc b/tests/ten_runtime/smoke/msg_test/msg_10.cc index bc37976184..af74ecfe8f 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_10.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_10.cc @@ -138,16 +138,6 @@ TEST(MsgTest, Msg10) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "msg_10__extension_group_1", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ - "type": "extension_group", - "name": "msg_10__extension_group_2", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "msg_10__extension_1", "addon": "msg_10__extension_1", diff --git a/tests/ten_runtime/smoke/msg_test/msg_11.cc b/tests/ten_runtime/smoke/msg_test/msg_11.cc index 467756cd4b..eae384bffa 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_11.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_11.cc @@ -57,27 +57,6 @@ class test_extension : public ten::extension_t { std::unique_ptr hello_world_cmd; }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -100,8 +79,7 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(msg_11__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(msg_11__extension, test_extension); } // namespace @@ -119,11 +97,11 @@ TEST(MsgTest, Msg11) { "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "msg_11__extension_group", - "addon": "msg_11__extension_group", + "type": "extension", + "name": "test_extension", + "addon": "msg_11__extension", "app": "msgpack://127.0.0.1:8001/", - "extension": "test_extension" + "extension_group": "msg_11__extension_group" }] } })"_json); diff --git a/tests/ten_runtime/smoke/msg_test/msg_12.cc b/tests/ten_runtime/smoke/msg_test/msg_12.cc index 29bf531a7d..52362307ae 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_12.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_12.cc @@ -146,16 +146,6 @@ TEST(MsgTest, Msg12) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "msg_12__extension_group_1", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ - "type": "extension_group", - "name": "msg_12__extension_group_2", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "msg_12__extension_1", "addon": "msg_12__extension_1", diff --git a/tests/ten_runtime/smoke/msg_test/msg_13.cc b/tests/ten_runtime/smoke/msg_test/msg_13.cc index be003bc1fd..95eafe0038 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_13.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_13.cc @@ -145,16 +145,6 @@ TEST(MsgTest, Msg13) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "msg_13__extension_group_1", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ - "type": "extension_group", - "name": "msg_13__extension_group_2", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "msg_13__extension_1", "addon": "msg_13__extension_1", diff --git a/tests/ten_runtime/smoke/msg_test/msg_2.cc b/tests/ten_runtime/smoke/msg_test/msg_2.cc index f13a2ff3de..8e7bd2c5cd 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_2.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_2.cc @@ -57,27 +57,6 @@ class test_extension : public ten::extension_t { std::unique_ptr hello_world_cmd; }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -100,8 +79,7 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(msg_2__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(msg_2__extension, test_extension); } // namespace @@ -119,11 +97,11 @@ TEST(MsgTest, Msg2) { "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "msg_2__extension_group", - "addon": "msg_2__extension_group", + "type": "extension", + "name": "test_extension", + "addon": "msg_2__extension", "app": "msgpack://127.0.0.1:8001/", - "extension": "test_extension" + "extension_group": "msg_2__extension_group" }] } })"_json); diff --git a/tests/ten_runtime/smoke/msg_test/msg_3.cc b/tests/ten_runtime/smoke/msg_test/msg_3.cc index 4d5328a734..5046100dbe 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_3.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_3.cc @@ -49,27 +49,6 @@ class test_extension : public ten::extension_t { std::unique_ptr hello_world_cmd; }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -92,8 +71,7 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(msg_3__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(msg_3__extension, test_extension); } // namespace @@ -111,11 +89,11 @@ TEST(MsgTest, Msg3) { "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "msg_3__extension_group", - "addon": "msg_3__extension_group", + "type": "extension", + "name": "test_extension", + "addon": "msg_3__extension", "app": "msgpack://127.0.0.1:8001/", - "extension": "test_extension" + "extension_group": "msg_3__extension_group" }] } })"_json); diff --git a/tests/ten_runtime/smoke/msg_test/msg_4.cc b/tests/ten_runtime/smoke/msg_test/msg_4.cc index 85428c688e..54f0509d9c 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_4.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_4.cc @@ -57,27 +57,6 @@ class test_extension : public ten::extension_t { std::unique_ptr hello_world_cmd; }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -100,8 +79,7 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(msg_4__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(msg_4__extension, test_extension); } // namespace @@ -119,11 +97,11 @@ TEST(MsgTest, Msg4) { "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "msg_4__extension_group", - "addon": "msg_4__extension_group", + "type": "extension", + "name": "test_extension", + "addon": "msg_4__extension", "app": "msgpack://127.0.0.1:8001/", - "extension": "test_extension" + "extension_group": "msg_4__extension_group" }] } })"_json); diff --git a/tests/ten_runtime/smoke/msg_test/msg_5.cc b/tests/ten_runtime/smoke/msg_test/msg_5.cc index 84b591b473..c7d6089c76 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_5.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_5.cc @@ -59,27 +59,6 @@ class test_extension : public ten::extension_t { std::unique_ptr hello_world_cmd; }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -102,8 +81,7 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(msg_5__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(msg_5__extension, test_extension); } // namespace @@ -121,11 +99,11 @@ TEST(MsgTest, Msg5) { "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "msg_5__extension_group", - "addon": "msg_5__extension_group", + "type": "extension", + "name": "test_extension", + "addon": "msg_5__extension", "app": "msgpack://127.0.0.1:8001/", - "extension": "test_extension" + "extension_group": "msg_5__extension_group" }] } })"_json); diff --git a/tests/ten_runtime/smoke/msg_test/msg_6.cc b/tests/ten_runtime/smoke/msg_test/msg_6.cc index 0231da07fe..9e4bcbbb9a 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_6.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_6.cc @@ -57,27 +57,6 @@ class test_extension : public ten::extension_t { std::unique_ptr hello_world_cmd; }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -100,8 +79,7 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(msg_6__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(msg_6__extension, test_extension); } // namespace @@ -119,11 +97,11 @@ TEST(MsgTest, Msg6) { "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "msg_6__extension_group", - "addon": "msg_6__extension_group", + "type": "extension", + "name": "test_extension", + "addon": "msg_6__extension", "app": "msgpack://127.0.0.1:8001/", - "extension": "test_extension" + "extension_group": "msg_6__extension_group" }] } })"_json); diff --git a/tests/ten_runtime/smoke/msg_test/msg_7.cc b/tests/ten_runtime/smoke/msg_test/msg_7.cc index 397b1ac890..94cc373f27 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_7.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_7.cc @@ -56,27 +56,6 @@ class test_extension : public ten::extension_t { std::unique_ptr hello_world_cmd; }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -99,8 +78,7 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(msg_7__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(msg_7__extension, test_extension); } // namespace @@ -118,11 +96,11 @@ TEST(MsgTest, Msg7) { "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "msg_7__extension_group", - "addon": "msg_7__extension_group", + "type": "extension", + "name": "test_extension", + "addon": "msg_7__extension", "app": "msgpack://127.0.0.1:8001/", - "extension": "test_extension" + "extension_group": "msg_7__extension_group" }] } })"_json); diff --git a/tests/ten_runtime/smoke/msg_test/msg_8.cc b/tests/ten_runtime/smoke/msg_test/msg_8.cc index f7f978c700..ccf3a8e04a 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_8.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_8.cc @@ -110,16 +110,6 @@ TEST(MsgTest, Msg8) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "msg_8__extension_group_1", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ - "type": "extension_group", - "name": "msg_8__extension_group_2", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "msg_8__extension_1", "addon": "msg_8__extension_1", diff --git a/tests/ten_runtime/smoke/msg_test/msg_9.cc b/tests/ten_runtime/smoke/msg_test/msg_9.cc index 0034876b98..cc5f54362e 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_9.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_9.cc @@ -147,16 +147,6 @@ TEST(MsgTest, Msg9) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "msg_9__extension_group_1", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ - "type": "extension_group", - "name": "msg_9__extension_group_2", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "msg_9__extension_1", "addon": "msg_9__extension_1", diff --git a/tests/ten_runtime/smoke/msg_test/msg_fail_1.cc b/tests/ten_runtime/smoke/msg_test/msg_fail_1.cc index 0bfb2ab27c..aa31a24417 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_fail_1.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_fail_1.cc @@ -75,27 +75,6 @@ class test_extension : public ten::extension_t { std::unique_ptr hello_world_cmd; }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -118,8 +97,7 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(msg_fail_1__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(msg_fail_1__extension, test_extension); } // namespace @@ -137,11 +115,11 @@ TEST(MsgTest, MsgFail1) { "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "msg_fail_1__extension_group", - "addon": "msg_fail_1__extension_group", + "type": "extension", + "name": "test_extension", + "addon": "msg_fail_1__extension", "app": "msgpack://127.0.0.1:8001/", - "extension": "test_extension" + "extension_group": "msg_fail_1__extension_group" }] } })"_json); diff --git a/tests/ten_runtime/smoke/msg_test/msg_fail_2.cc b/tests/ten_runtime/smoke/msg_test/msg_fail_2.cc index 44b54c063d..cbc27dbf9f 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_fail_2.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_fail_2.cc @@ -73,27 +73,6 @@ class test_extension : public ten::extension_t { std::unique_ptr hello_world_cmd; }; -class test_extension_group : public ten::extension_group_t { - public: - explicit test_extension_group(const std::string &name) - : ten::extension_group_t(name) {} - - void on_create_extensions(ten::ten_env_t &ten_env) override { - std::vector extensions; - extensions.push_back(new test_extension("test_extension")); - ten_env.on_create_extensions_done(extensions); - } - - void on_destroy_extensions( - ten::ten_env_t &ten_env, - const std::vector &extensions) override { - for (auto *extension : extensions) { - delete extension; - } - ten_env.on_destroy_extensions_done(); - } -}; - class test_app : public ten::app_t { public: void on_configure(ten::ten_env_t &ten_env) override { @@ -116,8 +95,8 @@ void *test_app_thread_main(TEN_UNUSED void *args) { return nullptr; } -TEN_CPP_REGISTER_ADDON_AS_EXTENSION_GROUP(msg_fail_2__extension_group, - test_extension_group); +TEN_CPP_REGISTER_ADDON_AS_EXTENSION(msg_fail_2__extension, + test_extension); } // namespace @@ -135,11 +114,11 @@ TEST(MsgTest, MsgFail2) { "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "msg_fail_2__extension_group", - "addon": "msg_fail_2__extension_group", + "type": "extension", + "name": "test_extension", + "addon": "msg_fail_2__extension", "app": "msgpack://127.0.0.1:8001/", - "extension": "test_extension" + "extension_group": "msg_fail_2__extension_group" }] } })"_json); diff --git a/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_1.cc b/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_1.cc index 8a4cffaa09..d88f54f050 100644 --- a/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_1.cc +++ b/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_1.cc @@ -127,11 +127,6 @@ TEST(NotifyTest, MemberFuncInLambda1) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension", "addon": "notify_test_member_func_basic_in_lambda_1__test_extension", diff --git a/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_2.cc b/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_2.cc index 180ad3a298..36fd044c66 100644 --- a/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_2.cc +++ b/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_2.cc @@ -135,11 +135,6 @@ TEST(NotifyTest, MemberFuncInLambda2) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension", "addon": "notify_test_member_func_basic_in_lambda_2__test_extension", diff --git a/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_3.cc b/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_3.cc index 4125d0cc8c..a8248b3a21 100644 --- a/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_3.cc +++ b/tests/ten_runtime/smoke/notify_test/member_func_in_lambda_3.cc @@ -137,11 +137,6 @@ TEST(NotifyTest, MemberFuncInLambda3) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension", "addon": "notify_test_member_func_basic_in_lambda_3__test_extension", diff --git a/tests/ten_runtime/smoke/notify_test/normal_func.cc b/tests/ten_runtime/smoke/notify_test/normal_func.cc index b4738d5970..bda843f468 100644 --- a/tests/ten_runtime/smoke/notify_test/normal_func.cc +++ b/tests/ten_runtime/smoke/notify_test/normal_func.cc @@ -129,11 +129,6 @@ TEST(NotifyTest, NormalFunc) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension", "addon": "notify_test_normal_func__test_extension", diff --git a/tests/ten_runtime/smoke/notify_test/normal_func_in_lambda.cc b/tests/ten_runtime/smoke/notify_test/normal_func_in_lambda.cc index 9d7a32cb0c..038b216417 100644 --- a/tests/ten_runtime/smoke/notify_test/normal_func_in_lambda.cc +++ b/tests/ten_runtime/smoke/notify_test/normal_func_in_lambda.cc @@ -133,11 +133,6 @@ TEST(NotifyTest, NormalFuncInLambda) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension", "addon": "notify_test_normal_func_in_lambda__test_extension", diff --git a/tests/ten_runtime/smoke/notify_test/normal_func_with_user_data.cc b/tests/ten_runtime/smoke/notify_test/normal_func_with_user_data.cc index b4c8ff7250..f7ecd35d18 100644 --- a/tests/ten_runtime/smoke/notify_test/normal_func_with_user_data.cc +++ b/tests/ten_runtime/smoke/notify_test/normal_func_with_user_data.cc @@ -137,11 +137,6 @@ TEST(NotifyTest, NormalFuncWithUserData) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension", "addon": "notify_test_normal_func_with_user_data__test_extension", diff --git a/tests/ten_runtime/smoke/result_conversion/result_conversion_1.cc b/tests/ten_runtime/smoke/result_conversion/result_conversion_1.cc index 860de7a4e8..29f70c80a7 100644 --- a/tests/ten_runtime/smoke/result_conversion/result_conversion_1.cc +++ b/tests/ten_runtime/smoke/result_conversion/result_conversion_1.cc @@ -79,11 +79,6 @@ class test_app : public ten::app_t { "auto_start": false, "singleton": true, "nodes": [{ - "type": "extension_group", - "name": "result_mapping_1__extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "result_mapping_1__test_extension_1", diff --git a/tests/ten_runtime/smoke/schema_test/schema_cmd_property_required.cc b/tests/ten_runtime/smoke/schema_test/schema_cmd_property_required.cc index f26749453f..1e9a4f0a67 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_cmd_property_required.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_cmd_property_required.cc @@ -208,11 +208,6 @@ TEST(SchemaTest, SendCmdPropertyRequired) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "schema_cmd_property_required__test_extension_1", diff --git a/tests/ten_runtime/smoke/schema_test/schema_cmd_result.cc b/tests/ten_runtime/smoke/schema_test/schema_cmd_result.cc index 1bc2693a5a..6ff263636a 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_cmd_result.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_cmd_result.cc @@ -153,11 +153,6 @@ TEST(SchemaTest, CmdResult) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "schema_cmd_result__test_extension_1", diff --git a/tests/ten_runtime/smoke/schema_test/schema_cmd_result_error.cc b/tests/ten_runtime/smoke/schema_test/schema_cmd_result_error.cc index a258bd2ab0..a9d3de3cce 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_cmd_result_error.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_cmd_result_error.cc @@ -153,11 +153,6 @@ TEST(SchemaTest, CmdResultError) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "schema_cmd_result_error__test_extension_1", diff --git a/tests/ten_runtime/smoke/schema_test/schema_data_prop.cc b/tests/ten_runtime/smoke/schema_test/schema_data_prop.cc index 48c5e10847..3473c667de 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_data_prop.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_data_prop.cc @@ -188,11 +188,6 @@ TEST(SchemaTest, DataProp) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "schema_data_prop__test_extension_1", diff --git a/tests/ten_runtime/smoke/schema_test/schema_on_cmd.cc b/tests/ten_runtime/smoke/schema_test/schema_on_cmd.cc index a03bd7ef00..d43087d175 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_on_cmd.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_on_cmd.cc @@ -142,11 +142,6 @@ TEST(SchemaTest, OnCmd) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "schema_on_cmd__test_extension_1", diff --git a/tests/ten_runtime/smoke/schema_test/schema_send_cmd.cc b/tests/ten_runtime/smoke/schema_test/schema_send_cmd.cc index 22877cd26b..1f6657d552 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_send_cmd.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_send_cmd.cc @@ -139,11 +139,6 @@ TEST(SchemaTest, SendCmd) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "schema_send_cmd__test_extension_1", diff --git a/tests/ten_runtime/smoke/schema_test/schema_set_extension_property.cc b/tests/ten_runtime/smoke/schema_test/schema_set_extension_property.cc index 686adae2a3..7e272774e0 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_set_extension_property.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_set_extension_property.cc @@ -192,11 +192,6 @@ TEST(SchemaTest, SetExtensionProperty) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension", "addon": "schema_set_extension_prop__test_extension", diff --git a/tests/ten_runtime/smoke/schema_test/schema_set_property_buf.cc b/tests/ten_runtime/smoke/schema_test/schema_set_property_buf.cc index c295170bb1..ba42108e15 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_set_property_buf.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_set_property_buf.cc @@ -140,11 +140,6 @@ TEST(SchemaTest, SetPropertyBuf) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "schema_set_property_buf__test_extension_1", diff --git a/tests/ten_runtime/smoke/schema_test/schema_set_property_ptr.cc b/tests/ten_runtime/smoke/schema_test/schema_set_property_ptr.cc index a2147d4dfc..8341cdbf67 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_set_property_ptr.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_set_property_ptr.cc @@ -142,11 +142,6 @@ TEST(SchemaTest, SetPropertyPtr) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "schema_set_property_ptr__test_extension_1", diff --git a/tests/ten_runtime/smoke/video_frame_test/basic.cc b/tests/ten_runtime/smoke/video_frame_test/basic.cc index 7f8748978a..85d0f80883 100644 --- a/tests/ten_runtime/smoke/video_frame_test/basic.cc +++ b/tests/ten_runtime/smoke/video_frame_test/basic.cc @@ -100,11 +100,6 @@ TEST(VideoFrameTest, Basic) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "video_frame_basic__test_extension_1", diff --git a/tests/ten_runtime/smoke/video_frame_test/create_from_json.cc b/tests/ten_runtime/smoke/video_frame_test/create_from_json.cc index 15a0add20d..c4693d9780 100644 --- a/tests/ten_runtime/smoke/video_frame_test/create_from_json.cc +++ b/tests/ten_runtime/smoke/video_frame_test/create_from_json.cc @@ -117,11 +117,6 @@ TEST(VideoFrameTest, CreateFromJson) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "video_frame_create_from_json__test_extension_1", diff --git a/tests/ten_runtime/smoke/video_frame_test/from_json.cc b/tests/ten_runtime/smoke/video_frame_test/from_json.cc index be38ddc2ba..0137b211d6 100644 --- a/tests/ten_runtime/smoke/video_frame_test/from_json.cc +++ b/tests/ten_runtime/smoke/video_frame_test/from_json.cc @@ -116,11 +116,6 @@ TEST(VideoFrameTest, FromJson) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "basic_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "test_extension_1", "addon": "video_frame_from_json__test_extension_1", diff --git a/tests/ten_runtime/smoke/video_frame_test/multi_dest_video_frame.cc b/tests/ten_runtime/smoke/video_frame_test/multi_dest_video_frame.cc index e934c4a0dc..160af7d81f 100644 --- a/tests/ten_runtime/smoke/video_frame_test/multi_dest_video_frame.cc +++ b/tests/ten_runtime/smoke/video_frame_test/multi_dest_video_frame.cc @@ -177,11 +177,6 @@ TEST(VideoFrameTest, MultiDestVideoFrame) { // NOLINT "type": "start_graph", "seq_id": "55", "nodes": [{ - "type": "extension_group", - "name": "test_extension_group", - "addon": "default_extension_group", - "app": "msgpack://127.0.0.1:8001/" - },{ "type": "extension", "name": "extension 1", "addon": "multi_dest_video_frame__extension_1",