void EntityImporterBase::createRule(const Atlas::Objects::Root & obj, OpVector & res) { m_state = RULE_CREATING; Atlas::Objects::Operation::Create createOp; createOp->setFrom(mAccountId); createOp->setArgs1(obj); createOp->setSerialno(newSerialNumber()); S_LOG_INFO("Creating new rule '" << obj->getId() << "' on server."); res.push_back(createOp); }
void Admintest::test_createObject_fallthrough() { Account_createObject_called = 0; std::string parent("unimportant_string"); Root arg; Atlas::Objects::Operation::Create op; op->setSerialno(m_id_counter++); OpVector res; arg->setObjtype("obj"); m_account->createObject(parent, arg, op, res); ASSERT_EQUAL(res.size(), 0u); ASSERT_EQUAL(Account_createObject_called, m_account); }
void Admintest::test_createObject_juncture_serialno() { newId_fail = false; std::string parent("juncture"); Root arg; Atlas::Objects::Operation::Create op; op->setSerialno(m_id_counter++); OpVector res; arg->setObjtype("obj"); m_account->createObject(parent, arg, op, res); ASSERT_EQUAL(res.size(), 1u); ASSERT_EQUAL(res.front()->getClassNo(), Atlas::Objects::Operation::INFO_NO); ASSERT_TRUE(!res.front()->isDefaultRefno()); }