TimeDurationConverter implements Converter { @Override public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String value) { Object ret = null; try { if (value.indexOf(':') != -1) { ret = TimeFormatUtil.parseFormattedDuration(value); } else { ret = TimeUtil.parseTimeString(value); } } catch (Exception e) { LOG.error("Cannot parse date value of" + value); } return ret; }  @Override Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String value); @Override String getAsString(FacesContext facesContext, UIComponent uiComponent, Object obj);  }
@Test public void testGetAsObject_1() throws Exception { TimeDurationConverter fixture = new TimeDurationConverter(); FacesContext facesContext = FacesContext.getCurrentInstance(); UIComponent uiComponent = new DynaForm(); String value = ""; Object result = fixture.getAsObject(facesContext, uiComponent, value); assertNotNull(result); }
@Test public void testGetAsObject_2() throws Exception { TimeDurationConverter fixture = new TimeDurationConverter(); FacesContext facesContext = FacesContext.getCurrentInstance(); UIComponent uiComponent = new DynaForm(); String value = ""; Object result = fixture.getAsObject(facesContext, uiComponent, value); assertNotNull(result); }