Project

General

Profile

Download (1.07 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2017 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.cdm.cache;
10

    
11

    
12
import org.junit.Assert;
13
import org.junit.Test;
14

    
15
import eu.etaxonomy.cdm.model.occurrence.Collection;
16

    
17
/**
18
 * @author a.kohlbecker
19
 * @since 09.11.2017
20
 *
21
 */
22
public class EntityCacheTest {
23

    
24
    @Test
25
    public void EntityKeyTest() {
26

    
27
        Collection collection1 = Collection.NewInstance();
28
        Collection collection2 = Collection.NewInstance();
29
        collection1.setId(81);
30
        collection2.setId(81);
31

    
32

    
33
        CdmEntityCache cache = new CdmEntityCache(collection1);
34

    
35
        CdmEntityCache.EntityKey key1 = cache.new EntityKey(collection1);
36

    
37
        CdmEntityCache.EntityKey key2 = cache.new EntityKey(collection2);
38

    
39
        Assert.assertEquals(key1, key2);
40

    
41
        Assert.assertEquals(key1.hashCode(), key2.hashCode());
42

    
43
        Assert.assertNotNull(cache.find(collection1));
44
    }
45

    
46
}
    (1-1/1)