Commit 271c335f authored by Renato Figueiro Maia's avatar Renato Figueiro Maia

Ajustes na infraestrutura de testes de interop. para facilitar sua configuração/inicialização.

git-svn-id: https://subversion.tecgraf.puc-rio.br/engdist/openbus/sdk/lua/branches/02_00_01@159711 ae0415b3-e90b-0410-900d-d0be9363c56b
parent e06eff7f
local log = require "openbus.util.logger"
local openbus = require "openbus" local openbus = require "openbus"
local log = require "openbus.util.logger"
require "openbus.test.util" require "openbus.test.util"
-- customize test configuration for this case
settestcfg(...)
-- setup the ORB -- setup the ORB
local orb = openbus.initORB() local orb = openbus.initORB(orbcfg)
-- load interface definition -- load interface definition
orb:loadidlfile("idl/proxy.idl") orb:loadidlfile("idl/proxy.idl")
local iface = orb.types:lookup("tecgraf::openbus::interop::chaining::HelloProxy") local iface = orb.types:lookup("tecgraf::openbus::interop::chaining::HelloProxy")
-- customize test configuration for this case
settestcfg(iface, ...)
-- get bus context manager -- get bus context manager
local OpenBusContext = orb.OpenBusContext local OpenBusContext = orb.OpenBusContext
......
local log = require "openbus.util.logger"
local openbus = require "openbus" local openbus = require "openbus"
local log = require "openbus.util.logger"
local sysex = require "openbus.util.sysex" local sysex = require "openbus.util.sysex"
local ComponentContext = require "scs.core.ComponentContext" local ComponentContext = require "scs.core.ComponentContext"
require "openbus.test.util" require "openbus.test.util"
-- customize test configuration for this case
settestcfg(...)
-- setup and start the ORB -- setup and start the ORB
local orb = openbus.initORB() local orb = openbus.initORB(orbcfg)
-- load interface definition -- load interface definition
orb:loadidlfile("idl/proxy.idl") orb:loadidlfile("idl/proxy.idl")
...@@ -14,9 +17,6 @@ orb:loadidlfile("helloidl/hello.idl") ...@@ -14,9 +17,6 @@ orb:loadidlfile("helloidl/hello.idl")
local iface = orb.types:lookup("tecgraf::openbus::interop::chaining::HelloProxy") local iface = orb.types:lookup("tecgraf::openbus::interop::chaining::HelloProxy")
local serviface = orb.types:lookup("tecgraf::openbus::interop::simple::Hello") local serviface = orb.types:lookup("tecgraf::openbus::interop::simple::Hello")
-- customize test configuration for this case
settestcfg(iface, ...)
-- get bus context manager -- get bus context manager
local OpenBusContext = orb.OpenBusContext local OpenBusContext = orb.OpenBusContext
......
local log = require "openbus.util.logger"
local openbus = require "openbus" local openbus = require "openbus"
local log = require "openbus.util.logger"
local sysex = require "openbus.util.sysex" local sysex = require "openbus.util.sysex"
local ComponentContext = require "scs.core.ComponentContext" local ComponentContext = require "scs.core.ComponentContext"
require "openbus.test.util" require "openbus.test.util"
-- customize test configuration for this case
settestcfg(...)
-- setup and start the ORB -- setup and start the ORB
local orb = openbus.initORB() local orb = openbus.initORB(orbcfg)
-- load interface definition -- load interface definition
orb:loadidlfile("helloidl/hello.idl") orb:loadidlfile("helloidl/hello.idl")
local iface = orb.types:lookup("tecgraf::openbus::interop::simple::Hello") local iface = orb.types:lookup("tecgraf::openbus::interop::simple::Hello")
-- customize test configuration for this case
settestcfg(iface, ...)
-- get bus context manager -- get bus context manager
local OpenBusContext = orb.OpenBusContext local OpenBusContext = orb.OpenBusContext
...@@ -29,7 +29,7 @@ local expected = { ...@@ -29,7 +29,7 @@ local expected = {
function hello:sayHello() function hello:sayHello()
local chain = OpenBusContext:getCallerChain() local chain = OpenBusContext:getCallerChain()
local entity = chain.caller.entity local entity = chain.caller.entity
if expected[entity:match("^interop_chaining_(.-)_helloproxy$")] ~= nil then if expected[entity:match("^interop_chaining_(.-)_proxy$")] ~= nil then
log:TEST("got call from ",chain2str(chain)) log:TEST("got call from ",chain2str(chain))
return "Hello "..chain.originators[1].entity.."!" return "Hello "..chain.originators[1].entity.."!"
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment