*/
public class WatermarkRenderTest extends TestCase {
public void testWatermarkParameter() throws Exception {
WatermarkParameter param = new WatermarkParameter(
new ImageWrapper(
new BufferedImage(1, 1,
BufferedImage.TYPE_INT_RGB)),
0.5f, 0, 0);
try {
param = new WatermarkParameter(null, 0.5f, 0, 0);
assertTrue(false);
} catch (IllegalArgumentException e) {
assertTrue(true);
}
try {
param = new WatermarkParameter(null);
assertTrue(false);
} catch (IllegalArgumentException e) {
assertTrue(true);
}
try {
param = new WatermarkParameter(new ImageWrapper(new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB)),
-0.9f, 0, 0);
assertTrue(false);
} catch (IllegalArgumentException e) {
assertTrue(true);
}
try {
param = new WatermarkParameter(new ImageWrapper(new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB)), 1.2f,
0, 0);
assertTrue(false);
} catch (IllegalArgumentException e) {
assertTrue(true);
}
try {
param = new WatermarkParameter(new ImageWrapper(new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB)), 0.9f,
-1, 0);
assertTrue(false);
} catch (IllegalArgumentException e) {
assertTrue(true);
}
try {
param = new WatermarkParameter(new ImageWrapper(new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB)), 0.9f,
0, -2);
assertTrue(param.getX() == 0);
assertTrue(false);
} catch (IllegalArgumentException e) {
assertTrue(true);