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

    https://github.com/apache/incubator-pirk/pull/112#discussion_r84764924
  
    --- Diff: 
src/test/java/org/apache/pirk/schema/query/LoadQuerySchemaTest.java ---
    @@ -389,49 +320,42 @@ private void createDataSchema(String schemaFile) 
throws IOException
         SystemConfiguration.setProperty("data.schemas", file.toString());
     
         // Write to the file
    -    try
    -    {
    -      DocumentBuilderFactory dbFactory = 
DocumentBuilderFactory.newInstance();
    -      DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
    -      Document doc = dBuilder.newDocument();
    -
    -      // root element
    -      Element rootElement = doc.createElement("schema");
    -      doc.appendChild(rootElement);
    -
    -      // Add the schemaName
    -      Element schemaNameElement = doc.createElement("schemaName");
    -      schemaNameElement.appendChild(doc.createTextNode(dataSchemaName));
    -      rootElement.appendChild(schemaNameElement);
    -
    -      // Add the elements
    -      // element1 -- single String
    -      TestUtils.addElement(doc, rootElement, element1, 
PrimitiveTypePartitioner.STRING, "false", 
PrimitiveTypePartitioner.class.getName());
    -
    -      // element2 - -- array of Integers
    -      TestUtils.addElement(doc, rootElement, element2, 
PrimitiveTypePartitioner.INT, "true", PrimitiveTypePartitioner.class.getName());
    -
    -      // element3 -- array of IP addresses
    -      TestUtils.addElement(doc, rootElement, element3, 
PrimitiveTypePartitioner.STRING, "true", IPDataPartitioner.class.getName());
    -
    -      // element4 -- single byte type
    -      TestUtils.addElement(doc, rootElement, element4, 
PrimitiveTypePartitioner.BYTE, "false", 
PrimitiveTypePartitioner.class.getName());
    -
    -      // Write to a xml file
    -      TransformerFactory transformerFactory = 
TransformerFactory.newInstance();
    -      Transformer transformer = transformerFactory.newTransformer();
    -      DOMSource source = new DOMSource(doc);
    -      StreamResult result = new StreamResult(file);
    -      transformer.transform(source, result);
    -
    -      // Output for testing
    -      StreamResult consoleResult = new StreamResult(System.out);
    -      transformer.transform(source, consoleResult);
    -      System.out.println();
    -
    -    } catch (Exception e)
    -    {
    -      e.printStackTrace();
    -    }
    +    DocumentBuilderFactory dbFactory = 
DocumentBuilderFactory.newInstance();
    +    DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
    +    Document doc = dBuilder.newDocument();
    +
    +    // root element
    +    Element rootElement = doc.createElement("schema");
    +    doc.appendChild(rootElement);
    +
    +    // Add the schemaName
    +    Element schemaNameElement = doc.createElement("schemaName");
    +    schemaNameElement.appendChild(doc.createTextNode(dataSchemaName));
    +    rootElement.appendChild(schemaNameElement);
    +
    +    // Add the elements
    +    // element1 -- single String
    +    TestUtils.addElement(doc, rootElement, element1, 
PrimitiveTypePartitioner.STRING, "false", 
PrimitiveTypePartitioner.class.getName());
    +
    +    // element2 - -- array of Integers
    +    TestUtils.addElement(doc, rootElement, element2, 
PrimitiveTypePartitioner.INT, "true", PrimitiveTypePartitioner.class.getName());
    +
    +    // element3 -- array of IP addresses
    +    TestUtils.addElement(doc, rootElement, element3, 
PrimitiveTypePartitioner.STRING, "true", IPDataPartitioner.class.getName());
    +
    +    // element4 -- single byte type
    +    TestUtils.addElement(doc, rootElement, element4, 
PrimitiveTypePartitioner.BYTE, "false", 
PrimitiveTypePartitioner.class.getName());
    +
    +    // Write to a xml file
    +    TransformerFactory transformerFactory = 
TransformerFactory.newInstance();
    +    Transformer transformer = transformerFactory.newTransformer();
    +    DOMSource source = new DOMSource(doc);
    +    StreamResult result = new StreamResult(file);
    +    transformer.transform(source, result);
    +
    +    // Output for testing
    +    StreamResult consoleResult = new StreamResult(System.out);
    +    transformer.transform(source, consoleResult);
    +    System.out.println();
    --- End diff --
    
    How about use a Log.Info here instead of System.out.println() ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to