1 29 30 package nextapp.echo2.app.test; 31 32 import nextapp.echo2.app.Extent; 33 import nextapp.echo2.app.ResourceImageReference; 34 import junit.framework.TestCase; 35 36 40 public class ResourceImageReferenceTest extends TestCase { 41 42 private static final ResourceImageReference image1 = new ResourceImageReference("image1.png", "image/png", 43 new Extent(50), new Extent(40)); 44 private static final ResourceImageReference image1Copy = new ResourceImageReference("image1.png", "image/png", 45 new Extent(50), new Extent(40)); 46 private static final ResourceImageReference image2 = new ResourceImageReference("image2.png", "image/png", 47 new Extent(50), new Extent(40)); 48 49 52 public void testEquals() { 53 assertTrue(image1.equals(image1Copy)); 54 assertFalse(image1.equals(image2)); 55 assertFalse(image1.equals(new Object ())); 56 assertFalse(image1.equals(null)); 57 } 58 59 62 public void testLeadingSlashes() { 63 assertEquals("test/image1.png", new ResourceImageReference("test/image1.png").getResource()); 64 assertEquals("test/image1.png", new ResourceImageReference("/test/image1.png").getResource()); 65 } 66 } 67 | Popular Tags |