test_class.declarator: ctx = new HystrixRequestContextRule()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public HystrixRequestContextRule ctx = new HystrixRequestContextRule();
test_class.type: HystrixRequestContextRule
test_class.var_name: ctx
test_class.declarator: stream
test_class.original_string: HystrixDashboardStream stream;
test_class.type: HystrixDashboardStream
test_class.var_name: stream
test_class.declarator: groupKey = HystrixCommandGroupKey.Factory.asKey("Dashboard")
test_class.modifier: private final static
test_class.original_string: private final static HystrixCommandGroupKey groupKey = HystrixCommandGroupKey.Factory.asKey("Dashboard");
test_class.type: HystrixCommandGroupKey
test_class.var_name: groupKey
test_class.declarator: commandKey = HystrixCommandKey.Factory.asKey("DashboardCommand")
test_class.modifier: private final static
test_class.original_string: private final static HystrixCommandKey commandKey = HystrixCommandKey.Factory.asKey("DashboardCommand");
test_class.type: HystrixCommandKey
test_class.var_name: commandKey
test_class.file: hystrix-core/src/test/java/com/netflix/hystrix/metric/consumer/HystrixDashboardStreamTest.java
test_class.identifier: HystrixDashboardStreamTest
test_class.superclass: extends CommandStreamTest
test_case.body: @Test
      public void testStreamHasData() throws Exception {
          final AtomicBoolean commandShowsUp = new AtomicBoolean(false);
          final CountDownLatch latch = new CountDownLatch(1);
          final int NUM = 10;
  
          for (int i = 0; i < 2; i++) {
              HystrixCommand<Integer> cmd = Command.from(groupKey, commandKey, HystrixEventType.SUCCESS, 50);
              cmd.observe();
          }
  
          stream.observe().take(NUM).subscribe(
                  new Subscriber<HystrixDashboardStream.DashboardData>() {
                      @Override
                      public void onCompleted() {
                          System.out.println(System.currentTimeMillis() + " : " + Thread.currentThread().getName() + " OnCompleted");
                          latch.countDown();
                      }
  
                      @Override
                      public void onError(Throwable e) {
                          System.out.println(System.currentTimeMillis() + " : " + Thread.currentThread().getName() + " OnError : " + e);
                          latch.countDown();
                      }
  
                      @Override
                      public void onNext(HystrixDashboardStream.DashboardData dashboardData) {
                          System.out.println(System.currentTimeMillis() + " : " + Thread.currentThread().getName() + " : Received data with : " + dashboardData.commandMetrics.size() + " commands");
                          for (HystrixCommandMetrics metrics : dashboardData.commandMetrics) {
                              if (metrics.getCommandKey().equals(commandKey)) {
                                  commandShowsUp.set(true);
                              }
                          }
                      }
                  });
  
          assertTrue(latch.await(10000, TimeUnit.MILLISECONDS));
          assertTrue(commandShowsUp.get());
      }
test_case.class_method_signature: HystrixDashboardStreamTest.testStreamHasData()
test_case.full_signature: @Test public void testStreamHasData()
test_case.identifier: testStreamHasData
test_case.invocations: from observe subscribe take observe println currentTimeMillis getName currentThread countDown println currentTimeMillis getName currentThread countDown println currentTimeMillis getName currentThread size equals getCommandKey set assertTrue await assertTrue get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testStreamHasData()
focal_class.declarator: delayInMs
focal_class.modifier: final
focal_class.original_string: final int delayInMs;
focal_class.type: int
focal_class.var_name: delayInMs
focal_class.declarator: singleSource
focal_class.modifier: final
focal_class.original_string: final Observable<DashboardData> singleSource;
focal_class.type: Observable<DashboardData>
focal_class.var_name: singleSource
focal_class.declarator: isSourceCurrentlySubscribed = new AtomicBoolean(false)
focal_class.modifier: final
focal_class.original_string: final AtomicBoolean isSourceCurrentlySubscribed = new AtomicBoolean(false);
focal_class.type: AtomicBoolean
focal_class.var_name: isSourceCurrentlySubscribed
focal_class.declarator: dataEmissionIntervalInMs =
              DynamicPropertyFactory.getInstance().getIntProperty("hystrix.stream.dashboard.intervalInMilliseconds", 500)
focal_class.modifier: private static final
focal_class.original_string: private static final DynamicIntProperty dataEmissionIntervalInMs =
              DynamicPropertyFactory.getInstance().getIntProperty("hystrix.stream.dashboard.intervalInMilliseconds", 500);
focal_class.type: DynamicIntProperty
focal_class.var_name: dataEmissionIntervalInMs
focal_class.declarator: INSTANCE =
              new HystrixDashboardStream(dataEmissionIntervalInMs.get())
focal_class.modifier: private static final
focal_class.original_string: private static final HystrixDashboardStream INSTANCE =
              new HystrixDashboardStream(dataEmissionIntervalInMs.get());
focal_class.type: HystrixDashboardStream
focal_class.var_name: INSTANCE
focal_class.file: hystrix-core/src/main/java/com/netflix/hystrix/metric/consumer/HystrixDashboardStream.java
focal_class.identifier: HystrixDashboardStream
focal_class.class_method_signature: HystrixDashboardStream.HystrixDashboardStream(int delayInMs)
focal_class.full_signature: private  HystrixDashboardStream(int delayInMs)
focal_class.identifier: HystrixDashboardStream
focal_class.modifiers: private
focal_class.parameters: (int delayInMs)
focal_class.signature:  HystrixDashboardStream(int delayInMs)
focal_class.class_method_signature: HystrixDashboardStream.getInstance()
focal_class.full_signature: public static HystrixDashboardStream getInstance()
focal_class.identifier: getInstance
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: HystrixDashboardStream
focal_class.signature: HystrixDashboardStream getInstance()
focal_class.class_method_signature: HystrixDashboardStream.getNonSingletonInstanceOnlyUsedInUnitTests(int delayInMs)
focal_class.full_signature: static HystrixDashboardStream getNonSingletonInstanceOnlyUsedInUnitTests(int delayInMs)
focal_class.identifier: getNonSingletonInstanceOnlyUsedInUnitTests
focal_class.modifiers: static
focal_class.parameters: (int delayInMs)
focal_class.return: HystrixDashboardStream
focal_class.signature: HystrixDashboardStream getNonSingletonInstanceOnlyUsedInUnitTests(int delayInMs)
focal_class.class_method_signature: HystrixDashboardStream.observe()
focal_class.full_signature: public Observable<DashboardData> observe()
focal_class.identifier: observe
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Observable<DashboardData>
focal_class.signature: Observable<DashboardData> observe()
focal_class.class_method_signature: HystrixDashboardStream.isSourceCurrentlySubscribed()
focal_class.full_signature: public boolean isSourceCurrentlySubscribed()
focal_class.identifier: isSourceCurrentlySubscribed
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isSourceCurrentlySubscribed()
focal_method.body: public Observable<DashboardData> observe() {
          return singleSource;
      }
focal_method.class_method_signature: HystrixDashboardStream.observe()
focal_method.full_signature: public Observable<DashboardData> observe()
focal_method.identifier: observe
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: Observable<DashboardData>
focal_method.signature: Observable<DashboardData> observe()