...30 @org.openjdk.jmh.annotations.Benchmark31 public void benchmark_testRunWorkloadThrice() throws java.lang.Throwable {32 this.payloads.testRunWorkloadThrice.evaluate();33 }34 private static class _InstanceStatement extends org.junit.runners.model.Statement {35 private final se.chalmers.ju2jmh.api.ThrowingConsumer<ParseJavaSourceEmptyRulesTest> payload;36 private final _Benchmark benchmark;37 public _InstanceStatement(se.chalmers.ju2jmh.api.ThrowingConsumer<ParseJavaSourceEmptyRulesTest> payload, _Benchmark benchmark) {38 this.payload = payload;39 this.benchmark = benchmark;40 }41 @java.lang.Override42 public void evaluate() throws java.lang.Throwable {43 this.payload.accept(this.benchmark.instance);44 }45 }46 private static class _ClassStatement extends org.junit.runners.model.Statement {47 private final se.chalmers.ju2jmh.api.ThrowingConsumer<ParseJavaSourceEmptyRulesTest> payload;48 private final _Benchmark benchmark;49 private final org.junit.runner.Description description;50 private final org.junit.runners.model.FrameworkMethod frameworkMethod;51 private _ClassStatement(se.chalmers.ju2jmh.api.ThrowingConsumer<ParseJavaSourceEmptyRulesTest> payload, _Benchmark benchmark, org.junit.runner.Description description, org.junit.runners.model.FrameworkMethod frameworkMethod) {52 this.payload = payload;53 this.benchmark = benchmark;54 this.description = description;55 this.frameworkMethod = frameworkMethod;56 }57 @java.lang.Override58 public void evaluate() throws java.lang.Throwable {59 this.benchmark.instance = new ParseJavaSourceEmptyRulesTest();60 org.junit.runners.model.Statement statement = new _InstanceStatement(this.payload, this.benchmark);61 statement = this.applyRule(this.benchmark.instance.emptyRuleField, statement);62 statement = this.applyRule(this.benchmark.instance.emptyRuleMethod(), statement);63 statement.evaluate();64 }65 private org.junit.runners.model.Statement applyRule(org.junit.rules.TestRule rule, org.junit.runners.model.Statement statement) {66 return se.chalmers.ju2jmh.api.Rules.apply(rule, statement, this.description);67 }68 private org.junit.runners.model.Statement applyRule(org.junit.rules.MethodRule rule, org.junit.runners.model.Statement statement) {69 return se.chalmers.ju2jmh.api.Rules.apply(rule, statement, this.frameworkMethod, this.benchmark.instance);70 }71 public static org.junit.runners.model.Statement forPayload(se.chalmers.ju2jmh.api.ThrowingConsumer<ParseJavaSourceEmptyRulesTest> payload, String name, _Benchmark benchmark) {72 org.junit.runner.Description description = se.chalmers.ju2jmh.api.Rules.description(ParseJavaSourceEmptyRulesTest.class, name);73 org.junit.runners.model.FrameworkMethod frameworkMethod = se.chalmers.ju2jmh.api.Rules.frameworkMethod(ParseJavaSourceEmptyRulesTest.class, name);74 org.junit.runners.model.Statement statement = new _ClassStatement(payload, benchmark, description, frameworkMethod);75 statement = se.chalmers.ju2jmh.api.Rules.apply(ParseJavaSourceEmptyRulesTest.emptyClassRuleField, statement, description);76 statement = se.chalmers.ju2jmh.api.Rules.apply(ParseJavaSourceEmptyRulesTest.emptyClassRuleMethod(), statement, description);77 return statement;78 }79 }80 private static class _Payloads {81 public org.junit.runners.model.Statement testRunWorkloadOnce;82 public org.junit.runners.model.Statement testRunWorkloadTwice;83 public org.junit.runners.model.Statement testRunWorkloadThrice;84 }85 @org.openjdk.jmh.annotations.Setup(org.openjdk.jmh.annotations.Level.Trial)86 public void makePayloads() {87 this.payloads = new _Payloads();88 this.payloads.testRunWorkloadOnce = _ClassStatement.forPayload(ParseJavaSourceEmptyRulesTest::testRunWorkloadOnce, "testRunWorkloadOnce", this);89 this.payloads.testRunWorkloadTwice = _ClassStatement.forPayload(ParseJavaSourceEmptyRulesTest::testRunWorkloadTwice, "testRunWorkloadTwice", this);90 this.payloads.testRunWorkloadThrice = _ClassStatement.forPayload(ParseJavaSourceEmptyRulesTest::testRunWorkloadThrice, "testRunWorkloadThrice", this);91 }92 }93}...