Almost reverting changes in naming convention: moving "user" name to
front, but still keeping application name.  As part of an additional
change, shared folder name in actions is moved just after "action"
keyword

Making AddRemoteAction call exception-free

Change-Id: Ifd0a0c6256940eaf6df8081722ae9d7ed40b12e5
diff --git a/test/test-action-log.cc b/test/test-action-log.cc
index 1a1ff1f..c4d6a9b 100644
--- a/test/test-action-log.cc
+++ b/test/test-action-log.cc
@@ -77,12 +77,12 @@
   pco = actionLog->LookupActionPco (localName, 1);
   BOOST_CHECK_EQUAL ((bool)pco, true);
 
-  BOOST_CHECK_EQUAL (pco->name (), "/test-chronoshare/top-secret/action/alex/%00%01");
+  BOOST_CHECK_EQUAL (pco->name (), "/alex/test-chronoshare/action/top-secret/%00%01");
 
-  ActionItemPtr action = actionLog->LookupAction (Name ("/test-chronoshare/top-secret/action/alex")(0));
+  ActionItemPtr action = actionLog->LookupAction (Name ("/alex/test-chronoshare/action/top-secret")(0));
   BOOST_CHECK_EQUAL ((bool)action, false);
 
-  action = actionLog->LookupAction (Name ("/test-chronoshare/top-secret/action/alex")(1));
+  action = actionLog->LookupAction (Name ("/alex/test-chronoshare/action/top-secret")(1));
   BOOST_CHECK_EQUAL ((bool)action, true);
 
   if (action)
@@ -117,7 +117,7 @@
       BOOST_CHECK_EQUAL (action->version (), 1);
     }
 
-  BOOST_CHECK_NO_THROW (actionLog->AddRemoteAction (pco));
+  BOOST_CHECK_EQUAL ((bool)actionLog->AddRemoteAction (pco), true);
   BOOST_CHECK_EQUAL (actionLog->LogSize (), 2);
 
   // create a real remote action
@@ -128,11 +128,11 @@
   item.set_timestamp (time (NULL));
 
   BytesPtr item_msg = serializeMsg (item);
-  Name actionName = Name ("/")("test-chronoshare")("top-secret")("action")("zhenkai")(1);
+  Name actionName = Name ("/")(Name("/zhenkai/test"))("test-chronoshare")("action")("top-secret")(1);
   Bytes actionData = ccnx->createContentObject (actionName, head (*item_msg), item_msg->size ());
 
   pco = make_shared<ParsedContentObject> (actionData);
-  BOOST_CHECK_NO_THROW (actionLog->AddRemoteAction (pco));
+  BOOST_CHECK_EQUAL ((bool)actionLog->AddRemoteAction (pco), true);
   BOOST_CHECK_EQUAL (actionLog->LogSize (), 3);
 
   remove_all (tmpdir);
diff --git a/test/test-serve-and-fetch.cc b/test/test-serve-and-fetch.cc
index 9d71cfb..7919246 100644
--- a/test/test-serve-and-fetch.cc
+++ b/test/test-serve-and-fetch.cc
@@ -147,7 +147,7 @@
 
   FetchManager fm(ccnx_fetch, bind(simpleMap, _1));
   HashPtr hash = pub.get<0> ();
-  Name baseName = Name ("/")(APPNAME)("file")(hash->GetHash(), hash->GetHashBytes())(deviceName);
+  Name baseName = Name ("/")(deviceName)(APPNAME)("file")(hash->GetHash(), hash->GetHashBytes());
 
   fm.Enqueue(deviceName, baseName, bind(segmentCallback, _1, _2, _3, _4), bind(finishCallback, _1, _2), 0, pub.get<1>() - 1);