hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TaskReducersManagerFactoryTest.cpp
Go to the documentation of this file.
1 /*
2  * TaskReducersManagerFactoryTest.cpp
3  *
4  * Created on: Dec 16, 2013
5  * Author: igor
6  */
7 #include <gtest/gtest.h>
9 
10 using namespace std;
11 using namespace Poco;
12 using namespace HCE;
13 using namespace HCE::reduce;
14 using namespace HCE::reduce::additions;
15 using namespace HCE::sphinx::reduce_task;
16 
17 TEST(TaskReducersManagerFactory, createSphinxTaskReducersManager)
18 {
19  TaskReducersManagerFactory taskReducersManagerFactory;
20 
21  SharedPtr<TaskReducersManagerIf> sphinxTaskReducersManager =
22  taskReducersManagerFactory.build(HCE::types::MessageType::mtSphinx);
23 
24  ASSERT_TRUE(typeid(SphinxTaskReducersManager) == typeid(*sphinxTaskReducersManager.get()));
25 }
26 
27 
28 TEST(TaskReducersManagerFactory, DRCETaskReducersManager)
29 {
30  TaskReducersManagerFactory taskReducersManagerFactory;
31 
32  SharedPtr<TaskReducersManagerIf> drceTaskReducersManager =
33  taskReducersManagerFactory.build(HCE::types::MessageType::mtDrce);
34 
35  ASSERT_TRUE(typeid(drce::reduce_task::DRCETaskReducersManager) == typeid(*drceTaskReducersManager.get()));
36 }
37 
38 
39 TEST(TaskReducersManagerFactory, throwNotFoundByKeyExceptionForUnsupportManagerTypes)
40 {
41  HCE::types::MessageType unsupportManagerType = HCE::types::MessageType::mtSqlite;
42  TaskReducersManagerFactory taskReducersManagerFactory;
43 
44  ASSERT_THROW(taskReducersManagerFactory.build(unsupportManagerType), NotFoundByKeyException);
45 }