本文整理汇总了C++中JoynrClusterControllerRuntime类的典型用法代码示例。如果您正苦于以下问题:C++ JoynrClusterControllerRuntime类的具体用法?C++ JoynrClusterControllerRuntime怎么用?C++ JoynrClusterControllerRuntime使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JoynrClusterControllerRuntime类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
~JoynrClusterControllerRuntimeTest(){
if (runtime) {
runtime->deleteChannel();
runtime->stopMessaging();
delete runtime;
}
}
示例2: startMessagingDoesNotThrow
void JoynrClusterControllerRuntimeTest::startMessagingDoesNotThrow() {
EXPECT_CALL(*mockHttpMessageReceiver, startReceiveQueue())
.Times(1);
EXPECT_CALL(*mockHttpMessageReceiver, stopReceiveQueue())
.Times(1);
ASSERT_TRUE(runtime != nullptr);
runtime->startMessaging();
runtime->stopMessaging();
}
示例3: QCoreApplication
JoynrClusterControllerRuntime* JoynrClusterControllerRuntime::create(Settings* settings)
{
// Only allow one QCoreApplication instance
static int argc = 0;
static char* argv[] = {nullptr};
static QCoreApplication* coreApplication =
(QCoreApplication::instance() == nullptr) ? new QCoreApplication(argc, argv) : nullptr;
JoynrClusterControllerRuntime* runtime =
new JoynrClusterControllerRuntime(coreApplication, settings);
runtime->start();
return runtime;
}
示例4: SystemServicesRoutingTest
SystemServicesRoutingTest() :
settingsFilename("test-resources/SystemServicesRoutingTest.settings"),
settings(new QSettings(settingsFilename, QSettings::IniFormat)),
routingDomain(),
routingProviderParticipantId(),
runtime(NULL),
mockMessageReceiver(new MockMessageReceiver()),
mockMessageSender(new MockMessageSender()),
discoveryQos(),
routingProxyBuilder(NULL),
routingProxy(NULL)
{
SystemServicesSettings systemSettings(*settings);
systemSettings.printSettings();
routingDomain = TypeUtil::toStd(systemSettings.getDomain());
routingProviderParticipantId = systemSettings.getCcRoutingProviderParticipantId();
discoveryQos.setCacheMaxAge(1000);
discoveryQos.setArbitrationStrategy(DiscoveryQos::ArbitrationStrategy::FIXED_PARTICIPANT);
discoveryQos.addCustomParameter("fixedParticipantId", TypeUtil::toStd(routingProviderParticipantId));
discoveryQos.setDiscoveryTimeout(50);
QString channelId("SystemServicesRoutingTest.ChannelId");
EXPECT_CALL(*(dynamic_cast<MockMessageReceiver*>(mockMessageReceiver)), getReceiveChannelId())
.WillRepeatedly(::testing::ReturnRefOfCopy(channelId));
//runtime can only be created, after MockMessageReceiver has been told to return
//a channelId for getReceiveChannelId.
runtime = new JoynrClusterControllerRuntime(NULL, settings, mockMessageReceiver, mockMessageSender);
// routing provider is normally registered in JoynrClusterControllerRuntime::create
runtime->registerRoutingProvider();
}
示例5: main
int main(int argc, char* argv[])
{
// init a logger
Logger logger("Runtime");
// Check the usage
std::string programName(argv[0]);
if (argc == 1) {
JOYNR_LOG_INFO(logger, "USAGE: No settings provided. Starting with default settings.");
JOYNR_LOG_INFO(logger, "USAGE: {} <file.settings>...", programName);
}
// Object that holds all the settings
Settings settings;
// Merge all the settings files into the settings object
for (int i = 1; i < argc; i++) {
std::string settingsFileName(argv[i]);
// Read the settings file
JOYNR_LOG_INFO(logger, "Loading settings file: {}", settingsFileName);
Settings currentSettings(settingsFileName);
// Check for errors
if (!currentSettings.isLoaded()) {
JOYNR_LOG_FATAL(logger, "Settings file \"{}\" doesn't exist.", settingsFileName);
return 1;
}
// Merge
Settings::merge(currentSettings, settings, true);
}
// create the cluster controller runtime
JoynrClusterControllerRuntime* clusterControllerRuntime =
JoynrClusterControllerRuntime::create(&settings);
// run the cluster controller forever
clusterControllerRuntime->runForever();
}
示例6: LibJoynrRuntimeTest
LibJoynrRuntimeTest() :
settingsFilename("test-resources/integrationtest.settings"),
temporarylibjoynrSettingsFilename("test-resouces/LibJoynrRuntimeTest.libjoynr.settings"),
settings(settingsFilename),
mockMessageReceiver(new MockMessageReceiver()),
mockMessageSender(new MockMessageSender()),
ccRuntime(NULL),
runtime(NULL),
routingProxyBuilder(NULL),
routingProxy(NULL),
mockTestProviderQos(
std::vector<joynr::types::CustomParameter>(), // custom provider parameters
1, // version
1, // priority
joynr::types::ProviderScope::LOCAL, // visibilitiy scope
false // supports on change subscriptions
),
mockTestProvider(),
discoveryProxyBuilder(NULL),
discoveryProxy(NULL)
{
std::string channelId("LibJoynrRuntimeTest.ChannelId");
//runtime can only be created, after MockMessageReceiver has been told to return
//a channelId for getReceiveChannelId.
EXPECT_CALL(*mockMessageReceiver, getReceiveChannelId())
.WillRepeatedly(::testing::ReturnRefOfCopy(channelId));
ccRuntime = new JoynrClusterControllerRuntime(
NULL,
new Settings(settingsFilename),
mockMessageReceiver,
mockMessageSender
);
// routing provider is normally registered in JoynrClusterControllerRuntime::create
ccRuntime->registerRoutingProvider();
// discovery provider is normally registered in JoynrClusterControllerRuntime::create
ccRuntime->registerDiscoveryProvider();
}
示例7:
~SystemServicesRoutingTest(){
runtime->deleteChannel();
runtime->stopMessaging();
delete runtime;
delete settings;
QFile::remove(settingsFilename);
}
示例8: TearDown
void TearDown() {
bool deleteChannel = true;
runtime1->stop(deleteChannel);
runtime2->stop(deleteChannel);
// Delete the persisted participant ids so that each test uses different participant ids
std::remove(LibjoynrSettings::DEFAULT_PARTICIPANT_IDS_PERSISTENCE_FILENAME().c_str());
}
示例9: TearDown
// Tears down the test fixture.
void TearDown(){
bool deleteChannel = true;
runtime->stop(deleteChannel);
// Remove participant id persistence file
std::remove(LibjoynrSettings::DEFAULT_PARTICIPANT_IDS_PERSISTENCE_FILENAME().c_str());
std::this_thread::sleep_for(std::chrono::milliseconds(550));
}
示例10: TearDown
// Tears down the test fixture.
void TearDown(){
bool deleteChannel = true;
runtime->stop(deleteChannel);
// Remove participant id persistence file
QFile::remove(LibjoynrSettings::DEFAULT_PARTICIPANT_IDS_PERSISTENCE_FILENAME());
QThreadSleep::msleep(550);
}
示例11: TearDown
void TearDown() {
bool deleteChannel = true;
runtime->stop(deleteChannel);
}
示例12: SetUp
void SetUp() {
runtime->start();
}
示例13:
~LibJoynrRuntimeTest() {
ccRuntime->deleteChannel();
ccRuntime->stopMessaging();
delete ccRuntime;
}
示例14: SetUp
void SetUp() {
runtime1->start();
runtime2->start();
}