[jbosstools-issues] [JBoss JIRA] (JBIDE-14514) openshift-java-client: remove workaround for https://bugzilla.redhat.com/show_bug.cgi?id=812046

Andre Dietisheim (JIRA) jira-events at lists.jboss.org
Fri May 17 13:23:06 EDT 2013


    [ https://issues.jboss.org/browse/JBIDE-14514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12775111#comment-12775111 ] 

Andre Dietisheim edited comment on JBIDE-14514 at 5/17/13 1:22 PM:
-------------------------------------------------------------------

To make sure the new code works we should also make sure the appropriate integration tests test the presence of the url. The integration tests have to assert the 2 different cases:

* presence of url with an *existing* embedded cartridge
* presence of url with a *freshly added* cartridge

The 2 different cases are covered by EmbeddedCartridgeResource#extractUrl(info, messages) which extract from either info (existing cartridge) or the messages (freshly created);

When embedding postgres the integration asserts the presence of an url (freshly embedded postgres):

{code:title=EmbeddedCartridgeResourceIntegrationTest#shouldEmbedPostgreSQL}
// verification
new EmbeddedCartridgeAssert(application.getEmbeddedCartridge(postgres))
		.hasUrl();
{code}

The very same test for mysql is *missing* this assertion (freshly embedded mysql):
{code:title=EmbeddedCartridgeResourceIntegrationTest#shouldEmbedshouldEmbedMySQL}
// verification
assertThat(new ApplicationAssert(application))
		.hasEmbeddableCartridges(numOfEmbeddedCartridges + 1)
		.hasEmbeddedCartridge(LatestVersionOf.mySQL());
{code}

#shouldEmbedJenkinsClient is missing it, too

{code:title=EmbeddedCartridgeResourceIntegrationTest#shouldEmbedJenkinsClient}
// verification
assertThat(new ApplicationAssert(application)
		.hasEmbeddedCartridge(LatestVersionOf.jenkinsClient()));
{code}

                
      was (Author: adietish):
    To make sure the new code works we should also make sure the appropriate integration tests test the presence of the url. The integration tests have to assert the 2 different cases:

* presence of url with an *existing* embedded cartridge
* presence of url with a *freshly added* cartridge

The 2 different cases are covered by EmbeddedCartridgeResource#extractUrl(info, messages) which extract from either info (existing cartridge) or the messages (freshly created);
When embedding postgres the integration asserts the presence of an url (freshly embedded postgres):

{code:title=EmbeddedCartridgeResourceIntegrationTest#shouldEmbedPostgreSQL}
// verification
new EmbeddedCartridgeAssert(application.getEmbeddedCartridge(postgres))
		.hasUrl();
{code}

The very same test for mysql is *missing* this assertion (freshly embedded mysql):
{code:title=EmbeddedCartridgeResourceIntegrationTest#shouldEmbedshouldEmbedMySQL}
// verification
assertThat(new ApplicationAssert(application))
		.hasEmbeddableCartridges(numOfEmbeddedCartridges + 1)
		.hasEmbeddedCartridge(LatestVersionOf.mySQL());
{code}

#shouldEmbedJenkinsClient is missing it, too

{code:title=EmbeddedCartridgeResourceIntegrationTest#shouldEmbedJenkinsClient}
// verification
assertThat(new ApplicationAssert(application)
		.hasEmbeddedCartridge(LatestVersionOf.jenkinsClient()));
{code}

                  
> openshift-java-client: remove workaround for https://bugzilla.redhat.com/show_bug.cgi?id=812046
> -----------------------------------------------------------------------------------------------
>
>                 Key: JBIDE-14514
>                 URL: https://issues.jboss.org/browse/JBIDE-14514
>             Project: Tools (JBoss Tools)
>          Issue Type: Enhancement
>          Components: openshift
>    Affects Versions: 4.1.0.Beta1
>            Reporter: Andre Dietisheim
>            Assignee: Andre Dietisheim
>             Fix For: 4.1.0.Beta2
>
>
> In the latest implementations the OpenShift broker returns the embedded cartridges within the application as follows:
> {code}
>       "embedded":{
>          "mongodb-2.2":{
>             "connection_url":"mongodb://$OPENSHIFT_MONGODB_DB_HOST:$OPENSHIFT_MONGODB_DB_PORT/",
>             "username":"admin",
>             "password":"NNxXMT1z8dVj",
>             "database_name":"springeap6",
>             "info":"Connection URL: mongodb://$OPENSHIFT_MONGODB_DB_HOST:$OPENSHIFT_MONGODB_DB_PORT/"
>          }
>       },
> {code}
> Prior code was only returning the *info* property where we had to exctract the url via regex. The new broker is returning the *connection_url* which does not require any regex-treatment any more
> The code in openshift-java-client marks this workaround with a TODO:
> {code}
> protected EmbeddedCartridgeResource(final String name, final String displayName, final String description, final CartridgeType type, String info, final Map<String, Link> links,
> 	final Map<String, Message> messages, final ApplicationResource application) {
> 	super(application.getService(), links, messages);
> 	this.name = name;
> 	this.displayName = displayName;
> 	this.description = description;
> 	this.type = type;
> 	// TODO: fix this workaround once
> 	// https://bugzilla.redhat.com/show_bug.cgi?id=812046 is fixed
> 	this.url = extractUrl(info, messages);
> 	this.application = application;
> }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jbosstools-issues mailing list