Revision 41468
Added by Claudio Atzori about 8 years ago
XsltRowTransformerFactoryTest.java | ||
---|---|---|
100 | 100 |
@Test |
101 | 101 |
public void testParseClaimUpdate() throws Exception { |
102 | 102 |
|
103 |
doTest(loadFromTransformationProfile("oaf2hbase.xml"), load("recordClaimUpdate.xml")); |
|
103 |
final List<Row> rows = Lists.newArrayList(); |
|
104 |
rows.addAll(asRows(loadFromTransformationProfile("oaf2hbase.xml"), load("recordClaim.xml"))); |
|
105 |
rows.addAll(asRows(loadFromTransformationProfile("claimUpdates_2_hbase.xsl"), load("recordClaimUpdate.xml"))); |
|
106 |
|
|
107 |
printAll(mapAll(buildTable(rows))); |
|
104 | 108 |
} |
105 | 109 |
|
106 | 110 |
@Test |
... | ... | |
196 | 200 |
} |
197 | 201 |
|
198 | 202 |
@Test |
203 |
public void testLinkARC() throws Exception { |
|
204 |
|
|
205 |
final List<Row> rows = Lists.newArrayList(); |
|
206 |
rows.addAll(asRows(loadFromTransformationProfile("projects_2_hbase.xsl"), load("projectRecordARC.xml"))); |
|
207 |
rows.addAll(asRows(loadFromTransformationProfile("oaf2hbase.xml"), load("recordARC.xml"))); |
|
208 |
|
|
209 |
printAll(mapAll(buildTable(rows))); |
|
210 |
} |
|
211 |
|
|
212 |
@Test |
|
199 | 213 |
public void testLinkWT() throws Exception { |
200 | 214 |
|
201 | 215 |
final List<Row> rows = Lists.newArrayList(); |
... | ... | |
495 | 509 |
|
496 | 510 |
final Type type = OafRowKeyDecoder.decode(rowKey).getType(); |
497 | 511 |
|
498 |
final Map<String, byte[]> colEntity = row.get(type.toString());
|
|
512 |
final Map<String, byte[]> familyMap = row.get(type.toString());
|
|
499 | 513 |
|
500 |
if (colEntity == null) return;
|
|
514 |
if (familyMap == null) return;
|
|
501 | 515 |
|
502 |
final byte[] bodyB = colEntity.get("body");
|
|
516 |
final byte[] bodyB = familyMap.get("body");
|
|
503 | 517 |
|
504 | 518 |
if (bodyB != null) { |
505 | 519 |
ensureBuilder(builders, rowKey); |
506 |
final OafDecoder mainEntity = OafDecoder.decode(Oaf.parseFrom(bodyB)); |
|
520 |
|
|
521 |
final Oaf oaf = UpdateMerger.mergeBodyUpdates(familyMap); |
|
522 |
|
|
523 |
final OafDecoder mainEntity = OafDecoder.decode(oaf); |
|
524 |
|
|
507 | 525 |
builders.get(rowKey).setMainEntity(mainEntity); |
508 | 526 |
|
509 | 527 |
for (final LinkDescriptor ld : entityConfigTable.getDescriptors(type)) { |
... | ... | |
514 | 532 |
if ((cols != null) && !cols.isEmpty()) { |
515 | 533 |
|
516 | 534 |
for (final byte[] oafB : cols.values()) { |
517 |
final Oaf oaf = Oaf.parseFrom(oafB); |
|
518 | 535 |
|
519 |
final Oaf.Builder relBuilder = Oaf.newBuilder(oaf);
|
|
536 |
final Oaf.Builder relBuilder = Oaf.newBuilder(Oaf.parseFrom(oafB));
|
|
520 | 537 |
|
521 | 538 |
if (ld.isSymmetric()) { |
522 | 539 |
final RelDescriptor rd = ld.getRelDescriptor(); |
Also available in: Unified diff
introducing support for projects that doesn't provide a link to a specific fundingpath.