* Test method for 'java.awt.font.ImageGraphicAttribute.ImageGraphicAttribute(Image, int)'
*/
public final void testImageGraphicAttributeImageIntFloatFloat() {
float xOrigin = 5;
float yOrigin = 5;
ImageGraphicAttribute igAttribute = new ImageGraphicAttribute(img, alignment, xOrigin, yOrigin);
assertNotNull(igAttribute);
assertEquals(alignment, igAttribute.getAlignment());
assertEquals(width - xOrigin, igAttribute.getAdvance(), 0F);
assertEquals(yOrigin, igAttribute.getAscent(), 0F);
assertEquals(height - yOrigin, igAttribute.getDescent(), 0F);
assertEquals(new Rectangle2D.Float(-xOrigin, -yOrigin, img.getWidth(null), img.getHeight(null)),
igAttribute.getBounds());
// illegal alignment value
try {
iga = new ImageGraphicAttribute(img, -3, xOrigin, yOrigin);
fail("IllegalArgumentException expected");
} catch (IllegalArgumentException e) {
// expected
}
try {
iga = new ImageGraphicAttribute(img, 3, xOrigin, yOrigin);
fail("IllegalArgumentException expected");
} catch (IllegalArgumentException e) {
// expected
}
}