Search in sources :

Example 1 with EndOfStreamNode

use of org.apache.nifi.processors.evtx.parser.bxml.EndOfStreamNode 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());
}
Also used : TemplateNode(org.apache.nifi.processors.evtx.parser.bxml.TemplateNode) RootNode(org.apache.nifi.processors.evtx.parser.bxml.RootNode) BxmlNode(org.apache.nifi.processors.evtx.parser.bxml.BxmlNode) UnsignedInteger(com.google.common.primitives.UnsignedInteger) NameStringNode(org.apache.nifi.processors.evtx.parser.bxml.NameStringNode) EndOfStreamNode(org.apache.nifi.processors.evtx.parser.bxml.EndOfStreamNode) TreeMap(java.util.TreeMap) Map(java.util.Map) Test(org.junit.Test) TemplateNodeTest(org.apache.nifi.processors.evtx.parser.bxml.TemplateNodeTest) NameStringNodeTest(org.apache.nifi.processors.evtx.parser.bxml.NameStringNodeTest)

Example 2 with EndOfStreamNode

use of org.apache.nifi.processors.evtx.parser.bxml.EndOfStreamNode in project nifi by apache.

the class RecordTest method testInit.

@Test
public void testInit() {
    assertEquals(recordNum, record.getRecordNum().intValue());
    RootNode rootNode = record.getRootNode();
    List<BxmlNode> children = rootNode.getChildren();
    assertEquals(1, children.size());
    assertTrue(children.get(0) instanceof EndOfStreamNode);
    assertEquals(0, rootNode.getSubstitutions().size());
}
Also used : RootNode(org.apache.nifi.processors.evtx.parser.bxml.RootNode) BxmlNode(org.apache.nifi.processors.evtx.parser.bxml.BxmlNode) EndOfStreamNode(org.apache.nifi.processors.evtx.parser.bxml.EndOfStreamNode) Test(org.junit.Test)

Example 3 with EndOfStreamNode

use of org.apache.nifi.processors.evtx.parser.bxml.EndOfStreamNode in project nifi by apache.

the class BXmlTypeNodeTest method testInit.

@Test
public void testInit() {
    RootNode rootNode = bXmlTypeNode.getRootNode();
    List<BxmlNode> children = rootNode.getChildren();
    assertEquals(1, children.size());
    assertTrue(children.get(0) instanceof EndOfStreamNode);
    assertEquals(0, rootNode.getSubstitutions().size());
    assertEquals(rootNode.toString(), bXmlTypeNode.getValue());
}
Also used : RootNode(org.apache.nifi.processors.evtx.parser.bxml.RootNode) BxmlNode(org.apache.nifi.processors.evtx.parser.bxml.BxmlNode) EndOfStreamNode(org.apache.nifi.processors.evtx.parser.bxml.EndOfStreamNode) Test(org.junit.Test)

Aggregations

BxmlNode (org.apache.nifi.processors.evtx.parser.bxml.BxmlNode)3 EndOfStreamNode (org.apache.nifi.processors.evtx.parser.bxml.EndOfStreamNode)3 RootNode (org.apache.nifi.processors.evtx.parser.bxml.RootNode)3 Test (org.junit.Test)3 UnsignedInteger (com.google.common.primitives.UnsignedInteger)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 NameStringNode (org.apache.nifi.processors.evtx.parser.bxml.NameStringNode)1 NameStringNodeTest (org.apache.nifi.processors.evtx.parser.bxml.NameStringNodeTest)1 TemplateNode (org.apache.nifi.processors.evtx.parser.bxml.TemplateNode)1 TemplateNodeTest (org.apache.nifi.processors.evtx.parser.bxml.TemplateNodeTest)1