ePages 6.17.52 - DE_EPAGES/MultiStore/API/Test/CheckImported.pm

Package DE_EPAGES::MultiStore::API::Test::CheckImported

Checks imported objects in a shop based in some metadata. The metadata provides information (PERL data format like array, hash, scalar) to check the status of synchronization: if objects were deleted, created or updated, ... This is the format of the metada in a simple notation: NOTATION: LABEL := VALUE Where LABEL Is an (uppercase) identifier VALUE Could be - A description - A final string between quotes Like: 'value' - Possible values between brackets and separated by '|' Like: ( A | B | C ) - Array, 1 to n items between square brackets Like: [ LABEL_1, ... ] - Hash, 1 to n items between curly brackets Like: { 'key_1' => LABEL_1, ... } METADATA FORMAT ( See example file 't/data/CheckImported_Example.pm' ): EXPECTED := [ OBJECT_INFO, ... ] OBJECT_INFO := ( OBJECT_EXISTS | OBJECT_NOT_EXISTS ) OBJECT_EXISTS := { 'CheckType' => CHECK_TYPE, 'CheckMsgExists' => MSG_OBJ_EXISTS, 'CheckMsgClass' => MSG_CLASS, 'CheckMsgSync' => MSG_SYNC, 'Class' => OBJECT_CLASS, 'Path' => OBJECT_PATH, 'Attributes' => ATTRIBUTES } OBJECT_NOT_EXISTS := { 'CheckType' => CHECK_TYPE, 'CheckMsgExists' => MSG_OBJ_NOT_EXISTS, 'Path' => OBJECT_PATH } CHECK_TYPE := ( 'Exists' | 'NotFound' ) ATTRIBUTES := [ ATTRIBUTE_INFO, ... ] ATTRIBUTE_INFO := { 'Type' => ATTRIBUTE_TYPE, 'Name' => ATTRIBUTE_NAME, 'Value' => ATTRIBUTE_VALUE, } ATTRIBUTE_TYPE := ( 'scalar' | 'object' ) ATTRIBUTE_NAME := String with expected attribute alias E.g. 'StockLevel' ATTRIBUTE_VALUE := TEXT | NUMBER | OBJECT_VALUE OBJECT_VALUE := [ OBJECT_ALIAS, ... ] OBJECT_ALIAS := String with alias of an existing object E.g. 'lt_0401107001' MSG_OBJ_EXISTS := Print this test message if object exists MSG_OBJ_NOT_EXISTS := Print this test message if object doesn't exist MSG_CLASS := Print this test message if object class is ok MSG_SYNC := Print this test message if attributes is synchronized Include '%s' to replace it with ATTRIBUTE_INFO['Name'] E.g. 'The attribute "%s" was synchronized' Output > The attribute "StockLevel" was synchronized OBJECT_CLASS := String with expected class name for an object instance E.g. 'ProductClass' OBJECT_PATH := String with object relative path inside the shop E.g. 'Products/lt_0401107001' TEXT := Perl string NUMBER := Perl number

Base
Exporter
@EXPORT_OK
CheckImportedObjects

Functions

CheckImportedObjects

CheckImportedObjects

Checks the status of an epages object according the provided metadata.

Syntax
CheckImportedObjects($hSubShopInfo, $aExpected);
Input
$hSubShopInfo (hash.ref)
SubShop info (storename, shop alias, ...)
$aExpected (array.ref)
Metadata with expected object status