aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/utils/ImageResizeUtilTest.java
blob: cb12203eed57067e79d9d6e7d3a57253c3770c18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package org.openecomp.sdc.be.dao.utils;

import java.awt.image.BufferedImage;

import org.junit.Test;

import mockit.Deencapsulation;

public class ImageResizeUtilTest {

	@Test
	public void testResizeImage() throws Exception {
		BufferedImage originalImage = new BufferedImage(1, 1, 1);
		int width = 1;
		int height = 1;
		boolean preserveDimensions = false;
		BufferedImage result;

		// default test
		result = ImageResizeUtil.resizeImage(originalImage, width, height, preserveDimensions);
	}

	@Test
	public void testResizeImageWithHint() throws Exception {
		BufferedImage originalImage = new BufferedImage(1, 1, 1);
		int width = 1;
		int height = 1;
		boolean preserveDimensions = false;
		BufferedImage result;

		// default test
		result = ImageResizeUtil.resizeImageWithHint(originalImage, width, height, preserveDimensions);
	}

	@Test
	public void testResizeImage_1() throws Exception {
		BufferedImage originalImage = new BufferedImage(1, 1, 1);
		int width = 1;
		int height = 1;
		boolean preserveDimensions = true;
		boolean enableHighQuality = false;
		BufferedImage result;

		// default test
		result = Deencapsulation.invoke(ImageResizeUtil.class, "resizeImage",
				originalImage, width, height, preserveDimensions, enableHighQuality);
	}

	@Test
	public void testComputeDimensions() throws Exception {
		int width = 0;
		int height = 0;
		int originalWidth = 0;
		int originalHeight = 0;
		int[] result;

		// default test
		result = ImageResizeUtil.computeDimensions(width, height, originalWidth, originalHeight);
	}
}