Search in sources :

Example 96 with HashMap

use of java.util.HashMap in project camel by apache.

the class BindySimpleCsvMarshallDslTest method generateModel.

public List<Map<String, Object>> generateModel() {
    Map<String, Object> modelObjects = new HashMap<String, Object>();
    Order order = new Order();
    order.setOrderNr(1);
    order.setOrderType("BUY");
    order.setClientNr("B2");
    order.setFirstName("Keira");
    order.setLastName("Knightley");
    order.setAmount(new BigDecimal("450.45").setScale(2));
    order.setInstrumentCode("ISIN");
    order.setInstrumentNumber("XX23456789");
    order.setInstrumentType("Share");
    order.setCurrency("EUR");
    Calendar calendar = new GregorianCalendar();
    calendar.set(2009, 0, 14);
    order.setOrderDate(calendar.getTime());
    calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
    // 4 hour shift
    // 17-05-2010 23:21:59 by GMT+4
    calendar.set(2010, 4, 17, 19, 21, 59);
    order.setOrderDateTime(calendar.getTime());
    modelObjects.put(order.getClass().getName(), order);
    models.add(modelObjects);
    return models;
}
Also used : Order(org.apache.camel.dataformat.bindy.model.simple.oneclass.Order) HashMap(java.util.HashMap) GregorianCalendar(java.util.GregorianCalendar) Calendar(java.util.Calendar) GregorianCalendar(java.util.GregorianCalendar) BigDecimal(java.math.BigDecimal)

Example 97 with HashMap

use of java.util.HashMap in project camel by apache.

the class BindySimpleCsvMarshallTest method generateModel.

public List<Map<String, Object>> generateModel() {
    Map<String, Object> modelObjects = new HashMap<String, Object>();
    Order order = new Order();
    order.setOrderNr(1);
    order.setOrderType("BUY");
    order.setClientNr("B2");
    order.setFirstName("Keira");
    order.setLastName("Knightley");
    order.setAmount(new BigDecimal("400.25"));
    order.setInstrumentCode("ISIN");
    order.setInstrumentNumber("XX23456789");
    order.setInstrumentType("Share");
    order.setCurrency("EUR");
    Calendar calendar = new GregorianCalendar();
    calendar.set(2009, 0, 14);
    order.setOrderDate(calendar.getTime());
    calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
    // 4 hour shift
    // 17-02-2011 23:21:59 by GMT+4
    calendar.set(2011, 1, 17, 19, 21, 59);
    order.setOrderDateTime(calendar.getTime());
    modelObjects.put(order.getClass().getName(), order);
    models.add(modelObjects);
    return models;
}
Also used : Order(org.apache.camel.dataformat.bindy.model.simple.oneclass.Order) HashMap(java.util.HashMap) GregorianCalendar(java.util.GregorianCalendar) Calendar(java.util.Calendar) GregorianCalendar(java.util.GregorianCalendar) BigDecimal(java.math.BigDecimal)

Example 98 with HashMap

use of java.util.HashMap in project camel by apache.

the class BindySimpleFixedLengthMarshallTest method generateModel.

public List<Map<String, Object>> generateModel() {
    Map<String, Object> modelObjects = new HashMap<String, Object>();
    Order order = new Order();
    order.setOrderNr(10);
    order.setOrderType("BUY");
    order.setClientNr("A9");
    order.setFirstName("Pauline");
    order.setLastName("M");
    order.setAmount(new BigDecimal("2500.45"));
    order.setInstrumentCode("ISIN");
    order.setInstrumentNumber("XD12345678");
    order.setInstrumentType("Share");
    order.setCurrency("USD");
    Calendar calendar = new GregorianCalendar();
    calendar.set(2009, 7, 1);
    order.setOrderDate(calendar.getTime());
    modelObjects.put(order.getClass().getName(), order);
    models.add(modelObjects);
    return models;
}
Also used : HashMap(java.util.HashMap) GregorianCalendar(java.util.GregorianCalendar) Calendar(java.util.Calendar) GregorianCalendar(java.util.GregorianCalendar) BigDecimal(java.math.BigDecimal)

Example 99 with HashMap

use of java.util.HashMap in project camel by apache.

the class BindySimpleFixedLengthMarshallWithNoClipTest method generateModel.

public List<Map<String, Object>> generateModel() {
    Map<String, Object> modelObjects = new HashMap<String, Object>();
    Order order = new Order();
    order.setOrderNr(10);
    order.setOrderType("BUY");
    order.setClientNr("A98");
    order.setFirstName("Madame de Sol");
    order.setLastName("M");
    order.setAmount(new BigDecimal("2500.45"));
    order.setInstrumentCode("ISIN");
    order.setInstrumentNumber("XD12345678");
    order.setInstrumentType("Share");
    order.setCurrency("USD");
    Calendar calendar = new GregorianCalendar();
    calendar.set(2009, 7, 1);
    order.setOrderDate(calendar.getTime());
    modelObjects.put(order.getClass().getName(), order);
    models.add(modelObjects);
    return models;
}
Also used : HashMap(java.util.HashMap) GregorianCalendar(java.util.GregorianCalendar) Calendar(java.util.Calendar) GregorianCalendar(java.util.GregorianCalendar) BigDecimal(java.math.BigDecimal)

Example 100 with HashMap

use of java.util.HashMap in project camel by apache.

the class BindyFixedLengthHeaderFooterSkipHeaderTest method createHeaderRow.

private Map<String, Object> createHeaderRow() {
    Map<String, Object> headerMap = new HashMap<String, Object>();
    OrderHeader header = new OrderHeader();
    Calendar calendar = new GregorianCalendar();
    calendar.set(2009, 7, 1);
    header.setRecordDate(calendar.getTime());
    headerMap.put(OrderHeader.class.getName(), header);
    return headerMap;
}
Also used : HashMap(java.util.HashMap) GregorianCalendar(java.util.GregorianCalendar) Calendar(java.util.Calendar) GregorianCalendar(java.util.GregorianCalendar)

Aggregations

HashMap (java.util.HashMap)24090 ArrayList (java.util.ArrayList)5632 Map (java.util.Map)5586 Test (org.junit.Test)5079 List (java.util.List)2721 HashSet (java.util.HashSet)2103 IOException (java.io.IOException)1780 Set (java.util.Set)1465 File (java.io.File)1206 Iterator (java.util.Iterator)1198 LinkedHashMap (java.util.LinkedHashMap)1138 Test (org.testng.annotations.Test)884 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)680 Date (java.util.Date)545 LinkedList (java.util.LinkedList)494 URI (java.net.URI)415 Properties (java.util.Properties)381 InputStream (java.io.InputStream)343 Collection (java.util.Collection)342 TreeMap (java.util.TreeMap)333