@@ -0,0 +1,1236 @@
+package org.jetel.data.primitive;%0A%0Aimport junit.framework.TestCase;%0A%0A/**%0A * %0A * @author Martin Varecha %3Cmartin.varecha@@javlinconsulting.cz%3E%0A * (c) JavlinConsulting s.r.o.%0A * www.javlinconsulting.cz%0A * @created Nov 7, 2007%0A */%0Apublic class StringFormatTest extends TestCase %7B%0A%0A%09private static void t(String regexp, String expected, String input, String outputFormat) %7B%0A%09%09String result = StringFormat.create(regexp).format(input, outputFormat);%0A%09%09assertEquals(expected, result);%0A%09%7D%0A%0A%09public void testFormat() throws Exception %7B%0A%09%09t(%22(%5C%5Cd*)(?:%5C%5CD*)(%5C%5Cd*)%22, %2200420123456789%22, %2200420- -123456789%22, null);%0A%09%09t(%22(?:%5C%5Cd*)(?:%5C%5CD*)(%5C%5Cd*)%22, %22+420 123456789%22, %2200420- -123456789%22, %22+420 $1%22);%0A%09%09t(%22.*%22, %22abcd%22, %22abcd%22, null);%0A%09%09t(%22(%5C%5Cw+)(%5C%5Cs)%5C%5Cs*(?:%5C%5Cw+%5C%5Cs+)?(%5C%5Cw+)%22, %22Martin Varecha%22, %22Martin Bubak Varecha%22, null);%0A%09%09t(%22(%5C%5Cw+)(%5C%5Cs)%5C%5Cs*(?:%5C%5Cw+%5C%5Cs+)?(%5C%5Cw+)%22, %22Martin Varecha%22, %22Martin Varecha%22, null);%0A%09%09t(%22(%5C%5Cw+)%5C%5Cs*(?:%5C%5Cw+%5C%5Cs+)?(%5C%5Cw+)%22, %22Varecha Martin%22, %22Martin Varecha%22, %22$2 $1%22);%0A%09%09t(%22(%5C%5Cw+)%5C%5Cs*(?:%5C%5Cw+%5C%5Cs+)?(%5C%5Cw+)%22, %22lastName:Varecha firstName:Martin%22, %22Martin Bubak Varecha%22, %22lastName:$2 firstName:$1%22);%0A%09%09this.assertTrue(StringFormat.create(%22%5C%5Cw*%22).matches(%22bubak%22));%0A%09%09this.assertTrue(StringFormat.create(%22%5C%5CW*%22).matches(%22/'%5B%5D;,%22));%0A%09%7D%0A%7D

test case has been moved into separated class in the tests package