Project

General

Profile

Download (1.54 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
 * Copyright (C) 2014 EDIT
3
 * European Distributed Institute of Taxonomy
4
 * http://www.e-taxonomy.eu
5
 *
6
 * The contents of this file are subject to the Mozilla Public License Version 1.1
7
 * See LICENSE.TXT at the top of this package for the full license terms.
8
 */
9
package eu.etaxonomy.taxeditor.lazyloading;
10

    
11
import org.apache.logging.log4j.LogManager;
12
import org.apache.logging.log4j.Logger;
13
import org.junit.Assert;
14
import org.junit.Test;
15

    
16
import eu.etaxonomy.cdm.api.application.CdmApplicationState;
17
import eu.etaxonomy.cdm.api.cache.CdmServiceCachingProxy;
18
import eu.etaxonomy.cdm.model.common.Language;
19
import eu.etaxonomy.taxeditor.httpinvoker.RemotingSessionAwareTest;
20

    
21
public class CdmServiceCacherTest extends RemotingSessionAwareTest {
22

    
23
    @SuppressWarnings("unused")
24
    private static final Logger logger = LogManager.getLogger(CdmServiceCacherTest.class);
25

    
26
	private static CdmServiceCachingProxy cdmServiceCacher = CdmApplicationState.getTermProxy();
27

    
28
	@Test
29
	public void testLanguageCache() {
30
		Language defaultLanguage = Language.getDefaultLanguage();
31

    
32
		Language defaultLanguageInCache = (Language)cdmServiceCacher.getFromCache(defaultLanguage.getUuid());
33
		Assert.assertEquals("Loaded Language Term should match Language Term in Cache",defaultLanguage,defaultLanguageInCache);
34

    
35
		Language language = Language.getLanguageFromUuid(Language.uuidFrench);
36
		Language languageInCache = (Language)cdmServiceCacher.getFromCache(language.getUuid());
37
		Assert.assertEquals("Loaded Language Term should match Language Term in Cache",language,languageInCache);
38
	}
39
}
(2-2/5)