コード例 #1
0
        public void InitializeApplication()
        {
            testHelper = new FunctionalTestHelper();
            testHelper.ReInitializeGlobalBank();

            authen = new AuthenAdapter();
        }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testIsMasterOnStandaloneReturns403()
        public virtual void TestIsMasterOnStandaloneReturns403()
        {
            FunctionalTestHelper helper = new FunctionalTestHelper(_server);

            JaxRsResponse response = RestRequest.req().get(GetBasePath(helper) + IS_MASTER_PATH);

            assertEquals(SC_FORBIDDEN, response.Status);
        }
コード例 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldRespondWith201IfAllTheRulesPassWhenCreatingANode() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldRespondWith201IfAllTheRulesPassWhenCreatingANode()
        {
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getCanonicalName method:
            _server = CommunityServerBuilder.serverOnRandomPorts().withDefaultDatabaseTuning().withSecurityRules(typeof(PermanentlyPassingSecurityRule).FullName).usingDataDir(Folder.directory(Name.MethodName).AbsolutePath).build();
            _server.start();
            _functionalTestHelper = new FunctionalTestHelper(_server);

            Gen.get().expectedStatus(201).expectedHeader("Location").post(_functionalTestHelper.nodeUri()).response();
        }
コード例 #4
0
        public virtual void Should401WithBasicChallengeWhenASecurityRuleFails()
        {
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getCanonicalName method:
            _server = CommunityServerBuilder.serverOnRandomPorts().withDefaultDatabaseTuning().withSecurityRules(typeof(PermanentlyFailingSecurityRule).FullName).usingDataDir(Folder.directory(Name.MethodName).AbsolutePath).build();
            _server.start();
            _functionalTestHelper = new FunctionalTestHelper(_server);
            JaxRsResponse response = Gen.get().expectedStatus(401).expectedHeader("WWW-Authenticate").post(_functionalTestHelper.nodeUri()).response();

            assertThat(response.Headers.getFirst("WWW-Authenticate"), containsString("Basic realm=\"" + PermanentlyFailingSecurityRule.REALM + "\""));
        }
        public void InitializeApplication()
        {
            testHelper = new FunctionalTestHelper();
            testHelper.ReInitializeGlobalBank();

            authentication = new AuthenAdapter();
            authentication.SetUserNameAndPassword("Tom", "Password2");
            shell        = authentication.OkClick();
            findCustomer = shell.FindCustomer();
        }
コード例 #6
0
        public void InitializeApplication()
        {
            testHelper = new FunctionalTestHelper();
            testHelper.ReInitializeGlobalBank();

            authentication = new AuthenAdapter();
            authentication.SetUserNameAndPassword("Jerry", "Password1");
            shell = authentication.OkClick();
            addCustomerToQueue = shell.AddNewCustomerToQueue();
        }
コード例 #7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testDiscoveryListingOnStandaloneDoesNotContainHA() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void TestDiscoveryListingOnStandaloneDoesNotContainHA()
        {
            FunctionalTestHelper helper = new FunctionalTestHelper(_server);

            JaxRsResponse response = RestRequest.req().get(helper.ManagementUri());

            IDictionary <string, object> map = JsonHelper.jsonToMap(response.Entity);

            assertEquals(2, ((System.Collections.IDictionary)map["services"]).Count);
        }
コード例 #8
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 = CommunityServerBuilder.server().usingDataDir(StaticFolder.Root.AbsolutePath).build();

                suppressAll().call((Callable <Void>)() =>
                {
                    Server.start();
                    return(null);
                });
                FunctionalTestHelper = new FunctionalTestHelper(Server);
            }
コード例 #9
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void should403WhenAuthenticatedButForbidden() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void Should403WhenAuthenticatedButForbidden()
        {
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getCanonicalName method:
            _server = CommunityServerBuilder.serverOnRandomPorts().withDefaultDatabaseTuning().withSecurityRules(typeof(PermanentlyForbiddenSecurityRule).FullName, typeof(PermanentlyPassingSecurityRule).FullName).usingDataDir(Folder.directory(Name.MethodName).AbsolutePath).build();
            _server.start();
            _functionalTestHelper = new FunctionalTestHelper(_server);

            JaxRsResponse clientResponse = Gen.get().expectedStatus(403).expectedType(MediaType.APPLICATION_JSON_TYPE).get(TrimTrailingSlash(_functionalTestHelper.baseUri())).response();

            assertEquals(403, clientResponse.Status);
        }
