AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Functions
alexaClientSDK::acsdkManufactory::test Namespace Reference

Classes

class  AB
 
class  ABSubclass
 
struct  Annotation1
 Type used to annotate (i.e. distinguish instances of) another type. More...
 
struct  Annotation2
 Type used to annotate (i.e. distinguish instances of) another type. More...
 
struct  Annotation3
 Type used to annotate (i.e. distinguish instances of) another type. More...
 
struct  Annotation4
 Type used to annotate (i.e. distinguish instances of) another type. More...
 
class  Dependency
 
class  InterfaceA
 
class  InterfaceAB
 
class  InterfaceB
 
class  ManufactoryTest
 
struct  Type1
 

Functions

unique_ptr< InterfaceAcreateUniqueA ()
 
 TEST_F (ManufactoryTest, test_manufactureUnique)
 
shared_ptr< InterfaceABcreateSharedAB ()
 
 TEST_F (ManufactoryTest, test_manufactureShared)
 
shared_ptr< InterfaceAcreateAFromAB (const shared_ptr< InterfaceAB > &ab)
 
shared_ptr< InterfaceBcreateBFromAB (const shared_ptr< InterfaceAB > &ab)
 
shared_ptr< InterfaceABcreateAB ()
 
Component< shared_ptr< InterfaceA >, shared_ptr< InterfaceB > > getABComponent ()
 
 TEST_F (ManufactoryTest, test_multipleInhertance)
 
Annotated< Annotation1, InterfaceABcreateAB1 (const Annotated< Annotation3, InterfaceAB > &ab3)
 
Annotated< Annotation2, InterfaceABcreateAB2 ()
 
Annotated< Annotation3, InterfaceABcreateAB3 (const Annotated< Annotation2, InterfaceAB > &ab2)
 
Component< Annotated< Annotation1, InterfaceAB >, Annotated< Annotation2, InterfaceAB >, Import< Annotated< Annotation3, InterfaceAB > > > getComponent12 ()
 
Component< Annotated< Annotation3, InterfaceAB > > getComponent3 ()
 
 TEST_F (ManufactoryTest, test_annotatedManufacture)
 
Component< shared_ptr< InterfaceAB > > getRetainedABComponent ()
 
 TEST_F (ManufactoryTest, test_retainedManufacture)
 
Annotated< Annotation1, InterfaceABcreateRetainedAB1 ()
 
Annotated< Annotation2, InterfaceABcreateRequiredAB2 (const Annotated< Annotation1, InterfaceAB > &ab1)
 
Component< Annotated< Annotation1, InterfaceAB > > getRequiredComponent ()
 
 TEST_F (ManufactoryTest, test_requiredManufacture)
 
template<int X>
static shared_ptr< ABSubclass< X > > createABSubclass ()
 
Component< shared_ptr< ABSubclass< 1 > >, shared_ptr< ABSubclass< 2 > >, shared_ptr< ABSubclass< 3 > > > getPrimaryTestComponent ()
 
 TEST_F (ManufactoryTest, test_primeManufacture)
 
template<int X, typename... Dependencies>
function< shared_ptr< ABSubclass< X > >Dependencies...)> getFunctionFactory ()
 
Component< shared_ptr< ABSubclass< 1 > >, shared_ptr< ABSubclass< 2 > >, shared_ptr< ABSubclass< 3 > >, shared_ptr< ABSubclass< 4 > > > getFunctionTestComponent ()
 
 TEST_F (ManufactoryTest, test_functionManufacture)
 
template<typename Annotation , typename... Dependencies>
function< Annotated< Annotation, AB >Dependencies...)> getAnnotatedFunctionFactory ()
 
Component< Annotated< Annotation1, AB >, Annotated< Annotation2, AB >, Annotated< Annotation3, AB >, Annotated< Annotation4, AB >, Annotated< Annotation2, AB > > getAnnotatedFunctionTestComponent ()
 
 TEST_F (ManufactoryTest, test_anotatedFunctionManufacture)
 
shared_ptr< InterfaceAcreateCyclicA (const shared_ptr< InterfaceB > &)
 
shared_ptr< InterfaceBcreateCyclicB (const shared_ptr< InterfaceA > &)
 
Component< shared_ptr< InterfaceA >, shared_ptr< InterfaceB > > getCyclicComponent ()
 
 TEST_F (ManufactoryTest, test_checkCyclicDependencies)
 
 TEST_F (ManufactoryTest, test_subManufactory)
 
