Beispiel #1
0
        /**********************************************************/

        public void processRegisterReport(RegisterReport registerReport)
        {
            updateError(registerReport);
            ucLog1.addOadrMessage(registerReport, chkAutoScroll.Checked);

            ucRegisteredReports1.handleRegisterReports(registerReport.request);
        }
        /**********************************************************************************/

        private void updateReportList()
        {
            Dictionary <string, ReportWrapper> reports = m_resources.Reports;

            // HACK: this was a simple way to update the list of registered reports
            // note that the reports are not actually registered until the user clicks register reports
            // or regiters with the VTN
            RegisterReport request = new RegisterReport();

            request.createRegisterReport("requestID", "venID", reports);

            m_callbacks.processUpdateReportList(request.request);
        }
Beispiel #3
0
        public void reportGeneration()
        {
            ReportDescription reportDescription = ReportHelper.generateReportDescription();

            RegisterReport registerReport = new RegisterReport();

            string output = registerReport.createRegisterReport(RandomHex.instance().generateRandomHex(10),
                                                                "TH_VEN", reportDescription);

            Console.Out.WriteLine(output);

            Assert.IsTrue(output.Contains("x-notApplicable"));
            Assert.IsTrue(output.Contains("x-resourceStatus"));

            object oadrObject = SerializeOadrObject.deserializeObject(output, typeof(oadrPayload));
        }
        public void N1_0020_TH_VTN_1()
        {
            VEN2b ven = new VEN2b(new HttpWebRequestWrapper(false, System.Net.SecurityProtocolType.Tls12), TestProperties.vtnURL, TestProperties.venName, TestProperties.venID, TestProperties.venPassword);

            // register
            CreatePartyRegistration createPartyRegistration = ven.createPartyRegistration(RandomHex.instance().generateRandomHex(10), oadrProfileType.Item20b, oadrTransportType.simpleHttp, "", false, false, true);

            Assert.IsTrue(createPartyRegistration.response != null);

            Console.Out.WriteLine(createPartyRegistration.responseBody);

            // POLL
            OadrPoll oadrPoll = ven.poll();

            Assert.IsNotNull(oadrPoll.response);

            Console.Out.WriteLine(oadrPoll.responseBody);

            // First request is registerReport
            Assert.IsTrue(oadrPoll.responseTypeIs(typeof(oadrRegisterReportType)));

            oadrRegisterReportType registerReportType = oadrPoll.getRegisterReportResponse();

            RegisteredReport registeredReport = ven.registeredReport(registerReportType.requestID, "200", "OK");

            Assert.IsNotNull(registeredReport.response);
            Assert.AreEqual(registeredReport.response.eiResponse.responseCode, "200");

            // register our own report
            ReportDescription reportDescription = ReportHelper.generateReportDescription();

            RegisterReport registerReport = ven.registerReport(RandomHex.instance().generateRandomHex(10), reportDescription);

            Assert.IsNotNull(registerReport.response);

            Assert.AreEqual("200", registerReport.response.eiResponse.responseCode);

            Assert.AreEqual(registerReport.request.requestID, registerReport.response.eiResponse.requestID);
        }