From a259ced7c3ff75f3677e1cba604c7d1b7e92491a Mon Sep 17 00:00:00 2001 From: Vignesh Raja Date: Mon, 3 Oct 2016 13:05:34 -0700 Subject: [PATCH] Fix benchmark tests --- .../src/jmh/java/com/optimizely/ab/OptimizelyBenchmark.java | 3 ++- .../jmh/java/com/optimizely/ab/OptimizelyBuilderBenchmark.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core-api/src/jmh/java/com/optimizely/ab/OptimizelyBenchmark.java b/core-api/src/jmh/java/com/optimizely/ab/OptimizelyBenchmark.java index 15c9a5ada..3638c70bf 100644 --- a/core-api/src/jmh/java/com/optimizely/ab/OptimizelyBenchmark.java +++ b/core-api/src/jmh/java/com/optimizely/ab/OptimizelyBenchmark.java @@ -17,6 +17,7 @@ package com.optimizely.ab; import com.optimizely.ab.config.Variation; +import com.optimizely.ab.config.parser.ConfigParseException; import com.optimizely.ab.event.NoopEventHandler; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -65,7 +66,7 @@ public class OptimizelyBenchmark { @Setup @SuppressFBWarnings(value="OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE", justification="stream is safely closed") - public void setup() throws IOException { + public void setup() throws IOException, ConfigParseException { Properties properties = new Properties(); InputStream propertiesStream = getClass().getResourceAsStream("/benchmark.properties"); properties.load(propertiesStream); diff --git a/core-api/src/jmh/java/com/optimizely/ab/OptimizelyBuilderBenchmark.java b/core-api/src/jmh/java/com/optimizely/ab/OptimizelyBuilderBenchmark.java index 98e825971..2240c5bed 100644 --- a/core-api/src/jmh/java/com/optimizely/ab/OptimizelyBuilderBenchmark.java +++ b/core-api/src/jmh/java/com/optimizely/ab/OptimizelyBuilderBenchmark.java @@ -16,6 +16,7 @@ */ package com.optimizely.ab; +import com.optimizely.ab.config.parser.ConfigParseException; import com.optimizely.ab.event.EventHandler; import com.optimizely.ab.event.NoopEventHandler; @@ -68,7 +69,7 @@ public void setup() throws IOException { } @Benchmark - public Optimizely measureOptimizelyCreation() throws IOException { + public Optimizely measureOptimizelyCreation() throws IOException, ConfigParseException { return Optimizely.builder(datafile, eventHandler).build(); } }