Component< shared_ptr< Type1 >, OptionalImport< shared_ptr< Dependency > > > getOptional ()
 
 TEST_F (ManufactoryTest, test_missingOptionalImportUsesEmptyObject)
 
 TEST_F (ManufactoryTest, test_withOptionalImportUsesProvidedImplementation)
 

Function Documentation

◆ createAB()

shared_ptr<InterfaceAB> alexaClientSDK::acsdkManufactory::test::createAB ( )

Factory used to create an instance of InterfaceAB.

Returns
An instance of InterfaceAB.

◆ createAB1()

Annotated<Annotation1, InterfaceAB> alexaClientSDK::acsdkManufactory::test::createAB1 ( const Annotated< Annotation3, InterfaceAB > &  ab3)

Factory used to create an annotated (with Annotation1) instance of InterfaceAB that depends upon the instance of InterfaceAB annotated with Annotation3.

Parameters
ab3A different instance of InterfaceAB (annotated with Annotation3)
Returns
The instance of InterfaceAB annotated with Annotation1.

◆ createAB2()

Annotated<Annotation2, InterfaceAB> alexaClientSDK::acsdkManufactory::test::createAB2 ( )

Factory used to create an annotated (with Annotation2) instance of InterfaceAB.

Returns
The instance of InterfaceAB annotated with Annotation2.

◆ createAB3()

Annotated<Annotation3, InterfaceAB> alexaClientSDK::acsdkManufactory::test::createAB3 ( const Annotated< Annotation2, InterfaceAB > &  ab2)

Factory used to create an annotated (with Annotation3) instance of InterfaceAB that depends upon the instance of InterfaceAB annotated with Annotation2.

Parameters
ab2A different instance of InterfaceAB (annotated with Annotation2)
Returns
The instance of InterfaceAB annotated with Annotation3.

◆ createABSubclass()

template<int X>
static shared_ptr<ABSubclass<X> > alexaClientSDK::acsdkManufactory::test::createABSubclass ( )
static

Template function to create instances of a variety of subclasses of AB.

Template Parameters
XA number used to distinguish subclasses.
Returns
A new instance of ABSubclass<X>.

◆ createAFromAB()

shared_ptr<InterfaceA> alexaClientSDK::acsdkManufactory::test::createAFromAB ( const shared_ptr< InterfaceAB > &  ab)

Factory for InterfaceA that depends upon an instance of InterfaceAB, and which returns an InterfaceA pointer the the provided instance of InterfaceAB.

Parameters
abThe instance of InterfaceAB to use to create an InterfaceA.
Returns
The InterfaceA portion of the InterfaceAB that was provided.

◆ createBFromAB()

shared_ptr<InterfaceB> alexaClientSDK::acsdkManufactory::test::createBFromAB ( const shared_ptr< InterfaceAB > &  ab)

Factory for InterfaceB that depends upon an instance of InterfaceAB, and which returns an InterfaceB pointer the the provided instance of InterfaceAB.

Parameters
abThe instance of InterfaceAB to use to create an InterfaceB.
Returns
The InterfaceB portion of the InterfaceAB that was provided.

◆ createCyclicA()

shared_ptr<InterfaceA> alexaClientSDK::acsdkManufactory::test::createCyclicA ( const shared_ptr< InterfaceB > &  )

Factory for instances of InterfaceA that depends upon InterfaceB.

Returns
An instance of InterfaceA.

◆ createCyclicB()

shared_ptr<InterfaceB> alexaClientSDK::acsdkManufactory::test::createCyclicB ( const shared_ptr< InterfaceA > &  )

Factory for instances of InterfaceB that depends upon InterfaceA.

Returns
An instance of InterfaceB.

◆ createRequiredAB2()

Annotated<Annotation2, InterfaceAB> alexaClientSDK::acsdkManufactory::test::createRequiredAB2 ( const Annotated< Annotation1, InterfaceAB > &  ab1)

Factory for an instance of InterfaceAB annotated with Anotation2, which is dependent upon an instance of InterfaceAB annotated with Annotation1.

Parameters
ab1An instance of InterfaceAB annotated with Annotation1.
Returns
An instance of InterfaceAB annotated with Annotation2.

◆ createRetainedAB1()

