Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 354368 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/rwt/internal/service/LifeCycleServiceHandler.java (-1 / +1 lines)
Lines 127-133 Link Here
127
    }
127
    }
128
  }
128
  }
129
129
130
  private static void clearSessionStore() {
130
  static void clearSessionStore() {
131
    Integer version = RWTRequestVersionControl.getInstance().getCurrentRequestId();
131
    Integer version = RWTRequestVersionControl.getInstance().getCurrentRequestId();
132
    SessionStoreImpl sessionStore = ( SessionStoreImpl )ContextProvider.getSession();
132
    SessionStoreImpl sessionStore = ( SessionStoreImpl )ContextProvider.getSession();
133
    // clear attributes of session store to enable new startup
133
    // clear attributes of session store to enable new startup
(-)src/org/eclipse/rwt/internal/service/LifeCycleServiceHandler_Test.java (+25 lines)
Lines 24-29 Link Here
24
import junit.framework.TestCase;
24
import junit.framework.TestCase;
25
25
26
import org.eclipse.rap.rwt.testfixture.Fixture;
26
import org.eclipse.rap.rwt.testfixture.Fixture;
27
import org.eclipse.rap.rwt.testfixture.TestRequest;
28
import org.eclipse.rap.rwt.testfixture.TestResponse;
27
import org.eclipse.rwt.internal.application.RWTFactory;
29
import org.eclipse.rwt.internal.application.RWTFactory;
28
import org.eclipse.rwt.internal.lifecycle.*;
30
import org.eclipse.rwt.internal.lifecycle.*;
29
import org.eclipse.rwt.service.IServiceHandler;
31
import org.eclipse.rwt.service.IServiceHandler;
Lines 139-144 Link Here
139
    
141
    
140
    verify( fakeWriter ).finish();
142
    verify( fakeWriter ).finish();
141
  }
143
  }
144
  
145
  public void testConcurrentlyResterSession() throws InterruptedException {
146
    final HttpSession session = ContextProvider.getSession().getHttpSession();
147
    final Throwable[] exception = { null };
148
    Runnable runnable = new Runnable() {
149
      public void run() {
150
        try {
151
          TestRequest request = new TestRequest();
152
          request.setSession( session );
153
          Fixture.createServiceContext( new TestResponse(), request );
154
          LifeCycleServiceHandler.clearSessionStore();
155
        } catch( Exception e ) {
156
          e.printStackTrace();
157
          exception[ 0 ] = e;
158
        }
159
      }
160
    };
161
    
162
    Thread[] threads = Fixture.startThreads( 200, runnable );
163
    Fixture.joinThreads( threads );
164
    
165
    assertNull( exception[ 0 ] );
166
  }
142
167
143
  protected void setUp() {
168
  protected void setUp() {
144
    Fixture.setUp();
169
    Fixture.setUp();

Return to bug 354368