ApplicationManagerTests.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AzCore/UnitTest/TestTypes.h>
  10. #include <AzToolsFramework/Metadata/MetadataManager.h>
  11. #include <native/utilities/BatchApplicationManager.h>
  12. #include <native/tests/MockAssetDatabaseRequestsHandler.h>
  13. #include <native/tests/assetmanager/MockAssetProcessorManager.h>
  14. #include <native/tests/assetmanager/MockFileProcessor.h>
  15. #include <native/tests/UnitTestUtilities.h>
  16. namespace UnitTests
  17. {
  18. struct MockBatchApplicationManager : BatchApplicationManager
  19. {
  20. using ApplicationManagerBase::InitFileMonitor;
  21. using ApplicationManagerBase::DestroyFileMonitor;
  22. using ApplicationManagerBase::InitFileStateCache;
  23. using ApplicationManagerBase::InitUuidManager;
  24. using ApplicationManagerBase::m_assetProcessorManager;
  25. using ApplicationManagerBase::m_fileProcessor;
  26. using ApplicationManagerBase::m_fileStateCache;
  27. using ApplicationManagerBase::m_platformConfiguration;
  28. using BatchApplicationManager::BatchApplicationManager;
  29. };
  30. struct ApplicationManagerTest : ::UnitTest::LeakDetectionFixture
  31. {
  32. protected:
  33. void SetUp() override;
  34. void TearDown() override;
  35. AssetProcessor::MockAssetDatabaseRequestsHandler m_databaseLocationListener;
  36. AZStd::unique_ptr<QCoreApplication> m_coreApplication;
  37. AZStd::unique_ptr<MockBatchApplicationManager> m_applicationManager;
  38. AZStd::unique_ptr<QThread> m_apmThread;
  39. AZStd::unique_ptr<QThread> m_fileProcessorThread;
  40. AZStd::unique_ptr<MockAssetProcessorManager> m_mockAPM;
  41. MockVirtualFileIO m_virtualFileIO;
  42. AzToolsFramework::UuidUtilComponent m_uuidUtil;
  43. AzToolsFramework::MetadataManager m_metadataManager;
  44. // These are just aliases, no need to manage/delete them
  45. FileWatcher* m_fileWatcher{};
  46. MockFileProcessor* m_mockFileProcessor{};
  47. };
  48. }