Project

General

Profile

Download (1.91 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.cdm.api.service.molecular;
10

    
11
import static org.junit.Assert.assertEquals;
12

    
13
import java.io.FileNotFoundException;
14
import java.util.List;
15
import java.util.UUID;
16

    
17
import org.apache.log4j.Logger;
18
import org.junit.Test;
19
import org.unitils.spring.annotation.SpringBeanByType;
20

    
21
import eu.etaxonomy.cdm.model.molecular.Primer;
22
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
23
import eu.etaxonomy.cdm.test.integration.CdmTransactionalIntegrationTest;
24

    
25
/**
26
 * @author pplitzner
27
 \* @since 31.03.2014
28
 *
29
 */
30
public class PrimerServiceTest extends CdmTransactionalIntegrationTest {
31
    private static final Logger logger = Logger.getLogger(PrimerServiceTest.class);
32

    
33
    @SpringBeanByType
34
    private IPrimerService primerService;
35

    
36
    @Test
37
    public void testGetPrimerUuidAndTitleCache(){
38
        String primerLabel = "MatK";
39
        Primer primer = Primer.NewInstance(primerLabel);
40
        UUID uuid = primerService.save(primer).getUuid();
41

    
42
        List<UuidAndTitleCache<Primer>> primerUuidAndTitleCache = primerService.getPrimerUuidAndTitleCache();
43
        assertEquals("Number of Primers in DB is incorrect.", 1, primerUuidAndTitleCache.size());
44
        UuidAndTitleCache<Primer> uuidAndTitleCache = primerUuidAndTitleCache.iterator().next();
45
        assertEquals("UUID is incorrect.", uuid, uuidAndTitleCache.getUuid());
46
        assertEquals("Label is incorrect.", primerLabel, uuidAndTitleCache.getTitleCache());
47
    }
48

    
49
    /* (non-Javadoc)
50
     * @see eu.etaxonomy.cdm.test.integration.CdmIntegrationTest#createTestData()
51
     */
52
    @Override
53
    public void createTestDataSet() throws FileNotFoundException {
54
        // TODO Auto-generated method stub
55

    
56
    }
57

    
58
}
(2-2/3)