Exemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReturnASingleNode()
        public virtual void ShouldReturnASingleNode()
        {
            GraphDatabaseFacade graphdb  = ( GraphDatabaseFacade )(new TestGraphDatabaseFactory()).newImpermanentDatabase();
            Database            database = new WrappedDatabase(graphdb);
            CypherExecutor      executor = new CypherExecutor(database, NullLogProvider.Instance);

            executor.Start();
            HttpServletRequest request = mock(typeof(HttpServletRequest));

            when(request.Scheme).thenReturn("http");
            when(request.RemoteAddr).thenReturn("127.0.0.1");
            when(request.RemotePort).thenReturn(5678);
            when(request.ServerName).thenReturn("127.0.0.1");
            when(request.ServerPort).thenReturn(7474);
            when(request.RequestURI).thenReturn("/");
            try
            {
                CypherSession         session = new CypherSession(executor, NullLogProvider.Instance, request);
                Pair <string, string> result  = session.Evaluate("create (a) return a");
                assertThat(result.First(), containsString("Node[0]"));
            }
            finally
            {
                graphdb.Shutdown();
            }
        }
Exemplo n.º 2
0
 public override ScriptSession NewSession(Database database, CypherExecutor cypherExecutor, HttpServletRequest request, LogProvider logProvider)
 {
     return(new CypherSession(cypherExecutor, logProvider, request));
 }