1 41 42 package org.jfree.chart.ui.junit; 43 44 import junit.framework.Test; 45 import junit.framework.TestCase; 46 import junit.framework.TestSuite; 47 48 import org.jfree.chart.ui.ColorPalette; 49 import org.jfree.chart.ui.GreyPalette; 50 51 54 public class ColorPaletteTests extends TestCase { 55 56 61 public static Test suite() { 62 return new TestSuite(ColorPaletteTests.class); 63 } 64 65 70 public ColorPaletteTests(String name) { 71 super(name); 72 } 73 74 77 public void testCloning() { 78 ColorPalette p1 = new GreyPalette(); 79 ColorPalette p2 = null; 80 try { 81 p2 = (ColorPalette) p1.clone(); 82 } 83 catch (CloneNotSupportedException e) { 84 System.err.println("Failed to clone."); 85 } 86 assertTrue(p1 != p2); 87 assertTrue(p1.getClass() == p2.getClass()); 88 assertTrue(p1.equals(p2)); 89 } 90 91 94 public void testEquals() { 95 ColorPalette p1 = new GreyPalette(); 96 ColorPalette p2 = new GreyPalette(); 97 assertTrue(p1.equals(p2)); 98 } 99 100 } 101 | Popular Tags |