public void testToSessionScope() throws Exception {
HttpSessionScopeContainer scope = new HttpSessionScopeContainer(workContext);
scope.start();
Object session1 = new Object();
workContext.setIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER, session1);
scope.onEvent(new HttpSessionStart(this, session1));
final OutboundWire wire = getWire(scope);
Target service = (Target) wireService.createProxy(wire);
Target target = (Target) wireService.createProxy(wire);
assertNotNull(service);
service.setString("foo");
assertEquals("foo", service.getString());
assertEquals("foo", target.getString());
workContext.clearIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER);
//second session
Object session2 = new Object();
workContext.setIdentifier(HttpSessionScopeContainer.HTTP_IDENTIFIER, session2);
scope.onEvent(new HttpSessionStart(this, session2));
Target service2 = (Target) wireService.createProxy(wire);
assertNotNull(service2);
assertNull(service2.getString());
Target target2 = (Target) wireService.createProxy(wire);