~mortenoh/+junk/dhis2-detailed-import-export

« back to all changes in this revision

Viewing changes to dhis-2/dhis-services/dhis-service-importexport/src/test/java/org/hisp/dhis/importexport/dhis14/Dhis14XmlImportServiceTest.java

  • Committer: larshelge at gmail
  • Date: 2009-03-03 16:46:36 UTC
  • Revision ID: larshelge@gmail.com-20090303164636-2sjlrquo7ib1gf7r
Initial check-in

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.hisp.dhis.importexport.dhis14;
 
2
 
 
3
import java.io.InputStream;
 
4
 
 
5
import org.hisp.dhis.DhisSpringTest;
 
6
import org.hisp.dhis.importexport.ImportInternalProcess;
 
7
import org.hisp.dhis.importexport.ImportParams;
 
8
import org.hisp.dhis.importexport.ImportType;
 
9
 
 
10
public class Dhis14XmlImportServiceTest
 
11
    extends DhisSpringTest
 
12
{
 
13
    private ImportInternalProcess importService;
 
14
 
 
15
    private InputStream inputStream;
 
16
 
 
17
    // -------------------------------------------------------------------------
 
18
    // Fixture
 
19
    // -------------------------------------------------------------------------
 
20
 
 
21
    public void setUpTest()
 
22
    {
 
23
        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
 
24
        
 
25
        inputStream = classLoader.getResourceAsStream( "dhis14A.zip" );
 
26
        
 
27
        importService = (ImportInternalProcess) getBean( "internal-process-DHIS14XMLImportService" );
 
28
    }
 
29
 
 
30
    // -------------------------------------------------------------------------
 
31
    // Tests
 
32
    // -------------------------------------------------------------------------
 
33
 
 
34
    public void testImport()
 
35
    {
 
36
        ImportParams params = new ImportParams();
 
37
 
 
38
        params.setType( ImportType.IMPORT );
 
39
        params.setDataValues( true );
 
40
        params.setExtendedMode( false );
 
41
        params.setSkipCheckMatching( false );
 
42
        
 
43
        importService.importData( params, inputStream );
 
44
    }
 
45
}