test_class.declarator: expectedEx = ExpectedException.none()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public ExpectedException expectedEx = ExpectedException.none();
test_class.type: ExpectedException
test_class.var_name: expectedEx
test_class.file: oak-run/src/test/java/org/apache/jackrabbit/oak/run/MetricsExporterFixtureProviderTest.java
test_class.identifier: MetricsExporterFixtureProviderTest
test_case.body: @Test
      public void checkCorrectPushGatewayInit() throws Exception {
          OptionParser parser = new OptionParser();
          DataStoreOptions dataStoreOptions = new DataStoreOptions(parser);
  
          OptionSet option = parser.parse("--export-metrics", "pushgateway;localhost:9091;key1=value1,key2=value2");
          dataStoreOptions.configure(option);
  
          MetricsExporterFixture metricsExporterFixture =
              MetricsExporterFixtureProvider.create(dataStoreOptions, new DefaultWhiteboard());
  
          assertEquals("pushgateway", metricsExporterFixture.getExporterType().name());
          Object metricsExporter = metricsExporterFixture.getMetricsExporter();
          assertTrue(metricsExporter instanceof PushGateway);
      }
test_case.class_method_signature: MetricsExporterFixtureProviderTest.checkCorrectPushGatewayInit()
test_case.full_signature: @Test public void checkCorrectPushGatewayInit()
test_case.identifier: checkCorrectPushGatewayInit
test_case.invocations: parse configure create assertEquals name getExporterType getMetricsExporter assertTrue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void checkCorrectPushGatewayInit()
focal_class.declarator: log = LoggerFactory.getLogger(NodeStoreFixtureProvider.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(NodeStoreFixtureProvider.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.file: oak-run/src/main/java/org/apache/jackrabbit/oak/run/MetricsExporterFixtureProvider.java
focal_class.identifier: MetricsExporterFixtureProvider
focal_class.class_method_signature: MetricsExporterFixtureProvider.create(DataStoreOptions options, Whiteboard wb)
focal_class.full_signature: @Nullable public static MetricsExporterFixture create(DataStoreOptions options, Whiteboard wb)
focal_class.identifier: create
focal_class.modifiers: @Nullable public static
focal_class.parameters: (DataStoreOptions options, Whiteboard wb)
focal_class.return: MetricsExporterFixture
focal_class.signature: MetricsExporterFixture create(DataStoreOptions options, Whiteboard wb)
focal_method.body: @Nullable
      public static MetricsExporterFixture create(DataStoreOptions options, Whiteboard wb) throws Exception {
          if (options.exportMetrics()) {
              CollectorRegistry collectorRegistry = new CollectorRegistry();
              wb.register(CollectorRegistry.class, collectorRegistry, emptyMap());
  
              MetricRegistry metricRegistry = getService(wb, MetricRegistry.class);
  
              ExportMetricsArgs
                  metricsArgs = new ExportMetricsArgs(options.exportMetricsArgs());
              if (metricsArgs.getExporterType() == ExporterType.pushgateway) {
                  PushGateway pg = new PushGateway(metricsArgs.getPushUri());
                  new DropwizardExports(metricRegistry).register(collectorRegistry);
  
                  wb.register(PushGateway.class, pg, emptyMap());
                  return new MetricsExporterFixture<PushGateway>() {
                      @Override public ExporterType getExporterType() {
                          return ExporterType.pushgateway;
                      }
  
                      @Override public PushGateway getMetricsExporter() {
                          return pg;
                      }
  
                      @Override public void close() throws IOException {
                          pg.pushAdd(collectorRegistry, PushGateway.class.getName(), metricsArgs.getPushMap());
                      }
                  };
              }
          }
          return null;
      }
focal_method.class_method_signature: MetricsExporterFixtureProvider.create(DataStoreOptions options, Whiteboard wb)
focal_method.full_signature: @Nullable public static MetricsExporterFixture create(DataStoreOptions options, Whiteboard wb)
focal_method.identifier: create
focal_method.invocations: exportMetrics register emptyMap getService exportMetricsArgs getExporterType getPushUri register register emptyMap pushAdd getName getPushMap
focal_method.modifiers: @Nullable public static
focal_method.parameters: (DataStoreOptions options, Whiteboard wb)
focal_method.return: MetricsExporterFixture
focal_method.signature: MetricsExporterFixture create(DataStoreOptions options, Whiteboard wb)