Annotated<Annotation1, InterfaceAB> alexaClientSDK::acsdkManufactory::test::createRetainedAB1 ( )

Factory for an instance of InterfaceAB annotated with Anotation1.

Returns
An instance of InterfaceAB annotated with Anotation1

◆ createSharedAB()

shared_ptr<InterfaceAB> alexaClientSDK::acsdkManufactory::test::createSharedAB ( )

Factory for creating a new instance of InterfaceAB and returning it via shared_ptr<InterfaceAB>.

Returns
A new instance of InterfaceAB.

◆ createUniqueA()

unique_ptr<InterfaceA> alexaClientSDK::acsdkManufactory::test::createUniqueA ( )

Factory for creating a new instance of InterfaceA and returning it via unique_ptr<InterfaceA>.

Returns
A new instance of InterfaceA.

◆ getABComponent()

Component<shared_ptr<InterfaceA>, shared_ptr<InterfaceB> > alexaClientSDK::acsdkManufactory::test::getABComponent ( )

Definition of a component that exports implementations of InterfaceA and InterfaceB.

Returns

◆ getAnnotatedFunctionFactory()

template<typename Annotation , typename... Dependencies>
function<Annotated<Annotation, AB>Dependencies...)> alexaClientSDK::acsdkManufactory::test::getAnnotatedFunctionFactory ( )

Template function to create a std:functions that creates an Annotated subclasses of AB.

Template Parameters
XA number used to distinguish subclasses.
DependenciesTypes of arguments to the ABSubclass<X> factory
Returns
A function to create a std:functions that creates a distinct subclasses of AB.

◆ getAnnotatedFunctionTestComponent()

Component< Annotated<Annotation1, AB>, Annotated<Annotation2, AB>, Annotated<Annotation3, AB>, Annotated<Annotation4, AB>, Annotated<Annotation2, AB> > alexaClientSDK::acsdkManufactory::test::getAnnotatedFunctionTestComponent ( )

◆ getComponent12()

Component< Annotated<Annotation1, InterfaceAB>, Annotated<Annotation2, InterfaceAB>, Import<Annotated<Annotation3, InterfaceAB> > > alexaClientSDK::acsdkManufactory::test::getComponent12 ( )

Definition of a component that exports instances of InterfaceAB annotated with Annotation1 and Annotation2, and which imports an instance of InterfaceAB annotated with Annotation3.

Returns
A component that exports instances of InterfaceAB annotated with Annotation1 and Annotation2...

◆ getComponent3()

Component<Annotated<Annotation3, InterfaceAB> > alexaClientSDK::acsdkManufactory::test::getComponent3 ( )

Definition of a component that exports the instance of InterfaceAB annotated with Annotation3.

Returns
A component that exports the instance of InterfaceAB annotated with Annotation3

◆ getCyclicComponent()

Component<shared_ptr<InterfaceA>, shared_ptr<InterfaceB> > alexaClientSDK::acsdkManufactory::test::getCyclicComponent ( )

Definition of a component with a cyclic dependency graph (InterfaceA <-> InterfaceB).

Returns
A component with a cyclic dependency graph.

◆ getFunctionFactory()

template<int X, typename... Dependencies>
function<shared_ptr<ABSubclass<X> >Dependencies...)> alexaClientSDK::acsdkManufactory::test::getFunctionFactory ( )

Template function to create a std:functions that creates a distinct subclasses of AB.

Template Parameters
XA number used to distinguish subclasses.
DependenciesTypes of arguments to the ABSubclass<X> factory
Returns
A function to create a std:functions that creates a distinct subclasses of AB.

◆ getFunctionTestComponent()

Component<shared_ptr<ABSubclass<1> >, shared_ptr<ABSubclass<2> >, shared_ptr<ABSubclass<3> >, shared_ptr<ABSubclass<4> > > alexaClientSDK::acsdkManufactory::test::getFunctionTestComponent ( )

◆ getOptional()

Component<shared_ptr<Type1>, OptionalImport<shared_ptr<Dependency> > > alexaClientSDK::acsdkManufactory::test::getOptional ( )

◆ getPrimaryTestComponent()

Component<shared_ptr<ABSubclass<1> >, shared_ptr<ABSubclass<2> >, shared_ptr<ABSubclass<3> > > alexaClientSDK::acsdkManufactory::test::getPrimaryTestComponent ( )

