@@ -0,0 +1,2280 @@
+package org.cache2k.test.core;%0A%0A/*%0A * #%25L%0A * cache2k core%0A * %25%25%0A * Copyright (C) 2000 - 2016 headissue GmbH, Munich%0A * %25%25%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A * %0A *      http://www.apache.org/licenses/LICENSE-2.0%0A * %0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A * #L%25%0A */%0A%0Aimport org.cache2k.Cache;%0Aimport org.cache2k.core.EntryAction;%0Aimport org.cache2k.junit.FastTests;%0Aimport org.cache2k.processor.CacheEntryProcessor;%0Aimport org.cache2k.processor.MutableCacheEntry;%0Aimport org.cache2k.test.util.IntCacheRule;%0Aimport org.junit.Before;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.junit.experimental.categories.Category;%0A%0Aimport static org.junit.Assert.*;%0A%0A/**%0A * @author Jens Wilke%0A */%0A@Category(FastTests.class)%0Apublic class EntryProcessorTest %7B%0A%0A  final static Integer KEY = 3;%0A%0A  /** Provide unique standard cache per method */%0A  @Rule public IntCacheRule target = new IntCacheRule();%0A  Cache%3CInteger, Integer%3E cache;%0A  @Before public void setup() %7B cache = target.cache(); %7D%0A%0A  /**%0A   * Test that exceptions get propagated, otherwise we cannot use assert inside the processor.%0A   */%0A  @Test(expected = EntryAction.ProcessingFailureException.class)%0A  public void exception() %7B%0A    cache.invoke(KEY, new CacheEntryProcessor%3CInteger, Integer, Object%3E() %7B%0A      @Override%0A      public Object process(final MutableCacheEntry%3CInteger, Integer%3E entry, final Object... arguments) throws Exception %7B%0A        throw new IllegalStateException(%22test%22);%0A      %7D%0A    %7D);%0A  %7D%0A%0A  @Test%0A  public void exists_Empty() %7B%0A    cache.invoke(KEY, new CacheEntryProcessor%3CInteger, Integer, Object%3E() %7B%0A      @Override%0A      public Object process(final MutableCacheEntry%3CInteger, Integer%3E entry, final Object... arguments) throws Exception %7B%0A        assertFalse(entry.exists());%0A        return null;%0A      %7D%0A    %7D);%0A    assertEquals(0, target.info().getSize());%0A  %7D%0A%0A%7D%0A

add test for entry processor