Revision 44352
Added by Sandro La Bruzzo over 7 years ago
XsltRowTransformerFactoryTest.java | ||
---|---|---|
10 | 10 |
import com.google.common.collect.Lists; |
11 | 11 |
import com.google.common.collect.Maps; |
12 | 12 |
import com.google.common.collect.Sets; |
13 |
import com.google.protobuf.ExtensionRegistry; |
|
13 | 14 |
import com.google.protobuf.InvalidProtocolBufferException; |
14 | 15 |
import eu.dnetlib.data.mapreduce.hbase.index.config.*; |
15 | 16 |
import eu.dnetlib.data.mapreduce.util.*; |
17 |
import eu.dnetlib.data.proto.DNGFProtos.DNGF; |
|
18 |
import eu.dnetlib.data.proto.DliFieldTypeProtos; |
|
19 |
import eu.dnetlib.data.proto.DliProtos; |
|
20 |
import eu.dnetlib.data.proto.DliRels; |
|
16 | 21 |
import eu.dnetlib.data.proto.KindProtos.Kind; |
17 |
import eu.dnetlib.data.proto.DNGFProtos.DNGF; |
|
18 | 22 |
import eu.dnetlib.data.proto.TypeProtos.Type; |
19 | 23 |
import eu.dnetlib.miscutils.functional.xml.XMLIndenter; |
20 | 24 |
import org.apache.commons.io.IOUtils; |
... | ... | |
166 | 170 |
} |
167 | 171 |
|
168 | 172 |
@Test |
169 |
public void testParseWDSDatacite() throws Exception { |
|
173 |
public void testParseWDSDaaaatacite() throws Exception {
|
|
170 | 174 |
|
171 | 175 |
doTest(loadFromTransformationProfile("dmfwds2hbase.xml"), load("recordWds.xml")); |
172 | 176 |
} |
173 | 177 |
|
178 |
|
|
174 | 179 |
@Test |
180 |
public void testParseDLIDatacite() throws Exception { |
|
181 |
|
|
182 |
doTest(loadFromTransformationProfile("dmfdli2hbase.xml"), load("record_dli_dmf.xml")); |
|
183 |
} |
|
184 |
|
|
185 |
@Test |
|
186 |
public void testParseDLIPMF() throws Exception { |
|
187 |
|
|
188 |
final List<Row> rows = Lists.newArrayList(); |
|
189 |
rows.addAll(asRows(loadFromTransformationProfile("pmfdli2hbase.xml"), load("record_dli_pmf.xml"))); |
|
190 |
|
|
191 |
final ExtensionRegistry r = ExtensionRegistry.newInstance(); |
|
192 |
|
|
193 |
rows.forEach(row -> { |
|
194 |
row.getColumns().forEach(result -> { |
|
195 |
if (result != null) { |
|
196 |
final DNGFDecoder decoder = |
|
197 |
DNGFDecoder.decode(result.getValue(), DliFieldTypeProtos.completionStatus, DliProtos.resolvedfrom, DliProtos.completionStatus, |
|
198 |
DliRels.isRelatedTo); |
|
199 |
|
|
200 |
System.out.println("decoder.getDNGF().toString() = " + decoder.getDNGF().toString()); |
|
201 |
} |
|
202 |
} |
|
203 |
); |
|
204 |
}); |
|
205 |
} |
|
206 |
|
|
207 |
@Test |
|
175 | 208 |
public void testParseDatacite() throws Exception { |
176 | 209 |
|
177 | 210 |
doTest(loadFromTransformationProfile("dmf2hbase.xml"), load("recordDatacite.xml")); |
... | ... | |
331 | 364 |
|
332 | 365 |
final Map<String, Map<String, Map<String, byte[]>>> table = buildTable(rows); |
333 | 366 |
|
334 |
// System.out.println("\n" + table.toString());
|
|
367 |
//System.out.println("\n" + table.toString()); |
|
335 | 368 |
|
336 | 369 |
final Map<String, XmlRecordFactory> builders = mapAll(table); |
337 | 370 |
|
Also available in: Unified diff
fixed bug