public void testTextSource() throws Exception { myState.put(ATTR_SOURCE_TYPE, SourceType.TEXT); ArgumentCaptor<ActionBarIconGenerator.ActionBarOptions> argument = runImageTest(); TextRenderUtil.Options options = new TextRenderUtil.Options(); options.font = Font.decode(myState.getString(ATTR_FONT) + " " + myState.getInt(ATTR_FONT_SIZE)); options.foregroundColor = 0xFFFFFFFF; BufferedImage expectedImage = TextRenderUtil.renderTextImage(myState.getString(ATTR_TEXT), 1, options); assertImagesSimilar("TextImage", expectedImage, argument.getValue().sourceImage, 5.0f); }
public void testImageSource() throws Exception { myState.put(ATTR_SOURCE_TYPE, SourceType.IMAGE); ArgumentCaptor<ActionBarIconGenerator.ActionBarOptions> argument = runImageTest(); BufferedImage expectedImage = getImage(myState.getString(ATTR_IMAGE_PATH), false); assertImagesSimilar("ImageImage", expectedImage, argument.getValue().sourceImage, 5.0f); }
public void testClipartSource() throws Exception { myState.put(ATTR_SOURCE_TYPE, SourceType.CLIPART); ArgumentCaptor<ActionBarIconGenerator.ActionBarOptions> argument = runImageTest(); BufferedImage expectedImage = GraphicGenerator.getClipartImage(myState.getString(ATTR_CLIPART_NAME)); assertImagesSimilar("ClipartImage", expectedImage, argument.getValue().sourceImage, 5.0f); }