Project

General

Profile

« Previous | Next » 

Revision 60199

fixed NPE

View differences:

BibTexConverterTest.java
1 1
package eu.dnetlib.data.utils;
2 2

  
3
import java.io.IOException;
4

  
5
import javax.xml.bind.JAXBException;
6

  
7
import org.apache.commons.io.IOUtils;
3 8
import org.junit.Ignore;
4 9
import org.junit.Test;
5 10

  
11
import com.google.gson.JsonSyntaxException;
12

  
6 13
import eu.dnetlib.data.mdstore.plugins.objects.MdRecord;
14
import eu.dnetlib.data.mdstore.plugins.objects.MdRecordConvertUtils;
7 15

  
8 16
public class BibTexConverterTest {
9 17

  
......
32 40
	}
33 41

  
34 42
	@Test
43
	@Ignore
35 44
	public void testAsBibTex_article_source_1() {
36 45

  
37 46
		final MdRecord record = new MdRecord();
......
47 56

  
48 57
	}
49 58

  
59
	@Test
60
	public void testAsBibTex_file() throws JsonSyntaxException, IOException, JAXBException {
61

  
62
		final String xml = IOUtils.toString(getClass().getResourceAsStream("record.xml"));
63

  
64
		final MdRecord record = MdRecordConvertUtils.fromString(xml);
65

  
66
		final String bib = BibTexConverter.asBibTex(record);
67

  
68
		System.out.println(bib);
69

  
70
	}
50 71
}

Also available in: Unified diff