/**
   * Test if a {@link JackVaderFilter} can be created in the KMS. The filter is pipelined with a
   * {@link PlayerEndpoint}, which feeds video to the filter. This test depends on the correct
   * behaviour of the player and its events.
   *
   * @throws InterruptedException
   */
  @Test
  public void testJackVaderFilter() throws InterruptedException {
    player.connect(jackVader);
    final BlockingQueue<EndOfStreamEvent> events = new ArrayBlockingQueue<EndOfStreamEvent>(1);
    player.addEndOfStreamListener(
        new MediaEventListener<EndOfStreamEvent>() {

          @Override
          public void onEvent(EndOfStreamEvent event) {
            events.add(event);
          }
        });

    player.play();

    Assert.assertNotNull(events.poll(10, SECONDS));
  }
  @Before
  public void setupMediaElements() throws InterruptedException {
    player = pipeline.newPlayerEndpoint(URL_SMALL).build();

    final BlockingQueue<JackVaderFilter> events = new ArrayBlockingQueue<JackVaderFilter>(1);
    pipeline
        .newJackVaderFilter()
        .buildAsync(
            new Continuation<JackVaderFilter>() {

              @Override
              public void onSuccess(JackVaderFilter result) {
                events.add(result);
              }

              @Override
              public void onError(Throwable cause) {
                throw new KurentoException(cause);
              }
            });
    jackVader = events.poll(4, SECONDS);
    Assert.assertNotNull(jackVader);
  }