コード例 #1
0
  @BeforeClass
  public static void startUp() throws InterruptedException, IOException {
    if (applicationContext == null) {
      if (System.getProperty(SHUTDOWN_AFTER_RUN) != null) {
        shutdownAfterRun = Boolean.getBoolean(SHUTDOWN_AFTER_RUN);
      }

      SpringApplication application =
          new SpringApplicationBuilder(
                  AdminApplication.class, AdminConfiguration.class, TestConfig.class)
              .build();
      applicationContext =
          application.run(
              String.format("--server.port=%s", adminPort),
              "--security.basic.enabled=false",
              "--spring.main.show_banner=false",
              "--spring.cloud.config.enabled=false");
    }
    JLineShellComponent shell =
        new Bootstrap(new String[] {"--port", String.valueOf(adminPort)}).getJLineShellComponent();
    if (!shell.isRunning()) {
      shell.start();
    }
    dataFlowShell = new DataFlowShell(shell);
  }