Definition of a component that includes both primary and required types to verify proper ordering of their instantiation.

Returns
A component that includes both primary and required types.

◆ getRequiredComponent()

Component<Annotated<Annotation1, InterfaceAB> > alexaClientSDK::acsdkManufactory::test::getRequiredComponent ( )

Definition of a Component that exports a 'required' instance of InterfaceAB annotated with Annotation1.

Returns
A Component that exports an instance of InterfaceAB annotated with Annotation1.

◆ getRetainedABComponent()

Component<shared_ptr<InterfaceAB> > alexaClientSDK::acsdkManufactory::test::getRetainedABComponent ( )

Definition of a Component that exports 'retained' (not unloadable) instances of InterfaceAB.

Returns
A Component that exports 'retained' (not unloadable) instances of InterfaceAB.

◆ TEST_F() [1/13]

alexaClientSDK::acsdkManufactory::test::TEST_F ( ManufactoryTest  ,
test_manufactureUnique   
)

Test manufacture of an instances returned via unique_ptr. Verify that multiple instances of the same interface are indeed distinct instances.

◆ TEST_F() [2/13]

alexaClientSDK::acsdkManufactory::test::TEST_F ( ManufactoryTest  ,
test_manufactureShared   
)

Test manufacture of an 'unloadable' instance returned via shared_ptr. Verify that while an instance is still referenced, manufacture of the same interface will provide the same instance. Also verify that when all references have been deleted, the next manufacture will create a new instance.

◆ TEST_F() [3/13]

alexaClientSDK::acsdkManufactory::test::TEST_F ( ManufactoryTest  ,
test_multipleInhertance   
)

Verify that a single object can be manufactured as multiple interfaces.

◆ TEST_F() [4/13]

alexaClientSDK::acsdkManufactory::test::TEST_F ( ManufactoryTest  ,
test_annotatedManufacture   
)

Verify that annotations can be used to distinguish specific instances of objects. Also verify that imports between components are properly resolved.

◆ TEST_F() [5/13]

alexaClientSDK::acsdkManufactory::test::TEST_F ( ManufactoryTest  ,
test_retainedManufacture   
)

Verify that manufacture of retained interfaces provides a single instance fore the life of the manufactory.

◆ TEST_F() [6/13]

alexaClientSDK::acsdkManufactory::test::TEST_F ( ManufactoryTest  ,
test_requiredManufacture   
)

Verify that manufacture of a required interface results in instantiation of the interface at the time that the Manufactory is created rather than being driven by other dependencies.

◆ TEST_F() [7/13]

alexaClientSDK::acsdkManufactory::test::TEST_F ( ManufactoryTest  ,
test_primeManufacture   
)

Verify that primary factories are invoked before required factories.

◆ TEST_F() [8/13]

alexaClientSDK::acsdkManufactory::test::TEST_F ( ManufactoryTest  ,
test_functionManufacture   
)

Verify that function factories work and are invoked in the correct order.

◆ TEST_F() [9/13]

alexaClientSDK::acsdkManufactory::test::TEST_F ( ManufactoryTest  ,
test_anotatedFunctionManufacture   
)

Verify that function factories work and are invoked in the correct order.

◆ TEST_F() [10/13]

alexaClientSDK::acsdkManufactory::test::TEST_F ( ManufactoryTest  ,
test_checkCyclicDependencies   
)

Verify that circular dependencies are detected, and the creation of an Manufactory from a component with a circular dependency will fail.

◆ TEST_F() [11/13]

alexaClientSDK::acsdkManufactory::test::TEST_F ( ManufactoryTest  ,
test_subManufactory   
)

Verify that the creation of a subManufactory works and that cached instances are shared between the primary and subManufactorys.

◆ TEST_F() [12/13]

alexaClientSDK::acsdkManufactory::test::TEST_F ( ManufactoryTest  ,
test_missingOptionalImportUsesEmptyObject   
)

Test that we are able to build manufactory from a component that has unsatisfied Optional dependency. Expect manufactory to just wire nullptr to that dependency.

◆ TEST_F() [13/13]

alexaClientSDK::acsdkManufactory::test::TEST_F ( ManufactoryTest  ,
test_withOptionalImportUsesProvidedImplementation   
)

Test that if the user provides a recipe for an optional dependency, the recipe is used.

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0