Esempio n. 1
0
	void LLMessageConfigTestObject::test<6>()
		// tests message builder defaults
	{
		LLSD config_backup = getCurrentConfig();
		LLSD config;
		config["serverDefaults"]["simulator"] = "template";
		config["messages"]["msg1"]["trusted-sender"] = true;
		writeConfigFile(config);
		ensure_equals("Ensure missing message defaults to server builder, not template",
					  LLMessageConfig::isMessageBuiltTemplate("Test"),
					  true);
		ensure_equals("Ensure missing message default to server builder llsd",
					  LLMessageConfig::isMessageBuiltLLSD("Test"),
					  false);
		ensure_equals("Ensure missing builder defaults to server builder, not template",
					  LLMessageConfig::isMessageBuiltTemplate("msg1"),
					  true);
		ensure_equals("Ensure missing builder default to server builder llsd",
					  LLMessageConfig::isMessageBuiltLLSD("msg1"),
					  false);

		ensure_equals("Ensure server default is not llsd",
					  LLMessageConfig::isServerDefaultBuilderLLSD(),
					  false);
		ensure_equals("Ensure server default is template",
					  LLMessageConfig::isServerDefaultBuilderTemplate(),
					  true);

		writeConfigFile(config_backup);
	}
Esempio n. 2
0
	void LLMessageConfigTestObject::test<3>()
		// tests trusted/untrusted senders
	{
		LLSD config_backup = getCurrentConfig();
		LLSD config;
		config["serverDefaults"]["simulator"] = "template";
		config["messages"]["msg1"]["builder"] = "llsd";
		config["messages"]["msg1"]["trusted-sender"] = false;
		config["messages"]["msg2"]["builder"] = "llsd";
		config["messages"]["msg2"]["trusted-sender"] = true;
		writeConfigFile(config);
		ensure_equals("Ensure untrusted is not trusted",
					  LLMessageConfig::isMessageTrusted("msg1"),
					  false);
		ensure_equals("Ensure untrusted is untrusted",
					  LLMessageConfig::isValidUntrustedMessage("msg1"),
					  true);
		ensure_equals("Ensure trusted is trusted",
					  LLMessageConfig::isMessageTrusted("msg2"),
					  true);
		ensure_equals("Ensure trusted is not untrusted",
					  LLMessageConfig::isValidUntrustedMessage("msg2"),
					  false);
		writeConfigFile(config_backup);
	}
Esempio n. 3
0
	void LLMessageConfigTestObject::test<1>()
		// tests server defaults
	{
		LLSD config_backup = getCurrentConfig();
		LLSD config;
		config["serverDefaults"]["simulator"] = "template";
		writeConfigFile(config);
		ensure_equals("Ensure server default is not llsd",
					  LLMessageConfig::isServerDefaultBuilderLLSD(),
					  false);
		ensure_equals("Ensure server default is template",
					  LLMessageConfig::isServerDefaultBuilderTemplate(),
					  true);
		writeConfigFile(config_backup);
	}
Esempio n. 4
0
void AffinityZonesDock::saveAffinityZoneEditorsState(void)
{
    getSettings().setValue("AffinityZones/zoneNames", this->zones());

    for (int i = 0; i < _editorsTabs->count(); i++)
    {
        auto editor = dynamic_cast<AffinityZoneEditor *>(_editorsTabs->widget(i));
        assert(editor != nullptr);
        auto dataObj = editor->getCurrentConfig();
        std::stringstream ss; dataObj->stringify(ss);
        getSettings().setValue("AffinityZones/zones/"+_editorsTabs->tabText(i), QString::fromStdString(ss.str()));
    }

    emit this->zonesChanged();
}
Esempio n. 5
0
	void LLMessageConfigTestObject::test<5>()
		// tests trusted/untrusted without flag, only builder
	{
		LLSD config_backup = getCurrentConfig();
		LLSD config;
		config["serverDefaults"]["simulator"] = "template";
		config["messages"]["msg1"]["builder"] = "llsd";
		writeConfigFile(config);
		ensure_equals("Ensure missing trusted is not trusted",
					  LLMessageConfig::isMessageTrusted("msg1"),
					  false);
		ensure_equals("Ensure missing trusted is not untrusted",
					  LLMessageConfig::isValidUntrustedMessage("msg1"),
					  false);
		writeConfigFile(config_backup);
	}
Esempio n. 6
0
void SyncConnector::checkConnectionHealth()
{
  QUrl requestUrl = mCurrentUrl;
  requestUrl.setPath(tr("/rest/system/connections"));
  QNetworkRequest healthRequest(requestUrl);
  QByteArray headerByte(mAPIKey.toStdString().c_str(), mAPIKey.size());
  healthRequest.setRawHeader(QByteArray("X-API-Key"), headerByte);
  QNetworkReply *reply = network.get(healthRequest);
  requestMap[reply] = kRequestMethod::connectionHealth;

  QUrl lastSyncedListURL = mCurrentUrl;
  lastSyncedListURL.setPath(tr("/rest/stats/folder"));
  QNetworkRequest lastSyncedRequest(lastSyncedListURL);
  lastSyncedRequest.setRawHeader(QByteArray("X-API-Key"), headerByte);
  QNetworkReply *lastSyncreply = network.get(lastSyncedRequest);
  requestMap[lastSyncreply] = kRequestMethod::getLastSyncedFiles;

  getCurrentConfig();
}
Esempio n. 7
0
	void LLMessageConfigTestObject::test<2>()
		// tests message builders
	{
		LLSD config_backup = getCurrentConfig();
		LLSD config;
		config["serverDefaults"]["simulator"] = "template";
		config["messages"]["msg1"]["builder"] = "template";
		config["messages"]["msg2"]["builder"] = "llsd";
		writeConfigFile(config);
		ensure_equals("Ensure msg template builder not llsd",
					  LLMessageConfig::isMessageBuiltLLSD("msg1"),
					  false);
		ensure_equals("Ensure msg template builder",
					  LLMessageConfig::isMessageBuiltTemplate("msg1"),
					  true);
		ensure_equals("Ensure msg llsd builder",
					  LLMessageConfig::isMessageBuiltLLSD("msg2"),
					  true);
		ensure_equals("Ensure msg llsd builder not template",
					  LLMessageConfig::isMessageBuiltTemplate("msg2"),
					  false);
		writeConfigFile(config_backup);
	}