 python = process.env.PYTHON or 'python'
 foreignParticipants =
   'PythonRepeat': [python, path.join __dirname, 'fixtures', './repeat.py']
+#  'CppRepeat': [python, path.join __dirname, 'fixtures', './repeat-cpp']
 
 startProcess = (args, callback) ->
   prog = args[0]

              chai.expect(err).to.not.exist
              setTimeout send, 1000 # HACK: wait for inqueue to be setup


  args = foreignParticipants[name]
  return startProcess args, callback

testParticipant = (state, name) ->

  describe "#{name} participant", ->
    participant = null
    beforeEach (done) ->
      @timeout 4000
      participant = startForeign name, done
    afterEach (done) ->
      participant.kill()
      done()

    describe 'when started', ->
      it 'sends definition on fbp queue', (done) ->
        broker = state.broker

        onDiscovery = (msg) ->
          def = msg.data
          chai.expect(def).to.be.an 'object'
          chai.expect(def).to.have.keys ['id', 'icon', 'component', 'label', 'inports', 'outports']
          state.broker.ackMessage msg
          return if def.component != name
          done()
        state.broker.subscribeParticipantChange onDiscovery

    describe 'sending data on inport queue', ->
      it 'repeats the same data on outport queue', (done) ->
        broker = state.broker

        input = { bar: 'foo' }
        onReceive = (msg) ->
          broker.ackMessage msg
