1 26 package org.objectweb.util.explorer.core.icon; 27 28 import org.objectweb.util.explorer.core.code.api.CodeDescription; 29 import org.objectweb.util.explorer.core.code.lib.BasicCodeDescription; 30 import org.objectweb.util.explorer.core.icon.api.IconCodeDescription; 31 import org.objectweb.util.explorer.core.icon.lib.BasicIconCodeDescription; 32 33 import junit.framework.Assert; 34 import junit.framework.TestCase; 35 36 44 public class IconDescriptionTest 45 extends TestCase 46 { 47 48 54 60 66 72 public void testIconCodeEqualsMethod(){ 73 CodeDescription c1 = new BasicCodeDescription(); 74 c1.setLanguage("Java"); 75 c1.setCode("java.lang.Object"); 76 CodeDescription c2 = new BasicCodeDescription(); 77 c2.setLanguage("Java"); 78 c2.setCode("java.lang.Object"); 79 CodeDescription nullCodeDesc = null; 80 81 IconCodeDescription iconCodeDesc = new BasicIconCodeDescription(); 82 IconCodeDescription expected = new BasicIconCodeDescription(); 83 Assert.assertEquals(expected, iconCodeDesc); 84 iconCodeDesc.setCode(nullCodeDesc); 85 Assert.assertEquals(expected, iconCodeDesc); 86 iconCodeDesc.setCode(c1); 87 Assert.assertEquals(iconCodeDesc, iconCodeDesc); 88 expected.setCode(c1); 89 Assert.assertEquals(expected, iconCodeDesc); 90 expected.setCode(c2); 91 Assert.assertEquals(expected, iconCodeDesc); 92 } 93 94 } 95 96 | Popular Tags |