IbUtils { public static OrderStatus.Status getOrderStatus(String status) { if ("PendingSubmit".equalsIgnoreCase(status)) { return OrderStatus.Status.NEW; } else if ("PendingCancel".equalsIgnoreCase(status)) { return OrderStatus.Status.PENDING_CANCEL; } else if ("PreSubmitted".equalsIgnoreCase(status)) { return OrderStatus.Status.NEW; } else if ("Submitted".equalsIgnoreCase(status)) { return OrderStatus.Status.NEW; } else if ("Cancelled".equalsIgnoreCase(status)) { return OrderStatus.Status.CANCELED; } else if ("Filled".equalsIgnoreCase(status)) { return OrderStatus.Status.FILLED; } else if ("Inactive".equalsIgnoreCase(status)) { return OrderStatus.Status.CANCELED; } else { return OrderStatus.Status.UNKNOWN; } }  static String translateToIbFuturesSymbol(String symbol); static String getOrderType(TradeOrder.Type orderType); static String getTif(TradeOrder.Duration duration); static String getSecurityType(InstrumentType instrumentType); static String getAction(TradeDirection direction); static QuoteType getQuoteType(int field); static OrderStatus.Status getOrderStatus(String status); static String getExpiryString(int expiryMonth, int expiryYear); static String getExpiryString(int expiryDay, int expiryMonth, int expiryYear); static String getOptionRight( OptionTicker.Right right ); static Image getIconImage(); static BigDecimal getIbMultiplier( Ticker ticker ); static Vector<TagValue> getDefaultTagVector(); static List<TagValue> getDefaultTagList();  }
@Test public void testGetOrderStatus() { assertEquals(OrderStatus.Status.NEW, IbUtils.getOrderStatus("PendingSubmit")); assertEquals(OrderStatus.Status.PENDING_CANCEL, IbUtils.getOrderStatus("PendingCancel")); assertEquals(OrderStatus.Status.NEW, IbUtils.getOrderStatus("PreSubmitted")); assertEquals(OrderStatus.Status.NEW, IbUtils.getOrderStatus("Submitted")); assertEquals(OrderStatus.Status.CANCELED, IbUtils.getOrderStatus("Cancelled")); assertEquals(OrderStatus.Status.FILLED, IbUtils.getOrderStatus("Filled")); assertEquals(OrderStatus.Status.CANCELED, IbUtils.getOrderStatus("Inactive")); assertEquals(OrderStatus.Status.UNKNOWN, IbUtils.getOrderStatus("foo")); }