diff --git a/libs/framework/gtest/src/CelixFrameworkTestSuite.cc b/libs/framework/gtest/src/CelixFrameworkTestSuite.cc index ea3920ec6..3eae055c6 100644 --- a/libs/framework/gtest/src/CelixFrameworkTestSuite.cc +++ b/libs/framework/gtest/src/CelixFrameworkTestSuite.cc @@ -26,7 +26,7 @@ #include "celix_launcher.h" #include "celix_framework_factory.h" #include "celix_framework.h" -#include "framework.h" +#include "framework_private.h" #include "celix_constants.h" #include "celix_utils.h" @@ -105,27 +105,27 @@ TEST_F(CelixFrameworkTestSuite, AsyncInstallStartStopUpdateAndUninstallBundleTes EXPECT_FALSE(celix_framework_isBundleActive(framework.get(), bndId)); celix_framework_updateBundleAsync(framework.get(), bndId, NULL); - std::this_thread::sleep_for(std::chrono::milliseconds{100}); + celix_framework_waitForBundleLifecycleHandlers(framework.get()); EXPECT_FALSE(celix_framework_isBundleActive(framework.get(), bndId)); celix_framework_startBundleAsync(framework.get(), bndId); - std::this_thread::sleep_for(std::chrono::milliseconds{100}); + celix_framework_waitForBundleLifecycleHandlers(framework.get()); EXPECT_TRUE(celix_framework_isBundleActive(framework.get(), bndId)); celix_framework_updateBundleAsync(framework.get(), bndId, NULL); - std::this_thread::sleep_for(std::chrono::milliseconds{100}); + celix_framework_waitForBundleLifecycleHandlers(framework.get()); EXPECT_TRUE(celix_framework_isBundleActive(framework.get(), bndId)); celix_framework_stopBundleAsync(framework.get(), bndId); - std::this_thread::sleep_for(std::chrono::milliseconds{100}); + celix_framework_waitForBundleLifecycleHandlers(framework.get()); EXPECT_FALSE(celix_framework_isBundleActive(framework.get(), bndId)); celix_framework_updateBundleAsync(framework.get(), bndId, NULL); - std::this_thread::sleep_for(std::chrono::milliseconds{100}); + celix_framework_waitForBundleLifecycleHandlers(framework.get()); EXPECT_FALSE(celix_framework_isBundleActive(framework.get(), bndId)); celix_framework_unloadBundleAsync(framework.get(), bndId); - std::this_thread::sleep_for(std::chrono::milliseconds{100}); + celix_framework_waitForBundleLifecycleHandlers(framework.get()); EXPECT_FALSE(celix_framework_isBundleInstalled(framework.get(), bndId)); // reloaded bundle should reuse the same bundle id @@ -134,7 +134,7 @@ TEST_F(CelixFrameworkTestSuite, AsyncInstallStartStopUpdateAndUninstallBundleTes EXPECT_FALSE(celix_framework_isBundleActive(framework.get(), bndId)); celix_framework_uninstallBundleAsync(framework.get(), bndId); - std::this_thread::sleep_for(std::chrono::milliseconds{100}); + celix_framework_waitForBundleLifecycleHandlers(framework.get()); EXPECT_FALSE(celix_framework_isBundleInstalled(framework.get(), bndId)); } diff --git a/libs/framework/src/framework_private.h b/libs/framework/src/framework_private.h index 162eec4a6..a00d6d8c6 100644 --- a/libs/framework/src/framework_private.h +++ b/libs/framework/src/framework_private.h @@ -344,11 +344,6 @@ void celix_framework_waitForAsyncRegistration(celix_framework_t *fw, long svcId) */ void celix_framework_waitForAsyncUnregistration(celix_framework_t *fw, long svcId); -/** - * Returns whether the current thread is the Celix framework event loop thread. - */ -bool celix_framework_isCurrentThreadTheEventLoop(celix_framework_t* fw); - /** * Increase the use count of a bundle and ensure that a bundle cannot be uninstalled. */