"res" is more common word for representing "resource" than "rsc".
Change-Id: I32c71d86a056a1c5127282e9fe0d69db8bc6e627
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
SET(TARGET_PKG_CLEARDATA "pkg_cleardata")
SET(TARGET_INSTALL_PRELOAD_PKG "install_preload_pkg")
SET(TARGET_PKG_UPGRADE "pkg_upgrade")
-SET(TARGET_RSC_COPY "rsc-copy")
+SET(TARGET_RES_COPY "res-copy")
SET(TARGET_RSC_SLICE "rsc-slice")
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")
%{_bindir}/pkg_cleardata
%{_bindir}/pkginfo
%{_bindir}/rsc-slice
-%{_bindir}/rsc-copy
+%{_bindir}/res-copy
%{_bindir}/pkg_upgrade
%attr(0755,root,root) %{_bindir}/install_preload_pkg
%{_datadir}/mime/packages/mime.wac.xml
ADD_SUBDIRECTORY(pkg_upgrade)
ADD_SUBDIRECTORY(pkgcmd)
ADD_SUBDIRECTORY(pkginfo)
-ADD_SUBDIRECTORY(rsc-copy)
+ADD_SUBDIRECTORY(res-copy)
ADD_SUBDIRECTORY(rsc-slice)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
# Target - definition
-ADD_EXECUTABLE(${TARGET_RSC_COPY} ${SRCS})
+ADD_EXECUTABLE(${TARGET_RES_COPY} ${SRCS})
# Dependency
-APPLY_PKG_CONFIG(${TARGET_RSC_COPY} PUBLIC
+APPLY_PKG_CONFIG(${TARGET_RES_COPY} PUBLIC
AUL_DEPS
GLIB_DEPS
BUNDLE_DEPS
)
# Install
-INSTALL(TARGETS ${TARGET_RSC_COPY} DESTINATION bin)
\ No newline at end of file
+INSTALL(TARGETS ${TARGET_RES_COPY} DESTINATION bin)
\ No newline at end of file
#include <string>
#include "include/error_type.hh"
-#include "include/rsc_path_info.hh"
+#include "include/res_path_info.hh"
-namespace rsc_handler {
+namespace res_handler {
class AbstractRequestHandler {
public:
AbstractRequestHandler(
- std::string pkgid, std::string root_path, std::list<RscPathInfo> path_list) :
+ std::string pkgid, std::string root_path, std::list<ResPathInfo> path_list) :
pkgid_(pkgid), root_path_(root_path), path_list_(path_list) {};
virtual ErrorType Execute() = 0;
protected:
std::string GetRootPath();
const std::string GetPkgID() const;
- const std::list<RscPathInfo> GetPathList() const;
+ const std::list<ResPathInfo> GetPathList() const;
private:
std::string pkgid_;
std::string root_path_;
- std::list<RscPathInfo> path_list_;
+ std::list<ResPathInfo> path_list_;
};
-} // rsc_handler
+} // namespace res_handler
#endif // ABSTRACT_REQUEST_HANDLER_HH_
#include <string>
#include "include/error_type.hh"
-#include "include/rsc_path_info.hh"
+#include "include/res_path_info.hh"
#include "include/request_type.hh"
-namespace rsc_handler {
+namespace res_handler {
class ConditionValidator {
public:
ConditionValidator(std::string pkgid, uid_t uid);
ErrorType ValidateCondition(ReqType req_type,
- std::list<RscPathInfo> path_list);
+ std::list<ResPathInfo> path_list);
private:
std::string pkgid_;
std::string root_path_;
uid_t uid_;
- ErrorType CheckCopyRequest(std::list<RscPathInfo> path_list);
- ErrorType CheckRemoveRequest(std::list<RscPathInfo> path_list);
+ ErrorType CheckCopyRequest(std::list<ResPathInfo> path_list);
+ ErrorType CheckRemoveRequest(std::list<ResPathInfo> path_list);
};
-} // namespace rsc_handler
+} // namespace res_handler
#endif // CONDITION_VALIDATOR_HH_
#include "include/abstract_request_handler.hh"
#include "include/error_type.hh"
-#include "include/rsc_path_info.hh"
+#include "include/res_path_info.hh"
-namespace rsc_handler {
+namespace res_handler {
class CopyRequestHandler : public AbstractRequestHandler {
public:
CopyRequestHandler(std::string pkgid, std::string root_path,
- std::list<RscPathInfo> path_list);
+ std::list<ResPathInfo> path_list);
ErrorType Execute() override;
const std::string GetRequestHandlerType() const override;
};
-} // namespace rsc_handler
+} // namespace res_handler
#endif // COPY_REQUEST_HANDLER_HH_
#ifndef ERROR_TYPE_HH_
#define ERROR_TYPE_HH_
-namespace rsc_handler {
+namespace res_handler {
enum ErrorType {
ERROR_NONE = 0,
ERROR_OUT_OF_MEMORY
};
-} // namespace rsc_handler
+} // namespace res_handler
#endif // ERROR_TYPE_HH_
#include "include/error_type.hh"
#include "include/request_type.hh"
-namespace rsc_handler {
+namespace res_handler {
class EventSignalSender {
public:
ReqType req_type_;
};
-} // rsc_handler
+} // res_handler
#endif // PARAM_CHECKER_HH_
#include <boost/filesystem.hpp>
#include <boost/filesystem/path.hpp>
-namespace rsc_handler {
+namespace res_handler {
// TODO(jungh.yeon) : is this necessary?
enum FSFlag : int {
bool RemoveAll(const boost::filesystem::path& path);
-} // namespace rsc_handler
+} // namespace res_handler
#endif // FILE_UTIL_HH_
#include <string>
#include "include/request_type.hh"
-#include "include/rsc_path_info.hh"
+#include "include/res_path_info.hh"
-namespace rsc_handler {
+namespace res_handler {
class ParamChecker {
public:
ReqType GetRequestType();
std::string GetPkgID() const;
uid_t GetUID() const;
- const std::list<RscPathInfo>& GetPathList() const;
+ const std::list<ResPathInfo>& GetPathList() const;
bool Validate();
private:
- std::list<RscPathInfo> path_info_list_;
+ std::list<ResPathInfo> path_info_list_;
std::string pkgid_;
std::string session_id_;
uid_t uid_ = 0;
bool ValidatePkgID();
};
-} // rsc_handler
+} // res_handler
#endif // PARAM_CHECKER_HH_
#include "include/abstract_request_handler.hh"
#include "include/error_type.hh"
-#include "include/rsc_path_info.hh"
+#include "include/res_path_info.hh"
-namespace rsc_handler {
+namespace res_handler {
class RemoveRequestHandler : public AbstractRequestHandler {
public:
RemoveRequestHandler(
std::string pkgid, std::string root_path,
- std::list<RscPathInfo> path_list);
+ std::list<ResPathInfo> path_list);
ErrorType Execute() override;
const std::string GetRequestHandlerType() const override;
};
-} // namespace rsc_handler
+} // namespace res_handler
#endif // REMOVE_REQUEST_HANDLER_HH_
#include "include/event_signal_sender.hh"
#include "include/param_checker.hh"
-namespace rsc_handler {
+namespace res_handler {
class RequestHandlerInvoker {
public:
void SetReqHandler();
};
-} // rsc_handler
+} // namespace res_handler
#endif // REQUEST_HANDLER_INVOKER_HH_
#ifndef REQUEST_TYPE_HH_
#define REQUEST_TYPE_HH_
-namespace rsc_handler {
+namespace res_handler {
enum ReqType {
REQ_TYPE_NEW = 0,
REQ_TYPE_UNKNOWN
};
-} // namespace rsc_handler
+} // namespace res_handler
#endif // REQUEST_TYPE_HH_
* limitations under the License.
*/
-#ifndef RSC_HANDLER_HH_
-#define RSC_HANDLER_HH_
+#ifndef RES_HANDLER_HH_
+#define RES_HANDLER_HH_
#include <memory>
#include "include/request_handler_invoker.hh"
-namespace rsc_handler {
+namespace res_handler {
-class RscHandler {
+class ResHandler {
public:
- RscHandler() {};
- //~RscHandler();
+ ResHandler() {};
bool Init(int argc, char* argv[]);
bool Run();
private:
- std::unique_ptr<rsc_handler::RequestHandlerInvoker> handler_;
+ std::unique_ptr<res_handler::RequestHandlerInvoker> handler_;
};
-} // rsc_handler
+} // namespace res_handler
-#endif // RSC_HANDLER_HH_
+#endif // RES_HANDLER_HH_
* limitations under the License.
*/
-#ifndef RSC_PATH_INFO_HH_
-#define RSC_PATH_INFO_HH_
+#ifndef RES_PATH_INFO_HH_
+#define RES_PATH_INFO_HH_
#include <string>
-namespace rsc_handler {
+namespace res_handler {
-class RscPathInfo {
+class ResPathInfo {
public:
- RscPathInfo(std::string src, std::string dst);
+ ResPathInfo(std::string src, std::string dst);
const std::string& GetSrcPath() const;
const std::string& GetDstPath() const;
std::string dst_;
};
-} // rsc_handler
+} // namespace res_handler
-#endif // RSC_PATH_INFO_HH_
+#endif // RES_PATH_INFO_HH_
#include "include/abstract_request_handler.hh"
#include "include/error_type.hh"
-#include "include/rsc_path_info.hh"
+#include "include/res_path_info.hh"
-namespace rsc_handler {
+namespace res_handler {
class UninstallRequestHandler : public AbstractRequestHandler {
public:
UninstallRequestHandler(
- std::string pkgid, std::string root_path, std::list<RscPathInfo> path_list);
+ std::string pkgid, std::string root_path, std::list<ResPathInfo> path_list);
ErrorType Execute() override;
const std::string GetRequestHandlerType() const override;
};
-} // namespace rsc_handler
+} // namespace res_handler
#endif // UNINSTALL_REQUEST_HANDLER_HH_
#include <iostream>
#include "include/request_type.hh"
-#include "include/rsc_path_info.hh"
+#include "include/res_path_info.hh"
-namespace rsc_handler {
+namespace res_handler {
std::string AbstractRequestHandler::GetRootPath() {
return root_path_;
return pkgid_;
}
-const std::list<RscPathInfo> AbstractRequestHandler::GetPathList() const {
+const std::list<ResPathInfo> AbstractRequestHandler::GetPathList() const {
return path_list_;
}
-} // namespace rsc_handler
+} // namespace res_handler
#include "include/logging.hh"
#include "include/request_type.hh"
-#include "include/rsc_path_info.hh"
+#include "include/res_path_info.hh"
#include <pkgmgr-info.h>
} // namespace
-namespace rsc_handler {
+namespace res_handler {
ConditionValidator::ConditionValidator(std::string pkgid, uid_t uid) :
pkgid_(pkgid), uid_(uid) {
}
ErrorType ConditionValidator::ValidateCondition(ReqType req_type,
- std::list<RscPathInfo> path_list) {
+ std::list<ResPathInfo> path_list) {
if (!IsPackageExists(pkgid_, uid_))
return ErrorType::ERROR_PKG_NOT_FOUND;
}
ErrorType ConditionValidator::CheckCopyRequest(
- std::list<RscPathInfo> path_list) {
+ std::list<ResPathInfo> path_list) {
boost::filesystem::path src_root_path(root_path_);
- uintmax_t rsc_size = 0;
+ uintmax_t res_size = 0;
src_root_path = src_root_path / "apps_rw" / pkgid_;
for (auto& path_info : path_list) {
- boost::filesystem::path rsc_path(src_root_path);
- rsc_path = rsc_path / path_info.GetSrcPath();
- if (!boost::filesystem::exists(rsc_path)) {
- LOG(ERROR) << "Resource not exists : " << rsc_path;
+ boost::filesystem::path res_path(src_root_path);
+ res_path = res_path / path_info.GetSrcPath();
+ if (!boost::filesystem::exists(res_path)) {
+ LOG(ERROR) << "Resource not exists : " << res_path;
return ErrorType::ERROR_RES_NOT_FOUND;
}
- if (boost::filesystem::is_directory(rsc_path))
- rsc_size += GetDirectorySize(rsc_path);
+ if (boost::filesystem::is_directory(res_path))
+ res_size += GetDirectorySize(res_path);
else
- rsc_size += boost::filesystem::file_size(rsc_path);
+ res_size += boost::filesystem::file_size(res_path);
+
}
- LOG(INFO) << "Required size for resource: " << rsc_size;
+ LOG(INFO) << "Required size for resource: " << res_size;
- if (!CheckFreeSpaceAtPath(static_cast<int64_t>(rsc_size), root_path_)) {
+ if (!CheckFreeSpaceAtPath(static_cast<int64_t>(res_size), root_path_)) {
LOG(ERROR) << "Not enough space for resource";
return ErrorType::ERROR_OUT_OF_SPACE;
}
}
ErrorType ConditionValidator::CheckRemoveRequest(
- std::list<RscPathInfo> path_list) {
+ std::list<ResPathInfo> path_list) {
for (auto& path_info : path_list) {
boost::filesystem::path dst_path(root_path_);
dst_path = dst_path / "shared_res"/ pkgid_ / path_info.GetDstPath();
return ErrorType::ERROR_NONE;
}
-} // namespace rsc_handler
+} // namespace res_handler
#include "include/error_type.hh"
#include "include/file_util.hh"
#include "include/logging.hh"
-#include "include/rsc_path_info.hh"
+#include "include/res_path_info.hh"
namespace bf = boost::filesystem;
} // namespace
-namespace rsc_handler {
+namespace res_handler {
CopyRequestHandler::CopyRequestHandler(
std::string pkgid, std::string root_path,
- std::list<RscPathInfo> path_list) :
+ std::list<ResPathInfo> path_list) :
AbstractRequestHandler(pkgid, root_path, path_list) {}
ErrorType CopyRequestHandler::Execute() {
return kCopyReqHandlerType;
}
-} // namespace rsc_handler
+} // namespace res_handler
#include "include/error_type.hh"
#include "include/request_type.hh"
-namespace rsc_handler {
+namespace res_handler {
bool EventSignalSender::SendStart() {
std::cout << "EventSignalSender::SendStart" << std::endl;
req_type_ = req_type;
}
-} // namespace rsc_handler
+} // namespace res_handler
namespace bs = boost::system;
namespace bf = boost::filesystem;
-namespace rsc_handler {
+namespace res_handler {
FSFlag operator|(FSFlag a, FSFlag b) {
return static_cast<FSFlag>(static_cast<int>(a) | static_cast<int>(b));
return true;
}
-} // namespace rsc_handler
+} // namespace res_handler
// Use of this source code is governed by a apache 2.0 license that can be
// found in the LICENSE file.
-#include "logging.hh"
+#include "include/logging.hh"
namespace utils {
#include "include/logging.hh"
#include "include/request_type.hh"
-#include "include/rsc_path_info.hh"
+#include "include/res_path_info.hh"
#include <pkgmgr-info.h>
namespace bs = boost::system;
namespace bpo = boost::program_options;
-namespace rsc_handler {
+namespace res_handler {
ParamChecker::ParamChecker(int argc, char* argv[]) {
bpo::options_description options;
return req_type_;
}
-const std::list<RscPathInfo>& ParamChecker::GetPathList() const {
+const std::list<ResPathInfo>& ParamChecker::GetPathList() const {
return path_info_list_;
}
return true;
}
-} // namespace rsc_handler
+} // namespace res_handler
#include "include/error_type.hh"
#include "include/file_util.hh"
#include "include/logging.hh"
-#include "include/rsc_path_info.hh"
+#include "include/res_path_info.hh"
namespace bf = boost::filesystem;
} // namespace
-namespace rsc_handler {
+namespace res_handler {
RemoveRequestHandler::RemoveRequestHandler(
std::string pkgid, std::string root_path,
- std::list<RscPathInfo> path_list) :
+ std::list<ResPathInfo> path_list) :
AbstractRequestHandler(pkgid, root_path, path_list) {}
ErrorType RemoveRequestHandler::Execute() {
return kRemoveReqHandlerType;
}
-} // namespace rsc_handler
+} // namespace res_handler
} // namespace
-namespace rsc_handler {
+namespace res_handler {
RequestHandlerInvoker::RequestHandlerInvoker(
ParamChecker option, EventSignalSender signal) :
}
}
-} // namespace rsc_handler
+} // namespace res_handler
#include <iostream>
-#include "include/rsc_handler.hh"
+#include "include/res_handler.hh"
#include "include/logging.hh"
int main(int argc, char *argv[]) {
try {
- rsc_handler::RscHandler handler;
+ res_handler::ResHandler handler;
if (!handler.Init(argc, argv)) {
LOG(ERROR) << "Failed to initliaze handler";
return -1;
* limitations under the License.
*/
-#include "include/rsc_handler.hh"
+#include "include/res_handler.hh"
#include <iostream>
#include "include/param_checker.hh"
#include "include/request_handler_invoker.hh"
-namespace rsc_handler {
+namespace res_handler {
-bool RscHandler::Init(int argc, char* argv[]) {
- rsc_handler::ParamChecker option(argc, argv);
+bool ResHandler::Init(int argc, char* argv[]) {
+ res_handler::ParamChecker option(argc, argv);
if (!option.Validate()) {
LOG(ERROR) << "Invalid argument has given";
return false;
}
- rsc_handler::EventSignalSender signal;
+ res_handler::EventSignalSender signal;
signal.SetPkgID(option.GetPkgID());
signal.SetReqType(option.GetRequestType());
- handler_.reset(new rsc_handler::RequestHandlerInvoker(option, signal));
+ handler_.reset(new res_handler::RequestHandlerInvoker(option, signal));
if (!handler_->Validate()) {
LOG(ERROR) << "Failed to initialize request handler";
return false;
return true;
}
-bool RscHandler::Run() {
+bool ResHandler::Run() {
return handler_->Execute();
}
-} // namespace rsc_handler
+} // namespace res_handler
* limitations under the License.
*/
-#include "include/rsc_path_info.hh"
+#include "include/res_path_info.hh"
#include <iostream>
#include <string>
-namespace rsc_handler {
+namespace res_handler {
-RscPathInfo::RscPathInfo(std::string src, std::string dst) :
+ResPathInfo::ResPathInfo(std::string src, std::string dst) :
src_(src), dst_(dst) {}
-const std::string& RscPathInfo::GetSrcPath() const {
+const std::string& ResPathInfo::GetSrcPath() const {
return src_;
}
-const std::string& RscPathInfo::GetDstPath() const {
+const std::string& ResPathInfo::GetDstPath() const {
return dst_;
}
-} // namespace rsc_handler
+} // namespace res_handler
#include "include/error_type.hh"
#include "include/file_util.hh"
#include "include/logging.hh"
-#include "include/rsc_path_info.hh"
+#include "include/res_path_info.hh"
namespace bf = boost::filesystem;
} // namespace
-namespace rsc_handler {
+namespace res_handler {
UninstallRequestHandler::UninstallRequestHandler(
std::string pkgid, std::string root_path,
- std::list<RscPathInfo> path_list) :
+ std::list<ResPathInfo> path_list) :
AbstractRequestHandler(pkgid, root_path, path_list) {}
ErrorType UninstallRequestHandler::Execute() {
return kUninstallReqHandlerType;
}
-} // namespace rsc_handler
+} // namespace res_handler
ADD_DEFINITIONS("-DDB_PATH=\"${DB_PATH}\"")
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../src/pkg_upgrade/include)
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../src/rsc-copy/)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../src/res-copy/)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../)
#pkg_upgrade
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../../src/pkg_upgrade/src PKG_UPGRADE_LIB_SOURCES)
LIST(REMOVE_ITEM PKG_UPGRADE_LIB_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../../src/pkg_upgrade/src/main.cc)
-#rsc-copy
-AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/rsc-copy/src RSC_COPY_SRCS)
-AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../../src/rsc-copy/src RSC_COPY_LIB_SOURCES)
-LIST(REMOVE_ITEM RSC_COPY_LIB_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../../src/rsc-copy/src/rsc_copy_main.cc)
-LIST(REMOVE_ITEM RSC_COPY_LIB_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../../src/rsc-copy/src/logging.cc)
+#res-copy
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/res-copy/src RES_COPY_SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../../src/res-copy/src RES_COPY_LIB_SOURCES)
+LIST(REMOVE_ITEM RES_COPY_LIB_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../../src/res-copy/src/res_copy_main.cc)
+LIST(REMOVE_ITEM RES_COPY_LIB_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../../src/res-copy/src/logging.cc)
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../mock MOCK_SOURCES)
ADD_EXECUTABLE(${PROJECT_NAME}
${PKG_UPGRADE_SRCS}
- ${RSC_COPY_SRCS}
+ ${RES_COPY_SRCS}
${MOCK_SOURCES}
${PKG_UPGRADE_LIB_SOURCES}
- ${RSC_COPY_LIB_SOURCES}
+ ${RES_COPY_LIB_SOURCES}
test_main.cc
)
using ::testing::InvokeArgument;
using ::testing::SaveArg;
-using rsc_handler::ConditionValidator;
-using rsc_handler::ParamChecker;
+using res_handler::ConditionValidator;
+using res_handler::ParamChecker;
class Mocks : public ::testing::NiceMock<PkgMgrInfoMock>,
public ::testing::NiceMock<OsMock> {};
EXPECT_CALL(GetMock<PkgMgrInfoMock>(), pkgmgrinfo_pkginfo_get_usr_pkginfo(_, _, _))
.WillRepeatedly(Return(-1));
- const char *argv[] = { "/bin/rsc-copy", "--uid", "5001", "--copy",
+ const char *argv[] = { "/bin/res-copy", "--uid", "5001", "--copy",
"org.test.targetpkgid", "-p", "srcpath", "dstpath", nullptr};
ParamChecker checker(8, (char**)argv);
ConditionValidator validator(checker.GetPkgID(), checker.GetUID());
- rsc_handler::ErrorType ret = validator.ValidateCondition(
+ res_handler::ErrorType ret = validator.ValidateCondition(
checker.GetRequestType(), checker.GetPathList());
- EXPECT_EQ(ret, rsc_handler::ErrorType::ERROR_PKG_NOT_FOUND);
+ EXPECT_EQ(ret, res_handler::ErrorType::ERROR_PKG_NOT_FOUND);
}
TEST_F(ConditionValidatorTest, CopyPkgNotExist) {
EXPECT_CALL(GetMock<PkgMgrInfoMock>(), pkgmgrinfo_pkginfo_get_usr_pkginfo(_, _, _))
.WillRepeatedly(Return(-1));
- const char *argv[] = { "/bin/rsc-copy", "--uid", "5001", "--copy",
+ const char *argv[] = { "/bin/res-copy", "--uid", "5001", "--copy",
"org.test.targetpkgid", "-p", "srcpath", "dstpath", nullptr};
ParamChecker checker(8, (char**)argv);
ConditionValidator validator(checker.GetPkgID(), checker.GetUID());
- rsc_handler::ErrorType ret = validator.ValidateCondition(
+ res_handler::ErrorType ret = validator.ValidateCondition(
checker.GetRequestType(), checker.GetPathList());
- EXPECT_EQ(ret, rsc_handler::ErrorType::ERROR_PKG_NOT_FOUND);
+ EXPECT_EQ(ret, res_handler::ErrorType::ERROR_PKG_NOT_FOUND);
}
TEST_F(ConditionValidatorTest, CopySrcNotExist) {
- const char *argv[] = { "/bin/rsc-copy", "--uid", "5001", "--copy",
+ const char *argv[] = { "/bin/res-copy", "--uid", "5001", "--copy",
"org.test.targetpkgid", "-p", "srcpath", "dstpath", nullptr};
ParamChecker checker(8, (char**)argv);
ConditionValidator validator(checker.GetPkgID(), checker.GetUID());
- rsc_handler::ErrorType ret = validator.ValidateCondition(
+ res_handler::ErrorType ret = validator.ValidateCondition(
checker.GetRequestType(), checker.GetPathList());
- EXPECT_EQ(ret, rsc_handler::ErrorType::ERROR_RES_NOT_FOUND);
+ EXPECT_EQ(ret, res_handler::ErrorType::ERROR_RES_NOT_FOUND);
}
TEST_F(ConditionValidatorTest, RemovePkgNotExist) {
EXPECT_CALL(GetMock<PkgMgrInfoMock>(), pkgmgrinfo_pkginfo_get_usr_pkginfo(_, _, _))
.WillRepeatedly(Return(-1));
- const char *argv[] = { "/bin/rsc-copy", "--uid", "5001", "--remove",
+ const char *argv[] = { "/bin/res-copy", "--uid", "5001", "--remove",
"org.test.targetpkgid", "-p", "", "dstpath", nullptr};
ParamChecker checker(8, (char**)argv);
ConditionValidator validator(checker.GetPkgID(), checker.GetUID());
- rsc_handler::ErrorType ret = validator.ValidateCondition(
+ res_handler::ErrorType ret = validator.ValidateCondition(
checker.GetRequestType(), checker.GetPathList());
- EXPECT_EQ(ret, rsc_handler::ErrorType::ERROR_PKG_NOT_FOUND);
+ EXPECT_EQ(ret, res_handler::ErrorType::ERROR_PKG_NOT_FOUND);
}
TEST_F(ConditionValidatorTest, RemoveSrcNotExist) {
- const char *argv[] = { "/bin/rsc-copy", "--uid", "5001", "--remove",
+ const char *argv[] = { "/bin/res-copy", "--uid", "5001", "--remove",
"org.test.targetpkgid", "-p", "", "dstpath", nullptr};
ParamChecker checker(8, (char**)argv);
ConditionValidator validator(checker.GetPkgID(), checker.GetUID());
- rsc_handler::ErrorType ret = validator.ValidateCondition(
+ res_handler::ErrorType ret = validator.ValidateCondition(
checker.GetRequestType(), checker.GetPathList());
- EXPECT_EQ(ret, rsc_handler::ErrorType::ERROR_RES_NOT_FOUND);
+ EXPECT_EQ(ret, res_handler::ErrorType::ERROR_RES_NOT_FOUND);
}
TEST_F(ConditionValidatorTest, DeletePkgNotExist) {
EXPECT_CALL(GetMock<PkgMgrInfoMock>(), pkgmgrinfo_pkginfo_get_usr_pkginfo(_, _, _))
.WillRepeatedly(Return(-1));
- const char *argv[] = { "/bin/rsc-copy", "--uid", "5001", "--delete",
+ const char *argv[] = { "/bin/res-copy", "--uid", "5001", "--delete",
"org.test.targetpkgid", nullptr};
ParamChecker checker(5, (char**)argv);
ConditionValidator validator(checker.GetPkgID(), checker.GetUID());
- rsc_handler::ErrorType ret = validator.ValidateCondition(
+ res_handler::ErrorType ret = validator.ValidateCondition(
checker.GetRequestType(), checker.GetPathList());
- EXPECT_EQ(ret, rsc_handler::ErrorType::ERROR_PKG_NOT_FOUND);
+ EXPECT_EQ(ret, res_handler::ErrorType::ERROR_PKG_NOT_FOUND);
}
using ::testing::InvokeArgument;
using ::testing::SaveArg;
-using rsc_handler::ParamChecker;
+using res_handler::ParamChecker;
class Mocks : public ::testing::NiceMock<PkgMgrInfoMock>,
public ::testing::NiceMock<OsMock> {};
};
TEST_F(ParamCheckerTest, InvalidUIDTest) {
- const char *argv[] = { "/bin/rsc-copy", "--uid", "0", "--copy",
+ const char *argv[] = { "/bin/res-copy", "--uid", "0", "--copy",
"org.test.targetpkgid", "-p", "srcpath", "dstpath", nullptr};
ParamChecker checker(8, (char**)argv);
}
TEST_F(ParamCheckerTest, PkgIDNotGiven) {
- const char *argv[] = { "/bin/rsc-copy", "--uid", "5001",
+ const char *argv[] = { "/bin/res-copy", "--uid", "5001",
"-p", "srcpath", "dstpath", "--copy", "", nullptr};
ParamChecker checker(8, (char**)argv);
EXPECT_EQ(checker.Validate(), false);
}
-TEST_F(ParamCheckerTest, CopyRsc) {
- const char *argv[] = { "/bin/rsc-copy", "--uid", "5001", "-p", "srcpath", "dstpath",
+TEST_F(ParamCheckerTest, CopyRes) {
+ const char *argv[] = { "/bin/res-copy", "--uid", "5001", "-p", "srcpath", "dstpath",
"--copy", "org.test.targetpkgid", nullptr};
ParamChecker checker(8, (char**)argv);
EXPECT_EQ(checker.Validate(), true);
- EXPECT_EQ(checker.GetRequestType(), rsc_handler::ReqType::REQ_TYPE_NEW);
+ EXPECT_EQ(checker.GetRequestType(), res_handler::ReqType::REQ_TYPE_NEW);
EXPECT_EQ(checker.GetPkgID(), "org.test.targetpkgid");
EXPECT_EQ(checker.GetPathList().size(), 1);
EXPECT_EQ(checker.GetUID(), 5001);
}
-TEST_F(ParamCheckerTest, RemoveRsc) {
- const char *argv[] = { "/bin/rsc-copy", "--uid", "5001", "--remove",
+TEST_F(ParamCheckerTest, RemoveRes) {
+ const char *argv[] = { "/bin/res-copy", "--uid", "5001", "--remove",
"org.test.targetpkgid", "-p", "dstpath", nullptr};
ParamChecker checker(7, (char**)argv);
EXPECT_EQ(checker.Validate(), true);
- EXPECT_EQ(checker.GetRequestType(), rsc_handler::ReqType::REQ_TYPE_REMOVE);
+ EXPECT_EQ(checker.GetRequestType(), res_handler::ReqType::REQ_TYPE_REMOVE);
EXPECT_EQ(checker.GetPkgID(), "org.test.targetpkgid");
EXPECT_EQ(checker.GetPathList().size(), 1);
EXPECT_EQ(checker.GetUID(), 5001);
}
-TEST_F(ParamCheckerTest, DeleteRsc) {
- const char *argv[] = { "/bin/rsc-copy", "--uid", "5001", "--delete",
+TEST_F(ParamCheckerTest, DeleteRes) {
+ const char *argv[] = { "/bin/res-copy", "--uid", "5001", "--delete",
"org.test.targetpkgid", nullptr};
ParamChecker checker(5, (char**)argv);
EXPECT_EQ(checker.Validate(), true);
- EXPECT_EQ(checker.GetRequestType(), rsc_handler::ReqType::REQ_TYPE_UNINSTALL);
+ EXPECT_EQ(checker.GetRequestType(), res_handler::ReqType::REQ_TYPE_UNINSTALL);
EXPECT_EQ(checker.GetPkgID(), "org.test.targetpkgid");
EXPECT_EQ(checker.GetPathList().size(), 0);
EXPECT_EQ(checker.GetUID(), 5001);
}
TEST_F(ParamCheckerTest, EmptyPkgID) {
- const char *argv[] = { "/bin/rsc-copy", "--uid", "5001", "--copy",
+ const char *argv[] = { "/bin/res-copy", "--uid", "5001", "--copy",
"", "-p", "srcpath", "dstpath", nullptr};
ParamChecker checker(8,(char**)argv);
}
TEST_F(ParamCheckerTest, UnknownReqType) {
- const char *argv[] = { "/bin/rsc-copy", "--uid", "5001", "-p",
+ const char *argv[] = { "/bin/res-copy", "--uid", "5001", "-p",
"srcpath", "dstpath", nullptr};
ParamChecker checker(6, (char**)argv);
}
TEST_F(ParamCheckerTest, PathNotGiven) {
- const char *argv[] = { "/bin/rsc-copy", "--uid", "5001",
+ const char *argv[] = { "/bin/res-copy", "--uid", "5001",
"-c", "org.tizen.pathnotgiven", nullptr};
ParamChecker checker(5, (char**)argv);
using ::testing::InvokeArgument;
using ::testing::SaveArg;
-using rsc_handler::CopyRequestHandler;
-using rsc_handler::RemoveRequestHandler;
-using rsc_handler::RscPathInfo;
-using rsc_handler::UninstallRequestHandler;
+using res_handler::CopyRequestHandler;
+using res_handler::RemoveRequestHandler;
+using res_handler::ResPathInfo;
+using res_handler::UninstallRequestHandler;
namespace bf = boost::filesystem;
namespace bs = boost::system;
rootpath / "shared_res/test_pkg/dest_dir");
}
virtual void TearDown() {
- bf::remove_all("./tests/unit_tests/rsc-copy/data/shared_res/test_pkg");
+ bf::remove_all("./tests/unit_tests/res-copy/data/shared_res/test_pkg");
}
- std::string root_path = "./tests/unit_tests/rsc-copy/data";
+ std::string root_path = "./tests/unit_tests/res-copy/data";
};
class RemoveRequestHandlerTest : public TestFixture {
rootpath / "shared_res/test_pkg/new_dir/new_dir2/resource_file.txt");
}
virtual void TearDown() {
- bf::remove_all("./tests/unit_tests/rsc-copy/data/shared_res/test_pkg");
+ bf::remove_all("./tests/unit_tests/res-copy/data/shared_res/test_pkg");
}
- std::string root_path = "./tests/unit_tests/rsc-copy/data";
+ std::string root_path = "./tests/unit_tests/res-copy/data";
};
class UninstallRequestHandlerTest : public TestFixture {
rootpath / "shared_res/test_pkg");
}
virtual void TearDown() {
- bf::remove_all("./tests/unit_tests/rsc-copy/data/shared_res/test_pkg");
+ bf::remove_all("./tests/unit_tests/res-copy/data/shared_res/test_pkg");
}
- std::string root_path = "./tests/unit_tests/rsc-copy/data";
+ std::string root_path = "./tests/unit_tests/res-copy/data";
};
TEST_F(CopyRequestHandlerTest, CopyFileAtRootToRoot) {
- std::list<RscPathInfo> path_list;
+ std::list<ResPathInfo> path_list;
path_list.emplace_back("data/resource_file.txt", "");
CopyRequestHandler handler("test_pkg", root_path, path_list);
- EXPECT_EQ(handler.Execute(), rsc_handler::ErrorType::ERROR_NONE);
+ EXPECT_EQ(handler.Execute(), res_handler::ErrorType::ERROR_NONE);
bf::path check_path(root_path + "/shared_res/test_pkg");
EXPECT_TRUE(bf::exists(check_path));
}
TEST_F(CopyRequestHandlerTest, CopyFileAtRootToRoot_ChangeFileName) {
- std::list<RscPathInfo> path_list;
+ std::list<ResPathInfo> path_list;
path_list.emplace_back("data/resource_file.txt", "another_name.txt");
CopyRequestHandler handler("test_pkg", root_path, path_list);
- EXPECT_EQ(handler.Execute(), rsc_handler::ErrorType::ERROR_NONE);
+ EXPECT_EQ(handler.Execute(), res_handler::ErrorType::ERROR_NONE);
bf::path check_path(root_path + "/shared_res/test_pkg");
EXPECT_TRUE(bf::exists(check_path));
}
TEST_F(CopyRequestHandlerTest, CopyFileAtRootToDirectory) {
- std::list<RscPathInfo> path_list;
+ std::list<ResPathInfo> path_list;
path_list.emplace_back("data/resource_file.txt", "dest_dir");
CopyRequestHandler handler("test_pkg", root_path, path_list);
- EXPECT_EQ(handler.Execute(), rsc_handler::ErrorType::ERROR_NONE);
+ EXPECT_EQ(handler.Execute(), res_handler::ErrorType::ERROR_NONE);
bf::path check_path(root_path + "/shared_res/test_pkg");
EXPECT_TRUE(bf::exists(check_path));
}
TEST_F(CopyRequestHandlerTest, CopyFileAtRootToDirectory_ChangeFileName) {
- std::list<RscPathInfo> path_list;
+ std::list<ResPathInfo> path_list;
path_list.emplace_back("data/resource_file.txt", "dest_dir/newname.txt");
CopyRequestHandler handler("test_pkg", root_path, path_list);
- EXPECT_EQ(handler.Execute(), rsc_handler::ErrorType::ERROR_NONE);
+ EXPECT_EQ(handler.Execute(), res_handler::ErrorType::ERROR_NONE);
bf::path check_path(root_path + "/shared_res/test_pkg");
EXPECT_TRUE(bf::exists(check_path));
}
TEST_F(CopyRequestHandlerTest, CopyFileAtDirectoryToRoot) {
- std::list<RscPathInfo> path_list;
+ std::list<ResPathInfo> path_list;
path_list.emplace_back("data/resource_dir1/resource_file3.txt", "");
CopyRequestHandler handler("test_pkg", root_path, path_list);
- EXPECT_EQ(handler.Execute(), rsc_handler::ErrorType::ERROR_NONE);
+ EXPECT_EQ(handler.Execute(), res_handler::ErrorType::ERROR_NONE);
bf::path check_path(root_path + "/shared_res/test_pkg");
EXPECT_TRUE(bf::exists(check_path));
}
TEST_F(CopyRequestHandlerTest, CopyFileAtDirectoryToRoot_ChangeFileName) {
- std::list<RscPathInfo> path_list;
+ std::list<ResPathInfo> path_list;
path_list.emplace_back(
"data/resource_dir1/resource_file3.txt", "newname.txt");
CopyRequestHandler handler("test_pkg", root_path, path_list);
- EXPECT_EQ(handler.Execute(), rsc_handler::ErrorType::ERROR_NONE);
+ EXPECT_EQ(handler.Execute(), res_handler::ErrorType::ERROR_NONE);
bf::path check_path(root_path + "/shared_res/test_pkg");
EXPECT_TRUE(bf::exists(check_path));
}
TEST_F(CopyRequestHandlerTest, CopyFileAtDirectoryToDirectory) {
- std::list<RscPathInfo> path_list;
+ std::list<ResPathInfo> path_list;
path_list.emplace_back("data/resource_dir1/resource_file3.txt", "dest_dir");
CopyRequestHandler handler("test_pkg", root_path, path_list);
- EXPECT_EQ(handler.Execute(), rsc_handler::ErrorType::ERROR_NONE);
+ EXPECT_EQ(handler.Execute(), res_handler::ErrorType::ERROR_NONE);
bf::path check_path(root_path + "/shared_res/test_pkg");
EXPECT_TRUE(bf::exists(check_path));
EXPECT_TRUE(bf::exists(check_path));
}
-TEST_F(CopyRequestHandlerTest, CopyFileAtDirectoryToDirectory_ChangeFileName) {
- std::list<RscPathInfo> path_list;
+TEST_F(CopyRequestHandlerTest, CopyDirectoryAtRootToRoot_ChangeFileName) {
+ std::list<ResPathInfo> path_list;
path_list.emplace_back(
- "data/resource_dir1/resource_file3.txt", "dest_dir/newname.txt");
+ "data/resource_dir1/resource_file3.txt", "dest_dir/newname.txt");
CopyRequestHandler handler("test_pkg", root_path, path_list);
- EXPECT_EQ(handler.Execute(), rsc_handler::ErrorType::ERROR_NONE);
+ EXPECT_EQ(handler.Execute(), res_handler::ErrorType::ERROR_NONE);
bf::path check_path(root_path + "/shared_res/test_pkg");
EXPECT_TRUE(bf::exists(check_path));
}
TEST_F(CopyRequestHandlerTest, CopyDirectoryAtRootToRoot) {
- std::list<RscPathInfo> path_list;
+ std::list<ResPathInfo> path_list;
path_list.emplace_back("data/resource_dir1", "");
CopyRequestHandler handler("test_pkg", root_path, path_list);
- EXPECT_EQ(handler.Execute(), rsc_handler::ErrorType::ERROR_NONE);
+ EXPECT_EQ(handler.Execute(), res_handler::ErrorType::ERROR_NONE);
bf::path check_path(root_path + "/shared_res/test_pkg");
EXPECT_TRUE(bf::exists(check_path));
}
TEST_F(CopyRequestHandlerTest, CopyDirectoryAtRootToDirectory) {
- std::list<RscPathInfo> path_list;
+ std::list<ResPathInfo> path_list;
path_list.emplace_back("data/resource_dir1", "dest_dir");
CopyRequestHandler handler("test_pkg", root_path, path_list);
- EXPECT_EQ(handler.Execute(), rsc_handler::ErrorType::ERROR_NONE);
+ EXPECT_EQ(handler.Execute(), res_handler::ErrorType::ERROR_NONE);
bf::path check_path(root_path + "/shared_res/test_pkg");
EXPECT_TRUE(bf::exists(check_path));
}
TEST_F(CopyRequestHandlerTest, CopyDirectoryAtRootToDirectory2) {
- std::list<RscPathInfo> path_list;
+ std::list<ResPathInfo> path_list;
path_list.emplace_back("data/resource_dir1", "resource_dir1");
CopyRequestHandler handler("test_pkg", root_path, path_list);
- EXPECT_EQ(handler.Execute(), rsc_handler::ErrorType::ERROR_NONE);
+ EXPECT_EQ(handler.Execute(), res_handler::ErrorType::ERROR_NONE);
bf::path check_path(root_path + "/shared_res/test_pkg");
EXPECT_TRUE(bf::exists(check_path));
}
TEST_F(CopyRequestHandlerTest, CopyDirectoryAtDirectoryToRoot) {
- std::list<RscPathInfo> path_list;
+ std::list<ResPathInfo> path_list;
path_list.emplace_back("data/resource_dir1/resource_dir2", "");
CopyRequestHandler handler("test_pkg", root_path, path_list);
- EXPECT_EQ(handler.Execute(), rsc_handler::ErrorType::ERROR_NONE);
+ EXPECT_EQ(handler.Execute(), res_handler::ErrorType::ERROR_NONE);
bf::path check_path(root_path + "/shared_res/test_pkg");
EXPECT_TRUE(bf::exists(check_path));
}
TEST_F(CopyRequestHandlerTest, CopyDirectoryAtDirectoryToDirectory) {
- std::list<RscPathInfo> path_list;
+ std::list<ResPathInfo> path_list;
path_list.emplace_back("data/resource_dir1/resource_dir2", "dest_dir");
CopyRequestHandler handler("test_pkg", root_path, path_list);
- EXPECT_EQ(handler.Execute(), rsc_handler::ErrorType::ERROR_NONE);
+ EXPECT_EQ(handler.Execute(), res_handler::ErrorType::ERROR_NONE);
bf::path check_path(root_path + "/shared_res/test_pkg");
EXPECT_TRUE(bf::exists(check_path));
EXPECT_TRUE(bf::exists(check_path));
}
-TEST_F(CopyRequestHandlerTest, RscNotexists) {
- std::list<RscPathInfo> path_list;
- path_list.emplace_back("data/not_existed_rsc", "new_dir");
+TEST_F(CopyRequestHandlerTest, ResNotexists) {
+ std::list<ResPathInfo> path_list;
+ path_list.emplace_back("data/not_existed_res", "new_dir");
CopyRequestHandler handler("test_pkg", root_path, path_list);
- EXPECT_EQ(handler.Execute(), rsc_handler::ErrorType::ERROR_RES_NOT_FOUND);
+ EXPECT_EQ(handler.Execute(), res_handler::ErrorType::ERROR_RES_NOT_FOUND);
}
-TEST_F(CopyRequestHandlerTest, ReplaceRsc) {
- std::list<RscPathInfo> path_list;
+TEST_F(CopyRequestHandlerTest, ReplaceRes) {
+ std::list<ResPathInfo> path_list;
path_list.emplace_back("data/resource_file.txt", "new_dir");
CopyRequestHandler handler("test_pkg", root_path, path_list);
- EXPECT_EQ(handler.Execute(), rsc_handler::ErrorType::ERROR_NONE);
+ EXPECT_EQ(handler.Execute(), res_handler::ErrorType::ERROR_NONE);
CopyRequestHandler replace_handler("test_pkg", root_path, path_list);
- EXPECT_EQ(handler.Execute(), rsc_handler::ErrorType::ERROR_NONE);
+ EXPECT_EQ(handler.Execute(), res_handler::ErrorType::ERROR_NONE);
}
TEST_F(RemoveRequestHandlerTest, RemoveFileAtRoot) {
- std::list<RscPathInfo> path_list;
+ std::list<ResPathInfo> path_list;
path_list.emplace_back("resource_file.txt", "");
RemoveRequestHandler handler("test_pkg", root_path, path_list);
- EXPECT_EQ(handler.Execute(), rsc_handler::ErrorType::ERROR_NONE);
+ EXPECT_EQ(handler.Execute(), res_handler::ErrorType::ERROR_NONE);
bf::path check_path(root_path + "/shared_res/test_pkg/resource_file.txt");
EXPECT_FALSE(bf::exists(check_path));
}
TEST_F(RemoveRequestHandlerTest, RemoveFileAtDirectory) {
- std::list<RscPathInfo> path_list;
+ std::list<ResPathInfo> path_list;
path_list.emplace_back("new_dir/resource_file.txt", "");
RemoveRequestHandler handler("test_pkg", root_path, path_list);
- EXPECT_EQ(handler.Execute(), rsc_handler::ErrorType::ERROR_NONE);
+ EXPECT_EQ(handler.Execute(), res_handler::ErrorType::ERROR_NONE);
bf::path check_path(
root_path + "/shared_res/test_pkg/new_dir/resource_file.txt");
}
TEST_F(RemoveRequestHandlerTest, RemoveDirectoryAtRoot) {
- std::list<RscPathInfo> path_list;
+ std::list<ResPathInfo> path_list;
path_list.emplace_back("new_dir", "");
RemoveRequestHandler handler("test_pkg", root_path, path_list);
- EXPECT_EQ(handler.Execute(), rsc_handler::ErrorType::ERROR_NONE);
+ EXPECT_EQ(handler.Execute(), res_handler::ErrorType::ERROR_NONE);
bf::path check_path(root_path + "/shared_res/test_pkg/new_dir");
EXPECT_FALSE(bf::exists(check_path));
}
TEST_F(RemoveRequestHandlerTest, RemoveDirectoryAtDirectory) {
- std::list<RscPathInfo> path_list;
+ std::list<ResPathInfo> path_list;
path_list.emplace_back("new_dir/new_dir2", "");
RemoveRequestHandler handler("test_pkg", root_path, path_list);
- EXPECT_EQ(handler.Execute(), rsc_handler::ErrorType::ERROR_NONE);
+ EXPECT_EQ(handler.Execute(), res_handler::ErrorType::ERROR_NONE);
bf::path check_path(root_path + "/shared_res/test_pkg/new_dir/new_dir2");
EXPECT_FALSE(bf::exists(check_path));
}
TEST_F(UninstallRequestHandlerTest, RemoveRootPath) {
- std::list<RscPathInfo> path_list;
+ std::list<ResPathInfo> path_list;
UninstallRequestHandler handler("test_pkg", root_path, path_list);
- EXPECT_EQ(handler.Execute(), rsc_handler::ErrorType::ERROR_NONE);
+ EXPECT_EQ(handler.Execute(), res_handler::ErrorType::ERROR_NONE);
bf::path check_path(root_path + "/shared_res/test_pkg/");
EXPECT_FALSE(bf::exists(check_path));
}
TEST_F(UninstallRequestHandlerTest, RootNotExists) {
- std::list<RscPathInfo> path_list;
+ std::list<ResPathInfo> path_list;
bf::path check_path(root_path + "/shared_res/test_pkg/");
bf::remove_all(check_path);
UninstallRequestHandler handler("test_pkg", root_path, path_list);
- EXPECT_EQ(handler.Execute(), rsc_handler::ErrorType::ERROR_NONE);
+ EXPECT_EQ(handler.Execute(), res_handler::ErrorType::ERROR_NONE);
}
TEST_F(UninstallRequestHandlerTest, EmptyPkgID) {
- std::list<RscPathInfo> path_list;
+ std::list<ResPathInfo> path_list;
UninstallRequestHandler handler("", root_path, path_list);
EXPECT_EQ(handler.Execute(),
- rsc_handler::ErrorType::ERROR_INVALID_PARAMETER);
+ res_handler::ErrorType::ERROR_INVALID_PARAMETER);
}
using ::testing::InvokeArgument;
using ::testing::SaveArg;
-using rsc_handler::ParamChecker;
-using rsc_handler::RequestHandlerInvoker;
+using res_handler::ParamChecker;
+using res_handler::RequestHandlerInvoker;
class Mocks : public ::testing::NiceMock<PkgMgrInfoMock>,
public ::testing::NiceMock<OsMock> {};
public:
RequestHandlerInvokerTest() : TestFixture(std::make_unique<Mocks>()) {
signal_sender_.SetPkgID("org.tizen.targepkgid");
- signal_sender_.SetReqType(rsc_handler::ReqType::REQ_TYPE_UNKNOWN);
+ signal_sender_.SetReqType(res_handler::ReqType::REQ_TYPE_UNKNOWN);
}
virtual ~RequestHandlerInvokerTest() {}
virtual void SetUp() {}
virtual void TearDown() {}
- rsc_handler::EventSignalSender signal_sender_;
+ res_handler::EventSignalSender signal_sender_;
};
TEST_F(RequestHandlerInvokerTest, CopyType) {
- const char *argv[] = { "/bin/rsc-copy", "--uid", "5001", "--copy",
+ const char *argv[] = { "/bin/res-copy", "--uid", "5001", "--copy",
"org.test.targetpkgid", "-p", "srcpath", "dstpath", nullptr};
ParamChecker checker(8, (char**)argv);
}
TEST_F(RequestHandlerInvokerTest, RemoveType) {
- const char *argv[] = { "/bin/rsc-copy", "--uid", "5001", "--remove",
+ const char *argv[] = { "/bin/res-copy", "--uid", "5001", "--remove",
"org.test.targetpkgid", "-p", "", "dstpath", nullptr};
ParamChecker checker(8, (char**)argv);
}
TEST_F(RequestHandlerInvokerTest, UninstallType) {
- const char *argv[] = { "/bin/rsc-copy", "--uid", "5001", "--delete",
+ const char *argv[] = { "/bin/res-copy", "--uid", "5001", "--delete",
"org.test.targetpkgid", nullptr};
ParamChecker checker(5, (char**)argv);
}
TEST_F(RequestHandlerInvokerTest, InvalidType) {
- const char *argv[] = { "/bin/rsc-copy", "--uid", "5001", nullptr};
+ const char *argv[] = { "/bin/res-copy", "--uid", "5001", nullptr};
ParamChecker checker(3, (char**)argv);
RequestHandlerInvoker request_handler_invoker(checker, signal_sender_);