예제 #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public static java.util.Map<String, Object> makeGet(String url) throws org.neo4j.server.rest.domain.JsonParseException
        public static IDictionary <string, object> MakeGet(string url)
        {
            JaxRsResponse response = (new RestRequest()).get(url);

            string body = GetResponseText(response);

            response.Close();

            return(DeserializeMap(body));
        }
예제 #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: protected static java.util.Map<String, Object> makePostMap(String url) throws org.neo4j.server.rest.domain.JsonParseException
        protected internal static IDictionary <string, object> MakePostMap(string url)
        {
            JaxRsResponse response = (new RestRequest()).post(url, null);

            string body = GetResponseText(response);

            response.Close();

            return(DeserializeMap(body));
        }
예제 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void canListAllAvailableServerExtensions() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void CanListAllAvailableServerExtensions()
        {
            JaxRsResponse response = RestRequest.req().get(_functionalTestHelper.extensionUri());

            assertThat(response.Status, equalTo(200));
            IDictionary <string, object> json = JsonHelper.jsonToMap(response.Entity);

            assertFalse(json.Count == 0);
            response.Close();
        }
예제 #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void datarootContainsReferenceToExtensions() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void DatarootContainsReferenceToExtensions()
        {
            JaxRsResponse response = RestRequest.req().get(_functionalTestHelper.dataUri());

            assertThat(response.Status, equalTo(200));
            IDictionary <string, object> json = JsonHelper.jsonToMap(response.Entity);

            new URI(( string )json["extensions_info"]);                  // throws on error
            response.Close();
        }
예제 #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldHandleNullPath() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldHandleNullPath()
        {
            long n = _functionalTestHelper.GraphDbHelper.createNode();

            string url = GetPluginMethodUri(_functionalTestHelper.nodeUri(n), "pathToReference");

            JaxRsResponse response = (new RestRequest()).post(url, null);

            assertThat(response.Entity, response.Status, @is(204));
            response.Close();
        }
예제 #6
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: protected static java.util.List<java.util.Map<String, Object>> makePostList(String url, java.util.Map<String, Object> params) throws org.neo4j.server.rest.domain.JsonParseException
        protected internal static IList <IDictionary <string, object> > MakePostList(string url, IDictionary <string, object> @params)
        {
            string        json     = JsonHelper.createJsonFrom(@params);
            JaxRsResponse response = (new RestRequest()).post(url, json);

            string body = GetResponseText(response);

            response.Close();

            return(DeserializeList(body));
        }
예제 #7
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: protected static java.util.Map<String, Object> makePostMap(String url, java.util.Map<String, Object> params) throws org.neo4j.server.rest.domain.JsonParseException
        protected internal static IDictionary <string, object> MakePostMap(string url, IDictionary <string, object> @params)
        {
            string        json     = JsonHelper.createJsonFrom(@params);
            JaxRsResponse response = (new RestRequest()).post(url, json, MediaType.APPLICATION_JSON_TYPE);

            string body = GetResponseText(response);

            response.Close();

            return(DeserializeMap(body));
        }
예제 #8
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unchecked") @Test public void canListExtensionMethodsForServerExtension() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void CanListExtensionMethodsForServerExtension()
        {
            JaxRsResponse response = RestRequest.req().get(_functionalTestHelper.extensionUri());

            assertThat(response.Status, equalTo(200));

            IDictionary <string, object> json = JsonHelper.jsonToMap(response.Entity);
            string refNodeService             = ( string )json[typeof(FunctionalTestPlugin).Name];

            response.Close();

            response = RestRequest.req().get(refNodeService);
            string result = response.Entity;

            assertThat(response.Status, equalTo(200));

            json = JsonHelper.jsonToMap(result);
            json = (IDictionary <string, object>)json["graphdb"];
            assertThat(json, hasKey(FunctionalTestPlugin.CREATE_NODE));
            response.Close();
        }