/** * {@inheritDoc} */ @Override public void backgroundProcess() { _msm.updateExpirationInMemcached(); super.backgroundProcess(); }
/** * {@inheritDoc} */ @Override public void backgroundProcess() { _msm.updateExpirationInMemcached(); super.backgroundProcess(); }
/** * {@inheritDoc} */ @Override public void backgroundProcess() { _msm.updateExpirationInMemcached(); super.backgroundProcess(); }
/** * {@inheritDoc} */ @Override public void backgroundProcess() { _msm.updateExpirationInMemcached(); super.backgroundProcess(); }
/** * Tests sessionAttributeFilter attribute: only filtered/allowed attributes must be serialized in updateExpirationInMemcached. */ @SuppressWarnings( { "unchecked", "rawtypes" } ) @Test public void testOnlyFilteredAttributesAreIncludedDuringUpdateExpiration() throws InterruptedException, ExecutionException { final TranscoderService transcoderServiceMock = mock( TranscoderService.class ); final ConcurrentMap<String, Object> anyMap = any( ConcurrentMap.class ); when( transcoderServiceMock.serializeAttributes( any( MemcachedBackupSession.class ), anyMap ) ).thenReturn( new byte[0] ); _service.setTranscoderService( transcoderServiceMock ); final MemcachedBackupSession session = createSession( _service ); _service.setSessionAttributeFilter( "^(foo|bar)$" ); session.setAttribute( "foo", "foo" ); session.setAttribute( "bar", "bar" ); session.setAttribute( "baz", "baz" ); session.access(); session.endAccess(); _service.updateExpirationInMemcached(); // capture the supplied argument, alternatively we could have used some Matcher (but there seems to be no MapMatcher). final ArgumentCaptor<ConcurrentMap> model = ArgumentCaptor.forClass( ConcurrentMap.class ); verify( transcoderServiceMock, times( 1 ) ).serializeAttributes( eq( session ), model.capture() ); // the serialized attributes must only contain allowed ones assertTrue( model.getValue().containsKey( "foo" ) ); assertTrue( model.getValue().containsKey( "bar" ) ); assertFalse( model.getValue().containsKey( "baz" ) ); }
/** * {@inheritDoc} */ @Override public void backgroundProcess() { _msm.updateExpirationInMemcached(); super.backgroundProcess(); }