Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.xwiki.cache.test;
import org.junit.jupiter.api.Test;
import org.xwiki.cache.Cache;
import org.xwiki.cache.CacheFactory;
import org.xwiki.cache.config.CacheConfiguration;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertSame;
/**
* Base class for testing cache component implementation.
*
* @version $Id: c4b428fc80f764818db488a2ec12893371c376bf $
*/
public abstract class AbstractGenericTestCache extends AbstractTestCache
{
/**
* @param roleHint the role hint of the cache component implementation to test.
*/
protected AbstractGenericTestCache(String roleHint)
{
super(roleHint);
}
/**
* Validate factory initialization.
*
* @throws Exception error.
*/
@Test
void getFactory() throws Exception
{
CacheFactory factory = getCacheFactory();
CacheFactory factory2 = getCacheFactory();
assertSame(factory, factory2);
}
/**
* Validate some basic cache use case without any constraints.
*
* @throws Exception error.
*/
@Test
void createAndDestroyCacheSimple() throws Exception
{
CacheFactory factory = getCacheFactory();
Cache