//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldGetSomeRelationships() public virtual void ShouldGetSomeRelationships() { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final RestRequest request = RestRequest.req(); RestRequest request = RestRequest.Req(); JaxRsResponse response = request.Get(_functionalTestHelper.relationshipsUri(_thomasAnderson, RelationshipDirection.all.name(), "KNOWS"), MediaType.TEXT_HTML_TYPE); assertEquals(Status.OK.StatusCode, response.Status); string entity = response.Entity; assertTrue(entity.Contains("KNOWS")); assertFalse(entity.Contains("LOVES")); AssertValidHtml(entity); response.Close(); response = request.Get(_functionalTestHelper.relationshipsUri(_thomasAnderson, RelationshipDirection.all.name(), "LOVES"), MediaType.TEXT_HTML_TYPE); entity = response.Entity; assertFalse(entity.Contains("KNOWS")); assertTrue(entity.Contains("LOVES")); AssertValidHtml(entity); response.Close(); response = request.Get(_functionalTestHelper.relationshipsUri(_thomasAnderson, RelationshipDirection.all.name(), "LOVES", "KNOWS"), MediaType.TEXT_HTML_TYPE); entity = response.Entity; assertTrue(entity.Contains("KNOWS")); assertTrue(entity.Contains("LOVES")); AssertValidHtml(entity); response.Close(); }
/// <summary> /// /db/data/index/relationship should be a resource with no content /// </summary> /// <exception cref="Exception"> </exception> //JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldRespondWithRelationshipIndexes() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldRespondWithRelationshipIndexes() { JaxRsResponse response = RestRequest.Req().get(_functionalTestHelper.relationshipIndexUri()); AssertResponseContainsNoIndexesOtherThanAutoIndexes(response); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldReturn404WhenPropertiesSentToANodeWhichDoesNotExist() public virtual void ShouldReturn404WhenPropertiesSentToANodeWhichDoesNotExist() { JaxRsResponse response = RestRequest.Req().delete(GetPropertiesUri(999999)); assertEquals(404, response.Status); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldRespondWith404WhenGettingOutgoingRelationshipsForNonExistingNode() public virtual void ShouldRespondWith404WhenGettingOutgoingRelationshipsForNonExistingNode() { JaxRsResponse response = SendRetrieveRequestToServer(_nonExistingNode, "/out"); assertEquals(404, response.Status); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldGetContentLengthHeaderWhenRetrievingNode() public virtual void ShouldGetContentLengthHeaderWhenRetrievingNode() { JaxRsResponse response = RetrieveNodeFromService(_nodeUri.ToString()); assertNotNull(response.Headers.get("Content-Length")); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldReturn400WhenSendingCorruptJsonProperty() public virtual void ShouldReturn400WhenSendingCorruptJsonProperty() { JaxRsResponse response = RestRequest.Req().put(GetPropertyUri("foo"), "this:::Is::notJSON}"); assertEquals(400, response.Status); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldRespondWith200WhenRetrievingDiscoveryDocument() public virtual void ShouldRespondWith200WhenRetrievingDiscoveryDocument() { JaxRsResponse response = DiscoveryDocument; assertEquals(200, response.Status); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldReturn204WhenPropertyIsSet() public virtual void ShouldReturn204WhenPropertyIsSet() { JaxRsResponse response = SetPropertyOnServer("foo", "bar"); assertEquals(204, response.Status); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldReturn400WhenSendinIncompatibleJsonProperty() public virtual void ShouldReturn400WhenSendinIncompatibleJsonProperty() { JaxRsResponse response = SetPropertyOnServer("jim", new Dictionary <string, object>()); assertEquals(400, response.Status); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldGetContentLengthHeaderWhenRetrievingDiscoveryDocument() public virtual void ShouldGetContentLengthHeaderWhenRetrievingDiscoveryDocument() { JaxRsResponse response = DiscoveryDocument; assertNotNull(response.Headers.get("Content-Length")); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldHaveJsonMediaTypeWhenRetrievingDiscoveryDocument() public virtual void ShouldHaveJsonMediaTypeWhenRetrievingDiscoveryDocument() { JaxRsResponse response = DiscoveryDocument; assertThat(response.Type.ToString(), containsString(APPLICATION_JSON)); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldReturn400WhenSendingCorruptJsonProperties() public virtual void ShouldReturn400WhenSendingCorruptJsonProperties() { JaxRsResponse response = RestRequest.Req().put(_propertiesUri.ToString(), "this:::Is::notJSON}"); assertEquals(400, response.Status); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldRespondWith404WhenGettingIncomingRelationshipsForNonExistingNodeStreaming() public virtual void ShouldRespondWith404WhenGettingIncomingRelationshipsForNonExistingNodeStreaming() { JaxRsResponse response = RestRequest.Req().header(StreamingJsonFormat.STREAM_HEADER, "true").get(_functionalTestHelper.nodeUri() + "/" + _nonExistingNode + "/relationships" + "/in"); assertEquals(404, response.Status); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldHaveJsonMediaTypeOnResponse() public virtual void ShouldHaveJsonMediaTypeOnResponse() { JaxRsResponse response = RetrieveNodeFromService(_nodeUri.ToString()); assertThat(response.Type.ToString(), containsString(MediaType.APPLICATION_JSON)); response.Close(); }
/// <summary> /// /db/data/index is not itself a resource /// </summary> //JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldRespondWith404ForNonResourceIndexPath() public virtual void ShouldRespondWith404ForNonResourceIndexPath() { JaxRsResponse response = RestRequest.Req().get(_functionalTestHelper.indexUri()); assertEquals(404, response.Status); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldReturn404WhenPropertySentToANodeWhichDoesNotExist() public virtual void ShouldReturn404WhenPropertySentToANodeWhichDoesNotExist() { JaxRsResponse response = RestRequest.Req().put(_badUri.ToString() + "/foo", JsonHelper.createJsonFrom("bar")); assertEquals(404, response.Status); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldGet404ForPropertiesOnNonExistentRelationship() public virtual void ShouldGet404ForPropertiesOnNonExistentRelationship() { JaxRsResponse response = RestRequest.Req().get(_functionalTestHelper.dataUri() + "relationship/999999/properties"); assertEquals(404, response.Status); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldGet404ForNoProperty() public virtual void ShouldGet404ForNoProperty() { JaxRsResponse response = RestRequest.Req().get(GetPropertyUri("baz")); assertEquals(404, response.Status); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldGetRoot() public virtual void ShouldGetRoot() { JaxRsResponse response = RestRequest.Req().get(_functionalTestHelper.dataUri(), MediaType.TEXT_HTML_TYPE); assertEquals(Status.OK.StatusCode, response.Status); AssertValidHtml(response.Entity); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldBeValidJSONOnResponse() public virtual void ShouldBeValidJSONOnResponse() { JaxRsResponse response = RestRequest.Req().get(GetPropertyUri("foo")); assertThat(response.Type.ToString(), containsString(MediaType.APPLICATION_JSON)); assertNotNull(JsonHelper.createJsonFrom(response.Entity)); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldGet404ForNonExistingRelationship() public virtual void ShouldGet404ForNonExistingRelationship() { string uri = _functionalTestHelper.dataUri() + "relationship/999999/properties/foo"; JaxRsResponse response = RestRequest.Req().get(uri); assertEquals(404, response.Status); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldGet200WhenRetrievingValidRelationship() public virtual void ShouldGet200WhenRetrievingValidRelationship() { long relationshipId = _helper.createRelationship("LIKES"); JaxRsResponse response = RestRequest.Req().get(_functionalTestHelper.relationshipUri(relationshipId)); assertEquals(200, response.Status); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldGet404WhenRemovingAnInvalidRelationship() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldGet404WhenRemovingAnInvalidRelationship() { long relationshipId = _helper.createRelationship("KNOWS"); JaxRsResponse response = SendDeleteRequest(new URI(_functionalTestHelper.relationshipUri((relationshipId + 1) * 9999))); assertEquals(404, response.Status); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldHaveJsonDataInResponse() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldHaveJsonDataInResponse() { JaxRsResponse response = RetrieveNodeFromService(_nodeUri.ToString()); IDictionary <string, object> map = JsonHelper.jsonToMap(response.Entity); assertTrue(map.ContainsKey("self")); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldRespondWith200AndEmptyListOfRelationshipRepresentationsWhenGettingOutgoingRelationshipsForANodeWithoutRelationships() throws org.neo4j.server.rest.domain.JsonParseException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldRespondWith200AndEmptyListOfRelationshipRepresentationsWhenGettingOutgoingRelationshipsForANodeWithoutRelationships() { JaxRsResponse response = SendRetrieveRequestToServer(_nodeWithoutRelationships, "/out"); assertEquals(200, response.Status); assertThat(response.Type.ToString(), containsString(MediaType.APPLICATION_JSON)); VerifyRelReps(0, response.Entity); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldBeAbleToIndexValuesContainingSpaces() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldBeAbleToIndexValuesContainingSpaces() { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final long startNodeId = helper.createNode(); long startNodeId = _helper.createNode(); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final long endNodeId = helper.createNode(); long endNodeId = _helper.createNode(); const string relationshiptype = "tested-together"; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final long relationshipId = helper.createRelationship(relationshiptype, startNodeId, endNodeId); long relationshipId = _helper.createRelationship(relationshiptype, startNodeId, endNodeId); const string key = "key"; const string value = "value with spaces in it"; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final String indexName = indexes.newInstance(); string indexName = _indexes.newInstance(); _helper.createRelationshipIndex(indexName); JaxRsResponse response = HttpPostIndexRelationshipNameKeyValue(indexName, relationshipId, key, value); assertEquals(Status.CREATED.StatusCode, response.Status); URI location = response.Location; response.Close(); response = HttpGetIndexRelationshipNameKeyValue(indexName, key, URIHelper.encode(value)); assertEquals(Status.OK.StatusCode, response.Status); string responseEntity = response.Entity; //JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET: //ORIGINAL LINE: java.util.Collection<?> hits = (java.util.Collection<?>) org.neo4j.server.rest.domain.JsonHelper.readJson(responseEntity); ICollection <object> hits = (ICollection <object>)JsonHelper.readJson(responseEntity); assertEquals(1, hits.Count); response.Close(); CLIENT.resource(location).delete(); response = HttpGetIndexRelationshipNameKeyValue(indexName, key, URIHelper.encode(value)); assertEquals(200, response.Status); responseEntity = response.Entity; //JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET: //ORIGINAL LINE: hits = (java.util.Collection<?>) org.neo4j.server.rest.domain.JsonHelper.readJson(responseEntity); hits = (ICollection <object>)JsonHelper.readJson(responseEntity); assertEquals(0, hits.Count); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldGet200AndArrayOfRelationshipRepsWhenGettingFromIndex() throws org.neo4j.server.rest.domain.JsonParseException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldGet200AndArrayOfRelationshipRepsWhenGettingFromIndex() { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final long startNode = helper.createNode(); long startNode = _helper.createNode(); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final long endNode = helper.createNode(); long endNode = _helper.createNode(); const string key = "key_get"; const string value = "value"; const string relationshipName1 = "related-to"; const string relationshipName2 = "dislikes"; string jsonString = JsonRelationshipCreationSpecification(relationshipName1, endNode, key, value); JaxRsResponse createRelationshipResponse = HttpPostCreateRelationship(startNode, jsonString); assertEquals(201, createRelationshipResponse.Status); string relationshipLocation1 = createRelationshipResponse.Location.ToString(); jsonString = JsonRelationshipCreationSpecification(relationshipName2, endNode, key, value); createRelationshipResponse = HttpPostCreateRelationship(startNode, jsonString); assertEquals(201, createRelationshipResponse.Status); string relationshipLocation2 = createRelationshipResponse.Headers.get(HttpHeaders.LOCATION).get(0); string indexName = _indexes.newInstance(); JaxRsResponse indexCreationResponse = HttpPostIndexRelationshipRoot("{\"name\":\"" + indexName + "\"}"); assertEquals(201, indexCreationResponse.Status); JaxRsResponse indexedRelationshipResponse = HttpPostIndexRelationshipNameKeyValue(indexName, _functionalTestHelper.getRelationshipIdFromUri(relationshipLocation1), key, value); string indexLocation1 = indexedRelationshipResponse.Headers.get(HttpHeaders.LOCATION).get(0); indexedRelationshipResponse = HttpPostIndexRelationshipNameKeyValue(indexName, _functionalTestHelper.getRelationshipIdFromUri(relationshipLocation2), key, value); string indexLocation2 = indexedRelationshipResponse.Headers.get(HttpHeaders.LOCATION).get(0); IDictionary <string, string> uriToName = new Dictionary <string, string>(); uriToName[indexLocation1] = relationshipName1; uriToName[indexLocation2] = relationshipName2; JaxRsResponse response = RestRequest.Req().get(_functionalTestHelper.indexRelationshipUri(indexName, key, value)); assertEquals(200, response.Status); //JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET: //ORIGINAL LINE: java.util.Collection<?> items = (java.util.Collection<?>) org.neo4j.server.rest.domain.JsonHelper.readJson(response.getEntity()); ICollection <object> items = (ICollection <object>)JsonHelper.readJson(response.Entity); int counter = 0; foreach (object item in items) { //JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET: //ORIGINAL LINE: java.util.Map<?, ?> map = (java.util.Map<?, ?>) item; IDictionary <object, ?> map = (IDictionary <object, ?>)item; assertNotNull(map["self"]); string indexedUri = ( string )map["indexed"]; assertEquals(uriToName[indexedUri], map["type"]); counter++; } assertEquals(2, counter); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldBeJSONContentTypeOnPropertiesResponse() public virtual void ShouldBeJSONContentTypeOnPropertiesResponse() { long relId = _helper.createRelationship("LIKES"); _helper.setRelationshipProperties(relId, Collections.singletonMap("foo", "bar")); JaxRsResponse response = RestRequest.Req().get(_functionalTestHelper.dataUri() + "relationship/" + relId + "/properties"); assertThat(response.Type.ToString(), containsString(MediaType.APPLICATION_JSON)); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldReturn400WhenSendinIncompatibleJsonProperties() public virtual void ShouldReturn400WhenSendinIncompatibleJsonProperties() { IDictionary <string, object> map = new Dictionary <string, object>(); map["jim"] = new Dictionary <string, object>(); JaxRsResponse response = UpdatePropertiesOnServer(map); assertEquals(400, response.Status); response.Close(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldRespondWithJMXResources() public virtual void ShouldRespondWithJMXResources() { string url = _functionalTestHelper.managementUri() + "/server/jmx"; JaxRsResponse resp = RestRequest.Req().get(url); string json = resp.Entity; assertEquals(json, 200, resp.Status); assertThat(json, containsString("resources")); assertThat(json, containsString("jmx/domain/{domain}/{objectName}")); resp.Close(); }