Package nexj.core.integration.io

Examples of nexj.core.integration.io.WriterOutput


    * Formats a reference with a child message.
    */
   public void testFormatChild1()
   {
      StringWriter writer = new StringWriter();
      WriterOutput out = new WriterOutput(writer);
      TransferObject root = new TransferObject("XML_Inherit_Parent_Referrer", 2);
      TransferObject polyRoot = new TransferObject(2);

      polyRoot.setClassName("XML_Inherit_Child1");
      polyRoot.setValue("b", Primitive.createInteger(23));
View Full Code Here


    * Formats a reference with a child's child message.
    */
   public void testFormatChild1Child()
   {
      StringWriter writer = new StringWriter();
      WriterOutput out = new WriterOutput(writer);
      TransferObject root = new TransferObject("XML_Inherit_Parent_Referrer", 2);
      TransferObject polyRoot = new TransferObject(3);

      polyRoot.setClassName("XML_Inherit_Child1_Child");
      polyRoot.setValue("b", Primitive.createInteger(23));
View Full Code Here

    */
   public void testFormatChild1_Child1Referrer()
   {
      Message msg = m_context.getMetadata().getMessage("XML_Inherit_Child1_Referrer");
      StringWriter writer = new StringWriter();
      WriterOutput out = new WriterOutput(writer);
      TransferObject root = new TransferObject("XML_Inherit_Child1_Referrer", 3);
      TransferObject polyRoot = new TransferObject(2);

      polyRoot.setClassName("XML_Inherit_Child1");
      polyRoot.setValue("b", Primitive.createInteger(23));
View Full Code Here

      recordList.add(record5);
      root.setValue("Row", recordList);
     
      //Format it
      StringWriter writer = new StringWriter();
      m_formatter.format(root, m_simpleMessage, new WriterOutput(writer));
     
      assertEquals("firstName,familyName,age,Phone1_location,Phone1_number,location,number,balance\n" +
         "Jo\\\\hn,Doe,42,,,,,108\n" +
         "\\#Jane,Doe,37\n\n" //two newlines, due to null row datum
         "Jack,L\"in,\n" +
View Full Code Here

      recordList.add(record1);
      root.setValue("Row", recordList);
     
      //Format it
      StringWriter writer = new StringWriter();
      m_formatter.format(root, m_simpleMessage, new WriterOutput(writer));
     
      assertEquals("firstName,familyName,age,Phone1_location,Phone1_number,location,number,balance\n" +
         "John,Doe,42\n",
         writer.toString());
   }
View Full Code Here

      root.setValue("Row", recordList);

      //Format it
      StringWriter writer = new StringWriter();
      m_formatter.format(root, m_simpleMessage, new WriterOutput(writer));

      assertEquals("firstName,familyName,age,Phone1_location,Phone1_number,location,number,balance\n",
         writer.toString());
   }
View Full Code Here

      recordList.add(record3);
      root.setValue("Row", recordList);
     
      //Format it
      StringWriter writer = new StringWriter();
      m_formatter.format(root, m_simpleMessage, new WriterOutput(writer));
     
      assertEquals("firstName,familyName,age,Phone1_location,Phone1_number,location,number,balance\n" +
         "John,Doe,42\n" +
         "\\;Hui Mei,Zhang,37,cell,0932077773\n" +
         "Jack,Lin,26,,,test,012345678\n",
View Full Code Here

      recordList.add(record3);
      root.setValue("Row", recordList);
     
      //Format it
      StringWriter writer = new StringWriter();
      m_formatter.format(root, m_tsvMessage, new WriterOutput(writer));
     
      assertEquals("'firstName'\t'lastName'\t'age'\t'Phone1''s location'\t'Phone1''s number'\t'location'\t'number'\r\n" +
         "'John'\t'Doe'\t42\r\n" +
         "'Jane'\t'Doe'\t37\r\n" +
         "'Jack'\t'Lin'\t26\r\n",
View Full Code Here

      recordList.add(record6);
      root.setValue("Data", recordList);
     
      //Format it
      StringWriter writer = new StringWriter();
      m_formatter.format(root, m_noHeaderMessage, new WriterOutput(writer));
     
      assertEquals("Doe,John,42\r" +
         "\u001e;Zhang\u001e,;Hui Mei,37,2007-07-27 05:24:00.000000000\r" +
         "\u001e#Lin\u001e,Jack,26\r" +
         "Huo,Yuan Jia\r" +
View Full Code Here

      //Format it
      try
      {
         StringWriter writer = new StringWriter();
        
         m_formatter.format(root, m_noHeaderMessage, new WriterOutput(writer));
         fail();
      }
      catch (IntegrationException outerEx)
      {
         Throwable innerEx = outerEx.getCause();
View Full Code Here

TOP

Related Classes of nexj.core.integration.io.WriterOutput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.