Package nexj.core.integration.io

Examples of nexj.core.integration.io.StringInput



   public void testParseSimpleTableAndLogicalComponents() throws Exception
   {
      TransferObject record;
      TransferObject root = m_parser.parse(new StringInput(
         "firstName,familyName,age,Phone1_location,Phone1_number,location,number,balance\n" +
         "John,Doe,42,,,,,108\n" +
         "Hui Mei,Zhang,37,cell,0932077773,,,\n" +
         "Jack,Lin,26,,,test,012345678,\n"
         ), m_simple_message);
View Full Code Here


    * Verify that the data fields may be reordered if a header is present.
    */
   public void testParseSimpleTableWithDifferentHeaderOrder() throws Exception
   {
      TransferObject record;
      TransferObject root = m_parser.parse(new StringInput(
         "familyName,Phone1_location,Phone1_number,location,number,balance,firstName,age\n" +
         "Doe,,,,,108,John,42\n" +
         "Zhang,cell,0932077773,,,,Hui Mei,37\n" +
         "Lin,,,test,012345678,,Jack,26\n"
         ), m_simple_message);
View Full Code Here

    * Verify that the data fields may be reordered if a header is present.
    */
   public void testParseSimpleTableWithMissingColumnsAndDifferentOrder() throws Exception
   {
      TransferObject record;
      TransferObject root = m_parser.parse(new StringInput(
         "familyName,Phone1_number,location,number,firstName,age\n" +
         "Doe,,,,John,42\n" +
         "Zhang,0932077773,,,Hui Mei,37\n" +
         "Lin,,test,012345678,Jack,26\n"
         ), m_simple_message);
View Full Code Here

    */
   public void testErrorOnDuplicateFieldName() throws Exception
   {
      try
      {
         m_parser.parse(new StringInput(
            "familyName,Phone1_number,location,number,Phone1_number,firstName,age\n" +
            "Doe,,,,,John,42\n" +
            "Zhang,0932077773,,,0000,Hui Mei,37\n" +
            "Lin,,test,012345678,,Jack,26\n"
            ), m_simple_message);
View Full Code Here

    */
   public void testErrorOnEnumerationValue() throws Exception
   {
      try
      {
         m_parser.parse(new StringInput(
            "familyName,Phone1_number,location,number,firstName,age\n" +
            "Doe,,,,John,42\n" +
            "Zhang,0932077773,,,Hui Mei,37\n" +
            "Lin,,invalid,012345678,Jack,26\n"
            ), m_simple_message);
View Full Code Here

    * fields that aren't quoted.
    */
   public void testParseSimpleTableAndNoHeader() throws Exception
   {
      TransferObject record;
      TransferObject root = m_parser.parse(new StringInput(
         "'Doe,\\\u001eJohn\\\u001e,42,\r" +
         "\u001eZhang\u001e,Hui\\,Mei,37,2007-07-27 05:24:00.000000000\r" +
         "Li\u001en,Ja\u001e\u001eck,26,\r"
         ), m_noheader_message);
     
View Full Code Here

    * within the field behave normally.
    */
   public void testParseSimpleTableAndDoubleQuoting() throws Exception
   {
      TransferObject record;
      TransferObject root = m_parser.parse(new StringInput(
         "\\\"John\\\",'Doe,42,\r" +
         "\"Hui,Mei\",\"Zha\"\"ng\",37,\"2007-07-27 05:24:00.000000000\"\r" +
         "Ja\"\"ck,Li\"n,26,\r"
         ), m_doublequote_message);
     
View Full Code Here

    * Test parsing with only escape character an no quote character.
    */
   public void testParseSimpleTableNoQuote() throws Exception
   {
      TransferObject record;
      TransferObject root = m_parser.parse(new StringInput(
         "\\\"John\\\",'Doe,42,\r" +
         "Hui\\,Mei,\"Zha\"\"ng\",37,2007-07-27 05:24:00.000000000\r" +
         "Ja\"\"ck,Li\"n,26,\r"
         ), m_noquote_message);
     
View Full Code Here

    * Also tests that parse can handle EOF on comment line.
    */
   public void testParseSimpleTableWithMultilineFields() throws Exception
   {
      TransferObject record;
      TransferObject root = m_parser.parse(new StringInput(
         "\u001eDoe\ra\r\ndeer\n\n\ndoe\u001e,John,42,\r" +
         "Zhang,\u001eHui\\\nMei\u001e,37,2007-07-27 05:24:00.000000000\r" +
         "Lin,Jack,26,\r" +
         ";"
         ), m_noheader_message);
View Full Code Here

    * with a newline.
    */
   public void testParseSimpleTableWithOptionalFields() throws Exception
   {
      TransferObject record;
      TransferObject root = m_parser.parse(new StringInput(
         "Doe,John\r" +
         "Zhang,Hui Mei,37,2007-07-27 05:24:00.000000000\r" +
         ",Jack\r" //Required field is null but not blank
         "Lin"  //still valid: message has only one required field.
         ), m_noheader_message);
View Full Code Here

TOP

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

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.