### Question:
WXTextDomObject extends WXDomObject { public TextPaint getTextPaint() { return mTextPaint; } WXTextDomObject(); TextPaint getTextPaint(); @Override void layoutBefore(); @Override void layoutAfter(); @Override Layout getExtra(); @Override void updateAttr(Map<String, Object> attrs); @Override void updateStyle(Map<String, Object> styles); @Override WXTextDomObject clone(); @Override void destroy();  }### Answer:
@Test public void testMeasure() throws Exception { testLayoutBefore(); MeasureOutput output = new MeasureOutput(); WXTextDomObject mock = PowerMockito.spy(dom); PowerMockito.when(mock,"getTextWidth",dom.getTextPaint(),100f,false).thenReturn(10f); WXTextDomObject.TEXT_MEASURE_FUNCTION.measure(mock,100,output); assertEquals(output.width,10f,0.1f); }