コード例 #1
0
        public async Task Test_8_3_17_AS4Message_Gets_Delivered_To_Payload_Service()
        {
            // Arrange
            AS4Component.OverrideSettings("8.3.17-settings.xml");

            Holodeck.CopyPModeToHolodeckA("8.3.17-pmode.xml");
            Holodeck.PutMessageSinglePayloadToHolodeckA("8.3.16-pmode");

            // Act
            AS4Component.Start();

            // Assert
            IEnumerable <FileInfo> deliverables =
                await PollingService.PollUntilPresentAsync(
                    AS4Component.FullInputPath,
                    fs => fs.Any(f => f.Extension == ".xml"));

            var doc = new XmlDocument();

            doc.LoadXml(File.ReadAllText(deliverables.First().FullName));
            XmlElement locationElement = doc["DeliverMessage"]?["Payloads"]?["Payload"]?["Location"];

            Assert.True(locationElement != null, "No payload location found in delivered DeliverMessage");

            HttpResponseMessage downloadResponse = await PayloadServiceClient.GetAsync(locationElement.InnerText);

            Assert.Equal(HttpStatusCode.OK, downloadResponse.StatusCode);
        }
コード例 #2
0
        public void Test_8_3_18_AS4Message_Gets_Delivered_To_Http_Target()
        {
            // Before
            const string location = "http://localhost:4001/";

            using (SpyHttpDeliverTarget deliverTarget = SpyHttpDeliverTarget.AtLocation(location))
            {
                // Arrange
                Holodeck.CopyPModeToHolodeckA("8.3.18-pmode.xml");
                Holodeck.PutMessageSinglePayloadToHolodeckA("8.3.17-pmode");

                // Act
                AS4Component.Start();

                // Assert
                Assert.True(deliverTarget.IsCalled, "Receive Single Payload Deliver HTTP Integration Test failed");
                string deliverContent = deliverTarget.DeliveredMessage;
                Assert.False(String.IsNullOrEmpty(deliverContent), "Delivered Message was empty");

                var doc = new XmlDocument();
                doc.LoadXml(deliverContent);
                XmlNode deliverMessageNode = doc.SelectSingleNode("//*[local-name()='DeliverMessage']");
                Assert.NotNull(deliverMessageNode);
            }
        }
コード例 #3
0
        public async Task Test_8_3_11_AS4Message_Gets_Responded_With_Non_Repudiation_Receipt()
        {
            // Arrange
            AS4Component.Start();
            Holodeck.CopyPModeToHolodeckA("8.3.11-pmode.xml");

            // Act
            Holodeck.PutMessageSinglePayloadToHolodeckA("8.3.11-pmode");

            // Assert
            await PollingService.PollUntilPresentAsync(Holodeck.HolodeckALocations.InputPath);
        }
コード例 #4
0
        public async Task Test_8_3_14_AS4Message_Test_Message_Gets_Responded_But_Not_Delivered()
        {
            // Arrange
            AS4Component.Start();
            Holodeck.CopyPModeToHolodeckA("8.3.14-pmode.xml");

            // Act
            Holodeck.PutMessageSinglePayloadToHolodeckA("8.3.14-pmode");

            // Assert
            await PollingService.PollUntilPresentAsync(Holodeck.HolodeckALocations.InputPath);

            Assert.Empty(Directory.GetFiles(AS4Component.FullInputPath, "*.xml"));
        }
コード例 #5
0
        public async Task Test_8_3_13_AS4Message_With_Single_Payload_Gets_Responded_With_Signed_NonRepudiation_Receipt()
        {
            // Arrange
            AS4Component.Start();
            Holodeck.CopyPModeToHolodeckA("8.3.13-pmode.xml");

            // Act
            Holodeck.PutMessageSinglePayloadToHolodeckA("8.3.13-pmode");

            // Assert
            await PollingService.PollUntilPresentAsync(
                Holodeck.HolodeckALocations.InputPath,
                fs => fs.Any(f => f.Extension == ".xml"),
                timeout : TimeSpan.FromSeconds(50));
        }
コード例 #6
0
        public async Task Test_8_4_1_Received_AS4Message_That_Cant_Be_Linked_To_ReceivingPMode_Result_In_Processing_Error()
        {
            // Arrange
            Holodeck.CopyPModeToHolodeckA("8.4.1-pmode.xml");

            // Act
            Holodeck.PutMessageSinglePayloadToHolodeckA("8.4.1-pmode");

            // Assert
            await PollingService.PollUntilPresentAsync(
                Holodeck.HolodeckALocations.InputPath,
                fs => fs.Any(f => f.Extension == ".xml"));

            Holodeck.AssertErrorOnHolodeckA(ErrorCode.Ebms0001);
        }
コード例 #7
0
        public async Task Test_8_3_1_AS4Message_With_Single_Payload_Result_In_File_Deliver()
        {
            // Arrange
            AS4Component.Start();
            Holodeck.CopyPModeToHolodeckA("8.3.1-pmode.xml");

            // Act
            Holodeck.PutMessageSinglePayloadToHolodeckA("8.3.1-pmode");

            // Assert
            await PollingService.PollUntilPresentAsync(
                AS4Component.FullInputPath,
                fs => fs.Any(f => f.Extension == ".xml"));

            Holodeck.AssertSinglePayloadOnHolodeckA();
        }