Revision 58601
Added by Claudio Atzori almost 4 years ago
XsltRowTransformerFactoryTest.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.transform; |
2 | 2 |
|
3 |
import static org.junit.Assert.assertFalse; |
|
4 |
import static org.junit.Assert.assertNotNull; |
|
5 |
import static org.junit.Assert.assertTrue; |
|
6 |
|
|
7 | 3 |
import java.io.BufferedReader; |
8 | 4 |
import java.io.IOException; |
9 | 5 |
import java.io.InputStream; |
... | ... | |
69 | 65 |
import eu.dnetlib.data.proto.TypeProtos.Type; |
70 | 66 |
import eu.dnetlib.miscutils.functional.xml.IndentXmlString; |
71 | 67 |
|
68 |
import static org.junit.Assert.*; |
|
69 |
|
|
72 | 70 |
public class XsltRowTransformerFactoryTest { |
73 | 71 |
|
74 | 72 |
private static final Log log = LogFactory.getLog(XsltRowTransformerFactoryTest.class); |
... | ... | |
224 | 222 |
printAll(mapAll(buildTable(rows))); |
225 | 223 |
} |
226 | 224 |
|
225 |
@Test |
|
226 |
public void testXpath() throws DocumentException { |
|
227 | 227 |
|
228 |
final String value = "CONICYT"; |
|
229 |
|
|
230 |
String ftree = "<fundingtree><funder><id>conicytf____::CONICYT</id><shortname>"+value+"</shortname><name>ComisiónNacionaldeInvestigaciónCientíficayTecnológica</name><jurisdiction>CL</jurisdiction></funder><funding_level_1><id>conicytf____::CONICYT::FONDECYT::REGULAR</id><description>Fondecytstream,REGULAR</description><name>Fondecytstream,REGULAR</name><class>conicyt:fondecytfundings</class><parent><funding_level_0><id>conicytf____::CONICYT::FONDECYT</id><name>FONDECYT</name><description>Fondecytfundings</description><parent/><class>conicyt:fondecytfundings</class></funding_level_0></parent></funding_level_1></fundingtree>"; |
|
231 |
final Document doc = new SAXReader().read(new StringReader(ftree)); |
|
232 |
|
|
233 |
assertEquals(value, doc.valueOf("//fundingtree/funder/shortname/text()")); |
|
234 |
} |
|
235 |
|
|
236 |
|
|
228 | 237 |
@Test |
229 | 238 |
public void testParseOaf() throws Exception { |
230 | 239 |
|
... | ... | |
244 | 253 |
} |
245 | 254 |
|
246 | 255 |
@Test |
256 |
public void testParseOpenAPCrecord() throws Exception { |
|
257 |
|
|
258 |
doTest(loadFromTransformationProfile("oaf2hbase.xml"), load("recordOpenAPC.xml")); |
|
259 |
} |
|
260 |
|
|
261 |
@Test |
|
247 | 262 |
public void testParseDatacite() throws Exception { |
248 | 263 |
|
249 | 264 |
doTest(loadFromTransformationProfile("odf2hbase.xml"), load("recordDatacite.xml")); |
Also available in: Unified diff
less memory pressure on the hbase table export job, context propagation utils. Proto exporter aligned with most recent dhp.model changes