Exemplo n.º 1
0
        private static void SetupTheDatabase()
        {
            long relationship = _helper.createRelationship("LIKES");
            IDictionary <string, object> map = new Dictionary <string, object>();

            map["foo"] = "bar";
            _helper.setRelationshipProperties(relationship, map);
            _baseRelationshipUri = _functionalTestHelper.dataUri() + "relationship/" + relationship + "/properties/";
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldAdvertiseExtensionThatPluginCreates() throws org.neo4j.server.rest.domain.JsonParseException, com.sun.jersey.api.client.ClientHandlerException, com.sun.jersey.api.client.UniformInterfaceException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldAdvertiseExtensionThatPluginCreates()
        {
            int originalCount = NodeCount();

            // Find the start node URI from the server
            JaxRsResponse response = (new RestRequest()).get(_functionalTestHelper.dataUri() + "node/1");

            string entity = response.Entity;

            IDictionary <string, object> map = JsonHelper.jsonToMap(entity);

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.HashMap<?, ?> extensionsMap = (java.util.HashMap<?, ?>) map.get("extensions");
            Dictionary <object, ?> extensionsMap = (Dictionary <object, ?>)map["extensions"];

            assertNotNull(extensionsMap);
            assertFalse(extensionsMap.Count == 0);

            const string graphClonerKey = "GraphCloner";

            assertTrue(extensionsMap.Keys.Contains(graphClonerKey));

            const string cloneSubgraphKey = "clonedSubgraph";
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: String clonedSubgraphUri = (String)((java.util.HashMap<?, ?>) extensionsMap.get(GRAPH_CLONER_KEY)).get(CLONE_SUBGRAPH_KEY);
            string clonedSubgraphUri = ( string )((Dictionary <object, ?>)extensionsMap[graphClonerKey])[cloneSubgraphKey];
Exemplo n.º 3
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();
        }
Exemplo n.º 4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void runningInCompiledRuntime()
        public virtual void RunningInCompiledRuntime()
        {
            // Given
            string uri     = FunctionalTestHelper.dataUri() + "transaction/commit";
            string payload = "{ 'statements': [ { 'statement': 'CYPHER runtime=compiled MATCH (n) RETURN n' } ] }";

            // When
            HTTP.Response res = HTTP.POST(uri, payload.replaceAll("'", "\""));

            // Then
            assertEquals(200, res.Status());
        }
Exemplo n.º 5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldInvokeAllSecurityRules() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldInvokeAllSecurityRules()
        {
            // given
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getCanonicalName method:
            _server = CommunityServerBuilder.serverOnRandomPorts().withDefaultDatabaseTuning().withSecurityRules(typeof(NoAccessToDatabaseSecurityRule).FullName).usingDataDir(Folder.directory(Name.MethodName).AbsolutePath).build();
            _server.start();
            _functionalTestHelper = new FunctionalTestHelper(_server);

            // when
            Gen.get().expectedStatus(401).get(_functionalTestHelper.dataUri()).response();

            // then
            assertTrue(NoAccessToDatabaseSecurityRule.WasInvoked());
        }
Exemplo n.º 6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void canGetGraphDatabaseExtensionList() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void CanGetGraphDatabaseExtensionList()
        {
            IDictionary <string, object> map = PluginFunctionalTestHelper.MakeGet(_functionalTestHelper.dataUri());

            assertThat(map["extensions"], instanceOf(typeof(System.Collections.IDictionary)));
        }
Exemplo n.º 7
0
 private JaxRsResponse HttpPostCreateRelationship(long startNode, string jsonString)
 {
     return(RestRequest.Req().post(_functionalTestHelper.dataUri() + "node/" + startNode + "/relationships", jsonString));
 }