1 26 package org.objectweb.util.explorer; 27 28 29 import junit.framework.Assert; 30 import junit.framework.TestCase; 31 32 40 public class ExplorerUtilsTest 41 extends TestCase 42 { 43 44 50 56 62 68 public void testCompareObjectsMethod(){ 69 Object o1=null, o2=null; 70 Assert.assertTrue(ExplorerUtils.compareObjects(o1,o2)); 71 o1 = new String (); 72 Assert.assertFalse(ExplorerUtils.compareObjects(o1,o2)); 73 o1 = null; 74 o2 = new String ("test"); 75 Assert.assertFalse(ExplorerUtils.compareObjects(o1,o2)); 76 o1 = new String ("test"); 77 Assert.assertTrue(ExplorerUtils.compareObjects(o1,o2)); 78 } 79 80 public void testIsEmptyString(){ 81 String s = null; 82 Assert.assertTrue(ExplorerUtils.isEmpty(s)); 83 s = ""; 84 Assert.assertTrue(ExplorerUtils.isEmpty(s)); 85 s = "not empty"; 86 Assert.assertFalse(ExplorerUtils.isEmpty(s)); 87 } 88 89 } 90 91 92 | Popular Tags |