Beispiel #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void txEndpointShouldReplyWithHttpsWhenItReturnsURLs() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void TxEndpointShouldReplyWithHttpsWhenItReturnsURLs()
        {
            StartServer();

            string baseUri = _server.baseUri().ToString();

            HTTP.Response response = POST(baseUri + "db/data/transaction", quotedJson("{'statements':[]}"));

            assertThat(response.Location(), startsWith(baseUri));
            assertThat(response.Get("commit").asText(), startsWith(baseUri));
        }
Beispiel #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldAllowDisablingAuthorization() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldAllowDisablingAuthorization()
        {
            // Given
            _server = CommunityServerBuilder.serverOnRandomPorts().withProperty(GraphDatabaseSettings.auth_enabled.name(), "false").build();

            // When
            _server.start();

            // Then I should have write access
            HTTP.Response response = HTTP.POST(_server.baseUri().resolve("db/data/node").ToString(), quotedJson("{'name':'My Node'}"));
            assertThat(response.Status(), equalTo(201));
            string node = response.Location();

            // Then I should have read access
            assertThat(HTTP.GET(node).status(), equalTo(200));
        }
Beispiel #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void executeQueryWithSnapshotEngine()
        public virtual void ExecuteQueryWithSnapshotEngine()
        {
            Database            database = _server.Database;
            GraphDatabaseFacade graph    = database.Graph;

            using (Transaction transaction = graph.BeginTx())
            {
                for (int i = 0; i < 10; i++)
                {
                    Node node = graph.CreateNode();
                    node.SetProperty("a", "b");
                }
                transaction.Success();
            }

            HTTP.Builder  httpClientBuilder = HTTP.withBaseUri(_server.baseUri());
            HTTP.Response transactionStart  = httpClientBuilder.Post(TransactionURI());
            assertThat(transactionStart.Status(), equalTo(201));
            HTTP.Response response = httpClientBuilder.POST(transactionStart.Location(), quotedJson("{ 'statements': [ { 'statement': 'MATCH (n) RETURN n' } ] }"));
            assertThat(response.Status(), equalTo(200));
        }