[ 
https://issues.apache.org/jira/browse/NIFI-5113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16470863#comment-16470863
 ] 

ASF GitHub Bot commented on NIFI-5113:
--------------------------------------

Github user markap14 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2675#discussion_r187377388
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/test/java/org/apache/nifi/xml/TestWriteXMLResultUtils.java
 ---
    @@ -0,0 +1,472 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.nifi.xml;
    +
    +import org.apache.nifi.serialization.SimpleRecordSchema;
    +import org.apache.nifi.serialization.record.DataType;
    +import org.apache.nifi.serialization.record.ListRecordSet;
    +import org.apache.nifi.serialization.record.MapRecord;
    +import org.apache.nifi.serialization.record.Record;
    +import org.apache.nifi.serialization.record.RecordField;
    +import org.apache.nifi.serialization.record.RecordFieldType;
    +import org.apache.nifi.serialization.record.RecordSchema;
    +import org.apache.nifi.serialization.record.RecordSet;
    +import org.apache.nifi.serialization.record.SchemaIdentifier;
    +
    +import java.util.ArrayList;
    +import java.util.Arrays;
    +import java.util.Collections;
    +import java.util.HashMap;
    +import java.util.List;
    +import java.util.Map;
    +
    +public class TestWriteXMLResultUtils {
    +
    +    protected static final String FIELD_NAME = "NAME";
    +    protected static final String FIELD_AGE = "AGE";
    +    protected static final String FIELD_COUNTRY = "COUNTRY";
    +    protected static final String FIELD_ADDRESS = "ADDRESS";
    +    protected static final String FIELD_STREET = "STREET";
    +    protected static final String FIELD_CITY = "CITY";
    +    protected static final String FIELD_CHILDREN = "CHILDREN";
    +
    +    protected static  Map<String,Object> RECORD_FIELDS_PERSON_1 = new 
HashMap<>();
    +    protected static Map<String,Object> RECORD_FIELDS_PERSON_2 = new 
HashMap<>();
    +    protected static Map<String,Object> RECORD_FIELDS_ADDRESS_1 = new 
HashMap<>();
    +    protected static Map<String,Object> RECORD_FIELDS_ADDRESS_2 = new 
HashMap<>();
    +
    +    protected static Object[] ARRAY_CHILDREN = {"Tom", "Anna", "Ben"};
    +    protected static Object[] ARRAY_CHILDREN_WITH_NULL_VALUE = {"Tom", 
null, "Ben"};
    +    protected static Object[] ARRAY_CHILDREN_ONLY_NULL_VALUES = {null, 
null, null};
    +
    +    static {
    +        RECORD_FIELDS_PERSON_1.put(FIELD_NAME, "Cleve Butler");
    +        RECORD_FIELDS_PERSON_1.put(FIELD_AGE, 42);
    +        RECORD_FIELDS_PERSON_1.put(FIELD_COUNTRY, "USA");
    +        RECORD_FIELDS_PERSON_2.put(FIELD_NAME, "Ainslie Fletcher");
    +        RECORD_FIELDS_PERSON_2.put(FIELD_AGE, 33);
    +        RECORD_FIELDS_PERSON_2.put(FIELD_COUNTRY, "UK");
    +        RECORD_FIELDS_ADDRESS_1.put(FIELD_STREET, "292 West Street");
    +        RECORD_FIELDS_ADDRESS_1.put(FIELD_CITY, "Jersey City");
    +        RECORD_FIELDS_ADDRESS_2.put(FIELD_STREET, "123 6th St.");
    +        RECORD_FIELDS_ADDRESS_2.put(FIELD_CITY, "Seattle");
    +
    +        RECORD_FIELDS_PERSON_1 = 
Collections.unmodifiableMap(RECORD_FIELDS_PERSON_1);
    +        RECORD_FIELDS_PERSON_2 = 
Collections.unmodifiableMap(RECORD_FIELDS_PERSON_2);
    +        RECORD_FIELDS_ADDRESS_1 = 
Collections.unmodifiableMap(RECORD_FIELDS_ADDRESS_1);
    +        RECORD_FIELDS_ADDRESS_2 = 
Collections.unmodifiableMap(RECORD_FIELDS_ADDRESS_2);
    +    }
    +
    +    protected static final SchemaIdentifier SCHEMA_IDENTIFIER_PERSON = 
SchemaIdentifier.builder().name("PERSON").id(0L).version(0).build();
    +    protected static final SchemaIdentifier SCHEMA_IDENTIFIER_RECORD = 
SchemaIdentifier.builder().name("RECORD").id(0L).version(0).build();
    +    // protected static final SchemaIdentifier SCHEMA_IDENTIFIER_ADDRESS = 
SchemaIdentifier.builder().name("ADDRESS").id(0L).version(0).build();
    --- End diff --
    
    Should remove this


> Add XML record writer
> ---------------------
>
>                 Key: NIFI-5113
>                 URL: https://issues.apache.org/jira/browse/NIFI-5113
>             Project: Apache NiFi
>          Issue Type: New Feature
>            Reporter: Johannes Peter
>            Assignee: Johannes Peter
>            Priority: Major
>
> Corresponding writer for the XML record reader



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to