Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Commit

Permalink
Update integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zfields committed Jan 25, 2017
1 parent b6b3260 commit b09cc9c
Showing 1 changed file with 5 additions and 61 deletions.
66 changes: 5 additions & 61 deletions bindings/nodejs/tests/nodejs_int/nodejs_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -703,18 +703,9 @@ BEGIN_TEST_SUITE(nodejs_int)
auto result = NODEJS_Create(g_broker, &config);

///assert
ASSERT_IS_NOT_NULL(result);

// wait for 15 seconds for the create to get done
NODEJS_MODULE_HANDLE_DATA* handle_data = reinterpret_cast<NODEJS_MODULE_HANDLE_DATA*>(result);
wait_for_predicate(15, [handle_data]() {
return handle_data->GetModuleState() != NodeModuleState::initializing;
});
ASSERT_IS_TRUE(handle_data->GetModuleState() == NodeModuleState::error);
ASSERT_IS_TRUE(handle_data->module_object.IsEmpty() == false);
ASSERT_IS_NULL(result);

///cleanup
NODEJS_Destroy(result);
STRING_delete(config.configuration_json);
STRING_delete(config.main_path);
}
Expand Down Expand Up @@ -745,18 +736,9 @@ BEGIN_TEST_SUITE(nodejs_int)
auto result = NODEJS_Create(g_broker, &config);

///assert
ASSERT_IS_NOT_NULL(result);

// wait for 15 seconds for the create to get done
NODEJS_MODULE_HANDLE_DATA* handle_data = reinterpret_cast<NODEJS_MODULE_HANDLE_DATA*>(result);
wait_for_predicate(15, [handle_data]() {
return handle_data->GetModuleState() != NodeModuleState::initializing;
});
ASSERT_IS_TRUE(handle_data->GetModuleState() == NodeModuleState::error);
ASSERT_IS_TRUE(handle_data->module_object.IsEmpty() == false);
ASSERT_IS_NULL(result);

///cleanup
NODEJS_Destroy(result);
STRING_delete(config.configuration_json);
STRING_delete(config.main_path);
}
Expand Down Expand Up @@ -788,18 +770,9 @@ BEGIN_TEST_SUITE(nodejs_int)
auto result = NODEJS_Create(g_broker, &config);

///assert
ASSERT_IS_NOT_NULL(result);

// wait for 15 seconds for the create to get done
NODEJS_MODULE_HANDLE_DATA* handle_data = reinterpret_cast<NODEJS_MODULE_HANDLE_DATA*>(result);
wait_for_predicate(15, [handle_data]() {
return handle_data->GetModuleState() != NodeModuleState::initializing;
});
ASSERT_IS_TRUE(handle_data->GetModuleState() == NodeModuleState::error);
ASSERT_IS_TRUE(handle_data->module_object.IsEmpty() == false);
ASSERT_IS_NULL(result);

///cleanup
NODEJS_Destroy(result);
STRING_delete(config.configuration_json);
STRING_delete(config.main_path);
}
Expand Down Expand Up @@ -831,18 +804,9 @@ BEGIN_TEST_SUITE(nodejs_int)
auto result = NODEJS_Create(g_broker, &config);

///assert
ASSERT_IS_NOT_NULL(result);

// wait for 15 seconds for the create to get done
NODEJS_MODULE_HANDLE_DATA* handle_data = reinterpret_cast<NODEJS_MODULE_HANDLE_DATA*>(result);
wait_for_predicate(15, [handle_data]() {
return handle_data->GetModuleState() != NodeModuleState::initializing;
});
ASSERT_IS_TRUE(handle_data->GetModuleState() == NodeModuleState::error);
ASSERT_IS_TRUE(handle_data->module_object.IsEmpty() == false);
ASSERT_IS_NULL(result);

///cleanup
NODEJS_Destroy(result);
STRING_delete(config.configuration_json);
STRING_delete(config.main_path);
}
Expand Down Expand Up @@ -874,17 +838,9 @@ BEGIN_TEST_SUITE(nodejs_int)
auto result = NODEJS_Create(g_broker, &config);

///assert
ASSERT_IS_NOT_NULL(result);

// wait for 15 seconds for the create to get done
NODEJS_MODULE_HANDLE_DATA* handle_data = reinterpret_cast<NODEJS_MODULE_HANDLE_DATA*>(result);
wait_for_predicate(15, [handle_data]() {
return handle_data->GetModuleState() != NodeModuleState::initializing;
});
ASSERT_IS_TRUE(handle_data->GetModuleState() == NodeModuleState::error);
ASSERT_IS_NULL(result);

///cleanup
NODEJS_Destroy(result);
STRING_delete(config.configuration_json);
STRING_delete(config.main_path);
}
Expand Down Expand Up @@ -1210,11 +1166,7 @@ BEGIN_TEST_SUITE(nodejs_int)
///act
auto result = NODEJS_Create(g_broker, &config);

// wait for 15 seconds for the create to get done
NODEJS_MODULE_HANDLE_DATA* handle_data = reinterpret_cast<NODEJS_MODULE_HANDLE_DATA*>(result);
wait_for_predicate(15, [handle_data]() {
return handle_data->GetModuleState() != NodeModuleState::initializing;
});

NODEJS_Destroy(result);

Expand Down Expand Up @@ -1270,11 +1222,7 @@ BEGIN_TEST_SUITE(nodejs_int)

NODEJS_Start(result);

// wait for 15 seconds for the create to get done
NODEJS_MODULE_HANDLE_DATA* handle_data = reinterpret_cast<NODEJS_MODULE_HANDLE_DATA*>(result);
wait_for_predicate(15, [handle_data]() {
return handle_data->GetModuleState() != NodeModuleState::initializing;
});

///assert
wait_for_predicate(15, [handle_data]() {
Expand Down Expand Up @@ -1325,11 +1273,7 @@ BEGIN_TEST_SUITE(nodejs_int)

auto result = NODEJS_Create(g_broker, &config);

// wait for 15 seconds for the create to get done
NODEJS_MODULE_HANDLE_DATA* handle_data = reinterpret_cast<NODEJS_MODULE_HANDLE_DATA*>(result);
wait_for_predicate(15, [handle_data]() {
return handle_data->GetModuleState() != NodeModuleState::initializing;
});

///act

Expand Down

0 comments on commit b09cc9c

Please sign in to comment.