Esempio n. 1
0
        public override void RestartServer()
        {
            lock (this)
            {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.logging.Log log = server.getDatabase().getGraph().getDependencyResolver().resolveDependency(org.neo4j.logging.internal.LogService.class).getUserLog(getClass());
                Log log = _server.Database.Graph.DependencyResolver.resolveDependency(typeof(LogService)).getUserLog(this.GetType());

                Thread thread = new Thread("Restart server thread" () =>
                {
                    log.Info("Restarting server");
                    _server.stop();
                    _server.start();
                });
                thread.Daemon = false;
                thread.Start();

                try
                {
                    thread.Join();
                }
                catch (InterruptedException e)
                {
                    throw new Exception(e);
                }
            }
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shellConsoleShouldBeEnabledByDefault() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
            public virtual void ShellConsoleShouldBeEnabledByDefault()
            {
                Server = CommunityServerBuilder.server().usingDataDir(Folder.directory(Name.MethodName).AbsolutePath).build();
                Server.start();

                assertThat(Exec("ls", "shell").Status, @is(200));
            }
Esempio n. 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldBeAbleToExplicitlySetConsolesToEnabled() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
            public virtual void ShouldBeAbleToExplicitlySetConsolesToEnabled()
            {
                Server = CommunityServerBuilder.server().withProperty(ServerSettings.console_module_engines.name(), "").usingDataDir(Folder.directory(Name.MethodName).AbsolutePath).build();
                Server.start();

                assertThat(Exec("ls", "shell").Status, @is(400));
            }
Esempio n. 4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @BeforeClass public static void setupServer() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public static void SetupServer()
        {
            Server = EnterpriseServerBuilder.serverOnRandomPorts().usingDataDir(StaticFolder.Root.AbsolutePath).build();

            suppressAll().call((Callable <Void>)() =>
            {
                Server.start();
                return(null);
            });
            FunctionalTestHelper = new FunctionalTestHelper(Server);
        }
Esempio n. 5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldLoadThirdPartyJaxRsClasses() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldLoadThirdPartyJaxRsClasses()
        {
            _server = CommunityServerBuilder.serverOnRandomPorts().withThirdPartyJaxRsPackage("org.dummy.web.service", DummyThirdPartyWebService.DUMMY_WEB_SERVICE_MOUNT_POINT).usingDataDir(Folder.directory(Name.MethodName).AbsolutePath).build();
            _server.start();

            URI    thirdPartyServiceUri = (new URI(_server.baseUri().ToString() + DummyThirdPartyWebService.DUMMY_WEB_SERVICE_MOUNT_POINT)).normalize();
            string response             = CLIENT.resource(thirdPartyServiceUri.ToString()).get(typeof(string));

            assertEquals("hello", response);

            // Assert that extensions gets initialized
            int nodesCreated = CreateSimpleDatabase(_server.Database.Graph);

            thirdPartyServiceUri = (new URI(_server.baseUri().ToString() + DummyThirdPartyWebService.DUMMY_WEB_SERVICE_MOUNT_POINT + "/inject-test")).normalize();
            response             = CLIENT.resource(thirdPartyServiceUri.ToString()).get(typeof(string));
            assertEquals(nodesCreated.ToString(), response);
        }
Esempio n. 6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void cleanTheDatabase() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void CleanTheDatabase()
        {
            _server = serverOnRandomPorts().withThirdPartyJaxRsPackage("org.dummy.web.service", DUMMY_WEB_SERVICE_MOUNT_POINT).usingDataDir(Folder.Root.AbsolutePath).build();
            _server.start();
        }