1 /*
2 * RCache - A collection of simple reference-based cache implementations.
3 * Copyright (C) 2007 Rodrigo Ruiz
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19 package net.sourceforge.rcache;
20
21 /**
22 * TestCase for {@link net.sourceforge.rcache.SoftCache}.
23 *
24 * @author Rodrigo Ruiz
25 */
26 public class SoftCacheTest extends BaseCacheTest {
27
28 /**
29 * {@inheritDoc}
30 */
31 @Override protected final BaseCache<Integer, Object> createCache() {
32 return new SoftCache<Integer, Object>();
33 }
34
35 /**
36 * {@inheritDoc}
37 */
38 @Override protected final BaseCache<Integer, Object> createCache(int capacity) {
39 return new SoftCache<Integer, Object>(capacity);
40 }
41
42 /**
43 * {@inheritDoc}
44 */
45 @Override protected final BaseCache<Integer, Object> createCache(int capacity,
46 float factor) {
47 return new SoftCache<Integer, Object>(capacity, factor);
48 }
49
50 /**
51 * {@inheritDoc}
52 */
53 @Override protected final BaseCache<Integer, Object> createCache(int capacity,
54 float factor, int level) {
55 return new SoftCache<Integer, Object>(capacity, factor, level);
56 }
57 }