1 28 29 package org.objectweb.util.explorer.parser.lib; 30 31 import org.objectweb.util.explorer.ExplorerUtils; 32 33 import junit.framework.Assert; 34 import junit.framework.TestCase; 35 36 44 public class ParserUtilsTest 45 extends TestCase 46 { 47 48 54 60 66 69 protected void setUp() throws Exception { 70 } 71 72 75 protected void test(Object [] a1, Object [] a2, String result){ 76 Object [] m = ExplorerUtils.mergeArrays(a1,a2); 77 String ms = ExplorerUtils.arrayToString(m); 78 Assert.assertEquals(result, ms); 79 } 80 81 87 90 public void testMergeArrays() { 91 test(null, null, "{}"); 92 test(new String []{"1","2","3"}, new String []{"1","3","4"}, "{1,2,3,4}"); 93 test(new String []{}, new String []{"1","2","3"}, "{1,2,3}"); 94 test(new String []{"1","2","3"}, null, "{1,2,3}"); 95 test(null, new String []{"1","2","3"}, "{1,2,3}"); 96 } 97 98 } 99 | Popular Tags |