use of org.apache.nifi.processors.evtx.parser.bxml.NameStringNode in project nifi by apache.
the class ChunkHeader method addNameStringNode.
public NameStringNode addNameStringNode(int offset, BinaryReader binaryReader) throws IOException {
NameStringNode nameStringNode = new NameStringNode(binaryReader, this);
nameStrings.put(offset, nameStringNode);
return nameStringNode;
}
use of org.apache.nifi.processors.evtx.parser.bxml.NameStringNode in project nifi by apache.
the class ChunkHeaderTest method testInit.
@Test
public void testInit() throws IOException {
int count = 0;
for (Map.Entry<Integer, NameStringNode> integerNameStringNodeEntry : new TreeMap<>(chunkHeader.getNameStrings()).entrySet()) {
assertEquals(Integer.toString(count++), integerNameStringNodeEntry.getValue().getString());
}
Iterator<String> iterator = guids.iterator();
for (Map.Entry<Integer, TemplateNode> integerTemplateNodeEntry : new TreeMap<>(chunkHeader.getTemplateNodes()).entrySet()) {
assertEquals(iterator.next(), integerTemplateNodeEntry.getValue().getGuid());
}
assertTrue(chunkHeader.hasNext());
Record next = chunkHeader.next();
assertEquals(fileLastRecordNumber, next.getRecordNum().intValue());
RootNode rootNode = next.getRootNode();
List<BxmlNode> children = rootNode.getChildren();
assertEquals(1, children.size());
assertTrue(children.get(0) instanceof EndOfStreamNode);
assertEquals(0, rootNode.getSubstitutions().size());
assertFalse(chunkHeader.hasNext());
}
Aggregations