Project

General

Profile

Download (1.85 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2007 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

    
10
package eu.etaxonomy.cdm.io.sdd.in;
11

    
12
import static org.junit.Assert.assertEquals;
13
import static org.junit.Assert.assertNotNull;
14

    
15
import java.net.URISyntaxException;
16
import java.net.URL;
17

    
18
import junit.framework.Assert;
19

    
20
import org.junit.Before;
21
import org.junit.Ignore;
22
import org.junit.Test;
23
import org.unitils.spring.annotation.SpringBeanByType;
24

    
25
import eu.etaxonomy.cdm.api.service.INameService;
26
import eu.etaxonomy.cdm.test.integration.CdmTransactionalIntegrationTest;
27

    
28
/**
29
 * @author b.clark
30
 * @created 20.01.2009
31
 * @version 1.0
32
 */
33

    
34
//@Ignore // we ignore this test at the moment because it does not run with maven
35
public class SDDImportTest extends CdmTransactionalIntegrationTest {
36

    
37
    @SpringBeanByType
38
    SDDImport sddImport;
39

    
40
    @SpringBeanByType
41
    INameService nameService;
42

    
43
    private SDDImportConfigurator configurator;
44

    
45
    @Before
46
    public void setUp() throws URISyntaxException {
47
        URL url = this.getClass().getResource("/eu/etaxonomy/cdm/io/sdd/SDDImportTest-input.xml");
48
        Assert.assertNotNull(url);
49
        configurator = SDDImportConfigurator.NewInstance(url.toURI(), null);
50
    }
51

    
52
    @Test
53
    public void testInit() {
54
        assertNotNull("sddImport should not be null", sddImport);
55
        assertNotNull("nameService should not be null", nameService);
56
    }
57

    
58
    @Test
59
    public void testDoInvoke() {
60
        sddImport.doInvoke(new SDDImportState(configurator));
61
        this.setComplete();
62
        this.endTransaction();
63
        assertEquals("Number of TaxonNames should be 1", 1, nameService.count(null));
64
    }
65

    
66
}
(2-2/2)