GitHub PullRequestReviewCommentEvent at 2014-10-14 19:41:25
Repository: openshift-java-client
Actor: jcantrill
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/openshift/openshift-java-client/pulls/comments/18853215","id":18853215,"diff_hunk":"@@ -0,0 +1,102 @@\n+/******************************************************************************* \n+ * Copyright (c) 2014 Red Hat, Inc. \n+ * Distributed under license by Red Hat, Inc. All rights reserved. \n+ * This program is made available under the terms of the \n+ * Eclipse Public License v1.0 which accompanies this distribution, \n+ * and is available at http://www.eclipse.org/legal/epl-v10.html \n+ * \n+ * Contributors: \n+ * Red Hat, Inc. - initial API and implementation \n+ ******************************************************************************/\n+package com.openshift.internal.client;\n+\n+import static com.openshift.client.utils.Samples.GET_DOMAINS;\n+import static com.openshift.client.utils.Samples.GET_DOMAINS_FOOBARZ_APPLICATIONS_3EMBEDDED;\n+import static org.fest.assertions.Assertions.assertThat;\n+import static org.mockito.Mockito.*;\n+import static com.openshift.client.utils.UrlEndsWithMatcher.urlEndsWith;\n+\n+import org.junit.Before;\n+import org.junit.Test;\n+\n+import com.openshift.client.IApplication;\n+import com.openshift.client.IDomain;\n+import com.openshift.client.IHttpClient;\n+import com.openshift.client.IUser;\n+import com.openshift.client.cartridge.IDeployedStandaloneCartridge;\n+import com.openshift.client.cartridge.IStandaloneCartridge;\n+import com.openshift.client.cartridge.StandaloneCartridge;\n+import com.openshift.client.utils.TestConnectionFactory;\n+import com.openshift.internal.client.httpclient.request.JsonMediaType;\n+import com.openshift.internal.client.httpclient.request.Parameter;\n+import com.openshift.internal.client.response.CartridgeResourceDTO;\n+import com.openshift.internal.client.utils.IOpenShiftJsonConstants;\n+\n+public class StandaloneCartridgeResourceTest {\n+\n+\tprivate ApplicationResource app = mock(ApplicationResource.class);\n+\tprivate CartridgeResourceDTO dto = mock(CartridgeResourceDTO.class);\n+\tprivate IStandaloneCartridge cartridge = mock(IStandaloneCartridge.class);\n+\tprivate StandaloneCartridgeResource cartridgeResource;\n+\t\n+\t@Before\n+\tpublic void setup(){\n+\t\twhen(dto.getName()).thenReturn(\"cartridgeName\");\n+\t\twhen(dto.getType()).thenReturn(CartridgeType.STANDALONE);\n+\t\twhen(cartridge.getName()).thenReturn(\"cartridgeName\");\n+\t\tcartridgeResource = new StandaloneCartridgeResource(dto,app);\n+\t}\n+\t\n+\t@Test\n+\tpublic void testSetAdditionalGearStorage() throws Exception {\n+\t\tHttpClientMockDirector builder = new HttpClientMockDirector();\n+\t\tIHttpClient httpClient = builder\n+\t\t\t\t.mockGetDomains(GET_DOMAINS)\n+\t\t\t\t.mockGetApplications(\n+\t\t\t\t\t\t\"foobarz\", GET_DOMAINS_FOOBARZ_APPLICATIONS_3EMBEDDED)\n+\t\t\t\t.client();\n+\t\tIUser user = new TestConnectionFactory().getConnection(httpClient).getUser();\n+\t\tIDomain domain = user.getDomain(\"foobarz\");\n+\t\tIApplication application = domain.getApplicationByName(\"springeap6\");\n+\t\t\n+\t\tIDeployedStandaloneCartridge cartridge = application.getStandaloneCartridge();\n+\t\t\n+\t\tcartridge.setAdditionalGearStorage(40);\n+\t\t\n+\t\tverify(httpClient, times(1)).put(\n+\t\t\t\turlEndsWith(\"applications/springeap6/cartridges/jbosseap-6\"), \n+\t\t\t\tany(JsonMediaType.class), \n+\t\t\t\tanyInt(), \n+\t\t\t\teq(new Parameter(IOpenShiftJsonConstants.PROPERTY_ADDITIONAL_GEAR_STORAGE, \"40\")));\n+\t}\n+\t\n+\t@Test\n+\tpublic void standaloneCartridgeResourceShouldEqualStandAloneCartridge() {\n+\t\t// pre-conditions\n+\t\t// operation\n+\t\t// verification\n+\t\tassertThat(cartridgeResource).isEqualTo(cartridge);\n+\t\t\n+\t\twhen(cartridge.getName()).thenReturn(\"other\");\n+\t\tassertThat(cartridgeResource).isNotEqualTo(cartridge);\n+\t}\n+\n+\t@Test\n+\tpublic void standaloneCartridgeResourceAndStandAloneCartridgeShouldHaveSameHashCode() {\n+\t\t// pre-conditions\n+\n+\t\t// operation\n+\t\t// verification\n+\t\tassertThat(cartridgeResource.hashCode()).isEqualTo(new StandaloneCartridge(\"cartridgeName\").hashCode());\n+\t}\n+\t\n+//\t@Test\n+//\tpublic void standaloneCartridgeResourceShouldEqualStandAloneCartridgeWithoutName() throws MalformedURLException {\n+//\t\t// pre-coniditions\n+//\t\t// operation\n+//\t\t// verification\n+//\t\tassertEquals(new EmbeddableCartridge(null, new URL(CartridgeTestUtils.FOREMAN_URL)),\n+//\t\t\t\tnew EmbeddableCartridge(\"redhat\", new URL(CartridgeTestUtils.FOREMAN_URL)));\n+//\t}\n+","path":"src/test/java/com/openshift/internal/client/StandaloneCartridgeResourceTest.java","position":101,"original_position":101,"commit_id":"b30a223e53bc5f374ab98235035c86fd0e3f366b","original_commit_id":"b30a223e53bc5f374ab98235035c86fd0e3f366b","user":{"login":"jcantrill","id":4548408,"avatar_url":"https://avatars.githubusercontent.com/u/4548408?v=2","gravatar_id":"","url":"https://api.github.com/users/jcantrill","html_url":"https://github.com/jcantrill","followers_url":"https://api.github.com/users/jcantrill/followers","following_url":"https://api.github.com/users/jcantrill/following{/other_user}","gists_url":"https://api.github.com/users/jcantrill/gists{/gist_id}","starred_url":"https://api.github.com/users/jcantrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcantrill/subscriptions","organizations_url":"https://api.github.com/users/jcantrill/orgs","repos_url":"https://api.github.com/users/jcantrill/repos","events_url":"https://api.github.com/users/jcantrill/events{/privacy}","received_events_url":"https://api.github.com/users/jcantrill/received_events","type":"User","site_admin":false},"body":"Test removed.  It doesn't look as though it was fully flushed out anyway.\n\nOn 10/14/2014 01:55 PM, André Dietisheim wrote:\n> In\n> src/test/java/com/openshift/internal/client/StandaloneCartridgeResourceTest.java:\n>\n>> +\t\t// pre-conditions\n>> +\n>> +\t\t// operation\n>> +\t\t// verification\n>> +\t\tassertThat(cartridgeResource.hashCode()).isEqualTo(new StandaloneCartridge(\"cartridgeName\").hashCode());\n>> +\t}\n>> +\t\n>> +//\t@Test\n>> +//\tpublic void standaloneCartridgeResourceShouldEqualStandAloneCartridgeWithoutName() throws MalformedURLException {\n>> +//\t\t// pre-coniditions\n>> +//\t\t// operation\n>> +//\t\t// verification\n>> +//\t\tassertEquals(new EmbeddableCartridge(null, new URL(CartridgeTestUtils.FOREMAN_URL)),\n>> +//\t\t\t\tnew EmbeddableCartridge(\"redhat\", new URL(CartridgeTestUtils.FOREMAN_URL)));\n>> +//\t}\n>> +\n>\n> If this test is commented, shouldnt we simply remove it?\n> (commented/unused code is imho a liability)\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/openshift/openshift-java-client/pull/148/files#r18846004>.\n>\n\n-- \nJeff Cantrill\nSenior Software Engineer, Red Hat Engineering\nRed Hat\nOffice: 703-748-4420 | 866-546-8970 ext. 8162420\njcantril@redhat.com\nhttp://www.redhat.com","created_at":"2014-10-14T19:41:25Z","updated_at":"2014-10-14T19:41:25Z","html_url":"https://github.com/openshift/openshift-java-client/pull/148#discussion_r18853215","pull_request_url":"https://api.github.com/repos/openshift/openshift-java-client/pulls/148","_links":{"self":{"href":"https://api.github.com/repos/openshift/openshift-java-client/pulls/comments/18853215"},"html":{"href":"https://github.com/openshift/openshift-java-client/pull/148#discussion_r18853215"},"pull_request":{"href":"https://api.github.com/repos/openshift/openshift-java-client/pulls/148"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/openshift-java-client/pulls/148","id":20741979,"html_url":"https://github.com/openshift/openshift-java-client/pull/148","diff_url":"https://github.com/openshift/openshift-java-client/pull/148.diff","patch_url":"https://github.com/openshift/openshift-java-client/pull/148.patch","issue_url":"https://api.github.com/repos/openshift/openshift-java-client/issues/148","number":148,"state":"closed","locked":false,"title":"[OSJC-101] Add support for setting and retrieving additional gear storag...","user":{"login":"jcantrill","id":4548408,"avatar_url":"https://avatars.githubusercontent.com/u/4548408?v=2","gravatar_id":"","url":"https://api.github.com/users/jcantrill","html_url":"https://github.com/jcantrill","followers_url":"https://api.github.com/users/jcantrill/followers","following_url":"https://api.github.com/users/jcantrill/following{/other_user}","gists_url":"https://api.github.com/users/jcantrill/gists{/gist_id}","starred_url":"https://api.github.com/users/jcantrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcantrill/subscriptions","organizations_url":"https://api.github.com/users/jcantrill/orgs","repos_url":"https://api.github.com/users/jcantrill/repos","events_url":"https://api.github.com/users/jcantrill/events{/privacy}","received_events_url":"https://api.github.com/users/jcantrill/received_events","type":"User","site_admin":false},"body":"...e","created_at":"2014-09-04T13:10:05Z","updated_at":"2014-10-14T19:41:26Z","closed_at":"2014-10-14T19:12:31Z","merged_at":null,"merge_commit_sha":"0a70733c8e3ee3dc9d27f55622b6cffd891a5246","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openshift/openshift-java-client/pulls/148/commits","review_comments_url":"https://api.github.com/repos/openshift/openshift-java-client/pulls/148/comments","review_comment_url":"https://api.github.com/repos/openshift/openshift-java-client/pulls/comments/{number}","comments_url":"https://api.github.com/repos/openshift/openshift-java-client/issues/148/comments","statuses_url":"https://api.github.com/repos/openshift/openshift-java-client/statuses/b30a223e53bc5f374ab98235035c86fd0e3f366b","head":{"label":"jcantrill:osjc_101_support_gear_storage","ref":"osjc_101_support_gear_storage","sha":"b30a223e53bc5f374ab98235035c86fd0e3f366b","user":{"login":"jcantrill","id":4548408,"avatar_url":"https://avatars.githubusercontent.com/u/4548408?v=2","gravatar_id":"","url":"https://api.github.com/users/jcantrill","html_url":"https://github.com/jcantrill","followers_url":"https://api.github.com/users/jcantrill/followers","following_url":"https://api.github.com/users/jcantrill/following{/other_user}","gists_url":"https://api.github.com/users/jcantrill/gists{/gist_id}","starred_url":"https://api.github.com/users/jcantrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcantrill/subscriptions","organizations_url":"https://api.github.com/users/jcantrill/orgs","repos_url":"https://api.github.com/users/jcantrill/repos","events_url":"https://api.github.com/users/jcantrill/events{/privacy}","received_events_url":"https://api.github.com/users/jcantrill/received_events","type":"User","site_admin":false},"repo":{"id":21657815,"name":"openshift-java-client","full_name":"jcantrill/openshift-java-client","owner":{"login":"jcantrill","id":4548408,"avatar_url":"https://avatars.githubusercontent.com/u/4548408?v=2","gravatar_id":"","url":"https://api.github.com/users/jcantrill","html_url":"https://github.com/jcantrill","followers_url":"https://api.github.com/users/jcantrill/followers","following_url":"https://api.github.com/users/jcantrill/following{/other_user}","gists_url":"https://api.github.com/users/jcantrill/gists{/gist_id}","starred_url":"https://api.github.com/users/jcantrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcantrill/subscriptions","organizations_url":"https://api.github.com/users/jcantrill/orgs","repos_url":"https://api.github.com/users/jcantrill/repos","events_url":"https://api.github.com/users/jcantrill/events{/privacy}","received_events_url":"https://api.github.com/users/jcantrill/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jcantrill/openshift-java-client","description":"Java Client for the OpenShift REST API","fork":true,"url":"https://api.github.com/repos/jcantrill/openshift-java-client","forks_url":"https://api.github.com/repos/jcantrill/openshift-java-client/forks","keys_url":"https://api.github.com/repos/jcantrill/openshift-java-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jcantrill/openshift-java-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jcantrill/openshift-java-client/teams","hooks_url":"https://api.github.com/repos/jcantrill/openshift-java-client/hooks","issue_events_url":"https://api.github.com/repos/jcantrill/openshift-java-client/issues/events{/number}","events_url":"https://api.github.com/repos/jcantrill/openshift-java-client/events","assignees_url":"https://api.github.com/repos/jcantrill/openshift-java-client/assignees{/user}","branches_url":"https://api.github.com/repos/jcantrill/openshift-java-client/branches{/branch}","tags_url":"https://api.github.com/repos/jcantrill/openshift-java-client/tags","blobs_url":"https://api.github.com/repos/jcantrill/openshift-java-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jcantrill/openshift-java-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jcantrill/openshift-java-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/jcantrill/openshift-java-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jcantrill/openshift-java-client/statuses/{sha}","languages_url":"https://api.github.com/repos/jcantrill/openshift-java-client/languages","stargazers_url":"https://api.github.com/repos/jcantrill/openshift-java-client/stargazers","contributors_url":"https://api.github.com/repos/jcantrill/openshift-java-client/contributors","subscribers_url":"https://api.github.com/repos/jcantrill/openshift-java-client/subscribers","subscription_url":"https://api.github.com/repos/jcantrill/openshift-java-client/subscription","commits_url":"https://api.github.com/repos/jcantrill/openshift-java-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/jcantrill/openshift-java-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/jcantrill/openshift-java-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/jcantrill/openshift-java-client/issues/comments/{number}","contents_url":"https://api.github.com/repos/jcantrill/openshift-java-client/contents/{+path}","compare_url":"https://api.github.com/repos/jcantrill/openshift-java-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jcantrill/openshift-java-client/merges","archive_url":"https://api.github.com/repos/jcantrill/openshift-java-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jcantrill/openshift-java-client/downloads","issues_url":"https://api.github.com/repos/jcantrill/openshift-java-client/issues{/number}","pulls_url":"https://api.github.com/repos/jcantrill/openshift-java-client/pulls{/number}","milestones_url":"https://api.github.com/repos/jcantrill/openshift-java-client/milestones{/number}","notifications_url":"https://api.github.com/repos/jcantrill/openshift-java-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jcantrill/openshift-java-client/labels{/name}","releases_url":"https://api.github.com/repos/jcantrill/openshift-java-client/releases{/id}","created_at":"2014-07-09T15:33:32Z","updated_at":"2014-06-20T18:14:33Z","pushed_at":"2014-10-14T13:04:14Z","git_url":"git://github.com/jcantrill/openshift-java-client.git","ssh_url":"git@github.com:jcantrill/openshift-java-client.git","clone_url":"https://github.com/jcantrill/openshift-java-client.git","svn_url":"https://github.com/jcantrill/openshift-java-client","homepage":"","size":3060,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openshift:master","ref":"master","sha":"57f0f44a1805d7eb6c3201f8d4c4431829b03c20","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=2","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":2694845,"name":"openshift-java-client","full_name":"openshift/openshift-java-client","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=2","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/openshift-java-client","description":"Java Client for the OpenShift REST API","fork":false,"url":"https://api.github.com/repos/openshift/openshift-java-client","forks_url":"https://api.github.com/repos/openshift/openshift-java-client/forks","keys_url":"https://api.github.com/repos/openshift/openshift-java-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/openshift-java-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/openshift-java-client/teams","hooks_url":"https://api.github.com/repos/openshift/openshift-java-client/hooks","issue_events_url":"https://api.github.com/repos/openshift/openshift-java-client/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/openshift-java-client/events","assignees_url":"https://api.github.com/repos/openshift/openshift-java-client/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/openshift-java-client/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/openshift-java-client/tags","blobs_url":"https://api.github.com/repos/openshift/openshift-java-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/openshift-java-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/openshift-java-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/openshift-java-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/openshift-java-client/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/openshift-java-client/languages","stargazers_url":"https://api.github.com/repos/openshift/openshift-java-client/stargazers","contributors_url":"https://api.github.com/repos/openshift/openshift-java-client/contributors","subscribers_url":"https://api.github.com/repos/openshift/openshift-java-client/subscribers","subscription_url":"https://api.github.com/repos/openshift/openshift-java-client/subscription","commits_url":"https://api.github.com/repos/openshift/openshift-java-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/openshift-java-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/openshift-java-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/openshift-java-client/issues/comments/{number}","contents_url":"https://api.github.com/repos/openshift/openshift-java-client/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/openshift-java-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/openshift-java-client/merges","archive_url":"https://api.github.com/repos/openshift/openshift-java-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/openshift-java-client/downloads","issues_url":"https://api.github.com/repos/openshift/openshift-java-client/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/openshift-java-client/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/openshift-java-client/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/openshift-java-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/openshift-java-client/labels{/name}","releases_url":"https://api.github.com/repos/openshift/openshift-java-client/releases{/id}","created_at":"2011-11-02T12:43:53Z","updated_at":"2014-09-02T09:57:34Z","pushed_at":"2014-10-13T17:44:26Z","git_url":"git://github.com/openshift/openshift-java-client.git","ssh_url":"git@github.com:openshift/openshift-java-client.git","clone_url":"https://github.com/openshift/openshift-java-client.git","svn_url":"https://github.com/openshift/openshift-java-client","homepage":"","size":6018,"stargazers_count":55,"watchers_count":55,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":51,"mirror_url":null,"open_issues_count":1,"forks":51,"open_issues":1,"watchers":55,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/openshift-java-client/pulls/148"},"html":{"href":"https://github.com/openshift/openshift-java-client/pull/148"},"issue":{"href":"https://api.github.com/repos/openshift/openshift-java-client/issues/148"},"comments":{"href":"https://api.github.com/repos/openshift/openshift-java-client/issues/148/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/openshift-java-client/pulls/148/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/openshift-java-client/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/openshift/openshift-java-client/pulls/148/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/openshift-java-client/statuses/b30a223e53bc5f374ab98235035c86fd0e3f366b"}}}}