Skip to content

Commit a16ef43

Browse files
committed
Auto-Connect on by default. Unit test.
1 parent 8a86114 commit a16ef43

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

eclipse-extensions/org.springframework.ide.eclipse.boot.launch.test/src/org/springframework/ide/eclipse/boot/launch/test/BootLaunchConfigurationDelegateTest.java

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2015, 2018 Pivotal Software, Inc.
2+
* Copyright (c) 2015, 2022 Pivotal Software, Inc.
33
* All rights reserved. This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License v1.0
55
* which accompanies this distribution, and is available at
@@ -16,13 +16,10 @@
1616
import java.net.URL;
1717
import java.time.Duration;
1818
import java.util.ArrayList;
19-
import java.util.Arrays;
2019
import java.util.List;
2120
import java.util.Properties;
2221
import java.util.function.Predicate;
2322

24-
import javax.xml.transform.stream.StreamResult;
25-
2623
import org.apache.commons.io.FileUtils;
2724
import org.apache.commons.lang3.StringUtils;
2825
import org.apache.commons.lang3.tuple.Pair;
@@ -41,7 +38,6 @@
4138
import org.springframework.ide.eclipse.boot.launch.process.BootProcessFactory;
4239
import org.springframework.ide.eclipse.boot.test.util.LaunchResult;
4340
import org.springframework.ide.eclipse.boot.test.util.LaunchUtil;
44-
import org.springsource.ide.eclipse.commons.frameworks.test.util.ACondition;
4541
import org.springsource.ide.eclipse.commons.frameworks.test.util.Timewatch;
4642
import org.springsource.ide.eclipse.commons.tests.util.StsTestUtil;
4743

@@ -166,6 +162,21 @@ public void testSetGetFastStartup() throws Exception {
166162
assertEquals(false, BootLaunchConfigurationDelegate.getFastStartup(wc));
167163
}
168164

165+
public void testSetGetAutoConnect() throws Exception {
166+
ILaunchConfigurationWorkingCopy wc = createWorkingCopy();
167+
assertEquals(true, BootLaunchConfigurationDelegate.getAutoConnect(wc));
168+
169+
BootLaunchConfigurationDelegate.setAutoConnect(wc, false);
170+
assertEquals(false, BootLaunchConfigurationDelegate.getAutoConnect(wc));
171+
172+
IProject project = createLaunchReadyProject(TEST_PROJECT);
173+
174+
//Creates a launch conf similar to that created by 'Run As' menu.
175+
wc = createWorkingCopy();
176+
BootLaunchConfigurationDelegate.setDefaults(wc, project, TEST_MAIN_CLASS);
177+
assertEquals(true, BootLaunchConfigurationDelegate.getAutoConnect(wc));
178+
}
179+
169180
public void testClearProperties() throws Exception {
170181
ILaunchConfigurationWorkingCopy wc = createWorkingCopy();
171182
BootLaunchConfigurationDelegate.setRawApplicationProperties(wc,

eclipse-extensions/org.springframework.ide.eclipse.boot.launch/src/org/springframework/ide/eclipse/boot/launch/BootLaunchConfigurationDelegate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ public static void setDefaults(ILaunchConfigurationWorkingCopy wc,
366366
setMainType(wc, mainType);
367367
}
368368
setEnableJMX(wc, DEFAULT_ENABLE_JMX);
369-
setAutoConnect(wc, false);
369+
setAutoConnect(wc, DEFAULT_AUTO_CONNECT);
370370
setEnableLiveBeanSupport(wc, DEFAULT_ENABLE_LIVE_BEAN_SUPPORT());
371371
setEnableLifeCycle(wc, DEFAULT_ENABLE_LIFE_CYCLE);
372372
setTerminationTimeout(wc,""+DEFAULT_TERMINATION_TIMEOUT);

0 commit comments

Comments
 (0)