Skip to content
Snippets Groups Projects
Commit 1149d806 authored by buczekp's avatar buczekp
Browse files

[LMS-1719] more reliable handling of session expired exception in tests

SVN: 22134
parent 7af07756
No related branches found
No related tags found
No related merge requests found
...@@ -212,7 +212,7 @@ public abstract class AbstractAsyncCallback<T> implements AsyncCallback<T> ...@@ -212,7 +212,7 @@ public abstract class AbstractAsyncCallback<T> implements AsyncCallback<T>
if (isIncompatibleServerException(caught)) if (isIncompatibleServerException(caught))
{ {
String sessionExpiredMessage = getMessage(Dict.SESSION_EXPIRED_MESSAGE); String sessionExpiredMessage = getMessage(Dict.SESSION_EXPIRED_MESSAGE);
handleSessionTerminated(sessionExpiredMessage); handleSessionTerminated(sessionExpiredMessage, caught);
return; return;
} }
...@@ -239,12 +239,7 @@ public abstract class AbstractAsyncCallback<T> implements AsyncCallback<T> ...@@ -239,12 +239,7 @@ public abstract class AbstractAsyncCallback<T> implements AsyncCallback<T>
} }
if (caught instanceof InvalidSessionException) if (caught instanceof InvalidSessionException)
{ {
handleSessionTerminated(msg); handleSessionTerminated(msg, caught);
// only for tests
if (staticCallbackListener != DEFAULT_CALLBACK_LISTENER)
{
callbackListener.onFailureOf(viewContext, this, msg, caught);
}
} else } else
{ {
callbackListener.onFailureOf(viewContext, this, msg, caught); callbackListener.onFailureOf(viewContext, this, msg, caught);
...@@ -281,7 +276,7 @@ public abstract class AbstractAsyncCallback<T> implements AsyncCallback<T> ...@@ -281,7 +276,7 @@ public abstract class AbstractAsyncCallback<T> implements AsyncCallback<T>
} }
} }
private void handleSessionTerminated(String msg) private void handleSessionTerminated(String msg, Throwable caught)
{ {
if (viewContext.isSimpleOrEmbeddedMode()) if (viewContext.isSimpleOrEmbeddedMode())
{ {
...@@ -290,6 +285,11 @@ public abstract class AbstractAsyncCallback<T> implements AsyncCallback<T> ...@@ -290,6 +285,11 @@ public abstract class AbstractAsyncCallback<T> implements AsyncCallback<T>
{ {
showSessionTerminated(msg); showSessionTerminated(msg);
} }
// only for tests
if (staticCallbackListener != DEFAULT_CALLBACK_LISTENER)
{
callbackListener.onFailureOf(viewContext, this, msg, caught);
}
} }
private void showSessionTerminated(String msg) private void showSessionTerminated(String msg)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment