@Test
 public void testDefaultProfile() {
   SpringApplication app = new SpringApplication(AdminApplication.class);
   ConfigurableApplicationContext context = app.run(new String[] {"--server.port=0"});
   assertThat(context.containsBean("processModuleDeployer"), is(true));
   assertThat(context.getBean("processModuleDeployer"), instanceOf(LocalModuleDeployer.class));
   context.close();
 }
Exemplo n.º 2
0
  @Override
  public void loadBean(DynamicBean dynamicBean) {
    long startTime = System.currentTimeMillis();

    String beanName = dynamicBean.getBeanName();
    if (applicationContext.containsBean(beanName)) {
      logger.warn(beanName, "bean【{}】已经加载!");
      // TODO 已经存在旧的bean,须不须要动态更新
      return;
    }

    beanDefinitionReader.loadBeanDefinitions(new DynamicResource(dynamicBean));
    logger.info(
        beanName, String.valueOf(System.currentTimeMillis() - startTime), "初始化bean【{}】耗时{}毫秒.");
  }