From: spo Date: Thu, 26 May 2016 13:40:05 +0000 (+0300) Subject: Move Mock files from src/ConstructionAPI/Test to src/ModelHighAPI/Mock X-Git-Tag: V_2.4.0~91^2~92 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0d8dafa0b70e90170f69de7d6faec25cc5e21f6e;p=modules%2Fshaper.git Move Mock files from src/ConstructionAPI/Test to src/ModelHighAPI/Mock --- diff --git a/src/ConstructionAPI/Test/CMakeLists.txt b/src/ConstructionAPI/Test/CMakeLists.txt index bbc44a46a..2df95c8c2 100644 --- a/src/ConstructionAPI/Test/CMakeLists.txt +++ b/src/ConstructionAPI/Test/CMakeLists.txt @@ -7,6 +7,7 @@ include_directories( ${PROJECT_SOURCE_DIR}/src/ModelAPI ${PROJECT_SOURCE_DIR}/src/ModelHighAPI ${PROJECT_SOURCE_DIR}/src/ConstructionAPI + ${PROJECT_SOURCE_DIR}/src/ModelHighAPI/Mock ) set(PROJECT_SOURCES diff --git a/src/ConstructionAPI/Test/MockModelAPI_AttributeDouble.h b/src/ConstructionAPI/Test/MockModelAPI_AttributeDouble.h deleted file mode 100644 index a3d1fc070..000000000 --- a/src/ConstructionAPI/Test/MockModelAPI_AttributeDouble.h +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -#ifndef MockModelAPI_AttributeDouble_H_ -#define MockModelAPI_AttributeDouble_H_ - -#include - -#include - -class MockModelAPI_AttributeDouble : public ModelAPI_AttributeDouble { - public: - MOCK_METHOD1(setValue, - void(const double theValue)); - MOCK_METHOD0(value, - double()); - MOCK_METHOD1(setCalculatedValue, - void(const double theValue)); - MOCK_METHOD1(setText, - void(const std::string& theText)); - MOCK_METHOD0(text, - std::string()); - MOCK_METHOD1(setExpressionInvalid, - void(const bool theFlag)); - MOCK_METHOD0(expressionInvalid, - bool()); - MOCK_METHOD1(setExpressionError, - void(const std::string& theError)); - MOCK_METHOD0(expressionError, - std::string()); - MOCK_METHOD1(setUsedParameters, - void(const std::set& theUsedParameters)); - MOCK_CONST_METHOD0(usedParameters, - std::set()); -}; - -#endif // MockModelAPI_AttributeDouble_H_ diff --git a/src/ConstructionAPI/Test/MockModelAPI_Data.h b/src/ConstructionAPI/Test/MockModelAPI_Data.h deleted file mode 100644 index c8f99a77c..000000000 --- a/src/ConstructionAPI/Test/MockModelAPI_Data.h +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -#ifndef MockModelAPI_Data_H_ -#define MockModelAPI_Data_H_ - -#include - -#include - -class MockModelAPI_Data : public ModelAPI_Data { - public: - MOCK_METHOD0(name, - std::string()); - MOCK_METHOD1(setName, - void(const std::string& theName)); - MOCK_METHOD1(document, - std::shared_ptr(const std::string& theID)); - MOCK_METHOD1(real, - std::shared_ptr(const std::string& theID)); - MOCK_METHOD1(integer, - std::shared_ptr(const std::string& theID)); - MOCK_METHOD1(reference, - std::shared_ptr(const std::string& theID)); - MOCK_METHOD1(selection, - std::shared_ptr(const std::string& theID)); - MOCK_METHOD1(selectionList, - std::shared_ptr(const std::string& theID)); - MOCK_METHOD1(refattr, - std::shared_ptr(const std::string& theID)); - MOCK_METHOD1(reflist, - std::shared_ptr(const std::string& theID)); - MOCK_METHOD1(refattrlist, - std::shared_ptr(const std::string& theID)); - MOCK_METHOD1(boolean, - std::shared_ptr(const std::string& theID)); - MOCK_METHOD1(string, - std::shared_ptr(const std::string& theID)); - MOCK_METHOD1(intArray, - std::shared_ptr(const std::string& theID)); - MOCK_METHOD1(attribute, - std::shared_ptr(const std::string& theID)); - MOCK_METHOD1(attributes, - std::list >(const std::string& theType)); - MOCK_METHOD1(attributesIDs, - std::list(const std::string& theType)); - MOCK_METHOD1(id, - const std::string&(const std::shared_ptr& theAttr)); - MOCK_METHOD1(isEqual, - bool(const std::shared_ptr& theData)); - MOCK_METHOD0(isValid, - bool()); - MOCK_METHOD2(addAttribute, - std::shared_ptr(const std::string& theID, const std::string theAttrType)); - MOCK_METHOD1(sendAttributeUpdated, - void(ModelAPI_Attribute* theAttr)); - MOCK_METHOD1(blockSendAttributeUpdated, - void(const bool theBlock)); - MOCK_METHOD0(erase, - void()); - MOCK_METHOD1(execState, - void(const ModelAPI_ExecState theState)); - MOCK_METHOD0(execState, - ModelAPI_ExecState()); - MOCK_METHOD2(setError, - void(const std::string& theError, bool theSend)); - MOCK_CONST_METHOD0(error, - std::string()); - MOCK_CONST_METHOD0(featureId, - int()); - MOCK_METHOD0(refsToMe, - const std::set >&()); - MOCK_METHOD1(referencesToObjects, - void(std::list > > >& theRefs)); - MOCK_METHOD1(copyTo, - void(std::shared_ptr theTarget)); - MOCK_METHOD0(invalidPtr, - std::shared_ptr()); - MOCK_METHOD0(updateID, - int()); - MOCK_METHOD1(setUpdateID, - void(const int theID)); - MOCK_METHOD0(owner, - std::shared_ptr()); - MOCK_METHOD0(isDeleted, - bool()); - MOCK_METHOD1(setIsDeleted, - void(const bool theFlag)); - MOCK_METHOD0(isInHistory, - bool()); - MOCK_METHOD1(setIsInHistory, - void(const bool theFlag)); - MOCK_METHOD0(isDisplayed, - bool()); - MOCK_METHOD1(setDisplayed, - void(const bool theDisplay)); -}; - -#endif // MockModelAPI_Data_H_ diff --git a/src/ConstructionAPI/Test/MockModelAPI_Document.h b/src/ConstructionAPI/Test/MockModelAPI_Document.h deleted file mode 100644 index cceea8119..000000000 --- a/src/ConstructionAPI/Test/MockModelAPI_Document.h +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -#ifndef MockModelAPI_Document_H_ -#define MockModelAPI_Document_H_ - -#include - -#include - -class MockModelAPI_Document : public ModelAPI_Document { - public: - MOCK_CONST_METHOD0(kind, - const std::string&()); - MOCK_METHOD1(close, - void(bool)); - MOCK_METHOD2(addFeature, - std::shared_ptr(std::string, bool)); - MOCK_METHOD3(refsToFeature, - void(std::shared_ptr theFeature, - std::set >& theRefs, - const bool isSendError)); - MOCK_METHOD1(removeFeature, - void(std::shared_ptr theFeature)); - MOCK_METHOD2(moveFeature, - void(std::shared_ptr theMoved, std::shared_ptr theAfterThis)); - MOCK_CONST_METHOD0(id, - const int()); - MOCK_METHOD2(object, - std::shared_ptr(const std::string& theGroupID, const int theIndex)); - MOCK_METHOD2(objectByName, - std::shared_ptr(const std::string& theGroupID, const std::string& theName)); - MOCK_METHOD1(index, - const int(std::shared_ptr theObject)); - MOCK_METHOD1(size, - int(const std::string& theGroupID)); - MOCK_METHOD1(currentFeature, - std::shared_ptr(const bool theVisible)); - MOCK_METHOD2(setCurrentFeature, - void(std::shared_ptr theCurrent, const bool theVisible)); - MOCK_METHOD0(setCurrentFeatureUp, - void()); - MOCK_METHOD0(numInternalFeatures, - int()); - MOCK_METHOD1(internalFeature, - std::shared_ptr(const int theIndex)); - MOCK_METHOD0(synchronizeTransactions, - void()); - MOCK_METHOD1(featureById, - std::shared_ptr(const int theId)); - MOCK_METHOD2(createConstruction, - std::shared_ptr(const std::shared_ptr& theFeatureData, const int theIndex)); - MOCK_METHOD2(createBody, - std::shared_ptr(const std::shared_ptr& theFeatureData, const int theIndex)); - MOCK_METHOD2(createPart, - std::shared_ptr(const std::shared_ptr& theFeatureData, const int theIndex)); - MOCK_METHOD3(copyPart, - std::shared_ptr(const std::shared_ptr& theOrigin, - const std::shared_ptr& theFeatureData, const int theIndex)); - MOCK_METHOD2(createGroup, - std::shared_ptr(const std::shared_ptr& theFeatureData, const int theIndex)); - MOCK_METHOD2(createParameter, - std::shared_ptr(const std::shared_ptr& theFeatureData, const int theIndex)); - MOCK_METHOD1(feature, - std::shared_ptr(const std::shared_ptr& theResult)); - MOCK_METHOD0(allFeatures, - std::list >()); - MOCK_METHOD1(setActive, - void(const bool theFlag)); - MOCK_CONST_METHOD0(isActive, - bool()); - MOCK_METHOD0(isOpened, - bool()); - MOCK_METHOD2(producedByFeature, - std::shared_ptr(std::shared_ptr theResult, const std::shared_ptr& theShape)); - MOCK_CONST_METHOD2(isLater, - bool(std::shared_ptr theLater, std::shared_ptr theCurrent)); - MOCK_METHOD1(updateHistory, - void(const std::shared_ptr theObject)); - MOCK_METHOD1(updateHistory, - void(const std::string theGroup)); -}; - -#endif // MockMockModelAPI_Document_H_ - diff --git a/src/ConstructionAPI/Test/MockModelAPI_Feature.h b/src/ConstructionAPI/Test/MockModelAPI_Feature.h deleted file mode 100644 index 47ef1f319..000000000 --- a/src/ConstructionAPI/Test/MockModelAPI_Feature.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -#ifndef MockModelAPI_Feature_H_ -#define MockModelAPI_Feature_H_ - -#include - -#include - -class MockModelAPI_Feature : public ModelAPI_Feature { - // ModelAPI_Object - public: - MOCK_METHOD0(groupName, - std::string()); - MOCK_METHOD0(initAttributes, - void()); - MOCK_METHOD0(isDisabled, - bool()); - MOCK_METHOD3(colorConfigInfo, - void(std::string& theSection, std::string& theName, std::string& theDefault)); - MOCK_METHOD0(init, - void()); - MOCK_CONST_METHOD0(data, - std::shared_ptr()); - - // ModelAPI_Feature - public: - MOCK_METHOD0(getKind, - const std::string&()); - MOCK_CONST_METHOD0(document, - std::shared_ptr()); - MOCK_METHOD0(execute, - void()); - MOCK_METHOD1(compute, - bool(const std::string& theAttributeId)); - MOCK_METHOD2(setError, - void(std::string, bool)); - MOCK_CONST_METHOD0(error, - std::string()); - MOCK_METHOD0(isPersistentResult, - bool()); - MOCK_METHOD0(isAction, - bool()); -}; - -#endif // MockModelAPI_Feature_H_ diff --git a/src/ConstructionAPI/Test/MockModelAPI_Object.h b/src/ConstructionAPI/Test/MockModelAPI_Object.h deleted file mode 100644 index ad865af5c..000000000 --- a/src/ConstructionAPI/Test/MockModelAPI_Object.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -#ifndef MockModelAPI_Object_H_ -#define MockModelAPI_Object_H_ - -#include - -#include - -class MockModelAPI_Object : public ModelAPI_Object { - public: - MOCK_METHOD0(groupName, - std::string()); - MOCK_METHOD0(initAttributes, - void()); - MOCK_METHOD0(isDisabled, - bool()); - MOCK_METHOD3(colorConfigInfo, - void(std::string& theSection, std::string& theName, std::string& theDefault)); - MOCK_METHOD0(init, - virtual void MODELAPI_EXPORT()); -}; - -#endif // MockModelAPI_Object_H_ diff --git a/src/ModelHighAPI/Mock/MockModelAPI_AttributeDouble.h b/src/ModelHighAPI/Mock/MockModelAPI_AttributeDouble.h new file mode 100644 index 000000000..a3d1fc070 --- /dev/null +++ b/src/ModelHighAPI/Mock/MockModelAPI_AttributeDouble.h @@ -0,0 +1,36 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + +#ifndef MockModelAPI_AttributeDouble_H_ +#define MockModelAPI_AttributeDouble_H_ + +#include + +#include + +class MockModelAPI_AttributeDouble : public ModelAPI_AttributeDouble { + public: + MOCK_METHOD1(setValue, + void(const double theValue)); + MOCK_METHOD0(value, + double()); + MOCK_METHOD1(setCalculatedValue, + void(const double theValue)); + MOCK_METHOD1(setText, + void(const std::string& theText)); + MOCK_METHOD0(text, + std::string()); + MOCK_METHOD1(setExpressionInvalid, + void(const bool theFlag)); + MOCK_METHOD0(expressionInvalid, + bool()); + MOCK_METHOD1(setExpressionError, + void(const std::string& theError)); + MOCK_METHOD0(expressionError, + std::string()); + MOCK_METHOD1(setUsedParameters, + void(const std::set& theUsedParameters)); + MOCK_CONST_METHOD0(usedParameters, + std::set()); +}; + +#endif // MockModelAPI_AttributeDouble_H_ diff --git a/src/ModelHighAPI/Mock/MockModelAPI_Data.h b/src/ModelHighAPI/Mock/MockModelAPI_Data.h new file mode 100644 index 000000000..c8f99a77c --- /dev/null +++ b/src/ModelHighAPI/Mock/MockModelAPI_Data.h @@ -0,0 +1,98 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + +#ifndef MockModelAPI_Data_H_ +#define MockModelAPI_Data_H_ + +#include + +#include + +class MockModelAPI_Data : public ModelAPI_Data { + public: + MOCK_METHOD0(name, + std::string()); + MOCK_METHOD1(setName, + void(const std::string& theName)); + MOCK_METHOD1(document, + std::shared_ptr(const std::string& theID)); + MOCK_METHOD1(real, + std::shared_ptr(const std::string& theID)); + MOCK_METHOD1(integer, + std::shared_ptr(const std::string& theID)); + MOCK_METHOD1(reference, + std::shared_ptr(const std::string& theID)); + MOCK_METHOD1(selection, + std::shared_ptr(const std::string& theID)); + MOCK_METHOD1(selectionList, + std::shared_ptr(const std::string& theID)); + MOCK_METHOD1(refattr, + std::shared_ptr(const std::string& theID)); + MOCK_METHOD1(reflist, + std::shared_ptr(const std::string& theID)); + MOCK_METHOD1(refattrlist, + std::shared_ptr(const std::string& theID)); + MOCK_METHOD1(boolean, + std::shared_ptr(const std::string& theID)); + MOCK_METHOD1(string, + std::shared_ptr(const std::string& theID)); + MOCK_METHOD1(intArray, + std::shared_ptr(const std::string& theID)); + MOCK_METHOD1(attribute, + std::shared_ptr(const std::string& theID)); + MOCK_METHOD1(attributes, + std::list >(const std::string& theType)); + MOCK_METHOD1(attributesIDs, + std::list(const std::string& theType)); + MOCK_METHOD1(id, + const std::string&(const std::shared_ptr& theAttr)); + MOCK_METHOD1(isEqual, + bool(const std::shared_ptr& theData)); + MOCK_METHOD0(isValid, + bool()); + MOCK_METHOD2(addAttribute, + std::shared_ptr(const std::string& theID, const std::string theAttrType)); + MOCK_METHOD1(sendAttributeUpdated, + void(ModelAPI_Attribute* theAttr)); + MOCK_METHOD1(blockSendAttributeUpdated, + void(const bool theBlock)); + MOCK_METHOD0(erase, + void()); + MOCK_METHOD1(execState, + void(const ModelAPI_ExecState theState)); + MOCK_METHOD0(execState, + ModelAPI_ExecState()); + MOCK_METHOD2(setError, + void(const std::string& theError, bool theSend)); + MOCK_CONST_METHOD0(error, + std::string()); + MOCK_CONST_METHOD0(featureId, + int()); + MOCK_METHOD0(refsToMe, + const std::set >&()); + MOCK_METHOD1(referencesToObjects, + void(std::list > > >& theRefs)); + MOCK_METHOD1(copyTo, + void(std::shared_ptr theTarget)); + MOCK_METHOD0(invalidPtr, + std::shared_ptr()); + MOCK_METHOD0(updateID, + int()); + MOCK_METHOD1(setUpdateID, + void(const int theID)); + MOCK_METHOD0(owner, + std::shared_ptr()); + MOCK_METHOD0(isDeleted, + bool()); + MOCK_METHOD1(setIsDeleted, + void(const bool theFlag)); + MOCK_METHOD0(isInHistory, + bool()); + MOCK_METHOD1(setIsInHistory, + void(const bool theFlag)); + MOCK_METHOD0(isDisplayed, + bool()); + MOCK_METHOD1(setDisplayed, + void(const bool theDisplay)); +}; + +#endif // MockModelAPI_Data_H_ diff --git a/src/ModelHighAPI/Mock/MockModelAPI_Document.h b/src/ModelHighAPI/Mock/MockModelAPI_Document.h new file mode 100644 index 000000000..cceea8119 --- /dev/null +++ b/src/ModelHighAPI/Mock/MockModelAPI_Document.h @@ -0,0 +1,84 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + +#ifndef MockModelAPI_Document_H_ +#define MockModelAPI_Document_H_ + +#include + +#include + +class MockModelAPI_Document : public ModelAPI_Document { + public: + MOCK_CONST_METHOD0(kind, + const std::string&()); + MOCK_METHOD1(close, + void(bool)); + MOCK_METHOD2(addFeature, + std::shared_ptr(std::string, bool)); + MOCK_METHOD3(refsToFeature, + void(std::shared_ptr theFeature, + std::set >& theRefs, + const bool isSendError)); + MOCK_METHOD1(removeFeature, + void(std::shared_ptr theFeature)); + MOCK_METHOD2(moveFeature, + void(std::shared_ptr theMoved, std::shared_ptr theAfterThis)); + MOCK_CONST_METHOD0(id, + const int()); + MOCK_METHOD2(object, + std::shared_ptr(const std::string& theGroupID, const int theIndex)); + MOCK_METHOD2(objectByName, + std::shared_ptr(const std::string& theGroupID, const std::string& theName)); + MOCK_METHOD1(index, + const int(std::shared_ptr theObject)); + MOCK_METHOD1(size, + int(const std::string& theGroupID)); + MOCK_METHOD1(currentFeature, + std::shared_ptr(const bool theVisible)); + MOCK_METHOD2(setCurrentFeature, + void(std::shared_ptr theCurrent, const bool theVisible)); + MOCK_METHOD0(setCurrentFeatureUp, + void()); + MOCK_METHOD0(numInternalFeatures, + int()); + MOCK_METHOD1(internalFeature, + std::shared_ptr(const int theIndex)); + MOCK_METHOD0(synchronizeTransactions, + void()); + MOCK_METHOD1(featureById, + std::shared_ptr(const int theId)); + MOCK_METHOD2(createConstruction, + std::shared_ptr(const std::shared_ptr& theFeatureData, const int theIndex)); + MOCK_METHOD2(createBody, + std::shared_ptr(const std::shared_ptr& theFeatureData, const int theIndex)); + MOCK_METHOD2(createPart, + std::shared_ptr(const std::shared_ptr& theFeatureData, const int theIndex)); + MOCK_METHOD3(copyPart, + std::shared_ptr(const std::shared_ptr& theOrigin, + const std::shared_ptr& theFeatureData, const int theIndex)); + MOCK_METHOD2(createGroup, + std::shared_ptr(const std::shared_ptr& theFeatureData, const int theIndex)); + MOCK_METHOD2(createParameter, + std::shared_ptr(const std::shared_ptr& theFeatureData, const int theIndex)); + MOCK_METHOD1(feature, + std::shared_ptr(const std::shared_ptr& theResult)); + MOCK_METHOD0(allFeatures, + std::list >()); + MOCK_METHOD1(setActive, + void(const bool theFlag)); + MOCK_CONST_METHOD0(isActive, + bool()); + MOCK_METHOD0(isOpened, + bool()); + MOCK_METHOD2(producedByFeature, + std::shared_ptr(std::shared_ptr theResult, const std::shared_ptr& theShape)); + MOCK_CONST_METHOD2(isLater, + bool(std::shared_ptr theLater, std::shared_ptr theCurrent)); + MOCK_METHOD1(updateHistory, + void(const std::shared_ptr theObject)); + MOCK_METHOD1(updateHistory, + void(const std::string theGroup)); +}; + +#endif // MockMockModelAPI_Document_H_ + diff --git a/src/ModelHighAPI/Mock/MockModelAPI_Feature.h b/src/ModelHighAPI/Mock/MockModelAPI_Feature.h new file mode 100644 index 000000000..47ef1f319 --- /dev/null +++ b/src/ModelHighAPI/Mock/MockModelAPI_Feature.h @@ -0,0 +1,46 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + +#ifndef MockModelAPI_Feature_H_ +#define MockModelAPI_Feature_H_ + +#include + +#include + +class MockModelAPI_Feature : public ModelAPI_Feature { + // ModelAPI_Object + public: + MOCK_METHOD0(groupName, + std::string()); + MOCK_METHOD0(initAttributes, + void()); + MOCK_METHOD0(isDisabled, + bool()); + MOCK_METHOD3(colorConfigInfo, + void(std::string& theSection, std::string& theName, std::string& theDefault)); + MOCK_METHOD0(init, + void()); + MOCK_CONST_METHOD0(data, + std::shared_ptr()); + + // ModelAPI_Feature + public: + MOCK_METHOD0(getKind, + const std::string&()); + MOCK_CONST_METHOD0(document, + std::shared_ptr()); + MOCK_METHOD0(execute, + void()); + MOCK_METHOD1(compute, + bool(const std::string& theAttributeId)); + MOCK_METHOD2(setError, + void(std::string, bool)); + MOCK_CONST_METHOD0(error, + std::string()); + MOCK_METHOD0(isPersistentResult, + bool()); + MOCK_METHOD0(isAction, + bool()); +}; + +#endif // MockModelAPI_Feature_H_ diff --git a/src/ModelHighAPI/Mock/MockModelAPI_Object.h b/src/ModelHighAPI/Mock/MockModelAPI_Object.h new file mode 100644 index 000000000..ad865af5c --- /dev/null +++ b/src/ModelHighAPI/Mock/MockModelAPI_Object.h @@ -0,0 +1,24 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + +#ifndef MockModelAPI_Object_H_ +#define MockModelAPI_Object_H_ + +#include + +#include + +class MockModelAPI_Object : public ModelAPI_Object { + public: + MOCK_METHOD0(groupName, + std::string()); + MOCK_METHOD0(initAttributes, + void()); + MOCK_METHOD0(isDisabled, + bool()); + MOCK_METHOD3(colorConfigInfo, + void(std::string& theSection, std::string& theName, std::string& theDefault)); + MOCK_METHOD0(init, + virtual void MODELAPI_EXPORT()); +}; + +#endif // MockModelAPI_Object_H_