KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > columba > core > gui > util > ColorFactoryTest


1 /*
2  * Created on 2003-nov-02
3  */

4 package org.columba.core.gui.util;
5
6 import java.awt.Color JavaDoc;
7
8 import junit.framework.TestCase;
9
10 import org.columba.core.gui.base.ColorFactory;
11
12
13 /**
14  * @author Erik Mattsson
15  */

16 public class ColorFactoryTest extends TestCase {
17     /*
18  * Test for getColor()
19  */

20     public void testGetColor() {
21         ColorFactory.clear();
22
23         Color JavaDoc col1 = ColorFactory.getColor(0);
24         assertNotNull("The factory returned a null object", col1);
25
26         Color JavaDoc col2 = ColorFactory.getColor(1);
27         assertNotNull("The factory returned a null object", col2);
28         assertNotSame("The factory returned the same object for different values",
29             col1, col2);
30
31         Color JavaDoc col1again = ColorFactory.getColor(0);
32         assertNotNull("The factory returned a null object", col1again);
33         assertSame("The factory did not return the same object for a value",
34             col1, col1again);
35     }
36 }
37
Popular Tags