Package org.springframework.batch.item.file.transform

Examples of org.springframework.batch.item.file.transform.DefaultFieldSet


    assertTrue(mapper.mapFieldSet(new DefaultFieldSet(new String[] { "FOO" })).isHeader());
  }

  @Test
  public void testDefaultEndRecord() throws Exception {
    assertFalse(mapper.mapFieldSet(new DefaultFieldSet(new String[] { "END" })).isHeader());
    assertTrue(mapper.mapFieldSet(new DefaultFieldSet(new String[] { "END" })).isFooter());
  }
View Full Code Here


  }

  @Test
  public void testSetEndRecord() throws Exception {
    mapper.setEnd("FOO");
    assertTrue(mapper.mapFieldSet(new DefaultFieldSet(new String[] { "FOO" })).isFooter());
  }
View Full Code Here

      @Override
      public String mapFieldSet(FieldSet fs) {
        return "foo";
      }
    });
    assertEquals("foo", mapper.mapFieldSet(new DefaultFieldSet(new String[] { "FOO" })).getItem());
  }
View Full Code Here

  @Override
  protected FieldSet fieldSet() {
    String[] tokens = new String[] { PAYMENT_ID, PAYMENT_DESC };
    String[] columnNames = new String[] { BillingFieldSetMapper.PAYMENT_TYPE_ID_COLUMN,
        BillingFieldSetMapper.PAYMENT_DESC_COLUMN };
    return new DefaultFieldSet(tokens, columnNames);
  }
View Full Code Here

  @Override
  protected FieldSet fieldSet() {
    String[] tokens = new String[] { String.valueOf(ORDER_ID), DATE };
    String[] columnNames = new String[] { HeaderFieldSetMapper.ORDER_ID_COLUMN,
        HeaderFieldSetMapper.ORDER_DATE_COLUMN };
    return new DefaultFieldSet(tokens, columnNames);
  }
View Full Code Here

   * need create mock objects for input source, mapper and validator.
   */
  @Test
  @SuppressWarnings("unchecked")
  public void testNext() throws Exception {
    FieldSet headerFS = new DefaultFieldSet(new String[] { Order.LINE_ID_HEADER });
    FieldSet customerFS = new DefaultFieldSet(new String[] { Customer.LINE_ID_NON_BUSINESS_CUST });
    FieldSet billingFS = new DefaultFieldSet(new String[] { Address.LINE_ID_BILLING_ADDR });
    FieldSet shippingFS = new DefaultFieldSet(new String[] { Address.LINE_ID_SHIPPING_ADDR });
    FieldSet billingInfoFS = new DefaultFieldSet(new String[] { BillingInfo.LINE_ID_BILLING_INFO });
    FieldSet shippingInfoFS = new DefaultFieldSet(new String[] { ShippingInfo.LINE_ID_SHIPPING_INFO });
    FieldSet itemFS = new DefaultFieldSet(new String[] { LineItem.LINE_ID_ITEM });
    FieldSet footerFS = new DefaultFieldSet(new String[] { Order.LINE_ID_FOOTER, "100", "3", "3" }, new String[] {
        "ID", "TOTAL_PRICE", "TOTAL_LINE_ITEMS", "TOTAL_ITEMS" });

    when(input.read()).thenReturn(headerFS, customerFS, billingFS, shippingFS, billingInfoFS,
        shippingInfoFS, itemFS, itemFS, itemFS, footerFS, null);

View Full Code Here

  @Override
  protected FieldSet fieldSet() {
    String[] tokens = new String[] { SHIPPER_ID, SHIPPING_INFO, SHIPPING_TYPE_ID };
    String[] columnNames = new String[] { ShippingFieldSetMapper.SHIPPER_ID_COLUMN,
        ShippingFieldSetMapper.ADDITIONAL_SHIPPING_INFO_COLUMN, ShippingFieldSetMapper.SHIPPING_TYPE_ID_COLUMN };
    return new DefaultFieldSet(tokens, columnNames);
  }
View Full Code Here

    String[] columnNames = new String[] { CustomerFieldSetMapper.LINE_ID_COLUMN,
        CustomerFieldSetMapper.FIRST_NAME_COLUMN, CustomerFieldSetMapper.LAST_NAME_COLUMN,
        CustomerFieldSetMapper.MIDDLE_NAME_COLUMN, CustomerFieldSetMapper.REGISTERED_COLUMN,
        CustomerFieldSetMapper.REG_ID_COLUMN, CustomerFieldSetMapper.VIP_COLUMN };

    return new DefaultFieldSet(tokens, columnNames);
  }
View Full Code Here

    String[] columnNames = new String[] { OrderItemFieldSetMapper.DISCOUNT_AMOUNT_COLUMN,
        OrderItemFieldSetMapper.DISCOUNT_PERC_COLUMN, OrderItemFieldSetMapper.HANDLING_PRICE_COLUMN,
        OrderItemFieldSetMapper.ITEM_ID_COLUMN, OrderItemFieldSetMapper.PRICE_COLUMN,
        OrderItemFieldSetMapper.QUANTITY_COLUMN, OrderItemFieldSetMapper.SHIPPING_PRICE_COLUMN,
        OrderItemFieldSetMapper.TOTAL_PRICE_COLUMN };
    return new DefaultFieldSet(tokens, columnNames);
  }
View Full Code Here

    String[] columnNames = new String[] { AddressFieldSetMapper.ADDRESSEE_COLUMN,
        AddressFieldSetMapper.ADDRESS_LINE1_COLUMN, AddressFieldSetMapper.ADDRESS_LINE2_COLUMN,
        AddressFieldSetMapper.CITY_COLUMN, AddressFieldSetMapper.STATE_COLUMN,
        AddressFieldSetMapper.COUNTRY_COLUMN, AddressFieldSetMapper.ZIP_CODE_COLUMN };

    return new DefaultFieldSet(tokens, columnNames);
  }
View Full Code Here

TOP

Related Classes of org.springframework.batch.item.file.transform.DefaultFieldSet

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.