001: package com.ibm.emb.test.mfb;
002:
003: // java stuff
004: import javax.emb.MediaConverterSpec;
005: import javax.emb.MediaException;
006:
007: import org.objectweb.jonas.emb.mfb.converter.image.ImageResizeConverterSpec;
008:
009: import com.ibm.emb.junit.EMBTestRunner;
010: import com.ibm.emb.test.MediaConverterSpecTest;
011:
012: public class ImageResizeConverterSpecTest extends
013: MediaConverterSpecTest {
014:
015: /**
016: * constructor
017: */
018: public ImageResizeConverterSpecTest(String name)
019: throws MediaException {
020: super (name);
021: }
022:
023: /**
024: * main method
025: */
026: public static void main(String args[]) {
027: EMBTestRunner.run(ImageResizeConverterSpecTest.class);
028: }
029:
030: /**
031: * do initialisation here
032: */
033: protected void setUp() {
034: }
035:
036: /**
037: * freeup resources
038: */
039: protected void tearDown() {
040: }
041:
042: /**
043: * creates an instance of ImageResizeConverterSpec with the given Parameters
044: * used in super class of ImageResizeConverterSpecTest
045: */
046: public MediaConverterSpec createMediaConverterSpec() {
047:
048: return new ImageResizeConverterSpec();
049: }
050:
051: /**
052: * <pre>
053: *
054: *
055: *
056: * Testcase Name: ImageResizeConverterSpec(double)
057: * Testcase Number: TEMB0103SBA
058: *
059: * setup:
060: *
061: * test procedure:
062: * 1.create ImageResizeConverterSpec passing 0.5
063: * --> check for horizontalCropFactor = 0.5;
064: * --> check for verticalCropFactor = 0.5;
065: * --> check for width = 0;
066: * --> check for height = 0;
067: *
068: *
069: *
070: * </pre>
071: */
072: public void testTEMB0103SBA() {
073: //
074: // test 1
075: //
076: ImageResizeConverterSpec testInstance = new ImageResizeConverterSpec(
077: 0.5);
078:
079: assertTrue("test 1 : ",
080: testInstance.getHorizontalCropFactor() == 0.5
081: && testInstance.getVerticalCropFactor() == 0.5
082: && testInstance.getWidth() == 0
083: && testInstance.getHeight() == 0);
084: testTrace("test 1 passed");
085:
086: succeed();
087: }
088:
089: /**
090: * <pre>
091: *
092: *
093: *
094: * Testcase Name: ImageResizeConverterSpec(double, double)
095: * Testcase Number: TEMB0104SBA
096: *
097: * setup:
098: *
099: * test procedure:
100: * 1.create ImageResizeConverterSpec passing 0.5 and 2.0
101: * --> check for horizontalCropFactor = 0.5;
102: * --> check for verticalCropFactor = 2.0;
103: * --> check for width = 0;
104: * --> check for height = 0;
105: *
106: *
107: *
108: * </pre>
109: */
110: public void testTEMB0104SBA() {
111: //
112: // test 1
113: //
114: ImageResizeConverterSpec testInstance = new ImageResizeConverterSpec(
115: 0.5, 2.0);
116:
117: assertTrue("test 1 : ",
118: testInstance.getHorizontalCropFactor() == 0.5
119: && testInstance.getVerticalCropFactor() == 2.0
120: && testInstance.getWidth() == 0
121: && testInstance.getHeight() == 0);
122: testTrace("test 1 passed");
123:
124: succeed();
125: }
126:
127: /**
128: * <pre>
129: *
130: *
131: *
132: * Testcase Name: ImageResizeConverterSpec(double, int)
133: * Testcase Number: TEMB0105SBA
134: *
135: * setup:
136: *
137: * test procedure:
138: * 1.create ImageResizeConverterSpec passing 0.5 and 480
139: * --> check for horizontalCropFactor = 0.5;
140: * --> check for verticalCropFactor = 0.0;
141: * --> check for width = 0;
142: * --> check for height = 480;
143: *
144: *
145: *
146: * </pre>
147: */
148: public void testTEMB0105SBA() {
149: //
150: // test 1
151: //
152: ImageResizeConverterSpec testInstance = new ImageResizeConverterSpec(
153: 0.5, 480);
154:
155: assertTrue("test 1 : ",
156: testInstance.getHorizontalCropFactor() == 0.5
157: && testInstance.getVerticalCropFactor() == 0.0
158: && testInstance.getWidth() == 0
159: && testInstance.getHeight() == 480);
160: testTrace("test 1 passed");
161:
162: succeed();
163: }
164:
165: /**
166: * <pre>
167: *
168: *
169: *
170: * Testcase Name: ImageResizeConverterSpec(int, double)
171: * Testcase Number: TEMB0106SBA
172: *
173: * setup:
174: *
175: * test procedure:
176: * 1.create ImageResizeConverterSpec passing 640 and 0.5
177: * --> check for horizontalCropFactor = 0.0;
178: * --> check for verticalCropFactor = 0.5;
179: * --> check for width = 640;
180: * --> check for height = 0;
181: *
182: *
183: *
184: * </pre>
185: */
186: public void testTEMB0106SBA() {
187: //
188: // test 1
189: //
190: ImageResizeConverterSpec testInstance = new ImageResizeConverterSpec(
191: 640, 0.5);
192:
193: assertTrue("test 1 : ",
194: testInstance.getHorizontalCropFactor() == 0.0
195: && testInstance.getVerticalCropFactor() == 0.5
196: && testInstance.getWidth() == 640
197: && testInstance.getHeight() == 0);
198: testTrace("test 1 passed");
199:
200: succeed();
201: }
202:
203: }
|