Project

General

Profile

Revision b52b1b9d

IDb52b1b9d91e5ba8ea42085eef9a20c35c3cfef04
Parent 11b2f52a
Child 9232c7e7

Added by Andreas Müller over 3 years ago

ref #6636: try to fix test for RIS import

View differences:

cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/reference/ris/in/RisReferenceImport.java
292 292
        String start = typeTag == null ? "??" : typeTag.location;
293 293
        String end = erTag == null ? "??" : erTag.location;
294 294

  
295
        String result = "line " + CdmUtils.concat("-", start, end);
295
        String result = "line " + CdmUtils.concat(" - ", start, end);
296 296

  
297 297
        return result;
298 298
    }
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/reference/ris/in/RisReferenceImportConfigurator.java
59 59
        InputStreamReader reader = new InputStreamReader(stream, "UTF8");
60 60

  
61 61
        RisReferenceImportConfigurator result = new RisReferenceImportConfigurator();
62
        result.setStream(IOUtils.toByteArray(stream));
62
        result.setStream(IOUtils.toByteArray(reader));
63 63
        return result;
64 64
    }
65 65

  
cdmlib-io/src/test/java/eu/etaxonomy/cdm/io/reference/RisReferenceImportTest.java
11 11

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

  
14
import java.io.FileInputStream;
15 14
import java.io.FileNotFoundException;
16 15
import java.net.URL;
17 16
import java.util.List;
......
57 56
	public void setUp() {
58 57
		String inputFile = "/eu/etaxonomy/cdm/io/reference/RisReferenceImportTest-input.ris";
59 58

  
60
		FileInputStream inputStream;
61 59
        try {
62
//            inputStream = new FileInputStream(inputFile);
63
//
64
//            byte[] data;
65
//            data = IOUtils.toByteArray(inputStream);
66 60
            URL url = this.getClass().getResource(inputFile);
67 61
            assertNotNull("URL for the test file '" + inputFile + "' does not exist", url);
68 62

  
69

  
70 63
            String inputFileLong = "/eu/etaxonomy/cdm/io/reference/Acantholimon.ris";
71 64
            URL urlLong = this.getClass().getResource(inputFileLong);
72 65
            assertNotNull("URL for the test file '" + inputFileLong + "' does not exist", urlLong);
73 66

  
74

  
75 67
			configurator = RisReferenceImportConfigurator.NewInstance(url, null);
76 68
			configLong = RisReferenceImportConfigurator.NewInstance(urlLong, null);
77 69

  
78 70

  
79

  
80 71
		} catch (Exception e) {
81 72
			e.printStackTrace();
82 73
			Assert.fail();
......
160 151
        String report = result.createReport().toString();
161 152
        System.out.println(report);
162 153

  
163
        Integer expected = 116;  //did not count yet
154
        Integer expected = 118;  //did not count yet
164 155
        Assert.assertEquals(expected, result.getNewRecords(Reference.class));
165 156

  
166 157
//        List<Reference> list = referenceService.list(Reference.class, null, null, null, null);

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)