コード例 #1
0
  public void testGetSetLiveBean() throws Exception {
    ILaunchConfigurationWorkingCopy wc = createWorkingCopy();
    boolean deflt = BootLaunchConfigurationDelegate.DEFAULT_ENABLE_LIVE_BEAN_SUPPORT;
    boolean other = !deflt;

    assertEquals(deflt, BootLaunchConfigurationDelegate.getEnableLiveBeanSupport(wc));

    BootLaunchConfigurationDelegate.setEnableLiveBeanSupport(wc, other);
    assertEquals(other, BootLaunchConfigurationDelegate.getEnableLiveBeanSupport(wc));

    BootLaunchConfigurationDelegate.setEnableLiveBeanSupport(wc, deflt);
    assertEquals(deflt, BootLaunchConfigurationDelegate.getEnableLiveBeanSupport(wc));
  }
コード例 #2
0
  private ILaunchConfigurationWorkingCopy createBaseWorkingCopy() throws Exception {
    ILaunchConfigurationWorkingCopy wc = createWorkingCopy();
    BootLaunchConfigurationDelegate.setDefaults(wc, getProject(TEST_PROJECT), TEST_MAIN_CLASS);

    // Explictly set all options in the config to 'disabled' irrespective of
    // their default values (tests will be more robust w.r.t changing of the defaults).
    BootLaunchConfigurationDelegate.setEnableDebugOutput(wc, false);
    BootLaunchConfigurationDelegate.setEnableLiveBeanSupport(wc, false);
    BootLaunchConfigurationDelegate.setJMXPort(wc, "");
    BootLaunchConfigurationDelegate.setProfile(wc, "");
    BootLaunchConfigurationDelegate.setProperties(wc, null);
    return wc;
  }
コード例 #3
0
  public void testLaunchWithLiveBeans() throws Exception {
    createLaunchReadyProject(TEST_PROJECT);
    ILaunchConfigurationWorkingCopy wc = createBaseWorkingCopy();

    BootLaunchConfigurationDelegate.setEnableLiveBeanSupport(wc, true);
    int port = JmxBeanSupport.randomPort();
    BootLaunchConfigurationDelegate.setJMXPort(wc, "" + port);

    LaunchResult result = LaunchUtil.synchLaunch(wc);

    System.out.println(result);

    assertContains(":: Spring Boot ::", result.out);
    // The following check doesn't real prove the live bean graph works, but at least it shows the
    // VM args are
    // taking effect.
    assertContains("com.sun.management.jmxremote.port='" + port + "'", result.out);
    assertOk(result);
  }