public String getId() { return "FUT." + nullSafe(getExchangeCode()) + "." + nullSafe(getShortName()) + "." + nullSafe(expiry); }
public void testCreateWithAdditionalProperties() throws DaoException { ApplicationContext appContext = new ClassPathXmlApplicationContext("springtest.xml"); IDaoFactory idf = (IDaoFactory) appContext.getBean("ibatisDao"); IInstrumentDao idao = idf.instrumentDao(); Future future = new Future(); future.setCreationTime(0L); future.setDeletionTime(0L); future.setName("test"); future.setDescription("The dax future"); future.setExpiry(20111231l); future.setShortName("test"); future.setTickSize(10.0); future.setTickValue(10.0); future.getUnderlyingMap().put("DECORATION", "DECORATION"); idao.create(future); Future loaded = (Future) idao.load(future.getId()); assertNotNull(loaded); assertEquals("test", future.getShortName()); assertEquals("DECORATION", loaded.getUnderlyingMap().get("DECORATION")); }
public void testCreateWithAdditionalProperties() throws DaoException { ApplicationContext appContext = new ClassPathXmlApplicationContext("springtest.xml"); IDaoFactory idf = (IDaoFactory) appContext.getBean("ibatisDao"); IInstrumentDao idao = idf.instrumentDao(); Future future = new Future(); future.setCreationTime(0L); future.setDeletionTime(0L); future.setName("test"); future.setDescription("The dax future"); future.setExpiry(20111231l); future.setShortName("test"); future.setTickSize(10.0); future.setTickValue(10.0); future.getUnderlyingMap().put("DECORATION", "DECORATION"); idao.create(future); Future loaded = (Future) idao.load(future.getId()); assertNotNull(loaded); assertEquals("test", future.getShortName()); assertEquals("DECORATION", loaded.getUnderlyingMap().get("DECORATION")); }
/** * test saving and then loading of a future. * * @throws DaoException */ public void testCreateFuture() throws DaoException { ApplicationContext appContext = new ClassPathXmlApplicationContext("springtest.xml"); IDaoFactory idf = (IDaoFactory) appContext.getBean("ibatisDao"); IInstrumentDao idao = idf.instrumentDao(); Future future = new Future(); future.setCreationTime(0L); future.setDeletionTime(0L); future.setName("FDAX"); future.setDescription("The dax future"); future.setExpiry(20111231l); future.setShortName("FDAX"); future.setTickSize(10.0); future.setTickValue(10.0); idao.create(future); // load the future Future loadedFuture = (Future) idao.load(future.getId()); assertEquals(future.getId(), loadedFuture.getId()); assertEquals(future.getShortName(), loadedFuture.getShortName()); assertEquals(future.getTickSize(), loadedFuture.getTickSize()); assertEquals(future.getTickValue(), loadedFuture.getTickValue()); }
/** * test saving and then loading of a future. * * @throws DaoException */ public void testCreateFuture() throws DaoException { ApplicationContext appContext = new ClassPathXmlApplicationContext("springtest.xml"); IDaoFactory idf = (IDaoFactory) appContext.getBean("ibatisDao"); IInstrumentDao idao = idf.instrumentDao(); Future future = new Future(); future.setCreationTime(0L); future.setDeletionTime(0L); future.setName("FDAX"); future.setDescription("The dax future"); future.setExpiry(20111231l); future.setShortName("FDAX"); future.setTickSize(10.0); future.setTickValue(10.0); idao.create(future); // load the future Future loadedFuture = (Future) idao.load(future.getId()); assertEquals(future.getId(), loadedFuture.getId()); assertEquals(future.getShortName(), loadedFuture.getShortName()); assertEquals(future.getTickSize(), loadedFuture.getTickSize()); assertEquals(future.getTickValue(), loadedFuture.getTickValue()); }