1 16 package scriptella.jdbc; 17 18 import scriptella.AbstractTestCase; 19 import scriptella.util.RepeatingInputStream; 20 21 import java.io.IOException ; 22 import java.io.InputStreamReader ; 23 24 30 public class SqlTokenizerPerfTest extends AbstractTestCase { 31 public void test() throws IOException { 33 String text = "INSERT INTO Table VALUES(?v,$v2);--Hint $v;\n" + 34 "/* Comment */\n//comment\nUPDATE Test SET V=?{v2}"; 35 RepeatingInputStream ris = new RepeatingInputStream(text.getBytes(), 20000); 36 SqlTokenizer tok = new SqlReaderTokenizer(new InputStreamReader (ris)); 37 while (tok.nextStatement()!=null) { 38 } 39 } 40 public void testNewLineSeparator() throws IOException { 42 String text = "INSERT INTO Table VALUES(?v,$v2);--Hint $v\n / \r" + 43 "/* Comment */\n//comment\nUPDATE Test SET V=?{v2}"; 44 RepeatingInputStream ris = new RepeatingInputStream(text.getBytes(), 20000); 45 SqlTokenizer tok = new SqlReaderTokenizer(new InputStreamReader (ris)); 46 while (tok.nextStatement()!=null) { 47 } 48 } 49 50 } 51 | Popular Tags |