mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 17:41:45 +00:00
Add FairMQ tests (PUB-SUB, PUSH-PULL, REQ-REP).
This commit is contained in:
committed by
Mohammad Al-Turany
parent
fbf7dbf2ba
commit
f13bb5995d
58
fairmq/test/push-pull/runTestPush.cxx
Normal file
58
fairmq/test/push-pull/runTestPush.cxx
Normal file
@@ -0,0 +1,58 @@
|
||||
/********************************************************************************
|
||||
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
||||
* *
|
||||
* This software is distributed under the terms of the *
|
||||
* GNU Lesser General Public Licence version 3 (LGPL) version 3, *
|
||||
* copied verbatim in the file "LICENSE" *
|
||||
********************************************************************************/
|
||||
/**
|
||||
* runTestPush.cxx
|
||||
*
|
||||
* @since 2015-09-05
|
||||
* @author A. Rybalchenko
|
||||
*/
|
||||
|
||||
#include "FairMQLogger.h"
|
||||
#include "FairMQTestPush.h"
|
||||
|
||||
#ifdef NANOMSG
|
||||
#include "FairMQTransportFactoryNN.h"
|
||||
#else
|
||||
#include "FairMQTransportFactoryZMQ.h"
|
||||
#endif
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
FairMQTestPush testPush;
|
||||
testPush.CatchSignals();
|
||||
|
||||
#ifdef NANOMSG
|
||||
testPush.SetTransport(new FairMQTransportFactoryNN());
|
||||
#else
|
||||
testPush.SetTransport(new FairMQTransportFactoryZMQ());
|
||||
#endif
|
||||
|
||||
testPush.SetProperty(FairMQTestPush::Id, "testPush");
|
||||
|
||||
FairMQChannel pushChannel("push", "bind", "tcp://127.0.0.1:5557");
|
||||
testPush.fChannels["data"].push_back(pushChannel);
|
||||
|
||||
testPush.ChangeState("INIT_DEVICE");
|
||||
testPush.WaitForEndOfState("INIT_DEVICE");
|
||||
|
||||
testPush.ChangeState("INIT_TASK");
|
||||
testPush.WaitForEndOfState("INIT_TASK");
|
||||
|
||||
testPush.ChangeState("RUN");
|
||||
testPush.WaitForEndOfState("RUN");
|
||||
|
||||
testPush.ChangeState("RESET_TASK");
|
||||
testPush.WaitForEndOfState("RESET_TASK");
|
||||
|
||||
testPush.ChangeState("RESET_DEVICE");
|
||||
testPush.WaitForEndOfState("RESET_DEVICE");
|
||||
|
||||
testPush.ChangeState("END");
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user