Community
Participate
Working Groups
Build Identifier: A server created with a user defined name incorrectly uses the default name when runtime type or hostname is changed after. Reproducible: Always Steps to Reproduce: 1. Enter a server name (e.g. "ServerA") 2. Click on another sever type or change the hostname 3. Create the server, the server name will be the default generated server name instead of "ServerA"
Created attachment 200219 [details] Patch v1.0
In both handleHostnameChange(IServerType) and handleTypeSelection(IServerType) The Server working copy is set to the defualt value of the server in two places in those methods: 1. loadServerImpl(IServerType) 2. updateRuntimeCombo(IServerType), which eventually calls setRuntime(IRuntime) updateRuntimeCombo is called after loadServerImpl, therefore only the server working modifications in updateRuntimeCombo would need to be modified. Within updateRuntimeCombo(IServerType) org.eclipse.wst.server.ui.internal.wizard.page.NewManualServerComposite.setRuntime(IRuntime), if serverNameModified, then the server name should be set to the value of the serverName's text field. serverName.getText() is used, without any trims or processing, because that is how the name is set in org.eclipse.wst.server.ui.internal.wizard.page.NewManualServerComposite.createControl().new ModifyListener() {...}.modifyText(ModifyEvent) within the NewManualServerComposite. ============================================= Tests run before patch ============================================= I will use server A to be one server type I had selected and server B to be another server type I had selected. Expected: 1. Choose server A, then create server. The default generated name is used for the created server 2. Choose server A, change the server name to "ServerA". The created server says "ServerA" 3. Choose server A, then choose server B and create the server. The default generated name for server B is used 4. Choose server A, change the hostname to "localhost123". The default generated name for server A with the new hostname is used. Failing cases: 1. Choose server A, change the name to "ServerA", then choose server B and create the server. The created server will use the default name for server B instead of "ServerA" 2. Choose server A, change the name to "ServerA", then change the hostname to "localhost123". The default generated name for "localhost123" is used instead of "ServerA" ============================================= Tests run after patch ============================================= I will use server A to be one server type I had selected and server B to be another server type I had selected. 1. Choose server A, then create server. The default generated name is used for the created server 2. Choose server A, change the server name to "ServerA". The created server says "ServerA" 3. Choose server A, then choose server B and create the server. The default generated name for server B is used 4. Choose server A, change the hostname to "localhost123". The default generated name for server A with the new hostname is used. 5. Choose server A, change the name to "ServerA", then choose server B and create the server. The created server will be named "ServerA" 6. Choose server A, change the name to "ServerA", then change the hostname to "localhost123". The created server will be named "ServerA" 7. Choose server A, change the name to "ServerA", then choose server B, then choose server A again. The created server will be named "ServerA" 8. Choose server A, change the name to "ServerA", then choose server B, then change the hostname to "localhost123". The created server will be named "ServerA"
The changes looks good and the test coverage is good as well. One minor comment on the code change is that there is no need to cast to ServerWorkingCopy since the method setName is exposed on IServerWorkingCopy.
Created attachment 200223 [details] Patch v1.2
The new patch looks good.
Changes released to 32M, 33M and HEAD
New Gerrit change created: https://git.eclipse.org/r/109054