Ejemplo n.º 1
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));
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setup() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void Setup()
        {
            ServerHelper.cleanTheDatabase(_readOnlyServer);
            _readOnlyServer = ServerHelper.createReadOnlyServer(Dir.storeDir());
            _http           = HTTP.withBaseUri(_readOnlyServer.baseUri());
        }