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 237848 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]
Updated patch with suggestion from comment #2
bug-422837.patch (text/plain), 2.79 KB, created by
Ivan Furnadjiev
on 2013-11-29 08:29:27 EST
(
hide
)
Description:
Updated patch with suggestion from comment #2
Filename:
MIME Type:
Creator:
Ivan Furnadjiev
Created:
2013-11-29 08:29:27 EST
Size:
2.79 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..66bd51b 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 >@@ -108,6 +108,7 @@ > writeInvalidContentType( response ); > } else if( isSessionShutdown() ) { > shutdownUISession(); >+ writeEmptyMessage( response ); > } else if( isSessionTimeout() ) { > writeSessionTimeoutError( response ); > } else if( !isRequestCounterValid() ) { >@@ -251,6 +252,10 @@ > response.setCharacterEncoding( HTTP.CHARSET_UTF_8 ); > } > >+ private static void writeEmptyMessage( ServletResponse response ) throws IOException { >+ new ProtocolMessageWriter().createMessage().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
Flags:
ivan
:
review?
rsternberg
:
review+
Actions:
View
|
Diff
Attachments on
bug 422837
:
237847
| 237848