From 6b6bd1149d007330c30f3531737ef53178c2ccf0 Mon Sep 17 00:00:00 2001 From: onecent1101 Date: Mon, 12 Jul 2021 14:17:33 -0700 Subject: [PATCH] [SPEC-7510] Remove unnecessary static container for AWSCore scriptcanvas nodes Signed-off-by: onecent1101 --- .../ScriptCanvas/AWSScriptBehaviorBase.h | 42 ------------- .../ScriptCanvas/AWSScriptBehaviorDynamoDB.h | 10 +-- .../ScriptCanvas/AWSScriptBehaviorLambda.h | 10 +-- .../Public/ScriptCanvas/AWSScriptBehaviorS3.h | 10 +-- .../AWSScriptBehaviorsComponent.h | 16 ----- .../AWSScriptBehaviorDynamoDB.cpp | 43 +++++-------- .../ScriptCanvas/AWSScriptBehaviorLambda.cpp | 43 +++++-------- .../ScriptCanvas/AWSScriptBehaviorS3.cpp | 62 ++++++++----------- .../AWSScriptBehaviorsComponent.cpp | 56 +---------------- .../AWSScriptBehaviorsComponentTest.cpp | 28 ++------- Gems/AWSCore/Code/awscore_files.cmake | 1 - 11 files changed, 87 insertions(+), 234 deletions(-) delete mode 100644 Gems/AWSCore/Code/Include/Public/ScriptCanvas/AWSScriptBehaviorBase.h diff --git a/Gems/AWSCore/Code/Include/Public/ScriptCanvas/AWSScriptBehaviorBase.h b/Gems/AWSCore/Code/Include/Public/ScriptCanvas/AWSScriptBehaviorBase.h deleted file mode 100644 index 90163dd363..0000000000 --- a/Gems/AWSCore/Code/Include/Public/ScriptCanvas/AWSScriptBehaviorBase.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - -namespace AZ -{ - class BehaviorContext; - class EditContext; - class SerializeContext; -} // namespace AZ - -// this just provides a convenient template to avoid the necessary boilerplate when you derive from AWSScriptBehaviorBase -#define AWS_SCRIPT_BEHAVIOR_DEFINITION(className, guidString) \ - AZ_TYPE_INFO(className, guidString) \ - AZ_CLASS_ALLOCATOR(className, AZ::SystemAllocator, 0) \ - void ReflectSerialization(AZ::SerializeContext* serializeContext) override; \ - void ReflectBehaviors(AZ::BehaviorContext* behaviorContext) override; \ - void ReflectEditParameters(AZ::EditContext* editContext) override; \ - className(); \ - -namespace AWSCore -{ - //! An interface for AWS ScriptCanvas Behaviors to inherit from - class AWSScriptBehaviorBase - { - public: - virtual ~AWSScriptBehaviorBase() = default; - - virtual void ReflectSerialization(AZ::SerializeContext* reflectContext) = 0; - virtual void ReflectBehaviors(AZ::BehaviorContext* behaviorContext) = 0; - virtual void ReflectEditParameters(AZ::EditContext* editContext) = 0; - - virtual void Init() {} - virtual void Activate() {} - virtual void Deactivate() {} - }; -} // namespace AWSCore diff --git a/Gems/AWSCore/Code/Include/Public/ScriptCanvas/AWSScriptBehaviorDynamoDB.h b/Gems/AWSCore/Code/Include/Public/ScriptCanvas/AWSScriptBehaviorDynamoDB.h index 317d16dbe4..7244f57f6a 100644 --- a/Gems/AWSCore/Code/Include/Public/ScriptCanvas/AWSScriptBehaviorDynamoDB.h +++ b/Gems/AWSCore/Code/Include/Public/ScriptCanvas/AWSScriptBehaviorDynamoDB.h @@ -10,8 +10,6 @@ #include #include -#include - namespace AWSCore { using DynamoDBAttributeValueMap = AZStd::unordered_map; @@ -55,10 +53,14 @@ namespace AWSCore }; class AWSScriptBehaviorDynamoDB - : public AWSScriptBehaviorBase { public: - AWS_SCRIPT_BEHAVIOR_DEFINITION(AWSScriptBehaviorDynamoDB, "{569E74F6-1268-4199-9653-A3B603FC9F4F}"); + AZ_RTTI(AWSScriptBehaviorDynamoDB, "{569E74F6-1268-4199-9653-A3B603FC9F4F}"); + + AWSScriptBehaviorDynamoDB() = default; + virtual ~AWSScriptBehaviorDynamoDB() = default; + + static void Reflect(AZ::ReflectContext* context); static void GetItem(const AZStd::string& tableResourceKey, const DynamoDBAttributeValueMap& keyMap); static void GetItemRaw(const AZStd::string& table, const DynamoDBAttributeValueMap& keyMap, const AZStd::string& region); diff --git a/Gems/AWSCore/Code/Include/Public/ScriptCanvas/AWSScriptBehaviorLambda.h b/Gems/AWSCore/Code/Include/Public/ScriptCanvas/AWSScriptBehaviorLambda.h index a8a807e7fb..64601d8e59 100644 --- a/Gems/AWSCore/Code/Include/Public/ScriptCanvas/AWSScriptBehaviorLambda.h +++ b/Gems/AWSCore/Code/Include/Public/ScriptCanvas/AWSScriptBehaviorLambda.h @@ -10,8 +10,6 @@ #include #include -#include - namespace AWSCore { //! AWS Script Behavior notifications for ScriptCanvas behaviors that interact with AWS Lambda @@ -53,10 +51,14 @@ namespace AWSCore }; class AWSScriptBehaviorLambda - : public AWSScriptBehaviorBase { public: - AWS_SCRIPT_BEHAVIOR_DEFINITION(AWSScriptBehaviorLambda, "{9E71534D-34B3-4723-B180-2552513DDA3D}"); + AZ_RTTI(AWSScriptBehaviorLambda, "{9E71534D-34B3-4723-B180-2552513DDA3D}"); + + AWSScriptBehaviorLambda() = default; + virtual ~AWSScriptBehaviorLambda() = default; + + static void Reflect(AZ::ReflectContext* context); static void Invoke(const AZStd::string& functionResourceKey, const AZStd::string& payload); static void InvokeRaw(const AZStd::string& functionName, const AZStd::string& payload, const AZStd::string& region); diff --git a/Gems/AWSCore/Code/Include/Public/ScriptCanvas/AWSScriptBehaviorS3.h b/Gems/AWSCore/Code/Include/Public/ScriptCanvas/AWSScriptBehaviorS3.h index a75c3bce31..ac2df1c822 100644 --- a/Gems/AWSCore/Code/Include/Public/ScriptCanvas/AWSScriptBehaviorS3.h +++ b/Gems/AWSCore/Code/Include/Public/ScriptCanvas/AWSScriptBehaviorS3.h @@ -10,8 +10,6 @@ #include #include -#include - namespace AWSCore { //! AWS Script Behavior notifications for ScriptCanvas behaviors that interact with AWS S3 @@ -68,7 +66,6 @@ namespace AWSCore }; class AWSScriptBehaviorS3 - : public AWSScriptBehaviorBase { static constexpr const char AWSScriptBehaviorS3Name[] = "AWSScriptBehaviorS3"; static constexpr const char OutputFileIsEmptyErrorMessage[] = "Request validation failed, output file is empty."; @@ -81,7 +78,12 @@ namespace AWSCore static constexpr const char RegionNameIsEmptyErrorMessage[] = "Request validation failed, region name is empty."; public: - AWS_SCRIPT_BEHAVIOR_DEFINITION(AWSScriptBehaviorS3, "{7F4E956C-7463-4236-B320-C992D36A9C6E}"); + AZ_RTTI(AWSScriptBehaviorS3, "{7F4E956C-7463-4236-B320-C992D36A9C6E}"); + + AWSScriptBehaviorS3() = default; + virtual ~AWSScriptBehaviorS3() = default; + + static void Reflect(AZ::ReflectContext* context); static void GetObject(const AZStd::string& bucketResourceKey, const AZStd::string& objectKey, const AZStd::string& outFile); static void GetObjectRaw(const AZStd::string& bucket, const AZStd::string& objectKey, const AZStd::string& region, const AZStd::string& outFile); diff --git a/Gems/AWSCore/Code/Include/Public/ScriptCanvas/AWSScriptBehaviorsComponent.h b/Gems/AWSCore/Code/Include/Public/ScriptCanvas/AWSScriptBehaviorsComponent.h index 8958425615..43bd15d726 100644 --- a/Gems/AWSCore/Code/Include/Public/ScriptCanvas/AWSScriptBehaviorsComponent.h +++ b/Gems/AWSCore/Code/Include/Public/ScriptCanvas/AWSScriptBehaviorsComponent.h @@ -10,7 +10,6 @@ #include #include #include -#include namespace AWSCore { @@ -30,23 +29,8 @@ namespace AWSCore static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required); static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent); - static bool AddedBehaviours() - { - return m_alreadyAddedBehaviors; - } - - protected: - - //////////////////////////////////////////////////////////////////////// // AZ::Component interface implementation - void Init() override; void Activate() override; void Deactivate() override; - //////////////////////////////////////////////////////////////////////// - - static void AddBehaviors(); // Add any behaviors you derived from AWSScriptBehaviorBase to the implementation of this function - - static AZStd::vector> m_behaviors; - static bool m_alreadyAddedBehaviors; }; } // namespace AWSCore diff --git a/Gems/AWSCore/Code/Source/ScriptCanvas/AWSScriptBehaviorDynamoDB.cpp b/Gems/AWSCore/Code/Source/ScriptCanvas/AWSScriptBehaviorDynamoDB.cpp index c25df555fc..41c1aff34d 100644 --- a/Gems/AWSCore/Code/Source/ScriptCanvas/AWSScriptBehaviorDynamoDB.cpp +++ b/Gems/AWSCore/Code/Source/ScriptCanvas/AWSScriptBehaviorDynamoDB.cpp @@ -20,39 +20,30 @@ namespace AWSCore { - AWSScriptBehaviorDynamoDB::AWSScriptBehaviorDynamoDB() + void AWSScriptBehaviorDynamoDB::Reflect(AZ::ReflectContext* context) { - } - - void AWSScriptBehaviorDynamoDB::ReflectSerialization(AZ::SerializeContext* serializeContext) - { - if (serializeContext) + if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) { serializeContext->Class() ->Version(0); } - } - void AWSScriptBehaviorDynamoDB::ReflectBehaviors(AZ::BehaviorContext* behaviorContext) - { - behaviorContext->Class("AWSScriptBehaviorDynamoDB") - ->Attribute(AZ::Script::Attributes::Category, "AWSCore") - ->Method("GetItem", &AWSScriptBehaviorDynamoDB::GetItem, - {{{"Table Resource KeyName", "The name of the table containing the requested item."}, - {"Key Map", "A map of attribute names to AttributeValue objects, representing the primary key of the item to retrieve."}}}) - ->Method("GetItemRaw", &AWSScriptBehaviorDynamoDB::GetItemRaw, - {{{"Table Name", "The name of the table containing the requested item."}, - {"Key Map", "A map of attribute names to AttributeValue objects, representing the primary key of the item to retrieve."}, - {"Region Name", "The region of the table located in."}}}); + if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) + { + behaviorContext->Class("AWSScriptBehaviorDynamoDB") + ->Attribute(AZ::Script::Attributes::Category, "AWSCore") + ->Method("GetItem", &AWSScriptBehaviorDynamoDB::GetItem, + {{{"Table Resource KeyName", "The name of the table containing the requested item."}, + {"Key Map", "A map of attribute names to AttributeValue objects, representing the primary key of the item to retrieve."}}}) + ->Method("GetItemRaw", &AWSScriptBehaviorDynamoDB::GetItemRaw, + {{{"Table Name", "The name of the table containing the requested item."}, + {"Key Map", "A map of attribute names to AttributeValue objects, representing the primary key of the item to retrieve."}, + {"Region Name", "The region of the table located in."}}}); - behaviorContext->EBus("AWSDynamoDBBehaviorNotificationBus") - ->Attribute(AZ::Script::Attributes::Category, "AWSCore") - ->Handler(); - } - - void AWSScriptBehaviorDynamoDB::ReflectEditParameters(AZ::EditContext* editContext) - { - AZ_UNUSED(editContext); + behaviorContext->EBus("AWSDynamoDBBehaviorNotificationBus") + ->Attribute(AZ::Script::Attributes::Category, "AWSCore") + ->Handler(); + } } void AWSScriptBehaviorDynamoDB::GetItem(const AZStd::string& tableResourceKey, const DynamoDBAttributeValueMap& keyMap) diff --git a/Gems/AWSCore/Code/Source/ScriptCanvas/AWSScriptBehaviorLambda.cpp b/Gems/AWSCore/Code/Source/ScriptCanvas/AWSScriptBehaviorLambda.cpp index a7420654de..d4137c313b 100644 --- a/Gems/AWSCore/Code/Source/ScriptCanvas/AWSScriptBehaviorLambda.cpp +++ b/Gems/AWSCore/Code/Source/ScriptCanvas/AWSScriptBehaviorLambda.cpp @@ -21,39 +21,30 @@ namespace AWSCore { - AWSScriptBehaviorLambda::AWSScriptBehaviorLambda() + void AWSScriptBehaviorLambda::Reflect(AZ::ReflectContext* context) { - } - - void AWSScriptBehaviorLambda::ReflectSerialization(AZ::SerializeContext* serializeContext) - { - if (serializeContext) + if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) { serializeContext->Class() ->Version(0); } - } - void AWSScriptBehaviorLambda::ReflectBehaviors(AZ::BehaviorContext* behaviorContext) - { - behaviorContext->Class("AWSScriptBehaviorLambda") - ->Attribute(AZ::Script::Attributes::Category, "AWSCore") - ->Method("Invoke", &AWSScriptBehaviorLambda::Invoke, - {{{"Function Resource KeyName", "The resource key name of the lambda function in resource mapping config file."}, - {"Payload", "The JSON that you want to provide to your Lambda function as input."}}}) - ->Method("InvokeRaw", &AWSScriptBehaviorLambda::InvokeRaw, - {{{"Function Name", "The name of the Lambda function, version, or alias."}, - {"Payload", "The JSON that you want to provide to your Lambda function as input."}, - {"Region Name", "The region of the lambda function located in."}}}); + if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) + { + behaviorContext->Class("AWSScriptBehaviorLambda") + ->Attribute(AZ::Script::Attributes::Category, "AWSCore") + ->Method("Invoke", &AWSScriptBehaviorLambda::Invoke, + {{{"Function Resource KeyName", "The resource key name of the lambda function in resource mapping config file."}, + {"Payload", "The JSON that you want to provide to your Lambda function as input."}}}) + ->Method("InvokeRaw", &AWSScriptBehaviorLambda::InvokeRaw, + {{{"Function Name", "The name of the Lambda function, version, or alias."}, + {"Payload", "The JSON that you want to provide to your Lambda function as input."}, + {"Region Name", "The region of the lambda function located in."}}}); - behaviorContext->EBus("AWSLambdaBehaviorNotificationBus") - ->Attribute(AZ::Script::Attributes::Category, "AWSCore") - ->Handler(); - } - - void AWSScriptBehaviorLambda::ReflectEditParameters(AZ::EditContext* editContext) - { - AZ_UNUSED(editContext); + behaviorContext->EBus("AWSLambdaBehaviorNotificationBus") + ->Attribute(AZ::Script::Attributes::Category, "AWSCore") + ->Handler(); + } } void AWSScriptBehaviorLambda::Invoke(const AZStd::string& functionResourceKey, const AZStd::string& payload) diff --git a/Gems/AWSCore/Code/Source/ScriptCanvas/AWSScriptBehaviorS3.cpp b/Gems/AWSCore/Code/Source/ScriptCanvas/AWSScriptBehaviorS3.cpp index f47dda8046..e82fff0c31 100644 --- a/Gems/AWSCore/Code/Source/ScriptCanvas/AWSScriptBehaviorS3.cpp +++ b/Gems/AWSCore/Code/Source/ScriptCanvas/AWSScriptBehaviorS3.cpp @@ -24,49 +24,39 @@ namespace AWSCore { - AWSScriptBehaviorS3::AWSScriptBehaviorS3() + void AWSScriptBehaviorS3::Reflect(AZ::ReflectContext* context) { - } - - void AWSScriptBehaviorS3::ReflectSerialization(AZ::SerializeContext* serializeContext) - { - if (serializeContext) + if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) { serializeContext->Class() ->Version(0); } - } - void AWSScriptBehaviorS3::ReflectBehaviors(AZ::BehaviorContext* behaviorContext) - { - behaviorContext->Class(AWSScriptBehaviorS3Name) - ->Attribute(AZ::Script::Attributes::Category, "AWSCore") - ->Method("GetObject", &AWSScriptBehaviorS3::GetObject, - {{{"Bucket Resource KeyName", "The resource key name of the bucket in resource mapping config file."}, - {"Object KeyName", "The object key."}, - {"Outfile Name", "Filename where the content will be saved."}}}) - ->Method("GetObjectRaw", &AWSScriptBehaviorS3::GetObjectRaw, - {{{"Bucket Name", "The name of the bucket containing the object."}, - {"Object KeyName", "The object key."}, - {"Region Name", "The region of the bucket located in."}, - {"Outfile Name", "Filename where the content will be saved."}}}) - ->Method("HeadObject", &AWSScriptBehaviorS3::HeadObject, - {{{"Bucket Resource KeyName", "The resource key name of the bucket in resource mapping config file."}, - {"Object KeyName", "The object key."}}}) - ->Method("HeadObjectRaw", &AWSScriptBehaviorS3::HeadObjectRaw, - {{{"Bucket Name", "The name of the bucket containing the object."}, - {"Object KeyName", "The object key."}, - {"Region Name", "The region of the bucket located in."}}}) - ; + if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) + { + behaviorContext->Class(AWSScriptBehaviorS3Name) + ->Attribute(AZ::Script::Attributes::Category, "AWSCore") + ->Method("GetObject", &AWSScriptBehaviorS3::GetObject, + {{{"Bucket Resource KeyName", "The resource key name of the bucket in resource mapping config file."}, + {"Object KeyName", "The object key."}, + {"Outfile Name", "Filename where the content will be saved."}}}) + ->Method("GetObjectRaw", &AWSScriptBehaviorS3::GetObjectRaw, + {{{"Bucket Name", "The name of the bucket containing the object."}, + {"Object KeyName", "The object key."}, + {"Region Name", "The region of the bucket located in."}, + {"Outfile Name", "Filename where the content will be saved."}}}) + ->Method("HeadObject", &AWSScriptBehaviorS3::HeadObject, + {{{"Bucket Resource KeyName", "The resource key name of the bucket in resource mapping config file."}, + {"Object KeyName", "The object key."}}}) + ->Method("HeadObjectRaw", &AWSScriptBehaviorS3::HeadObjectRaw, + {{{"Bucket Name", "The name of the bucket containing the object."}, + {"Object KeyName", "The object key."}, + {"Region Name", "The region of the bucket located in."}}}); - behaviorContext->EBus("AWSS3BehaviorNotificationBus") - ->Attribute(AZ::Script::Attributes::Category, "AWSCore") - ->Handler(); - } - - void AWSScriptBehaviorS3::ReflectEditParameters(AZ::EditContext* editContext) - { - AZ_UNUSED(editContext); + behaviorContext->EBus("AWSS3BehaviorNotificationBus") + ->Attribute(AZ::Script::Attributes::Category, "AWSCore") + ->Handler(); + } } void AWSScriptBehaviorS3::GetObject( diff --git a/Gems/AWSCore/Code/Source/ScriptCanvas/AWSScriptBehaviorsComponent.cpp b/Gems/AWSCore/Code/Source/ScriptCanvas/AWSScriptBehaviorsComponent.cpp index 530c35cde2..4c41dc3f0e 100644 --- a/Gems/AWSCore/Code/Source/ScriptCanvas/AWSScriptBehaviorsComponent.cpp +++ b/Gems/AWSCore/Code/Source/ScriptCanvas/AWSScriptBehaviorsComponent.cpp @@ -12,35 +12,17 @@ namespace AWSCore { - AZStd::vector> AWSScriptBehaviorsComponent::m_behaviors; - bool AWSScriptBehaviorsComponent::m_alreadyAddedBehaviors = false; - - void AWSScriptBehaviorsComponent::AddBehaviors() - { - if (!m_alreadyAddedBehaviors) - { - // Add new script behaviors here - m_behaviors.push_back(AZStd::make_unique()); - m_behaviors.push_back(AZStd::make_unique()); - m_behaviors.push_back(AZStd::make_unique()); - m_alreadyAddedBehaviors = true; - } - } - void AWSScriptBehaviorsComponent::Reflect(AZ::ReflectContext* context) { - AddBehaviors(); + AWSScriptBehaviorDynamoDB::Reflect(context); + AWSScriptBehaviorLambda::Reflect(context); + AWSScriptBehaviorS3::Reflect(context); if (AZ::SerializeContext* serialize = azrtti_cast(context)) { serialize->Class() ->Version(0); - for (auto&& behavior : m_behaviors) - { - behavior->ReflectSerialization(serialize); - } - if (AZ::EditContext* editContext = serialize->GetEditContext()) { editContext->Class("AWSScriptBehaviors", "Provides ScriptCanvas functions for calling AWS") @@ -49,19 +31,6 @@ namespace AWSCore ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("AWS")) ->Attribute(AZ::Edit::Attributes::AutoExpand, true) ; - - for (auto&& behavior : m_behaviors) - { - behavior->ReflectEditParameters(editContext); - } - } - } - - if (AZ::BehaviorContext* behaviorContext = azrtti_cast(context)) - { - for (auto&& behavior : m_behaviors) - { - behavior->ReflectBehaviors(behaviorContext); } } } @@ -86,31 +55,12 @@ namespace AWSCore AZ_UNUSED(dependent); } - void AWSScriptBehaviorsComponent::Init() - { - for (auto&& behavior : m_behaviors) - { - behavior->Init(); - } - } - void AWSScriptBehaviorsComponent::Activate() { - for (auto&& behavior : m_behaviors) - { - behavior->Activate(); - } } void AWSScriptBehaviorsComponent::Deactivate() { - for (auto&& behavior : m_behaviors) - { - behavior->Deactivate(); - } - - // this forces the vector to release its capacity, clear/shrink_to_fit is not - m_behaviors.swap(AZStd::vector>()); } } diff --git a/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorsComponentTest.cpp b/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorsComponentTest.cpp index 15ad297f9b..2283caa69e 100644 --- a/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorsComponentTest.cpp +++ b/Gems/AWSCore/Code/Tests/ScriptCanvas/AWSScriptBehaviorsComponentTest.cpp @@ -15,18 +15,6 @@ using namespace AWSCore; -class AWSScriptBehaviorsComponentMock - : public AWSScriptBehaviorsComponent -{ -public: - AZ_COMPONENT(AWSScriptBehaviorsComponentMock, "{78579706-E1B2-4788-A34D-A58D3F273FF9}"); - - int GetBehaviorsNum() - { - return m_behaviors.size(); - } -}; - class AWSScriptBehaviorsComponentTest : public UnitTest::ScopedAllocatorSetupFixture { @@ -38,7 +26,7 @@ public: m_behaviorContext = AZStd::make_unique(); m_entity = AZStd::make_unique(); - m_scriptBehaviorsComponent.reset(m_entity->CreateComponent()); + m_scriptBehaviorsComponent.reset(m_entity->CreateComponent()); } void TearDown() override @@ -56,20 +44,16 @@ protected: AZStd::unique_ptr m_serializeContext; AZStd::unique_ptr m_behaviorContext; AZStd::unique_ptr m_componentDescriptor; - AZStd::unique_ptr m_scriptBehaviorsComponent; + AZStd::unique_ptr m_scriptBehaviorsComponent; AZStd::unique_ptr m_entity; }; -TEST_F(AWSScriptBehaviorsComponentTest, InitActivateDeactivate_Call_GetExpectedNumOfAddedBehaviors) +TEST_F(AWSScriptBehaviorsComponentTest, Reflect) { - m_componentDescriptor.reset(AWSScriptBehaviorsComponentMock::CreateDescriptor()); + int oldEBusNum = m_behaviorContext->m_ebuses.size(); + m_componentDescriptor.reset(AWSScriptBehaviorsComponent::CreateDescriptor()); m_componentDescriptor->Reflect(m_serializeContext.get()); m_componentDescriptor->Reflect(m_behaviorContext.get()); - EXPECT_TRUE(AWSScriptBehaviorsComponentMock::AddedBehaviours()); - EXPECT_TRUE(m_scriptBehaviorsComponent->GetBehaviorsNum() == 3); - m_entity->Init(); - m_entity->Activate(); - m_entity->Deactivate(); - EXPECT_TRUE(m_scriptBehaviorsComponent->GetBehaviorsNum() == 0); + EXPECT_TRUE(m_behaviorContext->m_ebuses.size() - oldEBusNum == 3); } diff --git a/Gems/AWSCore/Code/awscore_files.cmake b/Gems/AWSCore/Code/awscore_files.cmake index c1577ec1eb..8e8ed280f8 100644 --- a/Gems/AWSCore/Code/awscore_files.cmake +++ b/Gems/AWSCore/Code/awscore_files.cmake @@ -32,7 +32,6 @@ set(FILES Include/Public/Framework/ServiceRequestJobConfig.h Include/Public/Framework/Util.h Include/Public/ResourceMapping/AWSResourceMappingBus.h - Include/Public/ScriptCanvas/AWSScriptBehaviorBase.h Include/Public/ScriptCanvas/AWSScriptBehaviorDynamoDB.h Include/Public/ScriptCanvas/AWSScriptBehaviorLambda.h Include/Public/ScriptCanvas/AWSScriptBehaviorS3.h