コード例 #10
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void runningInCompiledRuntime()
        public virtual void RunningInCompiledRuntime()
        {
            // Given
            string uri     = FunctionalTestHelper.dataUri() + "transaction/commit";
            string payload = "{ 'statements': [ { 'statement': 'CYPHER runtime=compiled MATCH (n) RETURN n' } ] }";

            // When
            HTTP.Response res = HTTP.POST(uri, payload.replaceAll("'", "\""));

            // Then
            assertEquals(200, res.Status());
        }
コード例 #11
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReportEnterpriseEdition() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldReportEnterpriseEdition()
        {
            // Given
            string releaseVersion = Server.Database.Graph.DependencyResolver.resolveDependency(typeof(KernelData)).version().ReleaseVersion;

            // When
            HTTP.Response res = HTTP.GET(FunctionalTestHelper.managementUri() + "/" + VersionAndEditionService.SERVER_PATH);

            // Then
            assertEquals(200, res.Status());
            assertThat(res.Get("edition").asText(), equalTo("enterprise"));
            assertThat(res.Get("version").asText(), equalTo(releaseVersion));
        }
コード例 #12
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldInvokeAllSecurityRules() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldInvokeAllSecurityRules()
        {
            // given
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getCanonicalName method:
            _server = CommunityServerBuilder.serverOnRandomPorts().withDefaultDatabaseTuning().withSecurityRules(typeof(NoAccessToDatabaseSecurityRule).FullName).usingDataDir(Folder.directory(Name.MethodName).AbsolutePath).build();
            _server.start();
            _functionalTestHelper = new FunctionalTestHelper(_server);

            // when
            Gen.get().expectedStatus(401).get(_functionalTestHelper.dataUri()).response();

            // then
            assertTrue(NoAccessToDatabaseSecurityRule.WasInvoked());
        }
コード例 #13
0
        public virtual void ASimpleWildcardUriPathShould401OnAccessToProtectedSubPath()
        {
            string mountPoint = "/protected/tree/starts/here" + DummyThirdPartyWebService.DUMMY_WEB_SERVICE_MOUNT_POINT;

//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getCanonicalName method:
            _server = CommunityServerBuilder.serverOnRandomPorts().withDefaultDatabaseTuning().withThirdPartyJaxRsPackage("org.dummy.web.service", mountPoint).withSecurityRules(typeof(PermanentlyFailingSecurityRuleWithWildcardPath).FullName).usingDataDir(Folder.directory(Name.MethodName).AbsolutePath).build();
            _server.start();

            _functionalTestHelper = new FunctionalTestHelper(_server);

            JaxRsResponse clientResponse = Gen.get().expectedStatus(401).expectedType(MediaType.APPLICATION_JSON_TYPE).expectedHeader("WWW-Authenticate").get(TrimTrailingSlash(_functionalTestHelper.baseUri()) + mountPoint + "/more/stuff").response();

            assertEquals(401, clientResponse.Status);
        }
コード例 #14
0
        public void InitializeApplication()
        {
            testHelper = new FunctionalTestHelper();
            testHelper.ReInitializeGlobalBank();

            authentication = new AuthenAdapter();
            authentication.SetUserNameAndPassword("Tom", "Password2");
            shell = authentication.OkClick();

            findCustomer           = shell.FindCustomer();
            findCustomer.FirstName = "kari";
            findCustomerResults    = findCustomer.Find();
            addReason = findCustomerResults.QueueForService();
            addReason.ReasonForVisit = "Checking Account - Opening request";
            addReason.Description    = "Test Visit";
            addReason.OkClick();
            rightPane       = shell.ServiceCustomer();
            customerSummary = rightPane.CustomerSummary();
        }
コード例 #15
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @BeforeClass public static void setupServer()
        public static void SetupServer()
        {
            _functionalTestHelper = new FunctionalTestHelper(SharedServerTestBase.server());
        }
コード例 #16
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @BeforeClass public static void setupServer()
        public static void SetupServer()
        {
            _functionalTestHelper = new FunctionalTestHelper(Server());
            _helper  = _functionalTestHelper.GraphDbHelper;
            _request = RestRequest.Req();
        }
コード例 #17
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @BeforeClass public static void setupServer()
        public static void SetupServer()
        {
            _functionalTestHelper = new FunctionalTestHelper(Server());
            _helper = _functionalTestHelper.GraphDbHelper;
        }
コード例 #18
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @BeforeClass public static void setupServer()
        public static void SetupServer()
        {
            _functionalTestHelper = new FunctionalTestHelper(Server());
        }
コード例 #19
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 java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public static void SetupServer()
        {
            _server = ServerHelper.createNonPersistentServer();
            _functionalTestHelper = new FunctionalTestHelper(_server);
        }
コード例 #20
0
 private string GetBasePath(FunctionalTestHelper helper)
 {
     return(helper.ManagementUri() + "/" + BASE_PATH);
 }