01: /*
02: * @(#) $Header: /cvs/jai-operators/src/tests/ca/forklabs/media/jai/OpImageUtilTest.java,v 1.1 2007/07/05 00:07:15 forklabs Exp $
03: *
04: * Copyright (C) 2006 DIRO Daniel Léonard
05: */
06:
07: package ca.forklabs.media.jai;
08:
09: import java.util.Collection;
10: import java.util.LinkedList;
11: import java.util.Vector;
12: import junit.framework.TestCase;
13: import ca.forklabs.media.jai.OpImageUtil;
14:
15: /**
16: * Class {@code OpImageUtilTest} tests class {@link OpImageUtil}.
17: *
18: * @author <a href="mailto:forklabs at dev.java.net?subject=ca.forklabs.media.jai.OpImageUtilTest">Daniel Léonard</a>
19: * @version $Revision: 1.1 $
20: */
21: @SuppressWarnings("nls")
22: public class OpImageUtilTest extends TestCase {
23:
24: //---------------------------
25: // Constructors
26: //---------------------------
27:
28: /**
29: * Constructor.
30: * @param name the name of this test.
31: */
32: public OpImageUtilTest(String name) {
33: super (name);
34: }
35:
36: //---------------------------
37: // Test methods
38: //---------------------------
39:
40: /**
41: * Tests {@link OpImageUtil#vectorize(Collection)} when the collection is a
42: * {@link Vector}.
43: */
44: public void testCollectionIsVector() {
45: Collection<String> collection = new Vector<String>();
46: collection.add("s1");
47: collection.add("s2");
48: collection.add("s3");
49:
50: Vector<String> vector = OpImageUtil.vectorize(collection);
51: assertSame(vector, collection);
52: }
53:
54: /**
55: * Tests {@link OpImageUtil#vectorize(Collection)} when the collection is
56: * NOT a {@link Vector}.
57: */
58: public void testCollectionIsNotVector() {
59: Collection<String> collection = new LinkedList<String>();
60: collection.add("s1");
61: collection.add("s2");
62: collection.add("s3");
63:
64: Vector<String> vector = OpImageUtil.vectorize(collection);
65: assertNotSame(vector, collection);
66: assertEquals(vector, collection);
67: }
68:
69: //---------------------------
70: // Class methods
71: //---------------------------
72:
73: /**
74: * Runs only this test.
75: * @param args ignored.
76: */
77: public static void main(String... args) {
78: junit.swingui.TestRunner.run(OpImageUtilTest.class);
79: }
80:
81: }
82:
83: /*
84: * $Log: OpImageUtilTest.java,v $
85: * Revision 1.1 2007/07/05 00:07:15 forklabs
86: * Removed the listerize method and moved the class to its new home.
87: *
88: * Revision 1.1 2007/06/13 18:58:30 forklabs
89: * Operator mediancollection.
90: *
91: */
|