spring-projects / eclipse-integration-tcserver

Eclipse Integration for vFabric tc Server
Eclipse Public License 1.0
15 stars 22 forks source link

[TC Pivotal] Server name is empty when user configured with custom server name #10

Open lak-proddev opened 5 years ago

lak-proddev commented 5 years ago

STEPS:

  1. Server > New > Pivotal tc server 4.0
  2. Provide a custom server name > "TCPivotal4" > Next.
  3. Select Create new instance radio > Next.
  4. Select base Template and provide a name > Next
  5. Finish

Configure a new Pivotal TC server with version 4.0.1 and provide a custom name in Server Name field. It results in server configuration created with blank server name. Reproducible with Pivotal TC server version 3.2.13.

For new instance, we are not setting any new name if not default name. which was already empty. See these code points com.vmware.vfabric.ide.eclipse.tcserver.internal.ui.TcServer21InstanceCreationFragment.exit() com.vmware.vfabric.ide.eclipse.tcserver.internal.ui.TcServer21InstanceCreationFragment.initialize()

lak-proddev commented 5 years ago

@BoykoAlex Do we really need to set the server name here ?

if (wc != null) { wc.setName(nameText.getText()); } // /code-open TcServer21InstanceCreationFragment.java 480-483

BoykoAlex commented 5 years ago

Hmm... think I've tried the steps above and I believe the server name was the one I typed in: screen shot 2019-02-22 at 11 46 22

Regarding the code snippet... Not sure... but why not? I feel that it might be the problem with isDefaultServerName flag set above on line 461: Maybe that line 461 should go after the code snippet you pasted because exit() lines 453-455 looks at the isDefaultServerName` and sets default name and may overwrite the name set previously.

Would like to create a PR that makes things work for you?

BoykoAlex commented 5 years ago

NVM... looks like creating new instance is the important step from the instructions... Feels like it creates a new working copy. I reproduced the issue when created a new instance rather than used the existing one. Maybe you're right and that if block has nothing to do there... there is a modify listener there already that sets the name based on changes... Perhaps it's the tests that require it...