|
@@ -512,12 +512,12 @@ TEST_F(ListTest, configureMulti) {
|
|
|
const ConstElementPtr elem(Element::fromJSON("["
|
|
|
"{"
|
|
|
" \"type\": \"type1\","
|
|
|
- " \"cache\": \"off\","
|
|
|
+ " \"cache-enable\": false,"
|
|
|
" \"params\": {}"
|
|
|
"},"
|
|
|
"{"
|
|
|
" \"type\": \"type2\","
|
|
|
- " \"cache\": \"off\","
|
|
|
+ " \"cache-enable\": false,"
|
|
|
" \"params\": {}"
|
|
|
"}]"
|
|
|
));
|
|
@@ -546,7 +546,7 @@ TEST_F(ListTest, configureParams) {
|
|
|
ConstElementPtr elem(Element::fromJSON(string("["
|
|
|
"{"
|
|
|
" \"type\": \"t\","
|
|
|
- " \"cache\": \"off\","
|
|
|
+ " \"cache-enable\": false,"
|
|
|
" \"params\": ") + *param +
|
|
|
"}]"));
|
|
|
list_->configure(elem, true);
|
|
@@ -555,6 +555,31 @@ TEST_F(ListTest, configureParams) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+TEST_F(ListTest, status) {
|
|
|
+ EXPECT_TRUE(list_->getStatus().empty());
|
|
|
+ const ConstElementPtr elem(Element::fromJSON("["
|
|
|
+ "{"
|
|
|
+ " \"type\": \"type1\","
|
|
|
+ " \"cache-enable\": false,"
|
|
|
+ " \"params\": {}"
|
|
|
+ "},"
|
|
|
+ "{"
|
|
|
+ " \"type\": \"type2\","
|
|
|
+ " \"cache-enable\": true,"
|
|
|
+ " \"cache-zones\": [],"
|
|
|
+ " \"name\": \"Test name\","
|
|
|
+ " \"params\": {}"
|
|
|
+ "}]"
|
|
|
+ ));
|
|
|
+ list_->configure(elem, true);
|
|
|
+ const vector<DataSourceStatus> statuses(list_->getStatus());
|
|
|
+ ASSERT_EQ(2, statuses.size());
|
|
|
+ EXPECT_EQ("type1", statuses[0].getName());
|
|
|
+ EXPECT_EQ(MSS_UNUSED, statuses[0].getSegmentState());
|
|
|
+ EXPECT_EQ("Test name", statuses[1].getName());
|
|
|
+ EXPECT_EQ(MSS_LOCAL, statuses[1].getSegmentState());
|
|
|
+}
|
|
|
+
|
|
|
TEST_F(ListTest, wrongConfig) {
|
|
|
const char* configs[] = {
|
|
|
// A lot of stuff missing from there
|