Commit 12f3fc3d authored by Renato Figueiro Maia's avatar Renato Figueiro Maia

[OPENBUS-2646] (Lua) Modificar semântica do retorno do método logout nos SDKs


git-svn-id: https://subversion.tecgraf.puc-rio.br/engdist/openbus/sdk/lua/branches/02_00_01@158107 ae0415b3-e90b-0410-900d-d0be9363c56b
parent 260daf38
......@@ -609,7 +609,7 @@ function Connection:loginBySharedAuth(sharedauth)
end
function Connection:logout()
local result, except = false
local result, except = true
local login = self.login
if login ~= nil then
log:request(msg.PerformLogout:tag{
......@@ -621,6 +621,9 @@ function Connection:logout()
result, except = pcallWithin(self, self.AccessControl, "logout")
InvalidLoginThreads[thread] = nil
localLogout(self)
if not result and is_NO_PERMISSION(except, InvalidLoginCode) then
result, except = true, nil
end
end
self.invalidLogin = nil
return result, except
......
......@@ -107,7 +107,7 @@ local function assertlogoff(conn, invalid)
assert(conn.busid == nil)
if not invalid then
-- check the attempt to logoff again
assert(conn:logout() == false)
assert(conn:logout() == true)
-- check the failure of 'startSharedAuth'
local ex = catcherr(conn.startSharedAuth, conn)
assert(ex._repid == sysex.NO_PERMISSION)
......@@ -266,7 +266,7 @@ for _, connOp in ipairs({"DefaultConnection", "CurrentConnection"}) do
local loginid = conn.login.id
local busid = conn.busid
-- first logout
conn:logout()
assert(conn:logout() == true)
assertlogoff(conn)
-- second login
local function relogin()
......@@ -368,7 +368,7 @@ for _, connOp in ipairs({"DefaultConnection", "CurrentConnection"}) do
-- during logout
assert(called == nil)
invalidate(conn.login.id)
assert(conn:logout() == false)
assert(conn:logout() == true)
assert(called == nil)
assertlogoff(conn)
relogin()
......@@ -396,7 +396,7 @@ for _, connOp in ipairs({"DefaultConnection", "CurrentConnection"}) do
-- during logout
assert(called == nil)
invalidate(conn.login.id)
assert(conn:logout() == false)
assert(conn:logout() == true)
assert(called == nil)
assertlogoff(conn)
relogin()
......@@ -428,7 +428,7 @@ for _, connOp in ipairs({"DefaultConnection", "CurrentConnection"}) do
-- during logout
assert(called == nil)
invalidate(conn.login.id)
assert(conn:logout() == false)
assert(conn:logout() == true)
assert(called == nil)
assertlogoff(conn)
end
......
......@@ -117,7 +117,7 @@ do log:TEST("Relog while performing a call")
prx:entityLogout{id="???",entity="???"}
assert(conn:logout())
conn:logout()
OpenBusContext:setDefaultConnection(nil)
end
......@@ -141,7 +141,7 @@ do log:TEST("Relog while dispathing a call")
pxy:entityLogout{id="???",entity="???"}
assert(conn:logout())
conn:logout()
OpenBusContext:setDefaultConnection(nil)
end
......
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