From: Youngjae Shin Date: Tue, 4 Feb 2020 06:22:39 +0000 (+0900) Subject: revise Mode/Rule Files name X-Git-Tag: submit/tizen/20200319.043412~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=776ed7afb7aa44cb819db3d07dfd7e29fa60e0fc;p=platform%2Fcore%2Fsystem%2Fmodes.git revise Mode/Rule Files name --- diff --git a/example/mode/tizen_asyncFail1_mode.xml b/example/mode/tizen_asyncFail1_mode.xml deleted file mode 100644 index b764ffa..0000000 --- a/example/mode/tizen_asyncFail1_mode.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - 5 - 5 - 5 - 5 - 1 - - diff --git a/example/mode/tizen_asyncFail2_mode.xml b/example/mode/tizen_asyncFail2_mode.xml deleted file mode 100644 index 74c4263..0000000 --- a/example/mode/tizen_asyncFail2_mode.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - 5 - 5 - 5 - 5 - 5 - - diff --git a/example/mode/tizen_asyncFailEx1_mode.xml b/example/mode/tizen_asyncFailEx1_mode.xml new file mode 100644 index 0000000..b764ffa --- /dev/null +++ b/example/mode/tizen_asyncFailEx1_mode.xml @@ -0,0 +1,10 @@ + + + + 5 + 5 + 5 + 5 + 1 + + diff --git a/example/mode/tizen_asyncFailEx2_mode.xml b/example/mode/tizen_asyncFailEx2_mode.xml new file mode 100644 index 0000000..74c4263 --- /dev/null +++ b/example/mode/tizen_asyncFailEx2_mode.xml @@ -0,0 +1,10 @@ + + + + 5 + 5 + 5 + 5 + 5 + + diff --git a/example/mode/tizen_asyncValidErr_mode.xml b/example/mode/tizen_asyncValidErr_mode.xml new file mode 100644 index 0000000..763c8ff --- /dev/null +++ b/example/mode/tizen_asyncValidErr_mode.xml @@ -0,0 +1,6 @@ + + + + diff --git a/example/mode/tizen_asyncValidFail_mode.xml b/example/mode/tizen_asyncValidFail_mode.xml deleted file mode 100644 index 763c8ff..0000000 --- a/example/mode/tizen_asyncValidFail_mode.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/example/mode/tizen_conflict1_mode.xml b/example/mode/tizen_conflict1_mode.xml deleted file mode 100644 index 5da4429..0000000 --- a/example/mode/tizen_conflict1_mode.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - 1 - - diff --git a/example/mode/tizen_conflict2_mode.xml b/example/mode/tizen_conflict2_mode.xml deleted file mode 100644 index 0c21e0a..0000000 --- a/example/mode/tizen_conflict2_mode.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - 2 - - diff --git a/example/mode/tizen_conflict3_mode.xml b/example/mode/tizen_conflict3_mode.xml deleted file mode 100644 index 43cb35b..0000000 --- a/example/mode/tizen_conflict3_mode.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - true - - diff --git a/example/mode/tizen_conflictErrBase_mode.xml b/example/mode/tizen_conflictErrBase_mode.xml new file mode 100644 index 0000000..5da4429 --- /dev/null +++ b/example/mode/tizen_conflictErrBase_mode.xml @@ -0,0 +1,6 @@ + + + + 1 + + diff --git a/example/mode/tizen_conflictErrExclusive_mode.xml b/example/mode/tizen_conflictErrExclusive_mode.xml new file mode 100644 index 0000000..43cb35b --- /dev/null +++ b/example/mode/tizen_conflictErrExclusive_mode.xml @@ -0,0 +1,6 @@ + + + + true + + diff --git a/example/mode/tizen_conflictErr_mode.xml b/example/mode/tizen_conflictErr_mode.xml new file mode 100644 index 0000000..0c21e0a --- /dev/null +++ b/example/mode/tizen_conflictErr_mode.xml @@ -0,0 +1,6 @@ + + + + 2 + + diff --git a/example/mode/tizen_ex1_mode.xml b/example/mode/tizen_ex1_mode.xml deleted file mode 100644 index 9de72ed..0000000 --- a/example/mode/tizen_ex1_mode.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - on - com.vpn.usa123 - https://pbskids.org/ - Modes-JBL - beatles-yesterday.mp3 - PRINT_TWO - true - - diff --git a/example/mode/tizen_ex2_mode.xml b/example/mode/tizen_ex2_mode.xml deleted file mode 100644 index e062a21..0000000 --- a/example/mode/tizen_ex2_mode.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/example/mode/tizen_invalid1_mode.xml b/example/mode/tizen_invalid1_mode.xml deleted file mode 100644 index c34416b..0000000 --- a/example/mode/tizen_invalid1_mode.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - 123 - - diff --git a/example/mode/tizen_invalid2_mode.xml b/example/mode/tizen_invalid2_mode.xml deleted file mode 100644 index 374eef1..0000000 --- a/example/mode/tizen_invalid2_mode.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - PRINT_TREE - - diff --git a/example/mode/tizen_invalidValErr1_mode.xml b/example/mode/tizen_invalidValErr1_mode.xml new file mode 100644 index 0000000..c34416b --- /dev/null +++ b/example/mode/tizen_invalidValErr1_mode.xml @@ -0,0 +1,6 @@ + + + + 123 + + diff --git a/example/mode/tizen_invalidValErr2_mode.xml b/example/mode/tizen_invalidValErr2_mode.xml new file mode 100644 index 0000000..374eef1 --- /dev/null +++ b/example/mode/tizen_invalidValErr2_mode.xml @@ -0,0 +1,6 @@ + + + + PRINT_TREE + + diff --git a/example/mode/tizen_normalEx1_mode.xml b/example/mode/tizen_normalEx1_mode.xml new file mode 100644 index 0000000..9de72ed --- /dev/null +++ b/example/mode/tizen_normalEx1_mode.xml @@ -0,0 +1,13 @@ + + + + on + com.vpn.usa123 + https://pbskids.org/ + Modes-JBL + beatles-yesterday.mp3 + PRINT_TWO + true + + diff --git a/example/mode/tizen_normalEx2_mode.xml b/example/mode/tizen_normalEx2_mode.xml new file mode 100644 index 0000000..e062a21 --- /dev/null +++ b/example/mode/tizen_normalEx2_mode.xml @@ -0,0 +1,7 @@ + + + + diff --git a/example/rule/tizen_aliasValueErr_rule.xml b/example/rule/tizen_aliasValueErr_rule.xml new file mode 100644 index 0000000..ea765f6 --- /dev/null +++ b/example/rule/tizen_aliasValueErr_rule.xml @@ -0,0 +1,39 @@ + + + + + test.exactness + Sensor Accuracy + System + + + test.changeAccuracy + Sensor Exactness + System + + + browser + Web Framework + + + display.autoLight + It makes the screen color warmer. + System + + + 0 + 1 + 2 + 3 + 4th + It prints integer value + System + + + 1 + 0 + It prints boolean value + System + + + diff --git a/example/rule/tizen_ex_rule.xml b/example/rule/tizen_ex_rule.xml deleted file mode 100644 index 6190d9a..0000000 --- a/example/rule/tizen_ex_rule.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - test.exactness - Sensor Accuracy - System - - - test.changeAccuracy - Sensor Exactness - System - - - browser - Web Framework - - - display.autoLight - It makes the screen color warmer. - System - - - Launch App - App Framework - - - bluetooth Audio Connect - Network & Connectivity - - - Audio/Video player - Multimedia - - - 0 - 1 - 2 - 3 - 4 - http://tizen.org/privilege/systemsettings.admin - It prints integer value - System - - - 1 - 0 - http://tizen.org/privilege/systemsettings.admin - It prints boolean value - System - - - http://tizen.org/privilege/systemsettings.admin - It prints double value - System - - - http://tizen.org/privilege/systemsettings.admin - It prints string value - System - - - http://tizen.org/privilege/systemsettings.admin - Sleep - System - - - Sleep and return valuse is error - System - - - diff --git a/example/rule/tizen_fail1_rule.xml b/example/rule/tizen_fail1_rule.xml deleted file mode 100644 index 02cb688..0000000 --- a/example/rule/tizen_fail1_rule.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - test.exactness - Sensor Accuracy - System - - - test.changeAccuracy - Sensor Exactness - System - - - browser - Web Framework - - - display.autoLight - It makes the screen color warmer. - System - - - 0 - 1 - 2 - 3 - 4 - It prints integer value - System - - - 1 - 0 - It prints boolean value - System - - - It is a duplicated Rule, It Must be unique - System - - - diff --git a/example/rule/tizen_fail2_rule.xml b/example/rule/tizen_fail2_rule.xml deleted file mode 100644 index ea765f6..0000000 --- a/example/rule/tizen_fail2_rule.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - test.exactness - Sensor Accuracy - System - - - test.changeAccuracy - Sensor Exactness - System - - - browser - Web Framework - - - display.autoLight - It makes the screen color warmer. - System - - - 0 - 1 - 2 - 3 - 4th - It prints integer value - System - - - 1 - 0 - It prints boolean value - System - - - diff --git a/example/rule/tizen_uniqueRuleErr_rule.xml b/example/rule/tizen_uniqueRuleErr_rule.xml new file mode 100644 index 0000000..02cb688 --- /dev/null +++ b/example/rule/tizen_uniqueRuleErr_rule.xml @@ -0,0 +1,43 @@ + + + + + test.exactness + Sensor Accuracy + System + + + test.changeAccuracy + Sensor Exactness + System + + + browser + Web Framework + + + display.autoLight + It makes the screen color warmer. + System + + + 0 + 1 + 2 + 3 + 4 + It prints integer value + System + + + 1 + 0 + It prints boolean value + System + + + It is a duplicated Rule, It Must be unique + System + + + diff --git a/packaging/modes.spec b/packaging/modes.spec index 6a60091..c6c5714 100644 --- a/packaging/modes.spec +++ b/packaging/modes.spec @@ -102,20 +102,18 @@ install -d -m 755 %{buildroot}%{modes_ro_dir}/mode install -d -m 755 %{buildroot}%{modes_ro_dir}/rule install -d -m 755 %{buildroot}%{modes_rw_dir}/custom-mode install -d -m 755 %{buildroot}%{modes_rw_dir}/undo-info -install -m 0644 example/mode/*ex*_mode.xml %{buildroot}%{modes_ro_dir}/mode/ -install -m 0644 example/mode/*sync*_mode.xml %{buildroot}%{modes_ro_dir}/mode/ -install -m 0644 example/rule/*ex*_rule.xml %{buildroot}%{modes_ro_dir}/rule/ -install -m 0644 example/mode/*conflict*_mode.xml %{buildroot}%{modes_test_dir}/ -install -m 0644 example/mode/*invalid*_mode.xml %{buildroot}%{modes_test_dir}/ -install -m 0644 example/rule/*fail*_rule.xml %{buildroot}%{modes_test_dir}/ +install -m 0644 example/mode/*Ex*_mode.xml %{buildroot}%{modes_ro_dir}/mode/ +install -m 0644 example/mode/*Err*_mode.xml %{buildroot}%{modes_test_dir}/ +install -m 0644 example/rule/*Err*_rule.xml %{buildroot}%{modes_test_dir}/ install -m 0755 unittest/modes-gtest-run.sh %{buildroot}%{modes_test_dir}/ %install_service multi-user.target.wants %{name}.path %check xmllint --noout --schema schema/tizen_mode.xsd example/mode/tizen_*_mode.xml +xmllint --noout --schema schema/tizen_action_rule.xsd plugin/tizen_test_rule.xml xmllint --noout --schema schema/tizen_action_rule.xsd example/rule/tizen_*_rule.xml -bash ./unittest/modes-gtest-run.sh ./example ./unittest +bash ./unittest/modes-gtest-run.sh %{buildroot}%{modes_ro_dir} %{buildroot}%{modes_test_dir} Building %post /sbin/ldconfig diff --git a/plugin/CMakeLists.txt b/plugin/CMakeLists.txt index 3407ca1..d82e2f6 100644 --- a/plugin/CMakeLists.txt +++ b/plugin/CMakeLists.txt @@ -10,3 +10,4 @@ ADD_LIBRARY(${LIB_NAME} SHARED ${TEST_PLUGIN_SRCS}) TARGET_LINK_LIBRARIES(${LIB_NAME} ${plugin_pkgs_LIBRARIES}) SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES NO_SONAME 1 ) INSTALL(TARGETS ${LIB_NAME} DESTINATION ${MODES_PLUGIN_DEFAULT_DIR}) +INSTALL(FILES tizen_test_rule.xml DESTINATION ${MODES_ACTIONRULE_DEFAULT_DIR}) diff --git a/plugin/tizen_test_rule.xml b/plugin/tizen_test_rule.xml new file mode 100644 index 0000000..597f618 --- /dev/null +++ b/plugin/tizen_test_rule.xml @@ -0,0 +1,72 @@ + + + + + test.exactness + Sensor Accuracy + System + + + test.changeAccuracy + Sensor Exactness + System + + + browser + Web Framework + + + display.autoLight + It makes the screen color warmer. + System + + + Launch App + App Framework + + + bluetooth Audio Connect + Network & Connectivity + + + Audio/Video player + Multimedia + + + 0 + 1 + 2 + 3 + 4 + http://tizen.org/privilege/systemsettings.admin + It prints integer value + System + + + 1 + 0 + http://tizen.org/privilege/systemsettings.admin + It prints boolean value + System + + + http://tizen.org/privilege/systemsettings.admin + It prints double value + System + + + http://tizen.org/privilege/systemsettings.admin + It prints string value + System + + + http://tizen.org/privilege/systemsettings.admin + Sleep + System + + + Sleep and return error after value seconds + System + + + diff --git a/unittest/modes-gtest-run.sh b/unittest/modes-gtest-run.sh index 941454f..e85baba 100755 --- a/unittest/modes-gtest-run.sh +++ b/unittest/modes-gtest-run.sh @@ -5,27 +5,31 @@ set -e if [ $# -lt 2 ] then - echo "Usage) $0 DATA_DIR WORKING_DIR" + echo "Usage) $0 DATA_DIR WORKING_DIR [Building]" exit 1 fi +IsBUILDING="no" +if [ $# -gt 2 ] +then + IsBUILDING=$3 +fi + DATA_DIR=$1 WORKING_DIR=$2 -CUR_DIR=$PWD - -cp $DATA_DIR/mode/*_mode.xml $WORKING_DIR -cp $DATA_DIR/rule/*_rule.xml $WORKING_DIR -mkdir -p $WORKING_DIR/extra -sed s/ex1/ex3/g $WORKING_DIR/tizen_ex1_mode.xml > $WORKING_DIR/extra/tizen_ex3_mode.xml -sed s/ex1/ex4/g $WORKING_DIR/tizen_ex1_mode.xml > $WORKING_DIR/extra/tizen_ex4_mode.xml +#CUR_DIR=$PWD pushd $WORKING_DIR -if [ ${DATA_DIR:0:1} == "." ] -then # on building - cp $CUR_DIR/schema/*.xsd ./ -else # on Target - cp $DATA_DIR/schema/*.xsd ./ +cp $DATA_DIR/mode/*_mode.xml ./ +cp $DATA_DIR/rule/*_rule.xml ./ +mkdir -p ./extra +sed s/ex1/ex3/g ./tizen_normalEx1_mode.xml > ./extra/tizen_normalEx3_mode.xml +sed s/ex1/ex4/g ./tizen_normalEx1_mode.xml > ./extra/tizen_normalEx4_mode.xml +cp $DATA_DIR/schema/*.xsd ./ + +if [ "$IsBUILDING" == "no" ] +then # on Target ./modes-gtest-client ./modes-gtest-noti ./modes-gtest-async @@ -37,4 +41,7 @@ fi ./modes-gtest-generator ./modes-gtest-conflict ./modes-gtest-plugin + +rm -rf *.xsd extra + popd diff --git a/unittest/modes_test_conflict.cpp b/unittest/modes_test_conflict.cpp index 48df8e9..c729744 100644 --- a/unittest/modes_test_conflict.cpp +++ b/unittest/modes_test_conflict.cpp @@ -27,7 +27,7 @@ public: protected: void SetUp() override { - ModeXMLParser modeparser("tizen_conflict1_mode.xml", ruleMgr); + ModeXMLParser modeparser("tizen_conflictErrBase_mode.xml", ruleMgr); careTaker.pushMode(modeparser.getMode()); } @@ -57,14 +57,14 @@ ConflictTest::ConflictTest() TEST_F(ConflictTest, isSavedMode) { - ModeXMLParser modeparser("tizen_conflict1_mode.xml", ruleMgr); + ModeXMLParser modeparser("tizen_conflictErrBase_mode.xml", ruleMgr); EXPECT_TRUE(careTaker.isSavedMode(modeparser.getModeName())); } -TEST_F(ConflictTest, isExcluded) +TEST_F(ConflictTest, isExclusive) { - ModeXMLParser modeparser("tizen_conflict3_mode.xml", ruleMgr); + ModeXMLParser modeparser("tizen_conflictErrExclusive_mode.xml", ruleMgr); careTaker.pushMode(modeparser.getMode()); EXPECT_TRUE(careTaker.isExclusive()); @@ -76,7 +76,7 @@ TEST_F(ConflictTest, isExcluded) TEST_F(ConflictTest, checkConflictAction) { - ModeXMLParser modeparser("tizen_conflict2_mode.xml", ruleMgr); + ModeXMLParser modeparser("tizen_conflictErr_mode.xml", ruleMgr); Mode mode = modeparser.getMode(); EXPECT_TRUE(careTaker.checkConflictAction(mode)); @@ -86,6 +86,6 @@ TEST_F(ConflictTest, isConflict) { ConflictManager conflMgr(careTaker); - ModeXMLParser modeparser("tizen_conflict2_mode.xml", ruleMgr); + ModeXMLParser modeparser("tizen_conflictErr_mode.xml", ruleMgr); EXPECT_TRUE(conflMgr.isConflict(modeparser.getMode())); } diff --git a/unittest/modes_test_generator.cpp b/unittest/modes_test_generator.cpp index 88b1789..65c88b2 100644 --- a/unittest/modes_test_generator.cpp +++ b/unittest/modes_test_generator.cpp @@ -49,21 +49,21 @@ TEST(XMLGenerator, makeModeXML) { GeneratorTest broker; - ModeXMLParser modeparser("tizen_ex1_mode.xml", broker.ruleMgr); - Mode mode = modeparser.getMode(); + ModeXMLParser modeParser("tizen_normalEx1_mode.xml", broker.ruleMgr); + Mode mode = modeParser.getMode(); try { XMLGenerator xmlGenerator; - xmlGenerator.makeModeXML("tizen_gen_ex1_mode.xml", mode); + xmlGenerator.makeModeXML("tizen_generatedEx1_mode.xml", mode); } catch (ModesEx &e) { - ERR("XMLGenerator(tizen_gen_ex1_mode.xml) Fail(%s)", e.what()); + ERR("XMLGenerator(tizen_generatedEx1_mode.xml) Fail(%s)", e.what()); FAIL(); } - ModeXMLParser genmodeparser("tizen_gen_ex1_mode.xml", broker.ruleMgr); - Mode genMode = genmodeparser.getMode(); + ModeXMLParser genModeParser("tizen_generatedEx1_mode.xml", broker.ruleMgr); + Mode genMode = genModeParser.getMode(); - EXPECT_EQ("ex1", genmodeparser.getModeName()); + EXPECT_EQ("ex1", genModeParser.getModeName()); std::list> actionList = mode.getActionList(); EXPECT_FALSE(actionList.empty()); @@ -78,8 +78,8 @@ TEST(XMLGenerator, exFileName) { GeneratorTest broker; - ModeXMLParser modeparser("tizen_ex1_mode.xml", broker.ruleMgr); - Mode mode = modeparser.getMode(); + ModeXMLParser modeParser("tizen_normalEx1_mode.xml", broker.ruleMgr); + Mode mode = modeParser.getMode(); EXPECT_THROW({ XMLGenerator xmlGenerator; diff --git a/unittest/modes_test_parser.cpp b/unittest/modes_test_parser.cpp index b7e0b75..67a2182 100644 --- a/unittest/modes_test_parser.cpp +++ b/unittest/modes_test_parser.cpp @@ -54,7 +54,7 @@ ParserTest::ParserTest() config.pluginDir = "."; ruleMgr.setOptions(std::string(), config.actionRuleXsdFile, config.pluginDir); - ruleMgr.parseActionRule("./tizen_ex_rule.xml"); + ruleMgr.parseActionRule("./tizen_test_rule.xml"); } list> ParserTest::getActionList(Mode& m) @@ -64,42 +64,42 @@ list> ParserTest::getActionList(Mode& m) TEST_F(ParserTest, getModeName) { - ModeXMLParser modeparser("tizen_ex1_mode.xml", ruleMgr); + ModeXMLParser modeparser("tizen_normalEx1_mode.xml", ruleMgr); EXPECT_EQ("ex1", modeparser.getModeName()); } TEST_F(ParserTest, modeGetName) { - ModeXMLParser modeparser("tizen_ex2_mode.xml", ruleMgr); + ModeXMLParser modeparser("tizen_normalEx2_mode.xml", ruleMgr); Mode mode = modeparser.getMode(); EXPECT_EQ("ex2", mode.getName()); } TEST_F(ParserTest, isHiddenTrue) { - ModeXMLParser modeparser("tizen_ex2_mode.xml", ruleMgr); + ModeXMLParser modeparser("tizen_normalEx2_mode.xml", ruleMgr); EXPECT_EQ(true, modeparser.isHidden()); } TEST_F(ParserTest, isHiddenFalse) { - ModeXMLParser modeparser("tizen_ex1_mode.xml", ruleMgr); + ModeXMLParser modeparser("tizen_normalEx1_mode.xml", ruleMgr); EXPECT_EQ(false, modeparser.isHidden()); } TEST_F(ParserTest, getModeType) { - ModeXMLParser modeparser("tizen_ex1_mode.xml", ruleMgr); + ModeXMLParser modeparser("tizen_normalEx1_mode.xml", ruleMgr); Mode mode = modeparser.getMode(); EXPECT_EQ(Mode::MODE_NORMAL, mode.getModeType()); } TEST_F(ParserTest, printAction) { - ModeXMLParser modeparser("tizen_ex1_mode.xml", ruleMgr); + ModeXMLParser modeparser("tizen_normalEx1_mode.xml", ruleMgr); Mode mode = modeparser.getMode(); list> actionList = getActionList(mode); @@ -114,16 +114,16 @@ TEST_F(ParserTest, printAction) TEST_F(ParserTest, invalidActionValue) { - ModeXMLParser modeparser1("tizen_invalid1_mode.xml", ruleMgr); + ModeXMLParser modeparser1("tizen_invalidValErr1_mode.xml", ruleMgr); EXPECT_THROW(modeparser1.getMode(), ModesEx); - ModeXMLParser modeparser2("tizen_invalid2_mode.xml", ruleMgr); + ModeXMLParser modeparser2("tizen_invalidValErr2_mode.xml", ruleMgr); EXPECT_THROW(modeparser2.getMode(), ModesEx); } TEST_F(ParserTest, validateAsyncStopOnErr) { - ModeXMLParser modeparser("tizen_asyncValidFail_mode.xml", ruleMgr); + ModeXMLParser modeparser("tizen_asyncValidErr_mode.xml", ruleMgr); EXPECT_THROW(modeparser.validateMode(MODES_MODE_DEFAULT_XSD_FILE), ModesEx); } diff --git a/unittest/modes_test_plugin.cpp b/unittest/modes_test_plugin.cpp index 8a92713..ef4222d 100644 --- a/unittest/modes_test_plugin.cpp +++ b/unittest/modes_test_plugin.cpp @@ -51,7 +51,7 @@ TEST(PluginMapper, readLibraryList) broker.piMapper.loadPlugins(); } catch (ModesEx &e) { - broker.piMapper.setPluginDir("../plugin"); + broker.piMapper.setPluginDir("../../lib/modes-plugins"); EXPECT_NO_THROW(broker.piMapper.loadPlugins()); } @@ -95,7 +95,7 @@ TEST(PluginMapper, getPluginTest) broker.piMapper.loadPlugins(); } catch (ModesEx &e) { - broker.piMapper.setPluginDir("../plugin"); + broker.piMapper.setPluginDir("../../lib/modes-plugins"); EXPECT_NO_THROW(broker.piMapper.loadPlugins()); } diff --git a/unittest/modes_test_rulemgr.cpp b/unittest/modes_test_rulemgr.cpp index 2a44d83..d357b19 100644 --- a/unittest/modes_test_rulemgr.cpp +++ b/unittest/modes_test_rulemgr.cpp @@ -58,24 +58,25 @@ TEST(RuleManagerTest, makeRuleMapP) TEST(RuleManagerTest, parseActionRuleP) { RuleManagerTest testBroker; - EXPECT_NO_THROW(testBroker.parseActionRule("./tizen_ex_rule.xml")); + EXPECT_NO_THROW(testBroker.parseActionRule("./tizen_test_rule.xml")); } TEST(RuleManagerTest, DuplicatedRule) { RuleManagerTest testBroker; - EXPECT_THROW(testBroker.parseActionRule("./tizen_fail1_rule.xml"), ModesEx); + EXPECT_THROW(testBroker.parseActionRule("./tizen_uniqueRuleErr_rule.xml"), ModesEx); } TEST(RuleManagerTest, InvalidValue) { RuleManagerTest testBroker; - EXPECT_THROW(testBroker.parseActionRule("./tizen_fail2_rule.xml"), ModesEx); + EXPECT_THROW(testBroker.parseActionRule("./tizen_uniqueRuleErr_rule.xml"), ModesEx); } +// If there are any errors in a file, the file will be ignored. TEST(RuleManagerTest, CheckAtomicity) { RuleManagerTest testBroker; - EXPECT_THROW(testBroker.parseActionRule("./tizen_fail2_rule.xml"), ModesEx); + EXPECT_THROW(testBroker.parseActionRule("./tizen_aliasValueErr.xml"), ModesEx); EXPECT_TRUE(testBroker.emptyRuleMap()); }