Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.junit.BeforeClass;
- import org.junit.Test;
- import com.carrotsearch.junitbenchmarks.AbstractBenchmark;
- public class PatternBenchmarkTest extends AbstractBenchmark {
- private static String bigS;
- private static StringSplitter pt;
- @BeforeClass
- public static void prepare() {
- char[] bigString = new char[10000000];
- for (int i = 0; i < bigString.length; i = i + 2) {
- bigString[i] = 'a';
- bigString[i + 1] = ' ';
- }
- bigS = new String(bigString);
- System.out.println("Created big string");
- pt = new StringSplitter();
- System.out.println("Created test class");
- }
- @Test
- public void testNonPrecompiled() {
- pt.nonPrecompiledTest(bigS);
- }
- @Test
- public void testPrecompiled() {
- pt.precompiledTest(bigS);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement