ValueMarshallerImpl implements ValueMarshaller { @Override public void setWritableObject(OrcStruct struct, Object javaObject) throws UnexpectedTypeException { Object writable; try { writable = converter.toWritableObject(javaObject); } catch (UnexpectedTypeException e) { throw new UnexpectedTypeException(javaObject, structField.getFieldName(), e); } inspector.setStructFieldData(struct, structField, writable); } ValueMarshallerImpl(SettableStructObjectInspector inspector, StructField structField, Converter converter); @Override Object getJavaObject(OrcStruct struct); @Override Object getWritableObject(OrcStruct struct); @Override void setWritableObject(OrcStruct struct, Object javaObject);  }
@Test public void setWritable() throws UnexpectedTypeException { when(converter.toWritableObject(string)).thenReturn(text); marshaller.setWritableObject(null, string); verify(inspector).setStructFieldData(null, structField, text); }
@Test(expected = UnexpectedTypeException.class) public void setWritableException() throws UnexpectedTypeException { doThrow(new UnexpectedTypeException()).when(converter).toWritableObject(string); marshaller.setWritableObject(null, string); }