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