1 16 package scriptella.expression; 17 18 import scriptella.AbstractTestCase; 19 import scriptella.spi.MockParametersCallbacks; 20 21 import java.util.Arrays ; 22 23 29 public class PropertiesSubstitutorPerfTest extends AbstractTestCase { 30 34 public void test() { 35 PropertiesSubstitutor ps = new PropertiesSubstitutor(MockParametersCallbacks.NAME); 36 37 char [] fillC = new char[1000]; 38 Arrays.fill(fillC,'-'); 39 String fill = new String (fillC); 40 41 String line = "Text ${subst1} $subst2 "+fill+":$end //"; 42 String exp = "Text subst1 subst2 "+fill+":end //"; 43 44 45 46 for (int i=0;i<100000;i++) { 47 String s = ps.substitute(line); 48 assertEquals(exp, s); 49 } 50 } 51 } 52 | Popular Tags |