components/src/test/java/eu/internetofus/common/components/Containers.java
/**
   * Start the basic containers and wait until they are ready.
   *
   * @return this containers instance.
   *
   * @see #startBasic()
   * @see #startProfileManagerContainer()
   * @see #startProfileDiversityManagerContainer()
   * @see #startTaskManagerContainer()
   * @see #startInteractionProtocolEngineContainer()
   */
Start the basic containers and wait until they are ready.
@return this containers instance.


Start the basic containers and wait until they are ready . @return this containers instance .
public Containers startAll() {
    this.startBasic();
    this.startProfileDiversityManagerContainer();
    this.startProfileManagerContainer();
    this.startTaskManagerContainer();
    this.startInteractionProtocolEngineContainer();
    this.waitUntilProfileManagerCanCreateProfile();
    this.waitUntilTaskManagerCanCreateTaskType();
    final List<String> started = new ArrayList<>();
    started.add(this.getProfileDiversityManagerApi() + "/help/info");
    started.add(this.getInteractionProtocolEngineApi() + "/help/info");
    final var max = Instant.now().plus(60, ChronoUnit.SECONDS).toEpochMilli();
    do {
      try {
        Thread.sleep(1000);
      } catch (final InterruptedException ignored) {
      }
      final var iter = started.iterator();
      while (iter.hasNext()) {
        try {
          final var url = iter.next();
          final var json = IOUtils.toString(new URL(url), Charset.defaultCharset());
          final var info = new JsonObject(json);
          if (info.getString("name", null) != null) {
            iter.remove();
          }
        } catch (final Throwable ignored) {
        }
      }
    } while (!started.isEmpty() && System.currentTimeMillis() < max);
    if (!started.isEmpty()) {
      fail("Not started all the containers.");
    }
    return this;
  }
public Containers startAll ( ) { this . startBasic ( ) ; this . startProfileDiversityManagerContainer ( ) ; this . startProfileManagerContainer ( ) ; this . startTaskManagerContainer ( ) ; this . startInteractionProtocolEngineContainer ( ) ; this . waitUntilProfileManagerCanCreateProfile ( ) ; this . waitUntilTaskManagerCanCreateTaskType ( ) ; final List < String > started = new ArrayList < > ( ) ; started . add ( this . getProfileDiversityManagerApi ( ) + "/help/info" ) ; started . add ( this . getInteractionProtocolEngineApi ( ) + "/help/info" ) ; final var max = Instant . now ( ) . plus ( 60 , ChronoUnit . SECONDS ) . toEpochMilli ( ) ; do { try { Thread . sleep ( 1000 ) ; } catch ( final InterruptedException ignored ) { } final var iter = started . iterator ( ) ; while ( iter . hasNext ( ) ) { try { final var url = iter . next ( ) ; final var json = IOUtils . toString ( new URL ( url ) , Charset . defaultCharset ( ) ) ; final var info = new JsonObject ( json ) ; if ( info . getString ( "name" , null ) != null ) { iter . remove ( ) ; } } catch ( final Throwable ignored ) { } } } while ( ! started . isEmpty ( ) && System . currentTimeMillis ( ) < max ) ; if ( ! started . isEmpty ( ) ) { fail ( "Not started all the containers." ) ; } return this ; }
Start the basic containers and wait until they are ready.
Start the basic containers and wait until they are ready .
// Wait until they has been started