Commit e06eff7f authored by Renato Figueiro Maia's avatar Renato Figueiro Maia

Merge from branch 02_00_00 (159696:159697)

git-svn-id: https://subversion.tecgraf.puc-rio.br/engdist/openbus/sdk/lua/branches/02_00_01@159709 ae0415b3-e90b-0410-900d-d0be9363c56b
parents 1da9976b 07d7a80e
local log = require "openbus.util.logger"
local openbus = require "openbus" local openbus = require "openbus"
local log = require "openbus.util.logger"
local ComponentContext = require "scs.core.ComponentContext" local ComponentContext = require "scs.core.ComponentContext"
local table = require "loop.table" local table = require "loop.table"
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 definitions -- load interface definitions
orb:loadidlfile("idl/messages.idl") orb:loadidlfile("idl/messages.idl")
local iface = orb.types:lookup("tecgraf::openbus::interop::delegation::Broadcaster") local iface = orb.types:lookup("tecgraf::openbus::interop::delegation::Broadcaster")
-- 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 table = table
local unpack = table.unpack or unpack
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 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/messages.idl") orb:loadidlfile("idl/messages.idl")
local iface = orb.types:lookup("tecgraf::openbus::interop::delegation::Messenger") local iface = orb.types:lookup("tecgraf::openbus::interop::delegation::Messenger")
-- customize test configuration for this case
settestcfg(iface, ...)
-- get bus context manager -- get bus context manager
local OpenBusContext = orb.OpenBusContext local OpenBusContext = orb.OpenBusContext
...@@ -31,7 +29,7 @@ local services = {} ...@@ -31,7 +29,7 @@ local services = {}
for _, name in ipairs{"Messenger", "Broadcaster", "Forwarder"} do for _, name in ipairs{"Messenger", "Broadcaster", "Forwarder"} do
-- define service properties -- define service properties
local iface = orb.types:lookup("tecgraf::openbus::interop::delegation::"..name) local iface = orb.types:lookup("tecgraf::openbus::interop::delegation::"..name)
local props = { unpack(properties), local props = { table.unpack(properties),
{name="openbus.component.interface",value=iface.repID}, {name="openbus.component.interface",value=iface.repID},
} }
-- retrieve service -- retrieve service
......
local log = require "openbus.util.logger"
local openbus = require "openbus" local openbus = require "openbus"
local log = require "openbus.util.logger"
local ComponentContext = require "scs.core.ComponentContext" local ComponentContext = require "scs.core.ComponentContext"
local table = require "loop.table" local table = require "loop.table"
local Timer = require "cothread.Timer" local Timer = require "cothread.Timer"
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 definitions -- load interface definitions
orb:loadidlfile("idl/messages.idl") orb:loadidlfile("idl/messages.idl")
local iface = orb.types:lookup("tecgraf::openbus::interop::delegation::Forwarder") local iface = orb.types:lookup("tecgraf::openbus::interop::delegation::Forwarder")
-- 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 ComponentContext = require "scs.core.ComponentContext" local ComponentContext = require "scs.core.ComponentContext"
local table = require "loop.table" local table = require "loop.table"
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 definitions -- load interface definitions
orb:loadidlfile("idl/messages.idl") orb:loadidlfile("idl/messages.idl")
local iface = orb.types:lookup("tecgraf::openbus::interop::delegation::Messenger") local iface = orb.types:lookup("tecgraf::openbus::interop::delegation::Messenger")
-- 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 table = require "loop.table"
local log = require "openbus.util.logger"
local openbus = require "openbus" local openbus = require "openbus"
local log = require "openbus.util.logger"
local table = require "loop.table"
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)
orb:loadidlfile("idl/hello.idl") orb:loadidlfile("idl/hello.idl")
-- load interface definition -- load interface definition
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
......
local log = require "openbus.util.logger"
local openbus = require "openbus" local openbus = require "openbus"
local log = require "openbus.util.logger"
local ComponentContext = require "scs.core.ComponentContext" local ComponentContext = require "scs.core.ComponentContext"
require "openbus.test.util" require "openbus.test.util"
-- setup and start the ORBs -- setup and start the ORBs
local orb1 = openbus.initORB() settestcfg(...)
local orb2 = openbus.initORB() local orb1 = openbus.initORB(orbcfg)
settestcfg(...)
local orb2 = openbus.initORB(orbcfg)
-- load interface definition -- load interface definition
orb1:loadidlfile("idl/hello.idl") orb1:loadidlfile("idl/hello.idl")
orb2:loadidlfile("idl/hello.idl") orb2:loadidlfile("idl/hello.idl")
local iface = orb1.types:lookup("tecgraf::openbus::interop::simple::Hello") local iface = orb1.types:lookup("tecgraf::openbus::interop::simple::Hello")
-- customize test configuration for this case
settestcfg(iface, ...)
-- get bus context manager -- get bus context manager
local OpenBusContext1 = orb1.OpenBusContext local OpenBusContext1 = orb1.OpenBusContext
local OpenBusContext2 = orb2.OpenBusContext local OpenBusContext2 = orb2.OpenBusContext
......
local openbus = require "openbus"
local idl = require "openbus.core.idl" local idl = require "openbus.core.idl"
local log = require "openbus.util.logger" local log = require "openbus.util.logger"
local except = require "openbus.util.except" local except = require "openbus.util.except"
local openbus = require "openbus"
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/mock.idl") orb:loadidlfile("idl/mock.idl")
local iface = orb.types:lookup("tecgraf::openbus::interop::protocol::Server") local iface = orb.types:lookup("tecgraf::openbus::interop::protocol::Server")
-- 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 ComponentContext = require "scs.core.ComponentContext" local ComponentContext = require "scs.core.ComponentContext"
-- create service implementation -- create service implementation
...@@ -50,11 +50,11 @@ end ...@@ -50,11 +50,11 @@ end
require "openbus.test.util" require "openbus.test.util"
-- setup and start the ORB
local orb = openbus.initORB()
-- customize test configuration for this case -- customize test configuration for this case
settestcfg(iface, ...) settestcfg(...)
-- setup and start the ORB
local orb = openbus.initORB(orbcfg)
-- 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"
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/hello.idl") orb:loadidlfile("idl/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
......
local table = require "loop.table"
local log = require "openbus.util.logger"
local openbus = require "openbus" local openbus = require "openbus"
local log = require "openbus.util.logger"
local ComponentContext = require "scs.core.ComponentContext" local ComponentContext = require "scs.core.ComponentContext"
local table = require "loop.table"
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/hello.idl") orb:loadidlfile("idl/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, ...)
-- read login private key -- read login private key
local key = assert(openbus.readKeyFile(syskey)) local key = assert(openbus.readKeyFile(syskey))
......
local table = require "loop.table"
local log = require "openbus.util.logger"
local openbus = require "openbus" local openbus = require "openbus"
local log = require "openbus.util.logger"
local ComponentContext = require "scs.core.ComponentContext" local ComponentContext = require "scs.core.ComponentContext"
local table = require "loop.table"
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/hello.idl") orb:loadidlfile("idl/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
......
local except = require "openbus.util.except"
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/hello.idl") orb:loadidlfile("idl/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
......
local log = require "openbus.util.logger"
local openbus = require "openbus" local openbus = require "openbus"
local log = require "openbus.util.logger"
local ComponentContext = require "scs.core.ComponentContext" local ComponentContext = require "scs.core.ComponentContext"
local oil = require "oil" local oil = require "oil"
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/hello.idl") orb:loadidlfile("idl/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
......
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/hello.idl") orb:loadidlfile("idl/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
......
local log = require "openbus.util.logger"
local openbus = require "openbus" local openbus = require "openbus"
local log = require "openbus.util.logger"
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/hello.idl") orb:loadidlfile("idl/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
......
...@@ -67,7 +67,7 @@ local InvalidTargetCode = loginconst.InvalidTargetCode ...@@ -67,7 +67,7 @@ local InvalidTargetCode = loginconst.InvalidTargetCode
local UnknownBusCode = loginconst.UnknownBusCode local UnknownBusCode = loginconst.UnknownBusCode
local NoLoginCode = loginconst.NoLoginCode local NoLoginCode = loginconst.NoLoginCode
local UnavailableBusCode = loginconst.UnavailableBusCode local UnavailableBusCode = loginconst.UnavailableBusCode
local UnavailableBusCode = loginconst.UnavailableBusCode local UnknownBusCode = loginconst.UnknownBusCode
local oldidl = require "openbus.core.legacy.idl" local oldidl = require "openbus.core.legacy.idl"
local loadoldidl = oldidl.loadto local loadoldidl = oldidl.loadto
...@@ -474,7 +474,7 @@ function Interceptor:receiverequest(request, credential) ...@@ -474,7 +474,7 @@ function Interceptor:receiverequest(request, credential)
entity = caller.entity, entity = caller.entity,
delegate = credential.delegate, delegate = credential.delegate,
}) })
setNoPermSysEx(request, InvalidCredentialCode) setNoPermSysEx(request, 0)
else else
-- invalid credential, try to reset credetial session -- invalid credential, try to reset credetial session
local sessions = self.incomingSessions local sessions = self.incomingSessions
......
...@@ -5,9 +5,8 @@ local openbus = require "openbus" ...@@ -5,9 +5,8 @@ local openbus = require "openbus"
require "openbus.test.configs" require "openbus.test.configs"
function settestcfg(interface, testname) function settestcfg(testname, security)
local name = interface.name:lower() local name = arg[0]:match("(%w+)%.lua$")
if name == "hello" then name = "server" end
local language = "lua" local language = "lua"
local domain = "interop_"..testname local domain = "interop_"..testname
system = domain.."_"..language.."_"..name system = domain.."_"..language.."_"..name
......
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