1 package hudson; 2 3 import junit.framework.TestCase; 4 5 import java.util.Map ; 6 import java.util.HashMap ; 7 8 11 public class UtilTest extends TestCase { 12 public void testReplaceMacro() { 13 Map <String ,String > m = new HashMap <String ,String >(); 14 m.put("A","a"); 15 m.put("AA","aa"); 16 m.put("B","B"); 17 18 assertEquals("aa",Util.replaceMacro("$AA",m)); 20 21 assertEquals("$AAB",Util.replaceMacro("$AAB",m)); 23 24 assertEquals("/a/B/aa", Util.replaceMacro("/$A/$B/$AA",m)); 26 assertEquals("a-aa", Util.replaceMacro("$A-$AA",m)); 27 assertEquals("/a/foo/can/B/you-believe_aa~it?", Util.replaceMacro("/$A/foo/can/$B/you-believe_$AA~it?",m)); 28 } 29 } 30 | Popular Tags |