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 shouldBeAbleToStartInHAMode() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldBeAbleToStartInHAMode()
        {
            // Given
            int       clusterPort = PortAuthority.allocatePort();
            NeoServer server      = EnterpriseServerBuilder.serverOnRandomPorts().usingDataDir(Folder.Root.AbsolutePath).withProperty(mode.name(), "HA").withProperty(server_id.name(), "1").withProperty(cluster_server.name(), ":" + clusterPort).withProperty(initial_hosts.name(), ":" + clusterPort).persistent().build();

            try
            {
                server.Start();
                server.Database;

                assertThat(server.Database.Graph, @is(instanceOf(typeof(HighlyAvailableGraphDatabase))));

                HTTP.Response haEndpoint = HTTP.GET(GetHaEndpoint(server));
                assertEquals(200, haEndpoint.Status());
                assertThat(haEndpoint.RawContent(), containsString("master"));

                HTTP.Response discovery = HTTP.GET(server.BaseUri().toASCIIString());
                assertEquals(200, discovery.Status());
            }
            finally
            {
                server.Stop();
            }
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReturnEmptyMapForEmptyProperties()
        public virtual void ShouldReturnEmptyMapForEmptyProperties()
        {
            // Given
            string location = HTTP.POST(Server().baseUri().resolve("db/data/node").ToString()).location();

            // When
            HTTP.Response res = HTTP.GET(location + "/properties");

            // Then
            assertThat(res.RawContent(), equalTo("{ }"));
        }
Ejemplo n.º 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldGetRootWithHTTP()
        public virtual void ShouldGetRootWithHTTP()
        {
            HTTP.Response response = HTTP.withHeaders("Accept", MediaType.TEXT_HTML).GET(_functionalTestHelper.dataUri());
            assertEquals(Status.OK.StatusCode, response.Status());
            AssertValidHtml(response.RawContent());
        }