Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 237847 Details for
Bug 422837
Shutdown request should return valid JSON
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Proposed patch
bug-422837.patch (text/plain), 3.19 KB, created by
Ivan Furnadjiev
on 2013-11-29 07:54:24 EST
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Ivan Furnadjiev
Created:
2013-11-29 07:54:24 EST
Size:
3.19 KB
patch
obsolete
>diff --git a/bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/service/LifeCycleServiceHandler.java b/bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/service/LifeCycleServiceHandler.java >index 0203b72..64311e9 100644 >--- a/bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/service/LifeCycleServiceHandler.java >+++ b/bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/service/LifeCycleServiceHandler.java >@@ -24,6 +24,7 @@ > import javax.servlet.http.HttpServletRequest; > import javax.servlet.http.HttpServletResponse; > >+import org.eclipse.rap.json.JsonArray; > import org.eclipse.rap.json.JsonObject; > import org.eclipse.rap.json.JsonValue; > import org.eclipse.rap.rwt.RWT; >@@ -108,6 +109,7 @@ > writeInvalidContentType( response ); > } else if( isSessionShutdown() ) { > shutdownUISession(); >+ writeEmptyMessage( response ); > } else if( isSessionTimeout() ) { > writeSessionTimeoutError( response ); > } else if( !isRequestCounterValid() ) { >@@ -251,6 +253,13 @@ > response.setCharacterEncoding( HTTP.CHARSET_UTF_8 ); > } > >+ private static void writeEmptyMessage( ServletResponse response ) throws IOException { >+ JsonObject message = new JsonObject(); >+ message.add( ClientMessage.PROP_HEAD, new JsonObject() ); >+ message.add( ClientMessage.PROP_OPERATIONS, new JsonArray() ); >+ message.writeTo( response.getWriter() ); >+ } >+ > private static void writeProtocolMessage( ServletResponse response ) throws IOException { > JsonObject message = getProtocolWriter().createMessage(); > bufferProtocolMessage( message ); >diff --git a/tests/org.eclipse.rap.rwt.test/src/org/eclipse/rap/rwt/internal/service/LifeCycleServiceHandler_Test.java b/tests/org.eclipse.rap.rwt.test/src/org/eclipse/rap/rwt/internal/service/LifeCycleServiceHandler_Test.java >index 3f7504f..908cdf8 100644 >--- a/tests/org.eclipse.rap.rwt.test/src/org/eclipse/rap/rwt/internal/service/LifeCycleServiceHandler_Test.java >+++ b/tests/org.eclipse.rap.rwt.test/src/org/eclipse/rap/rwt/internal/service/LifeCycleServiceHandler_Test.java >@@ -14,6 +14,7 @@ > import static org.eclipse.rap.rwt.internal.service.ContextProvider.getApplicationContext; > import static org.junit.Assert.assertEquals; > import static org.junit.Assert.assertFalse; >+import static org.junit.Assert.assertNotNull; > import static org.junit.Assert.assertNotSame; > import static org.junit.Assert.assertNull; > import static org.junit.Assert.assertSame; >@@ -137,6 +138,19 @@ > } > > @Test >+ public void testShutdownUISession_returnsValidJson() throws IOException { >+ LifeCycleServiceHandler.markSessionStarted(); >+ simulateShutdownUiRequest(); >+ service( handler ); >+ >+ TestResponse response = getResponse(); >+ JsonObject message = JsonObject.readFrom( response.getContent() ); >+ assertEquals( "application/json; charset=UTF-8", response.getHeader( "Content-Type" ) ); >+ assertNotNull( message.get( ClientMessage.PROP_HEAD ) ); >+ assertNotNull( message.get( ClientMessage.PROP_OPERATIONS ) ); >+ } >+ >+ @Test > public void testShutdownUISession_RemoveUISessionFromHttpSession() throws IOException { > UISession uiSession = ContextProvider.getUISession(); > HttpSession httpSession = uiSession.getHttpSession();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 422837
:
237847
|
237848