diff --git a/.vscode/launch.json b/.vscode/launch.json index 244e01430..25d01c0b4 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -137,7 +137,7 @@ "request": "launch", "program": "${workspaceFolder}/out/linux/x64/tests/standalone/ten_runtime_smoke_test", "args": [ - "--gtest_filter=AudioFrameTest.FromJson" + "--gtest_filter=CmdConversionTest.CmdConversionPathArray1" ], "cwd": "${workspaceFolder}/out/linux/x64/tests/standalone/", "env": { diff --git a/core/include/ten_runtime/binding/cpp/internal/msg/cmd/start_graph.h b/core/include/ten_runtime/binding/cpp/internal/msg/cmd/start_graph.h index a9930c7bc..97423e43d 100644 --- a/core/include/ten_runtime/binding/cpp/internal/msg/cmd/start_graph.h +++ b/core/include/ten_runtime/binding/cpp/internal/msg/cmd/start_graph.h @@ -47,13 +47,18 @@ class cmd_start_graph_t : public cmd_t { err != nullptr ? err->get_internal_representation() : nullptr); } - bool set_nodes_and_connections_from_json(const char *json_str, - error_t *err = nullptr) { - return ten_cmd_start_graph_init_from_json_str( + bool set_graph_from_json(const char *json_str, error_t *err = nullptr) { + return ten_cmd_start_graph_set_graph_from_json_str( c_msg, json_str, err != nullptr ? err->get_internal_representation() : nullptr); } + bool set_long_running_mode(bool long_running_mode, error_t *err = nullptr) { + return ten_cmd_start_graph_set_long_running_mode( + c_msg, long_running_mode, + err != nullptr ? err->get_internal_representation() : nullptr); + } + // @{ cmd_start_graph_t(cmd_start_graph_t &other) = delete; cmd_start_graph_t(cmd_start_graph_t &&other) = delete; diff --git a/core/include/ten_runtime/msg/cmd/start_graph/cmd.h b/core/include/ten_runtime/msg/cmd/start_graph/cmd.h index 06a728600..ba147b92c 100644 --- a/core/include/ten_runtime/msg/cmd/start_graph/cmd.h +++ b/core/include/ten_runtime/msg/cmd/start_graph/cmd.h @@ -20,5 +20,8 @@ TEN_RUNTIME_API bool ten_cmd_start_graph_set_predefined_graph_name( ten_shared_ptr_t *self, const char *predefined_graph_name, ten_error_t *err); -TEN_RUNTIME_API bool ten_cmd_start_graph_init_from_json_str( +TEN_RUNTIME_API bool ten_cmd_start_graph_set_long_running_mode( + ten_shared_ptr_t *self, bool long_running_mode, ten_error_t *err); + +TEN_RUNTIME_API bool ten_cmd_start_graph_set_graph_from_json_str( ten_shared_ptr_t *self, const char *json_str, ten_error_t *err); diff --git a/core/include_internal/ten_runtime/msg/msg.h b/core/include_internal/ten_runtime/msg/msg.h index 572c17770..a4350f831 100644 --- a/core/include_internal/ten_runtime/msg/msg.h +++ b/core/include_internal/ten_runtime/msg/msg.h @@ -154,9 +154,6 @@ TEN_RUNTIME_PRIVATE_API const char *ten_raw_msg_get_type_string( TEN_RUNTIME_PRIVATE_API void ten_msg_clear_and_set_dest_from_extension_info( ten_shared_ptr_t *self, ten_extension_info_t *extension_info); -TEN_RUNTIME_PRIVATE_API void ten_msg_clear_and_set_dest_to_extension( - ten_shared_ptr_t *self, ten_extension_t *extension); - TEN_RUNTIME_PRIVATE_API void ten_msg_correct_dest(ten_shared_ptr_t *msg, ten_engine_t *engine); @@ -264,10 +261,6 @@ TEN_RUNTIME_PRIVATE_API bool ten_msg_validate_schema( ten_shared_ptr_t *self, ten_schema_store_t *schema_store, bool is_msg_out, ten_error_t *err); -TEN_RUNTIME_PRIVATE_API bool ten_raw_msg_get_one_field_from_json( - ten_msg_t *self, ten_msg_field_process_data_t *field, void *user_data, - ten_error_t *err); - TEN_RUNTIME_PRIVATE_API bool ten_raw_msg_get_one_field_from_json_include_internal_field( ten_msg_t *self, ten_msg_field_process_data_t *field, void *user_data, @@ -303,25 +296,6 @@ TEN_RUNTIME_API ten_shared_ptr_t *ten_msg_create_from_msg_type( TEN_RUNTIME_API void ten_raw_msg_destroy(ten_msg_t *self); -TEN_RUNTIME_API const char *ten_msg_json_get_string_field_in_ten( - ten_json_t *json, const char *field); - -TEN_RUNTIME_PRIVATE_API bool ten_msg_json_get_is_ten_field_exist( - ten_json_t *json, const char *field); - -TEN_RUNTIME_API int64_t -ten_msg_json_get_integer_field_in_ten(ten_json_t *json, const char *field); - -TEN_RUNTIME_PRIVATE_API TEN_MSG_TYPE -ten_msg_json_get_msg_type(ten_json_t *json); - -TEN_RUNTIME_API const char *ten_raw_msg_get_name(ten_msg_t *self); - -TEN_RUNTIME_API bool ten_raw_msg_set_name_with_size(ten_msg_t *self, - const char *msg_name, - size_t msg_name_len, - ten_error_t *err); - TEN_RUNTIME_PRIVATE_API bool ten_raw_msg_set_name(ten_msg_t *self, const char *msg_name, ten_error_t *err); diff --git a/core/include_internal/ten_runtime/msg/msg_info.h b/core/include_internal/ten_runtime/msg/msg_info.h index 0a254b7ea..81ae8bf03 100644 --- a/core/include_internal/ten_runtime/msg/msg_info.h +++ b/core/include_internal/ten_runtime/msg/msg_info.h @@ -33,8 +33,6 @@ typedef void (*ten_msg_engine_handler_func_t)(ten_engine_t *engine, typedef ten_msg_t *(*ten_raw_msg_clone_func_t)(ten_msg_t *msg, ten_list_t *excluded_field_ids); -typedef void (*ten_raw_msg_destroy_func_t)(ten_msg_t *msg); - typedef bool (*ten_raw_msg_loop_all_fields_func_t)( ten_msg_t *msg, ten_raw_msg_process_one_field_func_t cb, void *user_data, ten_error_t *err); @@ -58,7 +56,6 @@ typedef struct ten_msg_info_t { bool create_in_path; ten_msg_engine_handler_func_t engine_handler; - ten_raw_msg_clone_func_t clone; ten_raw_msg_loop_all_fields_func_t loop_all_fields; ten_raw_msg_validate_schema_func_t validate_schema; diff --git a/core/include_internal/ten_utils/schema/bindings/rust/schema.h b/core/include_internal/ten_utils/schema/bindings/rust/schema.h index d1441b1ae..97c1f28c2 100644 --- a/core/include_internal/ten_utils/schema/bindings/rust/schema.h +++ b/core/include_internal/ten_utils/schema/bindings/rust/schema.h @@ -18,13 +18,13 @@ // knows the structure's layout. typedef struct ten_schema_t ten_schema_t; -TEN_UTILS_API ten_schema_t *ten_schema_create_from_json_string_proxy( - const char *json_string, const char **err_msg); +TEN_UTILS_API ten_schema_t *ten_schema_create_from_json_str_proxy( + const char *json_str, const char **err_msg); TEN_UTILS_API void ten_schema_destroy_proxy(const ten_schema_t *self); -TEN_UTILS_API bool ten_schema_adjust_and_validate_json_string_proxy( - const ten_schema_t *self, const char *json_string, const char **err_msg); +TEN_UTILS_API bool ten_schema_adjust_and_validate_json_str_proxy( + const ten_schema_t *self, const char *json_str, const char **err_msg); TEN_UTILS_API bool ten_schema_is_compatible_proxy(const ten_schema_t *self, const ten_schema_t *target, diff --git a/core/include_internal/ten_utils/schema/schema.h b/core/include_internal/ten_utils/schema/schema.h index c84257b31..1bc1a81ef 100644 --- a/core/include_internal/ten_utils/schema/schema.h +++ b/core/include_internal/ten_utils/schema/schema.h @@ -136,11 +136,11 @@ TEN_UTILS_PRIVATE_API void ten_schema_init(ten_schema_t *self); TEN_UTILS_PRIVATE_API void ten_schema_deinit(ten_schema_t *self); -TEN_UTILS_PRIVATE_API ten_schema_t *ten_schema_create_from_json_string( - const char *json_string, const char **err_msg); +TEN_UTILS_PRIVATE_API ten_schema_t *ten_schema_create_from_json_str( + const char *json_str, const char **err_msg); -TEN_UTILS_PRIVATE_API bool ten_schema_adjust_and_validate_json_string( - ten_schema_t *self, const char *json_string, const char **err_msg); +TEN_UTILS_PRIVATE_API bool ten_schema_adjust_and_validate_json_str( + ten_schema_t *self, const char *json_str, const char **err_msg); TEN_UTILS_API ten_schema_t *ten_schema_create_from_json(ten_json_t *json); diff --git a/core/src/ten_runtime/metadata/metadata.c b/core/src/ten_runtime/metadata/metadata.c index 6fd2f4a3d..dd857fa78 100644 --- a/core/src/ten_runtime/metadata/metadata.c +++ b/core/src/ten_runtime/metadata/metadata.c @@ -22,9 +22,9 @@ #include "include_internal/ten_rust/ten_rust.h" #endif -static bool ten_metadata_load_from_json_string(ten_value_t *metadata, - const char *json_str, - ten_error_t *err) { +static bool ten_metadata_load_from_json_str(ten_value_t *metadata, + const char *json_str, + ten_error_t *err) { TEN_ASSERT(metadata && ten_value_check_integrity(metadata) && json_str, "Should not happen."); @@ -57,7 +57,7 @@ static bool ten_metadata_load_from_json_file(ten_value_t *metadata, return false; } - bool ret = ten_metadata_load_from_json_string(metadata, buf, err); + bool ret = ten_metadata_load_from_json_str(metadata, buf, err); if (!ret) { TEN_LOGW( "Try to load metadata from file '%s', but file content with wrong " @@ -83,7 +83,7 @@ static bool ten_metadata_load_from_type_ane_value(ten_value_t *metadata, break; case TEN_METADATA_JSON_STR: - if (!ten_metadata_load_from_json_string(metadata, value, err)) { + if (!ten_metadata_load_from_json_str(metadata, value, err)) { result = false; goto done; } 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 4d83e1789..552002ea0 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 @@ -11,6 +11,7 @@ #include #include "include_internal/ten_runtime/app/app.h" +#include "include_internal/ten_runtime/common/constant_str.h" #include "include_internal/ten_runtime/common/loc.h" #include "include_internal/ten_runtime/extension/extension.h" #include "include_internal/ten_runtime/extension/extension_addon_and_instance_name_pair.h" @@ -81,6 +82,46 @@ ten_shared_ptr_t *ten_cmd_start_graph_create(void) { ten_raw_cmd_start_graph_destroy); } +static bool ten_raw_cmd_start_graph_as_msg_get_graph_from_json( + ten_msg_t *self, ten_msg_field_process_data_t *field, void *user_data, + ten_error_t *err) { + TEN_ASSERT(self && ten_raw_msg_check_integrity(self), "Should not happen."); + TEN_ASSERT(field, "Should not happen."); + TEN_ASSERT( + field->field_value && ten_value_check_integrity(field->field_value), + "Should not happen."); + + if (ten_c_string_is_equal(field->field_name, TEN_STR_NODES) || + ten_c_string_is_equal(field->field_name, TEN_STR_CONNECTIONS)) { + ten_json_t *json = (ten_json_t *)user_data; + TEN_ASSERT(json, "Should not happen."); + + json = ten_json_object_peek(json, field->field_name); + if (!json) { + // Some fields are optional, and it is allowed for the corresponding + // JSON block to be absent during deserialization. + return true; + } + + if (!ten_value_set_from_json(field->field_value, json)) { + // If the field value cannot be set from the JSON, it means that the + // JSON format is incorrect. + if (err) { + ten_error_set(err, TEN_ERRNO_INVALID_JSON, + "Invalid JSON format for field %s.", field->field_name); + } + + return false; + } + } + + // During JSON deserialization, the field value may be modified, so we set the + // value_is_changed_after_process flag. + field->value_is_changed_after_process = true; + + return true; +} + bool ten_raw_cmd_start_graph_init_from_json(ten_cmd_start_graph_t *self, ten_json_t *json, ten_error_t *err) { @@ -88,13 +129,24 @@ bool ten_raw_cmd_start_graph_init_from_json(ten_cmd_start_graph_t *self, "Should not happen."); TEN_ASSERT(json && ten_json_check_integrity(json), "Should not happen."); - // =-=-= return ten_raw_cmd_start_graph_loop_all_fields( (ten_msg_t *)self, ten_raw_msg_get_one_field_from_json_include_internal_field, json, err); } -static bool ten_raw_cmd_start_graph_as_msg_init_from_json_str( +bool ten_raw_cmd_start_graph_set_graph_from_json(ten_cmd_start_graph_t *self, + ten_json_t *json, + ten_error_t *err) { + TEN_ASSERT(self && ten_raw_cmd_check_integrity((ten_cmd_t *)self), + "Should not happen."); + TEN_ASSERT(json && ten_json_check_integrity(json), "Should not happen."); + + return ten_raw_cmd_start_graph_loop_all_fields( + (ten_msg_t *)self, ten_raw_cmd_start_graph_as_msg_get_graph_from_json, + json, err); +} + +static bool ten_raw_cmd_start_graph_set_graph_from_json_str( ten_msg_t *self, const char *json_str, ten_error_t *err) { TEN_ASSERT(self && ten_raw_cmd_check_integrity((ten_cmd_t *)self), "Invalid argument."); @@ -105,7 +157,7 @@ static bool ten_raw_cmd_start_graph_as_msg_init_from_json_str( return false; } - bool rc = ten_raw_cmd_start_graph_init_from_json( + bool rc = ten_raw_cmd_start_graph_set_graph_from_json( (ten_cmd_start_graph_t *)self, json, err); ten_json_destroy(json); @@ -113,13 +165,13 @@ static bool ten_raw_cmd_start_graph_as_msg_init_from_json_str( return rc; } -bool ten_cmd_start_graph_init_from_json_str(ten_shared_ptr_t *self, - const char *json_str, - ten_error_t *err) { +bool ten_cmd_start_graph_set_graph_from_json_str(ten_shared_ptr_t *self, + const char *json_str, + ten_error_t *err) { TEN_ASSERT(self && ten_cmd_check_integrity(self), "Invalid argument."); TEN_ASSERT(json_str, "Invalid argument."); - return ten_raw_cmd_start_graph_as_msg_init_from_json_str( + return ten_raw_cmd_start_graph_set_graph_from_json_str( ten_msg_get_raw_msg(self), json_str, err); } @@ -385,6 +437,17 @@ bool ten_cmd_start_graph_set_predefined_graph_name( predefined_graph_name); } +bool ten_cmd_start_graph_set_long_running_mode(ten_shared_ptr_t *self, + bool long_running_mode, + ten_error_t *err) { + TEN_ASSERT(self && ten_cmd_base_check_integrity(self) && + ten_msg_get_type(self) == TEN_MSG_TYPE_CMD_START_GRAPH, + "Should not happen."); + + return ten_value_set_bool(&get_raw_cmd(self)->long_running_mode, + long_running_mode); +} + ten_string_t *ten_raw_cmd_start_graph_get_predefined_graph_name( ten_cmd_start_graph_t *self) { TEN_ASSERT(self && ten_raw_cmd_check_integrity((ten_cmd_t *)self) && diff --git a/core/src/ten_runtime/msg/msg.c b/core/src/ten_runtime/msg/msg.c index 5a9976b29..3401b8459 100644 --- a/core/src/ten_runtime/msg/msg.c +++ b/core/src/ten_runtime/msg/msg.c @@ -400,26 +400,6 @@ void ten_msg_set_dest_engine_if_unspecified_or_predefined_graph_name( } } -void ten_msg_clear_and_set_dest_to_extension(ten_shared_ptr_t *self, - ten_extension_t *extension) { - TEN_ASSERT(self && ten_msg_check_integrity(self), "Invalid argument."); - - TEN_ASSERT(extension, "Invalid argument."); - // TEN_NOLINTNEXTLINE(thread-check) - // thread-check: The graph-related information of the extension remains - // unchanged during the lifecycle of engine/graph, allowing safe - // cross-thread access. - TEN_ASSERT(ten_extension_check_integrity(extension, false), - "Invalid use of extension %p.", extension); - - ten_msg_clear_and_set_dest( - self, ten_app_get_uri(extension->extension_context->engine->app), - ten_engine_get_id(extension->extension_context->engine, true), - ten_extension_group_get_name(extension->extension_thread->extension_group, - true), - ten_extension_get_name(extension, true), NULL); -} - void ten_msg_clear_and_set_dest_from_extension_info( ten_shared_ptr_t *self, ten_extension_info_t *extension_info) { TEN_ASSERT(self && ten_msg_check_integrity(self), "Invalid argument."); @@ -657,9 +637,9 @@ static bool ten_raw_msg_get_one_field_from_json_internal( return true; } -bool ten_raw_msg_get_one_field_from_json(ten_msg_t *self, - ten_msg_field_process_data_t *field, - void *user_data, ten_error_t *err) { +static bool ten_raw_msg_get_one_field_from_json( + ten_msg_t *self, ten_msg_field_process_data_t *field, void *user_data, + ten_error_t *err) { return ten_raw_msg_get_one_field_from_json_internal(self, field, user_data, false, err); } @@ -1019,54 +999,6 @@ void ten_msg_correct_dest(ten_shared_ptr_t *msg, ten_engine_t *engine) { } } -bool ten_msg_json_get_is_ten_field_exist(ten_json_t *json, const char *field) { - TEN_ASSERT(json && ten_json_check_integrity(json), "Should not happen."); - TEN_ASSERT(field, "Should not happen."); - - ten_json_t *ten_json = - ten_json_object_peek_object(json, TEN_STR_UNDERLINE_TEN); - TEN_ASSERT(ten_json, "Should not happen."); - - return ten_json_object_peek(ten_json, field) != NULL; -} - -int64_t ten_msg_json_get_integer_field_in_ten(ten_json_t *json, - const char *field) { - TEN_ASSERT(json && ten_json_check_integrity(json), "Should not happen."); - TEN_ASSERT(field, "Should not happen."); - - ten_json_t *ten_json = - ten_json_object_peek_object(json, TEN_STR_UNDERLINE_TEN); - TEN_ASSERT(ten_json, "Should not happen."); - - return ten_json_object_get_integer(ten_json, field); -} - -const char *ten_msg_json_get_string_field_in_ten(ten_json_t *json, - const char *field) { - TEN_ASSERT(json && ten_json_check_integrity(json), "Should not happen."); - TEN_ASSERT(field, "Should not happen."); - - ten_json_t *ten_json = - ten_json_object_peek_object(json, TEN_STR_UNDERLINE_TEN); - if (!ten_json) { - return NULL; - } - - return ten_json_object_peek_string(ten_json, field); -} - -TEN_MSG_TYPE ten_msg_json_get_msg_type(ten_json_t *json) { - TEN_ASSERT(json && ten_json_check_integrity(json), "Should not happen."); - - const char *type_str = - ten_msg_json_get_string_field_in_ten(json, TEN_STR_TYPE); - const char *name_str = - ten_msg_json_get_string_field_in_ten(json, TEN_STR_NAME); - - return ten_msg_type_from_type_and_name_string(type_str, name_str); -} - static bool ten_raw_msg_dump_internal(ten_msg_t *msg, ten_error_t *err, const char *fmt, va_list ap) { TEN_ASSERT(msg && ten_raw_msg_check_integrity(msg), "Should not happen."); @@ -1310,7 +1242,7 @@ bool ten_msg_has_locked_res(ten_shared_ptr_t *self) { return ten_raw_msg_has_locked_res(ten_shared_ptr_get_data(self)); } -const char *ten_raw_msg_get_name(ten_msg_t *self) { +static const char *ten_raw_msg_get_name(ten_msg_t *self) { TEN_ASSERT(self && ten_raw_msg_check_integrity(self), "Should not happen."); return ten_value_peek_raw_str(&self->name); } @@ -1324,8 +1256,10 @@ const char *ten_msg_get_name(ten_shared_ptr_t *self) { return ten_raw_msg_get_name(raw_msg); } -bool ten_raw_msg_set_name_with_size(ten_msg_t *self, const char *msg_name, - size_t msg_name_len, ten_error_t *err) { +static bool ten_raw_msg_set_name_with_size(ten_msg_t *self, + const char *msg_name, + size_t msg_name_len, + ten_error_t *err) { TEN_ASSERT(self && ten_raw_msg_check_integrity(self), "Should not happen."); if (msg_name == NULL) { diff --git a/core/src/ten_runtime/test/extension_tester.c b/core/src/ten_runtime/test/extension_tester.c index 689459ede..a595b9e9a 100644 --- a/core/src/ten_runtime/test/extension_tester.c +++ b/core/src/ten_runtime/test/extension_tester.c @@ -174,8 +174,6 @@ static void ten_extension_tester_create_and_start_graph( ten_string_t start_graph_cmd_json_str; ten_string_init_formatted(&start_graph_cmd_json_str, "{\ - \"_ten\": {\ - \"type\": \"start_graph\",\ \"nodes\": [{\ \"type\": \"extension\",\ \"name\": \"ten:test_extension\",\ @@ -262,7 +260,6 @@ static void ten_extension_tester_create_and_start_graph( }]\ }]\ }]\ - }\ }", ten_string_get_raw_str(first_addon_name), ten_string_get_raw_str(first_addon_name), @@ -280,7 +277,7 @@ static void ten_extension_tester_create_and_start_graph( NULL, NULL, NULL); TEN_ASSERT(rc, "Should not happen."); - rc = ten_cmd_start_graph_init_from_json_str( + rc = ten_cmd_start_graph_set_graph_from_json_str( start_graph_cmd, ten_string_get_raw_str(&start_graph_cmd_json_str), NULL); TEN_ASSERT(rc, "Should not happen."); diff --git a/core/src/ten_rust/src/schema/mod.rs b/core/src/ten_rust/src/schema/mod.rs index eeee11ffe..dadfb33ff 100644 --- a/core/src/ten_rust/src/schema/mod.rs +++ b/core/src/ten_rust/src/schema/mod.rs @@ -74,7 +74,7 @@ impl TenSchema { unsafe { let c_value_str = std::ffi::CString::new(value_str)?; let success = - bindings::ten_schema_adjust_and_validate_json_string_proxy( + bindings::ten_schema_adjust_and_validate_json_str_proxy( self.as_ptr(), c_value_str.as_ptr(), &mut err_msg as *mut _ as *mut *const c_char, @@ -122,15 +122,15 @@ fn create_schema_from_json( schema_json: &serde_json::Value, ) -> Result { let schema_str = serde_json::to_string(schema_json)?; - create_schema_from_json_string(&schema_str) + create_schema_from_json_str(&schema_str) } -fn create_schema_from_json_string(schema_json_str: &str) -> Result { +fn create_schema_from_json_str(schema_json_str: &str) -> Result { let mut err_msg: *mut c_char = std::ptr::null_mut(); let schema_ptr: *mut ten_schema_t; unsafe { let c_schema_str = std::ffi::CString::new(schema_json_str)?; - schema_ptr = bindings::ten_schema_create_from_json_string_proxy( + schema_ptr = bindings::ten_schema_create_from_json_str_proxy( c_schema_str.as_ptr(), &mut err_msg as *mut _ as *mut *const c_char, ); @@ -176,7 +176,7 @@ mod tests { #[test] fn test_create_schema_invalid_json() { let schema_str = include_str!("test_data_embed/invalid_schema.json"); - let schema_result = create_schema_from_json_string(schema_str); + let schema_result = create_schema_from_json_str(schema_str); println!("{:?}", schema_result); assert!(schema_result.is_err()); } diff --git a/core/src/ten_utils/schema/bindings/rust/schema.c b/core/src/ten_utils/schema/bindings/rust/schema.c index 769957868..e4c70f2f1 100644 --- a/core/src/ten_utils/schema/bindings/rust/schema.c +++ b/core/src/ten_utils/schema/bindings/rust/schema.c @@ -6,15 +6,15 @@ // #include "include_internal/ten_utils/schema/bindings/rust/schema.h" -#include "ten_utils/macro/check.h" #include "include_internal/ten_utils/schema/schema.h" #include "ten_utils/lib/alloc.h" #include "ten_utils/lib/error.h" +#include "ten_utils/macro/check.h" -ten_schema_t *ten_schema_create_from_json_string_proxy(const char *json_string, - const char **err_msg) { +ten_schema_t *ten_schema_create_from_json_str_proxy(const char *json_string, + const char **err_msg) { TEN_ASSERT(json_string, "Invalid argument."); - return ten_schema_create_from_json_string(json_string, err_msg); + return ten_schema_create_from_json_str(json_string, err_msg); } void ten_schema_destroy_proxy(const ten_schema_t *self) { @@ -23,15 +23,14 @@ void ten_schema_destroy_proxy(const ten_schema_t *self) { ten_schema_destroy(self_); } -bool ten_schema_adjust_and_validate_json_string_proxy(const ten_schema_t *self, - const char *json_string, - const char **err_msg) { +bool ten_schema_adjust_and_validate_json_str_proxy(const ten_schema_t *self, + const char *json_string, + const char **err_msg) { ten_schema_t *self_ = (ten_schema_t *)self; TEN_ASSERT(self && ten_schema_check_integrity(self_), "Invalid argument."); TEN_ASSERT(json_string, "Invalid argument."); - return ten_schema_adjust_and_validate_json_string(self_, json_string, - err_msg); + return ten_schema_adjust_and_validate_json_str(self_, json_string, err_msg); } bool ten_schema_is_compatible_proxy(const ten_schema_t *self, diff --git a/core/src/ten_utils/schema/schema.c b/core/src/ten_utils/schema/schema.c index 6e695f882..4da1caeaa 100644 --- a/core/src/ten_utils/schema/schema.c +++ b/core/src/ten_utils/schema/schema.c @@ -450,8 +450,8 @@ bool ten_schema_is_compatible(ten_schema_t *self, ten_schema_t *target, return result; } -ten_schema_t *ten_schema_create_from_json_string(const char *json_string, - const char **err_msg) { +ten_schema_t *ten_schema_create_from_json_str(const char *json_string, + const char **err_msg) { TEN_ASSERT(json_string, "Invalid argument."); ten_schema_t *schema = NULL; @@ -486,9 +486,9 @@ ten_schema_t *ten_schema_create_from_json_string(const char *json_string, return schema; } -bool ten_schema_adjust_and_validate_json_string(ten_schema_t *self, - const char *json_string, - const char **err_msg) { +bool ten_schema_adjust_and_validate_json_str(ten_schema_t *self, + const char *json_string, + const char **err_msg) { TEN_ASSERT(self && ten_schema_check_integrity(self), "Invalid argument."); TEN_ASSERT(json_string, "Invalid argument."); diff --git a/tests/ten_runtime/integration/cpp/check_start_graph/check_start_graph_source/ten_packages/extension/default_extension_cpp/src/main.cc b/tests/ten_runtime/integration/cpp/check_start_graph/check_start_graph_source/ten_packages/extension/default_extension_cpp/src/main.cc index 80c7de741..5db3e6245 100644 --- a/tests/ten_runtime/integration/cpp/check_start_graph/check_start_graph_source/ten_packages/extension/default_extension_cpp/src/main.cc +++ b/tests/ten_runtime/integration/cpp/check_start_graph/check_start_graph_source/ten_packages/extension/default_extension_cpp/src/main.cc @@ -27,8 +27,7 @@ class test_extension : public ten::extension_t { auto start_graph_cmd = ten::cmd_start_graph_t::create(); start_graph_cmd->set_dest("localhost", nullptr, nullptr, nullptr); - bool result = start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": { + bool result = start_graph_cmd->set_graph_from_json(R"({ "nodes": [ { "type": "extension", @@ -60,9 +59,8 @@ class test_extension : public ten::extension_t { ] } ] - } })", - &err); + &err); assert(!result && "The graph should be invalid."); // The extension_info is not found, extension_group: @@ -84,8 +82,7 @@ class test_extension : public ten::extension_t { auto start_graph_cmd = ten::cmd_start_graph_t::create(); start_graph_cmd->set_dest("localhost", nullptr, nullptr, nullptr); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": { + start_graph_cmd->set_graph_from_json(R"({ "nodes": [ { "type": "extension", @@ -94,7 +91,6 @@ class test_extension : public ten::extension_t { "extension_group": "default_extension_group" } ] - } })"); ten_env.send_cmd( 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 1403ed1c9..5dde741c7 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 @@ -14,8 +14,8 @@ int main(int argc, char **argv) { // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "default_extension_cpp", @@ -25,8 +25,7 @@ int main(int argc, char **argv) { "prop": "${env:TEST_ENV_VAR|foobar,foo, bar}" } }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); TEN_ASSERT(TEN_STATUS_CODE_OK == cmd_result->get_status_code(), 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 1403ed1c9..5dde741c7 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 @@ -14,8 +14,8 @@ int main(int argc, char **argv) { // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "default_extension_cpp", @@ -25,8 +25,7 @@ int main(int argc, char **argv) { "prop": "${env:TEST_ENV_VAR|foobar,foo, bar}" } }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); TEN_ASSERT(TEN_STATUS_CODE_OK == cmd_result->get_status_code(), 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 63e7a5324..29c3ecbcf 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 @@ -14,8 +14,8 @@ int main(int argc, char **argv) { // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "default_extension_cpp", @@ -25,8 +25,7 @@ int main(int argc, char **argv) { "prop": "${env:TEST_ENV_VAR}" } }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); TEN_ASSERT(TEN_STATUS_CODE_OK == cmd_result->get_status_code(), 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 62eeaf175..57984b05e 100644 --- a/tests/ten_runtime/integration/cpp/hello_world/client/client.cc +++ b/tests/ten_runtime/integration/cpp/hello_world/client/client.cc @@ -14,16 +14,15 @@ int main(int argc, char **argv) { // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "default_extension_cpp", "app": "msgpack://127.0.0.1:8001/", "extension_group": "test_extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); TEN_ASSERT(TEN_STATUS_CODE_OK == cmd_result->get_status_code(), diff --git a/tests/ten_runtime/integration/cpp/multi_apps/client/client.cc b/tests/ten_runtime/integration/cpp/multi_apps/client/client.cc index d268c9e0c..de71d0051 100644 --- a/tests/ten_runtime/integration/cpp/multi_apps/client/client.cc +++ b/tests/ten_runtime/integration/cpp/multi_apps/client/client.cc @@ -19,8 +19,8 @@ void test_extension_in_app1_not_installed() { // Send a start_graph cmd to app 8001. However, because there is no extension // addon named `ext_e` in app 8001, the `start_graph` command will fail. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "ext_a", "addon": "ext_e", @@ -33,8 +33,7 @@ void test_extension_in_app1_not_installed() { "app": "msgpack://127.0.0.1:8002/", "extension_group": "test_extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); TEN_ASSERT(TEN_STATUS_CODE_ERROR == cmd_result->get_status_code(), @@ -55,9 +54,8 @@ void test_extension_in_app2_not_installed() { // Send a start_graph cmd to app 8001. However, because there is no extension // addon named `ext_e` in app 8002, the `start_graph` command will fail. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json( + start_graph_cmd->set_graph_from_json( R"({ - "_ten": { "nodes": [{ "type": "extension", "name": "ext_a", @@ -84,7 +82,6 @@ void test_extension_in_app2_not_installed() { }] }] }] - } })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); @@ -109,9 +106,8 @@ int main(int argc, char **argv) { auto *client = new ten::msgpack_tcp_client_t("msgpack://127.0.0.1:8001/"); auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json( + start_graph_cmd->set_graph_from_json( R"({ - "_ten": { "nodes": [{ "type": "extension", "name": "ext_a", @@ -119,7 +115,6 @@ int main(int argc, char **argv) { "app": "msgpack://127.0.0.1:8001/", "extension_group": "test_extension_group" }] - } })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 85c274bb4..661070957 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 @@ -15,8 +15,8 @@ int main(TEN_UNUSED int argc, TEN_UNUSED char **argv) { auto *client = new ten::msgpack_tcp_client_t("msgpack://127.0.0.1:8007/"); auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [ { "type": "extension", "app": "msgpack://127.0.0.1:8007/", @@ -67,8 +67,7 @@ int main(TEN_UNUSED int argc, TEN_UNUSED char **argv) { }] } ] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); TEN_LOGD("client sent json"); 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 81c0ce2ba..e89406880 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 @@ -14,8 +14,8 @@ int main(TEN_UNUSED int argc, TEN_UNUSED char **argv) { auto *client = new ten::msgpack_tcp_client_t("msgpack://127.0.0.1:8007/"); auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [ { "type": "extension", "app": "msgpack://127.0.0.1:8007/", @@ -46,8 +46,7 @@ int main(TEN_UNUSED int argc, TEN_UNUSED char **argv) { }] } ] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); TEN_ASSERT(TEN_STATUS_CODE_OK == cmd_result->get_status_code(), diff --git a/tests/ten_runtime/smoke/audio_frame_test/basic.cc b/tests/ten_runtime/smoke/audio_frame_test/basic.cc index cc1205819..f74640dbd 100644 --- a/tests/ten_runtime/smoke/audio_frame_test/basic.cc +++ b/tests/ten_runtime/smoke/audio_frame_test/basic.cc @@ -95,8 +95,8 @@ TEST(AudioFrameTest, Basic) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "audio_frame_basic__test_extension_1", @@ -134,7 +134,6 @@ TEST(AudioFrameTest, Basic) { // NOLINT }] }] }] - } })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 9feb085af..1582eea2a 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 @@ -110,8 +110,8 @@ TEST(AudioFrameTest, CreateFromJson) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "audio_frame_create_from_json__test_extension_1", @@ -149,7 +149,6 @@ TEST(AudioFrameTest, CreateFromJson) { // NOLINT }] }] }] - } })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 5b31c7220..dfa0c7d42 100644 --- a/tests/ten_runtime/smoke/audio_frame_test/from_json.cc +++ b/tests/ten_runtime/smoke/audio_frame_test/from_json.cc @@ -107,8 +107,8 @@ TEST(AudioFrameTest, FromJson) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - bool rc = start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + bool rc = start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "audio_frame_from_json__test_extension_1", @@ -146,8 +146,7 @@ TEST(AudioFrameTest, FromJson) { // NOLINT }] }] }] - } - })"); + })"); TEN_ASSERT(rc, "Should not happen."); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 f0b0f599a..fcff7add2 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 @@ -173,8 +173,8 @@ TEST(AudioFrameTest, MultiDestAudioFrame) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "extension 1", "addon": "multi_dest_audio_frame__extension_1", @@ -210,8 +210,7 @@ TEST(AudioFrameTest, MultiDestAudioFrame) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 be3d724c1..5a8c8aa9e 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 @@ -87,9 +87,8 @@ TEST(CmdConversionTest, CmdConversionConnectCmd) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json( + start_graph_cmd->set_graph_from_json( R"###({ - "_ten": { "nodes": [{ "type": "extension", "name": "test_extension_1", @@ -124,7 +123,6 @@ TEST(CmdConversionTest, CmdConversionConnectCmd) { // NOLINT }] }] }] - } })###"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); diff --git a/tests/ten_runtime/smoke/cmd_result_test/multiple_result_1.cc b/tests/ten_runtime/smoke/cmd_result_test/multiple_result_1.cc index 97854ed41..64144989a 100644 --- a/tests/ten_runtime/smoke/cmd_result_test/multiple_result_1.cc +++ b/tests/ten_runtime/smoke/cmd_result_test/multiple_result_1.cc @@ -107,8 +107,8 @@ TEST(CmdResultTest, MultipleResult1) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "multiple_result_1__test_extension_1", @@ -134,8 +134,7 @@ TEST(CmdResultTest, MultipleResult1) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/cmd_result_test/multiple_result_2.cc b/tests/ten_runtime/smoke/cmd_result_test/multiple_result_2.cc index a0ca49123..959c76cb4 100644 --- a/tests/ten_runtime/smoke/cmd_result_test/multiple_result_2.cc +++ b/tests/ten_runtime/smoke/cmd_result_test/multiple_result_2.cc @@ -121,8 +121,8 @@ TEST(CmdResultTest, MultipleResult2) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "multiple_result_2__test_extension_1", @@ -158,8 +158,7 @@ TEST(CmdResultTest, MultipleResult2) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/cmd_result_test/multiple_result_3.cc b/tests/ten_runtime/smoke/cmd_result_test/multiple_result_3.cc index 7e50a3ee9..ce042b83f 100644 --- a/tests/ten_runtime/smoke/cmd_result_test/multiple_result_3.cc +++ b/tests/ten_runtime/smoke/cmd_result_test/multiple_result_3.cc @@ -121,8 +121,8 @@ TEST(CmdResultTest, MultipleResult3) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "multiple_result_3__test_extension_1", @@ -158,8 +158,7 @@ TEST(CmdResultTest, MultipleResult3) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/data_test/basic.cc b/tests/ten_runtime/smoke/data_test/basic.cc index 493556c20..55198cc5f 100644 --- a/tests/ten_runtime/smoke/data_test/basic.cc +++ b/tests/ten_runtime/smoke/data_test/basic.cc @@ -90,16 +90,15 @@ TEST(DataTest, Basic) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "data_basic__extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "default_extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/data_test/basic_2.cc b/tests/ten_runtime/smoke/data_test/basic_2.cc index fdf0bb4ca..9b09b3b39 100644 --- a/tests/ten_runtime/smoke/data_test/basic_2.cc +++ b/tests/ten_runtime/smoke/data_test/basic_2.cc @@ -94,8 +94,8 @@ TEST(DataTest, Basic2) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "data_basic_2__test_extension_1", @@ -133,8 +133,7 @@ TEST(DataTest, Basic2) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 607163c25..96406e867 100644 --- a/tests/ten_runtime/smoke/data_test/create_from_json.cc +++ b/tests/ten_runtime/smoke/data_test/create_from_json.cc @@ -99,8 +99,8 @@ TEST(DataTest, CreateFromJson) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "data_create_from_json__test_extension_1", @@ -138,8 +138,7 @@ TEST(DataTest, CreateFromJson) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/data_test/from_json.cc b/tests/ten_runtime/smoke/data_test/from_json.cc index 43c724fa6..55d328131 100644 --- a/tests/ten_runtime/smoke/data_test/from_json.cc +++ b/tests/ten_runtime/smoke/data_test/from_json.cc @@ -103,8 +103,8 @@ TEST(DataTest, FromJson) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "data_from_json__test_extension_1", @@ -142,8 +142,7 @@ TEST(DataTest, FromJson) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 4e4b5a0d6..2e5899dc3 100644 --- a/tests/ten_runtime/smoke/data_test/multi_dest_data.cc +++ b/tests/ten_runtime/smoke/data_test/multi_dest_data.cc @@ -162,8 +162,8 @@ TEST(DataTest, MultiDestData) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "extension 1", "addon": "multi_dest_data__extension_1", @@ -199,8 +199,7 @@ TEST(DataTest, MultiDestData) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 868e40d83..0f695726d 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 @@ -162,8 +162,8 @@ TEST(ExtensionTest, BasicExtensionsInitDependency) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "basic_extensions_init_dependency__extension_1", @@ -201,8 +201,7 @@ TEST(ExtensionTest, BasicExtensionsInitDependency) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 3615cd442..e03c6a759 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 @@ -74,16 +74,15 @@ TEST(ExtensionTest, BasicHelloWorld1) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "basic_hello_world_1__test_extension", "extension_group": "test_extension_group", "app": "msgpack://127.0.0.1:8001/" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 612e5f2db..8dc64d7b2 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 @@ -72,16 +72,15 @@ TEST(ExtensionTest, BasicHelloWorld2) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "basic_hello_world_2__extension", "extension_group": "test_extension_group", "app": "msgpack://127.0.0.1:8001/" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 ec5fa1cf5..c836a386c 100644 --- a/tests/ten_runtime/smoke/extension_test/basic/basic_loop.cc +++ b/tests/ten_runtime/smoke/extension_test/basic/basic_loop.cc @@ -117,8 +117,8 @@ TEST(ExtensionTest, BasicLoop) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "basic_loop__extension_1", @@ -156,8 +156,7 @@ TEST(ExtensionTest, BasicLoop) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 b73a79866..bd0a1d30b 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 @@ -121,8 +121,8 @@ TEST(ExtensionTest, BasicLoopCmd) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "basic_loop_cmd__extension_1", @@ -160,8 +160,7 @@ TEST(ExtensionTest, BasicLoopCmd) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 9a0232fd4..82e0ce144 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 @@ -121,8 +121,8 @@ TEST(ExtensionTest, BasicLoopCmdSnapShot) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "basic_loop_cmd_snapshot__extension_1", @@ -160,8 +160,7 @@ TEST(ExtensionTest, BasicLoopCmdSnapShot) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 4a389cf52..b44ea4ed7 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 @@ -95,8 +95,8 @@ TEST(ExtensionTest, BasicMsgPropertyToPropStore) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "basic_msg_property_to_property_store__test_extension_1", @@ -122,8 +122,7 @@ TEST(ExtensionTest, BasicMsgPropertyToPropStore) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 c6616bbdd..fca938a7d 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 @@ -154,8 +154,8 @@ TEST(ExtensionTest, BasicMultiApp) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "basic_multi_app__extension_1", @@ -181,8 +181,7 @@ TEST(ExtensionTest, BasicMultiApp) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 1db855c6a..4863690c0 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 @@ -139,8 +139,8 @@ TEST(ExtensionTest, BasicMultiAppCloseThroughEngine) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "basic_multi_app_close_through_engine__extension_1", @@ -166,8 +166,7 @@ TEST(ExtensionTest, BasicMultiAppCloseThroughEngine) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 d443a1cdc..7ad64737a 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 @@ -88,8 +88,8 @@ TEST(ExtensionTest, BasicMultiExtension) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "extension_group": "basic_multi_extension", @@ -115,8 +115,7 @@ TEST(ExtensionTest, BasicMultiExtension) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 fcd7c93a3..7aba4dbfd 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 @@ -88,8 +88,8 @@ TEST(ExtensionTest, BasicMultiExtensionGroup) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "basic_multi_extension_group__extension_1", @@ -115,8 +115,7 @@ TEST(ExtensionTest, BasicMultiExtensionGroup) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 f153c3fac..54cd0f5c1 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 @@ -72,15 +72,14 @@ TEST(ExtensionTest, BasicNoInitExtensionGroup) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "basic_no_init_extension_group", "addon": "basic_no_init_extension_group__extension" }] - } })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 2a22fd98d..16ec27811 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 @@ -184,8 +184,8 @@ TEST(ExtensionTest, BasicThrowExceptionInExtension) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "basic_throw_exception_in_extension__extension_1", @@ -247,8 +247,7 @@ TEST(ExtensionTest, BasicThrowExceptionInExtension) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); if (cmd_result) { 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 bda8262a4..127ae1578 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 @@ -87,8 +87,8 @@ TEST(ExtensionTest, BasicTwoExtensions) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "basic_two_extensions__test_extension_1", @@ -114,8 +114,7 @@ TEST(ExtensionTest, BasicTwoExtensions) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 6a14f6692..c0d582654 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 @@ -85,8 +85,8 @@ TEST(ExtensionTest, BasicTwoStandaloneExtension1) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "basic_two_standalone_extension_1__test_extension_1", @@ -99,8 +99,7 @@ TEST(ExtensionTest, BasicTwoStandaloneExtension1) { // NOLINT "extension_group": "test_extension_group", "app": "msgpack://127.0.0.1:8001/" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 b95f52ac9..fe36c34da 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 @@ -85,8 +85,8 @@ TEST(ExtensionTest, BasicTwoStandaloneExtension2) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "basic_two_standalone_extension_2__test_extension_1", @@ -99,8 +99,7 @@ TEST(ExtensionTest, BasicTwoStandaloneExtension2) { // NOLINT "extension_group": "test_extension_group 2", "app": "msgpack://127.0.0.1:8001/" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 2ffcb84f9..f2748a1de 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 @@ -72,16 +72,15 @@ TEST(ExtensionTest, CommandInvalidExtension) { // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "command_invalid_extension__extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "test_extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 16fbab967..f10e64558 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 @@ -89,16 +89,15 @@ TEST(ExtensionTest, CommandInvalidExtension2) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "command_invalid_extension_2__extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "test_extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 906c2fa36..c6bdb97d0 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 @@ -72,16 +72,15 @@ TEST(ExtensionTest, CommandInvalidExtensionGroup) { // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "command_invalid_extension_group__extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "test_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 ec5af53bf..bca674098 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 @@ -113,8 +113,8 @@ TEST(ExtensionTest, CommandSendEnum) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "command_send_enum__extension_1", "addon": "command_send_enum__extension_1", @@ -140,8 +140,7 @@ TEST(ExtensionTest, CommandSendEnum) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 4c9609bf8..aece9c644 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 @@ -107,8 +107,8 @@ TEST(ExtensionTest, CommandSendPtr) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "command_send_ptr__extension_1", "addon": "command_send_ptr__extension_1", @@ -134,8 +134,7 @@ TEST(ExtensionTest, CommandSendPtr) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 51ca9a88c..5374f9df7 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 @@ -111,8 +111,8 @@ TEST(ExtensionTest, CommandSendPtrThroughCmd) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "command_send_ptr_through_cmd__extension_1", "addon": "command_send_ptr_through_cmd__extension_1", @@ -138,8 +138,7 @@ TEST(ExtensionTest, CommandSendPtrThroughCmd) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 0809facd1..a222da22f 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 @@ -190,8 +190,8 @@ TEST(ExtensionTest, CommandStopGraphActively) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "command_stop_graph_actively__extension_1", @@ -253,8 +253,7 @@ TEST(ExtensionTest, CommandStopGraphActively) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 1df8dfe2a..5de72dcce 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 @@ -198,8 +198,8 @@ TEST(ExtensionTest, CommandStopGraphActivelyThroughCmd) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "command_stop_graph_actively_through_cmd__extension_1", @@ -261,8 +261,7 @@ TEST(ExtensionTest, CommandStopGraphActivelyThroughCmd) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 3759a8595..96ed7ba7f 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 @@ -193,8 +193,8 @@ TEST(ExtensionTest, CommandStopGraphActivelyThroughCmdDest) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "command_stop_graph_actively_through_cmd_dest__extension_1", @@ -256,8 +256,7 @@ TEST(ExtensionTest, CommandStopGraphActivelyThroughCmdDest) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 eec1888f9..4397131cf 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 @@ -141,8 +141,8 @@ void *client_thread_main(TEN_UNUSED void *args) { // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "multi_app_concurrent__extension_1", @@ -168,8 +168,7 @@ void *client_thread_main(TEN_UNUSED void *args) { }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 bb33c0223..91a296adc 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 @@ -149,8 +149,8 @@ TEST(ExtensionTest, MultiAppSequential) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "multi_app_sequential__extension_1", @@ -176,8 +176,7 @@ TEST(ExtensionTest, MultiAppSequential) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 16337f6a3..83ccb6f75 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 @@ -157,37 +157,35 @@ TEST(ExtensionTest, OneEngineConcurrent) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json( + start_graph_cmd->set_long_running_mode(true); + start_graph_cmd->set_graph_from_json( R"({ - "_ten": { - "long_running_mode": true, - "nodes": [{ - "type": "extension", - "name": "A", - "addon": "one_engine_concurrent__extension_A", - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "extension_group_A" - },{ - "type": "extension", - "name": "B", - "addon": "one_engine_concurrent__extension_B", - "app": "msgpack://127.0.0.1:8002/", - "extension_group": "extension_group_B" - }], - "connections": [{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "extension_group_A", - "extension": "A", - "cmd": [{ - "name": "test", - "dest": [{ - "app": "msgpack://127.0.0.1:8002/", - "extension_group": "extension_group_B", - "extension": "B" - }] + "nodes": [{ + "type": "extension", + "name": "A", + "addon": "one_engine_concurrent__extension_A", + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "extension_group_A" + },{ + "type": "extension", + "name": "B", + "addon": "one_engine_concurrent__extension_B", + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "extension_group_B" + }], + "connections": [{ + "app": "msgpack://127.0.0.1:8001/", + "extension_group": "extension_group_A", + "extension": "A", + "cmd": [{ + "name": "test", + "dest": [{ + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "extension_group_B", + "extension": "B" }] }] - } + }] })"); auto cmd_result = diff --git a/tests/ten_runtime/smoke/extension_test/dest/no_audio_frame_dest.cc b/tests/ten_runtime/smoke/extension_test/dest/no_audio_frame_dest.cc index ee34b9dae..97a33f85d 100644 --- a/tests/ten_runtime/smoke/extension_test/dest/no_audio_frame_dest.cc +++ b/tests/ten_runtime/smoke/extension_test/dest/no_audio_frame_dest.cc @@ -111,9 +111,8 @@ TEST(ExtensionTest, NoAudioFrameDest) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json( + start_graph_cmd->set_graph_from_json( R"({ - "_ten": { "nodes": [{ "type": "extension", "name": "test_extension_1", @@ -152,7 +151,6 @@ TEST(ExtensionTest, NoAudioFrameDest) { // NOLINT }] }] }] - } })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 fe73b2f8c..0f16aa1d5 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 @@ -127,37 +127,35 @@ TEST(ExtensionTest, EngineLongRunningMode) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json( + start_graph_cmd->set_long_running_mode(true); + start_graph_cmd->set_graph_from_json( R"({ - "_ten": { - "long_running_mode": true, - "nodes": [{ - "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", - "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/", - "extension_group": "engine_long_running_mode__extension_group_A", - "extension": "A", - "cmd": [{ - "name": "test", - "dest": [{ - "app": "msgpack://127.0.0.1:8002/", - "extension_group": "engine_long_running_mode__extension_group_B", - "extension": "B" - }] + "nodes": [{ + "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", + "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/", + "extension_group": "engine_long_running_mode__extension_group_A", + "extension": "A", + "cmd": [{ + "name": "test", + "dest": [{ + "app": "msgpack://127.0.0.1:8002/", + "extension_group": "engine_long_running_mode__extension_group_B", + "extension": "B" }] }] - } + }] })"); auto cmd_result = 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 7d6513f64..3857ca175 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 @@ -73,16 +73,15 @@ TEST(ExtensionTest, EngineOneLoopPerEngine) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "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" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 bf3c0a06d..555768222 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 @@ -85,16 +85,15 @@ TEST(ExtensionTest, ExtensionSendMsgToIncorrectEngine) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "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" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 58ed5238b..5e080c364 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 @@ -70,9 +70,8 @@ TEST(ExtensionTest, ErrorClientSendJson) { // NOLINT ten_error_t *err = ten_error_create(); auto *invalid_graph_cmd = ten_cmd_start_graph_create(); - bool success = ten_cmd_start_graph_init_from_json_str(invalid_graph_cmd, R"( - { - "_ten": { + bool success = + ten_cmd_start_graph_set_graph_from_json_str(invalid_graph_cmd, R"({ "nodes":[ { "type": "extension", @@ -89,10 +88,8 @@ TEST(ExtensionTest, ErrorClientSendJson) { // NOLINT "extension_group": "extension_group" } ] - } - } - )", - err); + })", + err); EXPECT_EQ(success, false); EXPECT_STREQ(ten_error_errmsg(err), "extension 'extension_1' is associated with different addon " 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 0d1d4804a..1edac37a5 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 @@ -72,16 +72,15 @@ TEST(ExtensionTest, ExtensionRegExtension) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "extension_reg_extension", "addon": "extension_reg_extension__extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "extension_reg_extension" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 4ba4df531..dda25e3ab 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 @@ -78,16 +78,15 @@ TEST(ExtensionTest, ExtensionRegExtensionAndCreateGroup) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "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" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 b75d3e2f3..ac4c87d47 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 @@ -73,16 +73,15 @@ TEST(ExtensionTest, ExtensionRegExtensionGroup) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "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" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 fa54787d4..a3c8a5275 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 @@ -115,8 +115,8 @@ TEST(ExtensionTest, ExtensionWithSameName) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "same_name", "addon": "extension_with_same_name__extension", @@ -129,8 +129,7 @@ TEST(ExtensionTest, ExtensionWithSameName) { // NOLINT "app": "msgpack://127.0.0.1:8001/", "extension_group": "extension_with_same_name__extension_group_2" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/extension_test/extension_group/extension_group_not_specified.cc b/tests/ten_runtime/smoke/extension_test/extension_group/extension_group_not_specified.cc index 3dd3f61c7..5e1003f33 100644 --- a/tests/ten_runtime/smoke/extension_test/extension_group/extension_group_not_specified.cc +++ b/tests/ten_runtime/smoke/extension_test/extension_group/extension_group_not_specified.cc @@ -71,8 +71,8 @@ TEST(ExtensionTest, ExtensionGroupNotSpecified) { // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "extension_group_not_specified__extension", @@ -85,8 +85,7 @@ TEST(ExtensionTest, ExtensionGroupNotSpecified) { "app": "msgpack://127.0.0.1:8001/", "extension_group": "extension_group_not_specified" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 68dd4b827..ab166ef72 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 @@ -71,8 +71,8 @@ TEST(ExtensionTest, ExtensionGroupWithSameName) { // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "extension_group_with_same_name__extension", @@ -85,8 +85,7 @@ TEST(ExtensionTest, ExtensionGroupWithSameName) { "app": "msgpack://127.0.0.1:8001/", "extension_group": "extension_group_with_same_name" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 cd8cd01e4..9f8965fdb 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 @@ -71,8 +71,8 @@ TEST(ExtensionTest, ExtensionGroupWithSameNameAndGraphInfo) { // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "extension_group_with_same_name_and_graph_info__extension", @@ -98,8 +98,7 @@ TEST(ExtensionTest, ExtensionGroupWithSameNameAndGraphInfo) { }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 19b072192..77c9d09a6 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 @@ -87,8 +87,8 @@ TEST(ExtensionTest, GraphLackSomething1) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "extension_group": "graph_lack_something_1", @@ -114,8 +114,7 @@ TEST(ExtensionTest, GraphLackSomething1) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 ab98d90da..48ce13ceb 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 @@ -87,8 +87,8 @@ TEST(ExtensionTest, GraphLackSomething2) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "graph_lack_something_2__extension_1", @@ -114,8 +114,7 @@ TEST(ExtensionTest, GraphLackSomething2) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 6c8345d44..ff8858912 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 @@ -87,8 +87,8 @@ TEST(ExtensionTest, GraphLackSomething3) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "graph_lack_something_3__extension_1", @@ -114,8 +114,7 @@ TEST(ExtensionTest, GraphLackSomething3) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 2ba1531b7..644c6fc56 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 @@ -186,8 +186,8 @@ TEST(ExtensionTest, GraphLoopInMultiApp) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "graph_loop_in_multi_app__extension_1", @@ -261,8 +261,7 @@ TEST(ExtensionTest, GraphLoopInMultiApp) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 12b5f2721..25d19899d 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 @@ -118,8 +118,8 @@ TEST(ExtensionTest, GraphLoopInOneApp) { // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "graph_loop_in_one_app__extension_1", @@ -193,8 +193,7 @@ TEST(ExtensionTest, GraphLoopInOneApp) { }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 468e2c87d..a66f0a0c4 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 @@ -111,10 +111,9 @@ TEST(ExtensionTest, GraphLoopMultipleCircle) { // NOLINT auto *client = new ten::msgpack_tcp_client_t("msgpack://127.0.0.1:8001/"); auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"dest": [{ - "app": "msgpack://127.0.0.1:8001/" - }], + start_graph_cmd->set_dest("msgpack://127.0.0.1:8001/", nullptr, nullptr, + nullptr); + start_graph_cmd->set_graph_from_json(R"({ "nodes": [{ "type": "extension", "name": "A", @@ -201,7 +200,6 @@ TEST(ExtensionTest, GraphLoopMultipleCircle) { // NOLINT }] }] }] - } })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 96353d05d..b85936a09 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 @@ -110,10 +110,9 @@ TEST(ExtensionTest, DISABLED_GraphLoopMultipleCircleThroughCmd) { // NOLINT auto *client = new ten::msgpack_tcp_client_t("msgpack://127.0.0.1:8001/"); auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"dest": [{ - "app": "msgpack://127.0.0.1:8001/" - }], + start_graph_cmd->set_dest("msgpack://127.0.0.1:8001/", nullptr, nullptr, + nullptr); + start_graph_cmd->set_graph_from_json(R"({ "nodes": [{ "type": "extension", "name": "A", @@ -200,7 +199,6 @@ TEST(ExtensionTest, DISABLED_GraphLoopMultipleCircleThroughCmd) { // NOLINT }] }] }] - } })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 838a9f892..e911ee002 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 @@ -4,6 +4,7 @@ // 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 @@ -108,10 +109,9 @@ TEST(ExtensionTest, auto *client = new ten::msgpack_tcp_client_t("msgpack://127.0.0.1:8001/"); auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"dest": [{ - "app": "msgpack://127.0.0.1:8001/" - }], + start_graph_cmd->set_dest("msgpack://127.0.0.1:8001/", nullptr, nullptr, + nullptr); + start_graph_cmd->set_graph_from_json(R"({ "nodes": [{ "type": "extension", "name": "A", @@ -198,7 +198,6 @@ TEST(ExtensionTest, }] }] }] - } })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 5c5c99eea..f9a604389 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 @@ -225,10 +225,9 @@ TEST(ExtensionTest, GraphMultiplePolygon) { // NOLINT client = new ten::msgpack_tcp_client_t("msgpack://127.0.0.1:8001/"); auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"dest": [{ - "app": "msgpack://127.0.0.1:8001/" - }], + start_graph_cmd->set_dest("msgpack://127.0.0.1:8001/", nullptr, nullptr, + nullptr); + start_graph_cmd->set_graph_from_json(R"({ "nodes": [{ "type": "extension", "name": "A", @@ -399,7 +398,6 @@ TEST(ExtensionTest, GraphMultiplePolygon) { // NOLINT }] }] }] - } })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 d58ab1ad4..ec41a73f8 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 @@ -150,10 +150,7 @@ TEST(ExtensionTest, GraphMultiplePolygonOneApp) { // NOLINT // Create a client and connect to the app. auto *client = new ten::msgpack_tcp_client_t("msgpack://127.0.0.1:8001/"); auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"dest": [{ - "app": "msgpack://127.0.0.1:8001/" - }], + start_graph_cmd->set_graph_from_json(R"({ "nodes": [{ "type": "extension", "name": "A", @@ -324,7 +321,6 @@ TEST(ExtensionTest, GraphMultiplePolygonOneApp) { // NOLINT }] }] }] - } })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 f9297e1af..5b27db9f0 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 @@ -85,8 +85,8 @@ TEST(ExtensionTest, GraphOutOfOrder1) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "graph_out_of_order_1__test_extension_1", @@ -99,8 +99,7 @@ TEST(ExtensionTest, GraphOutOfOrder1) { // NOLINT "extension_group": "test_extension_group 2", "app": "msgpack://127.0.0.1:8001/" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 d4e447406..559feb295 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 @@ -85,8 +85,8 @@ TEST(ExtensionTest, GraphOutOfOrder2) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "graph_out_of_order_2__test_extension_1", @@ -99,8 +99,7 @@ TEST(ExtensionTest, GraphOutOfOrder2) { // NOLINT "extension_group": "test_extension_group 2", "app": "msgpack://127.0.0.1:8001/" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_polygon_in_one_app_return_all_1.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_polygon_in_one_app_return_all_1.cc index 67f7ec29a..fc6d16b61 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_polygon_in_one_app_return_all_1.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_polygon_in_one_app_return_all_1.cc @@ -126,11 +126,11 @@ TEST(ExtensionTest, GraphPolygonInOneAppReturnAll1) { // NOLINT // Create a client and connect to the app. auto *client = new ten::msgpack_tcp_client_t("msgpack://127.0.0.1:8001/"); + auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"dest": [{ - "app": "msgpack://127.0.0.1:8001/" - }], + start_graph_cmd->set_dest("msgpack://127.0.0.1:8001/", nullptr, nullptr, + nullptr); + start_graph_cmd->set_graph_from_json(R"({ "nodes": [{ "type": "extension", "name": "A", @@ -213,7 +213,6 @@ TEST(ExtensionTest, GraphPolygonInOneAppReturnAll1) { // NOLINT "extension_group": "graph_polygon_in_one_app_return_all_1__extension_group", "extension": "D" }] - } })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); diff --git a/tests/ten_runtime/smoke/extension_test/graph/graph_polygon_in_one_app_return_all_2.cc b/tests/ten_runtime/smoke/extension_test/graph/graph_polygon_in_one_app_return_all_2.cc index c38458a76..4de984cd1 100644 --- a/tests/ten_runtime/smoke/extension_test/graph/graph_polygon_in_one_app_return_all_2.cc +++ b/tests/ten_runtime/smoke/extension_test/graph/graph_polygon_in_one_app_return_all_2.cc @@ -126,11 +126,11 @@ TEST(ExtensionTest, GraphPolygonInOneAppReturnAll2) { // NOLINT // Create a client and connect to the app. auto *client = new ten::msgpack_tcp_client_t("msgpack://127.0.0.1:8001/"); + auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"dest": [{ - "app": "msgpack://127.0.0.1:8001/" - }], + start_graph_cmd->set_dest("msgpack://127.0.0.1:8001/", nullptr, nullptr, + nullptr); + start_graph_cmd->set_graph_from_json(R"({ "nodes": [{ "type": "extension", "name": "A", @@ -213,7 +213,6 @@ TEST(ExtensionTest, GraphPolygonInOneAppReturnAll2) { // NOLINT "extension_group": "graph_polygon_in_one_app_return_all_2__extension_group", "extension": "D" }] - } })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 67e7814bd..dafec114b 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 @@ -185,8 +185,7 @@ TEST(ExtensionTest, GraphYShapeInMultiApp) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": { + start_graph_cmd->set_graph_from_json(R"({ "nodes": [{ "type": "extension", "name": "test_extension_1", @@ -249,7 +248,6 @@ TEST(ExtensionTest, GraphYShapeInMultiApp) { // NOLINT }] }] }] - } })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 0ef8b8ebe..497bfb4f9 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 @@ -117,8 +117,8 @@ TEST(ExtensionTest, GraphYShapeInOneApp) { // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "graph_y_shape_in_one_app__extension_1", @@ -180,8 +180,7 @@ TEST(ExtensionTest, GraphYShapeInOneApp) { }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 24ad822aa..6125e3c95 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 @@ -135,10 +135,9 @@ TEST(ExtensionTest, GraphNameBasic) { // NOLINT client = new ten::msgpack_tcp_client_t("msgpack://127.0.0.1:8001/"); auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"dest": [{ - "app": "msgpack://127.0.0.1:8001/" - }], + start_graph_cmd->set_dest("msgpack://127.0.0.1:8001/", nullptr, nullptr, + nullptr); + start_graph_cmd->set_graph_from_json(R"({ "nodes": [{ "type": "extension", "name": "extension1", @@ -183,7 +182,6 @@ TEST(ExtensionTest, GraphNameBasic) { // NOLINT }] }] }] - } })"); auto cmd_result = 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 08663759f..c82f7c443 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 @@ -164,8 +164,8 @@ TEST(ExtensionTest, LockData1) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "extension 1", "addon": "lock_data_1__extension_1", @@ -201,8 +201,7 @@ TEST(ExtensionTest, LockData1) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 2b5877371..5ace19e1c 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 @@ -108,8 +108,8 @@ TEST(ExtensionTest, MsgPropertySendCString) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "msg_property_send_c_string__extension_1", "addon": "msg_property_send_c_string__extension_1", @@ -135,8 +135,7 @@ TEST(ExtensionTest, MsgPropertySendCString) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 48ef1a9b2..a525dcf73 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 @@ -133,8 +133,8 @@ TEST(ExtensionTest, MsgPropertySendCppPtr) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "msg_property_send_cpp_ptr__extension_1", "addon": "msg_property_send_cpp_ptr__extension_1", @@ -160,8 +160,7 @@ TEST(ExtensionTest, MsgPropertySendCppPtr) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 77b44a22a..a6430e24f 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 @@ -106,8 +106,8 @@ TEST(ExtensionTest, MsgPropertySendCppString) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "msg_property_send_cpp_string__extension_1", "addon": "msg_property_send_cpp_string__extension_1", @@ -133,8 +133,7 @@ TEST(ExtensionTest, MsgPropertySendCppString) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 d7b756c04..3f9947d1b 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 @@ -115,8 +115,8 @@ TEST(ExtensionTest, MsgPropertySendFloatPtr) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "msg_property_send_float_ptr__extension_1", "addon": "msg_property_send_float_ptr__extension_1", @@ -142,8 +142,7 @@ TEST(ExtensionTest, MsgPropertySendFloatPtr) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 c24d74eba..4cd9159df 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 @@ -107,8 +107,8 @@ TEST(ExtensionTest, MsgPropertySendInt) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "msg_property_send_int__extension_1", "addon": "msg_property_send_int__extension_1", @@ -134,8 +134,7 @@ TEST(ExtensionTest, MsgPropertySendInt) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 d0ec1b92a..422e6b7bb 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 @@ -115,8 +115,8 @@ TEST(ExtensionTest, MsgPropertySendInt32Ptr) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "msg_property_send_int32_ptr__extension_1", "addon": "msg_property_send_int32_ptr__extension_1", @@ -142,8 +142,7 @@ TEST(ExtensionTest, MsgPropertySendInt32Ptr) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 544383475..00b5d7525 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 @@ -103,8 +103,8 @@ TEST(ExtensionTest, MultiDestBasic) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "extension 1", "addon": "multi_dest_basic__extension_1", @@ -140,8 +140,7 @@ TEST(ExtensionTest, MultiDestBasic) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 a46681f80..83193ecb5 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 @@ -164,8 +164,8 @@ TEST(ExtensionTest, MultiDestInMultiApp) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "multi_dest_in_multi_app__extension_1", @@ -321,8 +321,7 @@ TEST(ExtensionTest, MultiDestInMultiApp) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 f1abef415..bcb57b056 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 @@ -165,8 +165,8 @@ TEST(ExtensionTest, MultiDestInMultiAppWithResponseHandler) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "multi_dest_in_multi_app_with_result_handler__extension_1", @@ -322,8 +322,7 @@ TEST(ExtensionTest, MultiDestInMultiAppWithResponseHandler) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 78871370a..71d278a7c 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 @@ -170,8 +170,8 @@ TEST(ExtensionTest, MultiDestInMultiAppWithResponseHandlerLambda) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "multi_dest_in_multi_app_with_result_handler_lambda__extension_1", @@ -327,8 +327,7 @@ TEST(ExtensionTest, MultiDestInMultiAppWithResponseHandlerLambda) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 b52b014a6..d1587e763 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 @@ -211,7 +211,6 @@ TEST(ExtensionTest, MultiDestInOneApp) { // NOLINT auto *client = new ten::msgpack_tcp_client_t("msgpack://127.0.0.1:8001/"); auto start_graph_cmd_content_str = R"({ - "_ten": { "nodes": [], "connections": [{ "app": "msgpack://127.0.0.1:8001/", @@ -222,11 +221,10 @@ TEST(ExtensionTest, MultiDestInOneApp) { // NOLINT "dest": [] }] }] - } })"_json; for (int i = 1; i <= DEST_EXTENSION_MAX_ID; i++) { - start_graph_cmd_content_str["_ten"]["nodes"].push_back({ + start_graph_cmd_content_str["nodes"].push_back({ {"type", "extension"}, {"name", "test_extension_" + std::to_string(i)}, {"addon", "multi_dest_in_one_app__extension_" + std::to_string(i)}, @@ -236,18 +234,17 @@ TEST(ExtensionTest, MultiDestInOneApp) { // NOLINT } for (int i = DEST_EXTENSION_MIN_ID; i <= DEST_EXTENSION_MAX_ID; i++) { - start_graph_cmd_content_str["_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 - }); + start_graph_cmd_content_str["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. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json( + start_graph_cmd->set_graph_from_json( start_graph_cmd_content_str.dump().c_str()); auto cmd_result = 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 30bac7d15..1dab03b17 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 @@ -103,8 +103,8 @@ TEST(ExtensionTest, MultiDestRespWhenAll) { // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "extension 1", "addon": "multi_dest_resp_when_all__extension_1", @@ -140,8 +140,7 @@ TEST(ExtensionTest, MultiDestRespWhenAll) { }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 3d5686d7e..939592397 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 @@ -169,8 +169,8 @@ TEST(ExtensionTest, MultiDestRespWhenAllInMultiApp) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "extension 1", "addon": "multi_dest_resp_when_all_in_multi_app__extension_1", @@ -206,8 +206,7 @@ TEST(ExtensionTest, MultiDestRespWhenAllInMultiApp) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); diff --git a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_send_in_stop_period.cc b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_send_in_stop_period.cc index 63888da85..f63cbc913 100644 --- a/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_send_in_stop_period.cc +++ b/tests/ten_runtime/smoke/extension_test/multi_dest/multi_dest_send_in_stop_period.cc @@ -110,8 +110,8 @@ TEST(ExtensionTest, MultiDestSendInStopPeriod) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "extension 1", "addon": "multi_dest_send_in_stop_period__extension_1", @@ -147,8 +147,7 @@ TEST(ExtensionTest, MultiDestSendInStopPeriod) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 a59333944..f63890273 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 @@ -137,8 +137,8 @@ TEST(ExtensionTest, MultiDestYGraph) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "extension_1", "addon": "multi_dest_y_graph__extension_1", @@ -192,8 +192,7 @@ TEST(ExtensionTest, MultiDestYGraph) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 bb50d6806..d598f1c1f 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 @@ -1037,8 +1037,8 @@ TEST(ExtensionTest, // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "one_hundred_and_twenty_eight_threads_attempt_to_suspend_1__test_extension_1", @@ -1084,8 +1084,7 @@ TEST(ExtensionTest, }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 9cf56c288..352f8c727 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 @@ -300,8 +300,8 @@ TEST(ExtensionTest, SixteenThreadsAttemptToSuspend1) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "sixteen_threads_attempt_to_suspend_1__test_extension_1", @@ -335,8 +335,7 @@ TEST(ExtensionTest, SixteenThreadsAttemptToSuspend1) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 a836438d0..8db83e9ee 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 @@ -220,8 +220,8 @@ TEST(ExtensionTest, TwoThreadsAttemptToSuspend1) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "two_threads_attempt_to_suspend_1__test_extension_1", @@ -255,8 +255,7 @@ TEST(ExtensionTest, TwoThreadsAttemptToSuspend1) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 122ac58b7..54ca71cce 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 @@ -222,8 +222,8 @@ TEST(ExtensionTest, TwoThreadsAttemptToSuspend2) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "two_threads_attempt_to_suspend_2__test_extension_1", @@ -257,8 +257,7 @@ TEST(ExtensionTest, TwoThreadsAttemptToSuspend2) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 60e06ffef..39d1f8b68 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 @@ -245,8 +245,8 @@ TEST(ExtensionTest, TwoThreadsAttemptToSuspend3) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "two_threads_attempt_to_suspend_3__test_extension_1", @@ -280,8 +280,7 @@ TEST(ExtensionTest, TwoThreadsAttemptToSuspend3) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 498d1694c..7b18c0d22 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 @@ -255,8 +255,8 @@ TEST(ExtensionTest, TwoThreadsAttemptToSuspend4) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "two_threads_attempt_to_suspend_4__test_extension_1", @@ -290,8 +290,7 @@ TEST(ExtensionTest, TwoThreadsAttemptToSuspend4) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 0ff3bef7c..e2268bd6c 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 @@ -260,8 +260,8 @@ TEST(ExtensionTest, TwoThreadsAttemptToSuspend5) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "two_threads_attempt_to_suspend_5__test_extension_1", @@ -295,8 +295,7 @@ TEST(ExtensionTest, TwoThreadsAttemptToSuspend5) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 24361b9a2..68e983c94 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 @@ -221,8 +221,8 @@ TEST(ExtensionTest, TwoThreadsAttemptToSuspend6) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "two_threads_attempt_to_suspend_6__test_extension_1", @@ -256,8 +256,7 @@ TEST(ExtensionTest, TwoThreadsAttemptToSuspend6) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 5a43c3388..7b1607af2 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 @@ -221,8 +221,8 @@ TEST(ExtensionTest, TwoThreadsAttemptToSuspend7) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "two_threads_attempt_to_suspend_7__test_extension_1", @@ -256,8 +256,7 @@ TEST(ExtensionTest, TwoThreadsAttemptToSuspend7) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 e9186471b..c5207f340 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 @@ -420,8 +420,8 @@ TEST(ExtensionTest, ThirtyTwoThreadsAttemptToSuspend1) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "thirty_two_threads_attempt_to_suspend_1__test_extension_1", @@ -455,8 +455,7 @@ TEST(ExtensionTest, ThirtyTwoThreadsAttemptToSuspend1) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 a4b4da242..76c7c263c 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 @@ -427,8 +427,8 @@ TEST(ExtensionTest, ThirtyTwoThreadsAttemptToSuspend2) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "thirty_two_threads_attempt_to_suspend_2__test_extension_1", @@ -462,8 +462,7 @@ TEST(ExtensionTest, ThirtyTwoThreadsAttemptToSuspend2) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 b41719757..486e38020 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 @@ -422,8 +422,8 @@ TEST(ExtensionTest, ThirtyTwoThreadsAttemptToSuspend3) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "thirty_two_threads_attempt_to_suspend_3__test_extension_1", @@ -457,8 +457,7 @@ TEST(ExtensionTest, ThirtyTwoThreadsAttemptToSuspend3) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 57d5db184..0657e692f 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 @@ -432,8 +432,8 @@ TEST(ExtensionTest, ThirtyTwoThreadsAttemptToSuspend4) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "thirty_two_threads_attempt_to_suspend_4__test_extension_1", @@ -467,8 +467,7 @@ TEST(ExtensionTest, ThirtyTwoThreadsAttemptToSuspend4) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 486ca755c..3aa49e41d 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 @@ -513,8 +513,8 @@ TEST(ExtensionTest, ThirtyTwoThreadsAttemptToSuspend5) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "thirty_two_threads_attempt_to_suspend_5__test_extension_1", @@ -560,8 +560,7 @@ TEST(ExtensionTest, ThirtyTwoThreadsAttemptToSuspend5) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 ebb137f05..83195ca28 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 @@ -530,8 +530,8 @@ TEST(ExtensionTest, ThirtyTwoThreadsAttemptToSuspend6) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "thirty_two_threads_attempt_to_suspend_6__test_extension_1", @@ -577,8 +577,7 @@ TEST(ExtensionTest, ThirtyTwoThreadsAttemptToSuspend6) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 cb1a35084..a86b85625 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 @@ -207,8 +207,8 @@ TEST(ExtensionTest, AutoFreeOutOfScope) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "auto_free_out_of_scope__test_extension_1", @@ -242,8 +242,7 @@ TEST(ExtensionTest, AutoFreeOutOfScope) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 6fece1ffe..d19a27112 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 @@ -173,8 +173,8 @@ TEST(ExtensionTest, OuterThreadSendData) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "outer_thread_send_data__test_extension_1", @@ -208,8 +208,7 @@ TEST(ExtensionTest, OuterThreadSendData) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 0d179a7d0..519b2b963 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 @@ -198,8 +198,8 @@ TEST(ExtensionTest, OuterThreadSendDataRespHandler) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "outer_thread_send_data_resp_handler__test_extension_1", @@ -233,8 +233,7 @@ TEST(ExtensionTest, OuterThreadSendDataRespHandler) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 b097c0322..d6faf82d6 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 @@ -103,8 +103,8 @@ TEST(ExtensionTest, CleanWhenStopped) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "clean_when_stopped__test_extension_1", @@ -137,8 +137,7 @@ TEST(ExtensionTest, CleanWhenStopped) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 1a32d7eff..86e47f15a 100644 --- a/tests/ten_runtime/smoke/extension_test/path/path_timeout.cc +++ b/tests/ten_runtime/smoke/extension_test/path/path_timeout.cc @@ -115,8 +115,8 @@ TEST(ExtensionTest, PathTimeout) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "path_timeout__test_extension_1", @@ -149,8 +149,7 @@ TEST(ExtensionTest, PathTimeout) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 ded20b059..89926357d 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 @@ -118,8 +118,8 @@ TEST(ExtensionTest, PathTimeout2) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "path_timeout_2__test_extension_1", @@ -152,8 +152,7 @@ TEST(ExtensionTest, PathTimeout2) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 a8c94da35..45d2b34ba 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 @@ -35,8 +35,7 @@ class test_predefined_graph : public ten::extension_t { auto start_graph_cmd = ten::cmd_start_graph_t::create(); start_graph_cmd->set_dest("msgpack://127.0.0.1:8001/", nullptr, nullptr, nullptr); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": { + start_graph_cmd->set_graph_from_json(R"({ "nodes": [{ "type": "extension", "name": "normal_extension", @@ -44,9 +43,8 @@ class test_predefined_graph : public ten::extension_t { "app": "msgpack://127.0.0.1:8001/", "extension_group": "normal_extension_group" }] - } })"_json.dump() - .c_str()); + .c_str()); ten_env.send_cmd( std::move(start_graph_cmd), 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 6f43452ab..36da255fe 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 @@ -113,8 +113,8 @@ TEST(ExtensionTest, PrepareToStopDifferentThread) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "prepare_to_stop_different_thread__test_extension_1", @@ -147,8 +147,7 @@ TEST(ExtensionTest, PrepareToStopDifferentThread) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 7dfd83df0..4a7c4215b 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 @@ -114,8 +114,8 @@ TEST(ExtensionTest, PrepareToStopSameThread) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "prepare_to_stop_same_thread__extension_1", @@ -148,8 +148,7 @@ TEST(ExtensionTest, PrepareToStopSameThread) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 3e01d57dc..173338067 100644 --- a/tests/ten_runtime/smoke/extension_test/property/property_all.cc +++ b/tests/ten_runtime/smoke/extension_test/property/property_all.cc @@ -149,24 +149,20 @@ TEST(ExtensionTest, PropertyAll) { // NOLINT // Send graph with a property. nlohmann::json start_graph_cmd_content_str = R"({ - "_ten": { - "type": "start_graph", - "seq_id": "55", - "nodes": [{ - "type": "extension", - "name": "test_extension", - "app": "msgpack://127.0.0.1:8001/", - "addon": "property_all__extension", - "extension_group": "property_all__extension_group", - "property": {} - }] - } + "nodes": [{ + "type": "extension", + "name": "test_extension", + "app": "msgpack://127.0.0.1:8001/", + "addon": "property_all__extension", + "extension_group": "property_all__extension_group", + "property": {} + }] })"_json; - start_graph_cmd_content_str["_ten"]["nodes"][0]["property"][CONN_PROP_NAME] = + start_graph_cmd_content_str["nodes"][0]["property"][CONN_PROP_NAME] = CONN_PROP_VAL; auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json( + start_graph_cmd->set_graph_from_json( start_graph_cmd_content_str.dump().c_str()); auto cmd_result = 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 5ed5d0197..8a5e547bb 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 @@ -95,22 +95,20 @@ TEST(ExtensionTest, PropertyConnectCmd) { // NOLINT // Send graph. nlohmann::json start_graph_cmd_content_str = R"({ - "_ten": { - "nodes": [{ - "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": {} - }] - } + "nodes": [{ + "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; - start_graph_cmd_content_str["_ten"]["nodes"][0]["property"]["test_prop"] = + start_graph_cmd_content_str["nodes"][0]["property"]["test_prop"] = CONNECT_CMD_PROP_VAL; auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json( + start_graph_cmd->set_graph_from_json( start_graph_cmd_content_str.dump().c_str()); auto cmd_result = 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 696fb537c..1f655a406 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 @@ -80,22 +80,20 @@ TEST(ExtensionTest, PropertyConnectCmdOverrideExtensionSuccess) { // NOLINT // Send graph. nlohmann::json start_graph_cmd_content_str = R"({ - "_ten": { - "nodes": [{ - "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": {} - }] - } + "nodes": [{ + "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; - start_graph_cmd_content_str["_ten"]["nodes"][0]["property"]["test_prop"] = + start_graph_cmd_content_str["nodes"][0]["property"]["test_prop"] = PROP_NEW_VAL; auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json( + start_graph_cmd->set_graph_from_json( start_graph_cmd_content_str.dump().c_str()); auto cmd_result = 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 f7ecc045c..81e6aa98e 100644 --- a/tests/ten_runtime/smoke/extension_test/property/property_extension.cc +++ b/tests/ten_runtime/smoke/extension_test/property/property_extension.cc @@ -129,16 +129,15 @@ TEST(ExtensionTest, PropertyExtension) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "property_extension__extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "property_extension__extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 51cd80cc9..4b504802c 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 @@ -93,16 +93,15 @@ TEST(ExtensionTest, PropertyGetFloat64) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "property_get_float64__extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "property_get_float64__extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 ea8905598..9b48cf3cc 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 @@ -93,16 +93,15 @@ TEST(ExtensionTest, PropertyGetInt32) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "property_get_int32__extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "property_get_int32__extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 ffb10b142..dbc547058 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 @@ -79,16 +79,15 @@ TEST(ExtensionTest, PropertyNotExist) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "property_not_exist__extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "property_not_exist__extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 a05e0b06f..f097c6f22 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 @@ -111,16 +111,15 @@ TEST(ExtensionTest, PropertySetFloat32) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "property_set_float32__extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "property_set_float32__extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 6d1848ce5..dba869015 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 @@ -110,16 +110,15 @@ TEST(ExtensionTest, PropertySetInt32) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "property_set_int32__extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "property_set_int32__extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 295c00c39..7d0368112 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 @@ -162,8 +162,8 @@ TEST(ExtensionTest, RespHandlerAsyncBasic) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "resp_handler_async_basic__extension_1", @@ -217,8 +217,7 @@ TEST(ExtensionTest, RespHandlerAsyncBasic) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 eaf420843..29fc58dd9 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 @@ -169,8 +169,8 @@ TEST(ExtensionTest, RespHandlerBasic) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "resp_handler_basic__extension_1", @@ -224,8 +224,7 @@ TEST(ExtensionTest, RespHandlerBasic) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 2beca7f8f..99906faa8 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 @@ -175,8 +175,8 @@ TEST(ExtensionTest, RespHandlerBasicWaitInOnStart) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "resp_handler_basic_wait_in_on_start__extension_1", @@ -230,8 +230,7 @@ TEST(ExtensionTest, RespHandlerBasicWaitInOnStart) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 7f13b1882..6fdc8bb53 100644 --- a/tests/ten_runtime/smoke/extension_test/return/return_1.cc +++ b/tests/ten_runtime/smoke/extension_test/return/return_1.cc @@ -111,8 +111,8 @@ TEST(ExtensionTest, Return1) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "return_1__extension_1", @@ -148,8 +148,7 @@ TEST(ExtensionTest, Return1) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 0d9653f04..663e7006b 100644 --- a/tests/ten_runtime/smoke/extension_test/return/return_2.cc +++ b/tests/ten_runtime/smoke/extension_test/return/return_2.cc @@ -111,8 +111,8 @@ TEST(ExtensionTest, Return2) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "return_2__extension_1", @@ -148,8 +148,7 @@ TEST(ExtensionTest, Return2) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 6439e79ed..5668f0335 100644 --- a/tests/ten_runtime/smoke/extension_test/return/return_3.cc +++ b/tests/ten_runtime/smoke/extension_test/return/return_3.cc @@ -139,8 +139,8 @@ TEST(ExtensionTest, Return3) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "return_3__extension_1", @@ -176,8 +176,7 @@ TEST(ExtensionTest, Return3) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 4e7994524..48b4848c1 100644 --- a/tests/ten_runtime/smoke/extension_test/return/return_4.cc +++ b/tests/ten_runtime/smoke/extension_test/return/return_4.cc @@ -139,8 +139,8 @@ TEST(ExtensionTest, Return4) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "return_4__extension_1", @@ -176,8 +176,7 @@ TEST(ExtensionTest, Return4) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 99dffef41..6cf1a0e11 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 @@ -113,8 +113,8 @@ TEST(ExtensionTest, SameThreadExtOnData) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "same_thread_ext_on_data__test_extension_1", @@ -148,8 +148,7 @@ TEST(ExtensionTest, SameThreadExtOnData) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 c19d83f51..7e6d08974 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 @@ -121,8 +121,8 @@ TEST(ExtensionTest, SameThreadExtOnXxxBasic) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "same_thread_ext_on_xxx_basic__test_extension_1", @@ -148,8 +148,7 @@ TEST(ExtensionTest, SameThreadExtOnXxxBasic) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 1768d23a6..6fca4f2cf 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 @@ -34,8 +34,7 @@ class test_predefined_graph : public ten::extension_t { void on_start(ten::ten_env_t &ten_env) override { auto start_graph_cmd = ten::cmd_start_graph_t::create(); start_graph_cmd->set_dest("localhost", nullptr, nullptr, nullptr); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": { + start_graph_cmd->set_graph_from_json(R"({ "nodes": [{ "type": "extension", "name": "normal_extension", @@ -43,9 +42,8 @@ class test_predefined_graph : public ten::extension_t { "app": "msgpack://127.0.0.1:8001/", "extension_group": "start_graph_and_communication__normal_extension_group" }] - } })"_json.dump() - .c_str()); + .c_str()); ten_env.send_cmd( std::move(start_graph_cmd), 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 8027b79ba..017570af1 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 @@ -25,8 +25,7 @@ class test_predefined_graph : public ten::extension_t { void on_start(ten::ten_env_t &ten_env) override { auto start_graph_cmd = ten::cmd_start_graph_t::create(); start_graph_cmd->set_dest("localhost", nullptr, nullptr, nullptr); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": { + start_graph_cmd->set_graph_from_json(R"({ "nodes": [{ "type": "extension", "name": "normal_extension", @@ -34,9 +33,8 @@ class test_predefined_graph : public ten::extension_t { "app": "msgpack://127.0.0.1:8001/", "extension_group": "start_graph_from_extension__normal_extension_group" }] - } })"_json.dump() - .c_str()); + .c_str()); ten_env.send_cmd( std::move(start_graph_cmd), diff --git a/tests/ten_runtime/smoke/extension_test/start_graph/start_predefined_graph_cross_app.cc b/tests/ten_runtime/smoke/extension_test/start_graph/start_predefined_graph_cross_app.cc index e5aaba879..e1564cee6 100644 --- a/tests/ten_runtime/smoke/extension_test/start_graph/start_predefined_graph_cross_app.cc +++ b/tests/ten_runtime/smoke/extension_test/start_graph/start_predefined_graph_cross_app.cc @@ -57,20 +57,6 @@ class test_predefined_graph : public ten::extension_t { auto graph_id = cmd->get_property_string("detail"); - nlohmann::json hello_cmd = - R"({ - "_ten": { - "name": "hello_world", - "seq_id": "137", - "dest":[{ - "app": "msgpack://127.0.0.1:8001/", - "extension_group": "start_predefined_graph_cross_app__normal_extension_group", - "extension": "normal_extension_1" - }] - } - })"_json; - hello_cmd["_ten"]["dest"][0]["graph"] = graph_id; - auto hello_world_cmd = ten::cmd_t::create("hello_world"); hello_world_cmd->set_dest( "msgpack://127.0.0.1:8001/", graph_id.c_str(), 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 17e7feddc..e10bad5a9 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 @@ -185,8 +185,8 @@ TEST(ExtensionTest, SuspendResume1) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "suspend_resume_1__test_extension_1", @@ -220,8 +220,7 @@ TEST(ExtensionTest, SuspendResume1) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 4241e86c8..d4fce0de3 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 @@ -193,8 +193,8 @@ TEST(ExtensionTest, SuspendResume2) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "suspend_resume_2__test_extension_1", @@ -228,8 +228,7 @@ TEST(ExtensionTest, SuspendResume2) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 14d443703..61035e959 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 @@ -138,16 +138,15 @@ TEST(ExtensionTest, TenEnvProxy1) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "ten_proxy_1__test_extension_1", "app": "msgpack://127.0.0.1:8001/", "extension_group": "basic_extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 6b2810f83..d45be9b77 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 @@ -113,16 +113,15 @@ TEST(ExtensionTest, TimerOneShot) { // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "timer_one_shot__extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "timer_one_shot__extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 46862ded4..dd3a4d2d5 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 @@ -94,16 +94,15 @@ TEST(ExtensionTest, TimerTenShot) { // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "timer_ten_shot__extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "timer_ten_shot__extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 55a641ac2..8dae7acc2 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 @@ -94,16 +94,15 @@ TEST(ExtensionTest, TimerTwoShot) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "timer_two_shot__extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "timer_two_shot__extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/graph_test/group_node_missing.cc b/tests/ten_runtime/smoke/graph_test/group_node_missing.cc index ee2c9b9f2..3a7b13cd0 100644 --- a/tests/ten_runtime/smoke/graph_test/group_node_missing.cc +++ b/tests/ten_runtime/smoke/graph_test/group_node_missing.cc @@ -71,16 +71,15 @@ TEST(GraphTest, GroupNodeMissing) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "group_node_missing__test_extension", "extension_group": "test_extension_group", "app": "msgpack://127.0.0.1:8001/" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/graph_test/group_node_missing_2_apps.cc b/tests/ten_runtime/smoke/graph_test/group_node_missing_2_apps.cc index 843517bef..42a4dcd3b 100644 --- a/tests/ten_runtime/smoke/graph_test/group_node_missing_2_apps.cc +++ b/tests/ten_runtime/smoke/graph_test/group_node_missing_2_apps.cc @@ -152,8 +152,8 @@ TEST(GraphTest, GroupNodeMissing2Apps) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "addon": "group_node_missing_2_apps__extension_1", "name": "test_extension_1", @@ -179,8 +179,7 @@ TEST(GraphTest, GroupNodeMissing2Apps) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 950b387a2..1aacb6c01 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 @@ -119,8 +119,8 @@ TEST(InterfaceTest, OutCmdInSchema) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "interface_out_cmd_in_schema__test_extension_1", @@ -146,8 +146,7 @@ TEST(InterfaceTest, OutCmdInSchema) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 4eb786c83..e824fa982 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 @@ -119,8 +119,8 @@ TEST(InterfaceTest, OutCmdNotInSchema) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "interface_out_cmd_not_in_schema__test_extension_1", @@ -146,8 +146,7 @@ TEST(InterfaceTest, OutCmdNotInSchema) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 6dd5494b8..47cb6b769 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 @@ -161,8 +161,8 @@ TEST(InterfaceTest, OutResultError) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "interface_out_result_error__test_extension_1", @@ -188,8 +188,7 @@ TEST(InterfaceTest, OutResultError) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/log_test/log_file.cc b/tests/ten_runtime/smoke/log_test/log_file.cc index 8e3a4fc28..1fe8ad559 100644 --- a/tests/ten_runtime/smoke/log_test/log_file.cc +++ b/tests/ten_runtime/smoke/log_test/log_file.cc @@ -74,16 +74,15 @@ TEST(LogTest, LogFile) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "log_file__test_extension", "extension_group": "test_extension_group", "app": "msgpack://127.0.0.1:8001/" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/log_test/log_stderr.cc b/tests/ten_runtime/smoke/log_test/log_stderr.cc index 6eb03e3d9..e6c6fb94b 100644 --- a/tests/ten_runtime/smoke/log_test/log_stderr.cc +++ b/tests/ten_runtime/smoke/log_test/log_stderr.cc @@ -73,16 +73,15 @@ TEST(LogTest, LogStderr) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "log_stderr__test_extension", "extension_group": "test_extension_group", "app": "msgpack://127.0.0.1:8001/" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/msg_test/msg_1.cc b/tests/ten_runtime/smoke/msg_test/msg_1.cc index e142a2b80..62c0f7cd5 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_1.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_1.cc @@ -90,16 +90,15 @@ TEST(MsgTest, Msg1) { // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "msg_1__extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "msg_1__extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/msg_test/msg_10.cc b/tests/ten_runtime/smoke/msg_test/msg_10.cc index 14bdd6475..8d0b2d5ec 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_10.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_10.cc @@ -133,8 +133,8 @@ TEST(MsgTest, Msg10) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "msg_10__extension_1", "addon": "msg_10__extension_1", @@ -160,8 +160,7 @@ TEST(MsgTest, Msg10) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/msg_test/msg_11.cc b/tests/ten_runtime/smoke/msg_test/msg_11.cc index 5bda7fa13..ec0c5696d 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_11.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_11.cc @@ -83,16 +83,15 @@ TEST(MsgTest, Msg11) { // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "msg_11__extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "msg_11__extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/msg_test/msg_12.cc b/tests/ten_runtime/smoke/msg_test/msg_12.cc index c99acd5df..2bcdd82dd 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_12.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_12.cc @@ -134,8 +134,8 @@ TEST(MsgTest, Msg12) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "msg_12__extension_1", "addon": "msg_12__extension_1", @@ -161,8 +161,7 @@ TEST(MsgTest, Msg12) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/msg_test/msg_13.cc b/tests/ten_runtime/smoke/msg_test/msg_13.cc index 69c27864e..f0f5b6e0f 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_13.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_13.cc @@ -133,8 +133,8 @@ TEST(MsgTest, Msg13) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "msg_13__extension_1", "addon": "msg_13__extension_1", @@ -160,8 +160,7 @@ TEST(MsgTest, Msg13) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/msg_test/msg_2.cc b/tests/ten_runtime/smoke/msg_test/msg_2.cc index 658d3066b..3ade4c413 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_2.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_2.cc @@ -84,16 +84,15 @@ TEST(MsgTest, Msg2) { // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "msg_2__extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "msg_2__extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/msg_test/msg_3.cc b/tests/ten_runtime/smoke/msg_test/msg_3.cc index ce3299f15..9ea27310b 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_3.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_3.cc @@ -84,16 +84,15 @@ TEST(MsgTest, Msg3) { // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "msg_3__extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "msg_3__extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/msg_test/msg_4.cc b/tests/ten_runtime/smoke/msg_test/msg_4.cc index b2f18d846..676fb816a 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_4.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_4.cc @@ -84,16 +84,15 @@ TEST(MsgTest, Msg4) { // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "msg_4__extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "msg_4__extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/msg_test/msg_5.cc b/tests/ten_runtime/smoke/msg_test/msg_5.cc index cc620af08..df3370c27 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_5.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_5.cc @@ -84,16 +84,15 @@ TEST(MsgTest, Msg5) { // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "msg_5__extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "msg_5__extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/msg_test/msg_6.cc b/tests/ten_runtime/smoke/msg_test/msg_6.cc index 7d2ff93e5..9fd109422 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_6.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_6.cc @@ -84,16 +84,15 @@ TEST(MsgTest, Msg6) { // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "msg_6__extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "msg_6__extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/msg_test/msg_7.cc b/tests/ten_runtime/smoke/msg_test/msg_7.cc index 117151141..9d6ac3591 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_7.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_7.cc @@ -84,16 +84,15 @@ TEST(MsgTest, Msg7) { // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "msg_7__extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "msg_7__extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/msg_test/msg_8.cc b/tests/ten_runtime/smoke/msg_test/msg_8.cc index 3873b3b1a..eb8dfbdf3 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_8.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_8.cc @@ -105,8 +105,8 @@ TEST(MsgTest, Msg8) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "msg_8__extension_1", "addon": "msg_8__extension_1", @@ -132,8 +132,7 @@ TEST(MsgTest, Msg8) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/msg_test/msg_9.cc b/tests/ten_runtime/smoke/msg_test/msg_9.cc index 5d6ea3ffd..dcd771b66 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_9.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_9.cc @@ -134,8 +134,8 @@ TEST(MsgTest, Msg9) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "msg_9__extension_1", "addon": "msg_9__extension_1", @@ -161,8 +161,7 @@ TEST(MsgTest, Msg9) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 55eb5100d..88c1378fc 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_fail_1.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_fail_1.cc @@ -84,16 +84,15 @@ TEST(MsgTest, MsgFail1) { // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "msg_fail_1__extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "msg_fail_1__extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 3beab8d3f..a86637dc0 100644 --- a/tests/ten_runtime/smoke/msg_test/msg_fail_2.cc +++ b/tests/ten_runtime/smoke/msg_test/msg_fail_2.cc @@ -84,16 +84,15 @@ TEST(MsgTest, MsgFail2) { // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "msg_fail_2__extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "msg_fail_2__extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 6276552f8..237ada418 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 @@ -122,16 +122,15 @@ TEST(NotifyTest, MemberFuncInLambda1) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "notify_test_member_func_basic_in_lambda_1__test_extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "basic_extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 b23834454..9ef95446d 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 @@ -130,16 +130,15 @@ TEST(NotifyTest, MemberFuncInLambda2) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "notify_test_member_func_basic_in_lambda_2__test_extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "basic_extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 37012604f..e33e09f97 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 @@ -132,16 +132,15 @@ TEST(NotifyTest, MemberFuncInLambda3) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "notify_test_member_func_basic_in_lambda_3__test_extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "basic_extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/notify_test/normal_func.cc b/tests/ten_runtime/smoke/notify_test/normal_func.cc index 35df2a900..9c5b8e085 100644 --- a/tests/ten_runtime/smoke/notify_test/normal_func.cc +++ b/tests/ten_runtime/smoke/notify_test/normal_func.cc @@ -124,16 +124,15 @@ TEST(NotifyTest, NormalFunc) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "notify_test_normal_func__test_extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "basic_extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 91d7b3376..916b01121 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 @@ -128,16 +128,15 @@ TEST(NotifyTest, NormalFuncInLambda) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "notify_test_normal_func_in_lambda__test_extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "basic_extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 867c9b19e..264a7c8e5 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 @@ -132,16 +132,15 @@ TEST(NotifyTest, NormalFuncWithUserData) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "notify_test_normal_func_with_user_data__test_extension", "app": "msgpack://127.0.0.1:8001/", "extension_group": "basic_extension_group" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 5d7ba4255..8227ce90f 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 @@ -203,8 +203,8 @@ TEST(SchemaTest, SendCmdPropertyRequired) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "schema_cmd_property_required__test_extension_1", @@ -230,8 +230,7 @@ TEST(SchemaTest, SendCmdPropertyRequired) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 f4c5e2ce6..39eceb528 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_cmd_result.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_cmd_result.cc @@ -148,9 +148,8 @@ TEST(SchemaTest, CmdResult) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json( + start_graph_cmd->set_graph_from_json( R"###({ - "_ten": { "nodes": [{ "type": "extension", "name": "test_extension_1", @@ -177,7 +176,6 @@ TEST(SchemaTest, CmdResult) { // NOLINT }] }] }] - } })###"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 6f3f5b076..4fe4e47ad 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 @@ -148,9 +148,8 @@ TEST(SchemaTest, CmdResultError) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json( + start_graph_cmd->set_graph_from_json( R"###({ - "_ten": { "nodes": [{ "type": "extension", "name": "test_extension_1", @@ -177,7 +176,6 @@ TEST(SchemaTest, CmdResultError) { // NOLINT }] }] }] - } })###"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); 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 1ef7d7ebc..a0d52f709 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_data_prop.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_data_prop.cc @@ -183,8 +183,8 @@ TEST(SchemaTest, DataProp) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "schema_data_prop__test_extension_1", @@ -210,8 +210,7 @@ TEST(SchemaTest, DataProp) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 a15ec1ff4..6dce4a331 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_on_cmd.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_on_cmd.cc @@ -137,8 +137,8 @@ TEST(SchemaTest, OnCmd) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "schema_on_cmd__test_extension_1", @@ -164,8 +164,7 @@ TEST(SchemaTest, OnCmd) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 b702c608d..33b051d48 100644 --- a/tests/ten_runtime/smoke/schema_test/schema_send_cmd.cc +++ b/tests/ten_runtime/smoke/schema_test/schema_send_cmd.cc @@ -134,8 +134,8 @@ TEST(SchemaTest, SendCmd) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "schema_send_cmd__test_extension_1", @@ -161,8 +161,7 @@ TEST(SchemaTest, SendCmd) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 edc25c88f..7eb647a47 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 @@ -187,16 +187,15 @@ TEST(SchemaTest, SetExtensionProperty) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "schema_set_extension_prop__test_extension", "extension_group": "test_extension_group", "app": "msgpack://127.0.0.1:8001/" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 add6ac55c..b2b2364a5 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 @@ -135,8 +135,8 @@ TEST(SchemaTest, SetPropertyBuf) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "schema_set_property_buf__test_extension_1", @@ -162,8 +162,7 @@ TEST(SchemaTest, SetPropertyBuf) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 bd39c63fe..539693456 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 @@ -137,8 +137,8 @@ TEST(SchemaTest, SetPropertyPtr) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "schema_set_property_ptr__test_extension_1", @@ -164,8 +164,7 @@ TEST(SchemaTest, SetPropertyPtr) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/ten_env_call_timing/on_xxx_done.cc b/tests/ten_runtime/smoke/ten_env_call_timing/on_xxx_done.cc index 11705d3cb..e81943825 100644 --- a/tests/ten_runtime/smoke/ten_env_call_timing/on_xxx_done.cc +++ b/tests/ten_runtime/smoke/ten_env_call_timing/on_xxx_done.cc @@ -143,16 +143,15 @@ TEST(TenEnvCallTimingTest, OnXxxDone) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension", "addon": "on_xxx_done__test_extension", "extension_group": "test_extension_group", "app": "msgpack://127.0.0.1:8001/" }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); diff --git a/tests/ten_runtime/smoke/video_frame_test/basic.cc b/tests/ten_runtime/smoke/video_frame_test/basic.cc index f8a220ea5..e2b3828e9 100644 --- a/tests/ten_runtime/smoke/video_frame_test/basic.cc +++ b/tests/ten_runtime/smoke/video_frame_test/basic.cc @@ -95,8 +95,8 @@ TEST(VideoFrameTest, Basic) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "video_frame_basic__test_extension_1", @@ -134,8 +134,7 @@ TEST(VideoFrameTest, Basic) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 c8e3fcbaa..03fa2694c 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 @@ -106,8 +106,8 @@ TEST(VideoFrameTest, CreateFromJson) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "video_frame_create_from_json__test_extension_1", @@ -145,8 +145,7 @@ TEST(VideoFrameTest, CreateFromJson) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 d10d65abc..16c15bc8f 100644 --- a/tests/ten_runtime/smoke/video_frame_test/from_json.cc +++ b/tests/ten_runtime/smoke/video_frame_test/from_json.cc @@ -104,8 +104,8 @@ TEST(VideoFrameTest, FromJson) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "test_extension_1", "addon": "video_frame_from_json__test_extension_1", @@ -143,8 +143,7 @@ TEST(VideoFrameTest, FromJson) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK); 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 1a4d57a39..3503cc191 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 @@ -169,8 +169,8 @@ TEST(VideoFrameTest, MultiDestVideoFrame) { // NOLINT // Send graph. auto start_graph_cmd = ten::cmd_start_graph_t::create(); - start_graph_cmd->set_nodes_and_connections_from_json(R"({ - "_ten": {"nodes": [{ + start_graph_cmd->set_graph_from_json(R"({ + "nodes": [{ "type": "extension", "name": "extension 1", "addon": "multi_dest_video_frame__extension_1", @@ -206,8 +206,7 @@ TEST(VideoFrameTest, MultiDestVideoFrame) { // NOLINT }] }] }] - } - })"); + })"); auto cmd_result = client->send_cmd_and_recv_result(std::move(start_graph_cmd)); ten_test::check_status_code(cmd_result, TEN_STATUS_CODE_OK);