• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Framework.TestResult类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Test.Framework.TestResult的典型用法代码示例。如果您正苦于以下问题:C# Test.Framework.TestResult类的具体用法?C# Test.Framework.TestResult怎么用?C# Test.Framework.TestResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Test.Framework.TestResult类属于命名空间,在下文中一共展示了Test.Framework.TestResult类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Run

        /// <summary>
        /// Tests the initial default DataWriterQos and the getting and setting
        /// of the default DataWriterQos in the Publisher.
        /// </summary>
        /// <remarks>
        /// Tests the initial default DataWriterQos and the getting and setting
        /// of the default DataWriterQos in the Publisher.
        /// </remarks>
        public override Test.Framework.TestResult Run()
        {
            DDS.IPublisher publisher;
			DDS.DataWriterQos qos = null;
            string expResult = "DataWriterQos test succeeded";
            Test.Framework.TestResult result;
            DDS.ReturnCode rc;
            result = new Test.Framework.TestResult(expResult, string.Empty, Test.Framework.TestVerdict.Pass,
                Test.Framework.TestVerdict.Fail);
            publisher = (DDS.IPublisher)this.ResolveObject("publisher");

            if (publisher.GetDefaultDataWriterQos(ref qos) != DDS.ReturnCode.Ok)
            {
                result.Result = "Failed to get the default datawriter qos (1)";
                return result;
            }
            if (!test.sacs.QosComparer.DataWriterQosEquals(qos, test.sacs.QosComparer.defaultDataWriterQos
                ))
            {
                result.Result = "The default DataWriterQos != default (2)";
                return result;
            }
            qos.Deadline.Period.NanoSec = DDS.Duration.InfiniteNanoSec + 1;
            rc = publisher.SetDefaultDataWriterQos(qos);
            if (rc != DDS.ReturnCode.BadParameter)
            {
                result.Result = "Received return code " + rc + " but expected RETCODE_BAD_PARAMETER (3)";
                return result;
            }

            if (publisher.GetDefaultDataWriterQos(ref qos) != DDS.ReturnCode.Ok)
            {
                result.Result = "Failed to get the default datawriter qos (4)";
                return result;
            }
            if (!test.sacs.QosComparer.DataWriterQosEquals(qos, test.sacs.QosComparer.defaultDataWriterQos))
            {
                result.Result = "The default DataWriterQos != default (4)";
                return result;
            }
            qos.History.Depth = 8;
            qos.ResourceLimits.MaxSamplesPerInstance = 2;
            rc = publisher.SetDefaultDataWriterQos(qos);
            if (rc != DDS.ReturnCode.InconsistentPolicy)
            {
                result.Result = "Received return code " + rc + " but expected RETCODE_INCONSISTENT_POLICY (5)";
                return result;
            }
            result.Result = expResult;
            result.Verdict = Test.Framework.TestVerdict.Pass;
            return result;
        }
开发者ID:shizhexu,项目名称:opensplice,代码行数:60,代码来源:Publisher4.cs


示例2: Run

 public override Test.Framework.TestResult Run(Test.Framework.TestCase testCase)
 {
     string expectedResult = "Topic is deinitialized";
     DDS.IDomainParticipant participant;
     DDS.ITopic topic;
     DDS.ReturnCode rc;
     Test.Framework.TestResult result;
     result = new Test.Framework.TestResult(expectedResult, string.Empty, Test.Framework.TestVerdict.Pass,
         Test.Framework.TestVerdict.Fail);
     participant = (DDS.IDomainParticipant)testCase.ResolveObject("participant");
     topic = (DDS.ITopic)testCase.ResolveObject("topic");
     rc = participant.DeleteTopic(topic);
     if (rc == DDS.ReturnCode.PreconditionNotMet)
     {
         rc = participant.DeleteContainedEntities();
     }
     if (rc != DDS.ReturnCode.Ok)
     {
         result.Result = "Recieved return code " + rc + " after calling participant.delete_topic";
         return result;
     }
     testCase.UnregisterObject("topic");
     result.Result = expectedResult;
     result.Verdict = Test.Framework.TestVerdict.Pass;
     return result;
 }
开发者ID:shizhexu,项目名称:opensplice,代码行数:26,代码来源:DomainParticipantItem1Deinit.cs


示例3: Run

        public override Test.Framework.TestResult Run()
        {
            DDS.IDataReader reader;
			DDS.DataReaderQos qos = null;
			DDS.DataReaderQos qos2 = null;
			DDS.DataReaderQos holder = null;
            DDS.ReturnCode rc;
            Test.Framework.TestResult result;
            string expResult = "Reader test succeeded.";
            result = new Test.Framework.TestResult(expResult, string.Empty, Test.Framework.TestVerdict.Pass,
                Test.Framework.TestVerdict.Fail);
            reader = (DDS.IDataReader)this.ResolveObject("datareader");
            qos = (DDS.DataReaderQos)this.ResolveObject("datareaderQos");

            if (reader.GetQos(ref holder) != DDS.ReturnCode.Ok)
            {
                result.Result = "Qos of DataReader could not be resolved.";
                return result;
            }
            if (!test.sacs.QosComparer.DataReaderQosEquals(holder, qos))
            {
                result.Result = "Qos of DataReader does not match provided qos.";
                return result;
            }
            if (!test.sacs.QosComparer.DataReaderQosEquals(holder, test.sacs.QosComparer.defaultDataReaderQos))
            {
                result.Result = "Qos of DataWriter does not match default qos.";
                return result;
            }
            qos2 = holder;
            qos2.Deadline.Period = new DDS.Duration(3, 3);
            qos2.LatencyBudget.Duration = new DDS.Duration(6, 6);
            qos2.ReaderDataLifecycle.AutopurgeDisposedSamplesDelay = new DDS.Duration(
                5, 5);
            qos2.ReaderDataLifecycle.EnableInvalidSamples = false;
            qos2.ReaderDataLifecycle.InvalidSampleVisibility.Kind = DDS.InvalidSampleVisibilityQosPolicyKind.MinimumInvalidSamples;
            qos2.UserData.Value = new byte[2];
            qos2.UserData.Value[0] = 2;
            qos2.UserData.Value[0] = 4;
            rc = reader.SetQos(qos2);
            if (rc != DDS.ReturnCode.Ok)
            {
                result.Result = "New Qos could not be applied.";
                return result;
            }

            if (reader.GetQos(ref holder) != DDS.ReturnCode.Ok)
            {
                result.Result = "Qos of DataReader could not be resolved (2).";
                return result;
            }
            if (!test.sacs.QosComparer.DataReaderQosEquals(holder, qos2))
            {
                result.Result = "Qos of DataReader does not match provided qos (2).";
                return result;
            }
            result.Result = expResult;
            result.Verdict = Test.Framework.TestVerdict.Pass;
            return result;
        }
开发者ID:shizhexu,项目名称:opensplice,代码行数:60,代码来源:Reader1.cs


示例4: Run

 public override Test.Framework.TestResult Run(Test.Framework.TestCase testCase)
 {
     DDS.IDomainParticipant participant;
     DDS.ITopic topic;
     DDS.ReturnCode rc;
     Test.Framework.TestResult result;
     result = new Test.Framework.TestResult("Deinitialization success", string.Empty,
         Test.Framework.TestVerdict.Pass, Test.Framework.TestVerdict.Fail);
     participant = (DDS.IDomainParticipant)testCase.ResolveObject("participant");
     topic = (DDS.ITopic)testCase.ResolveObject("topic");
     rc = participant.DeleteTopic(topic);
     if (rc != DDS.ReturnCode.Ok)
     {
         if (rc == DDS.ReturnCode.PreconditionNotMet)
         {
             rc = participant.DeleteContainedEntities();
         }
         if (rc != DDS.ReturnCode.Ok)
         {
             result.Result = "Could not delete Topic.";
             return result;
         }
     }
     testCase.UnregisterObject("topic");
     result.Result = "Deinitialization success.";
     result.Verdict = Test.Framework.TestVerdict.Pass;
     return result;
 }
开发者ID:shizhexu,项目名称:opensplice,代码行数:28,代码来源:SubscriberItem2Deinit.cs


示例5: Run

 public override Test.Framework.TestResult Run()
 {
     DDS.IDomainParticipant participant1;
     DDS.IDomainParticipant lookedUpParticipant1;
     DDS.DomainParticipantFactory factory;
     Test.Framework.TestResult result = new Test.Framework.TestResult("lookup returns the same objects as where originally created"
         , "OK", Test.Framework.TestVerdict.Pass, Test.Framework.TestVerdict.Pass);
     factory = (DDS.DomainParticipantFactory)ResolveObject("theFactory");
     participant1 = (DDS.IDomainParticipant)ResolveObject("participant1");
     lookedUpParticipant1 = factory.LookupParticipant(string.Empty);
     if (participant1 != lookedUpParticipant1)
     {
         result.Result = "participant1 and lookedUpParticipant1 differ";
         result.Verdict = Test.Framework.TestVerdict.Fail;
         return result;
     }
     lookedUpParticipant1 = null;
     lookedUpParticipant1 = factory.LookupParticipant("file://rubbish");
     if (lookedUpParticipant1 != null)
     {
         result.Result = "lookup returned a participant after looking for a non existing participant";
         result.Verdict = Test.Framework.TestVerdict.Fail;
         return result;
     }
     lookedUpParticipant1 = null;
     lookedUpParticipant1 = factory.LookupParticipant(string.Empty);
     if (lookedUpParticipant1 != participant1)
     {
         result.Result = "lookup didn't return the expected participant";
         result.Verdict = Test.Framework.TestVerdict.Fail;
         return result;
     }
     return result;
 }
开发者ID:xrl,项目名称:opensplice,代码行数:34,代码来源:DomainParticipantFactory6.cs


示例6: Run

        public override Test.Framework.TestResult Run()
        {
            DDS.ReturnCode rc;
            string expResult = "null pointer struct returns BAD_PARAMETER";
            Test.Framework.TestResult result = new Test.Framework.TestResult(
                expResult,
                string.Empty,
                Test.Framework.TestVerdict.Pass,
                Test.Framework.TestVerdict.Fail);

            if (result.Result != string.Empty)
            {
                return result;
            }

            bce.message2 = new mod.embeddedStructType();
            bce.message2.tstStr = null;
            rc = bce.datawriter2.Write(bce.message2, 0);
            if (rc != DDS.ReturnCode.BadParameter)
            {
                result.Result = "null pointer struct did NOT return BAD_PARAMETER.";
                return result;
            }
            result.Result = expResult;
            result.Verdict = Test.Framework.TestVerdict.Pass;
            return result;
        }
开发者ID:shizhexu,项目名称:opensplice,代码行数:27,代码来源:BoundsCheck11.cs


示例7: Run

        public override Test.Framework.TestResult Run()
        {
            DDS.ReturnCode rc;
            string expResult = "struct array with too big size returns BAD_PARAMETER";
            Test.Framework.TestResult result = new Test.Framework.TestResult(
                expResult,
                string.Empty,
                Test.Framework.TestVerdict.Fail,
                Test.Framework.TestVerdict.Fail);

            if (result.Result != string.Empty)
            {
                return result;
            }

            bce.message2 = new mod.embeddedStructType();
            bce.message2.tstArr = new mod.tst[4];
            for (int i = 0; i < 4; i++) {
                bce.message2.tstArr[i] = new mod.tst(); // Prevent uninitialized array from causing error.
            }
            // scdds2162 - Once solved for CopyIn, re-enable the Write instruction.
            //rc = bce.datawriter2.Write(bce.message2, 0);
            rc = DDS.ReturnCode.Ok; // Temporary to make testcase FAIL. Please Remove when Write is re-enabled. 
            if (rc != DDS.ReturnCode.BadParameter)
            {
                result.Result = "struct array with too big size did NOT return BAD_PARAMETER.";
            	this.testFramework.TestMessage(Test.Framework.TestMessage.Note, "See scdds2162: CopyIn should do more validity checking.");
                return result;
            }
            result.Result = expResult;
            result.Verdict = Test.Framework.TestVerdict.Pass;
            return result;
        }
开发者ID:shizhexu,项目名称:opensplice,代码行数:33,代码来源:BoundsCheck14.cs


示例8: Run

        public override Test.Framework.TestResult Run()
        {
            DDS.IPublisher publisher;
			DDS.DataWriterQos dataWriterQos = null;
			DDS.DataWriterQos qosHolder1 = null;
            DDS.ITopic topic;
            string expResult = "copy_from_topic_qos rejects TOPIC_QOS_DEFAULT with correct code.";
            Test.Framework.TestResult result;
            DDS.ReturnCode rc = DDS.ReturnCode.Error;
            result = new Test.Framework.TestResult(expResult, string.Empty, Test.Framework.TestVerdict.Pass,
                Test.Framework.TestVerdict.Fail);
            publisher = (DDS.IPublisher)this.ResolveObject("publisher");
            topic = (DDS.ITopic)this.ResolveObject("topic");

            if (publisher.GetDefaultDataWriterQos(ref qosHolder1) != DDS.ReturnCode.Ok)
            {
                result.Result = "Could not retrieve default DataWriterQos";
                return result;
            }
            dataWriterQos = qosHolder1;
            dataWriterQos.History.Kind = DDS.HistoryQosPolicyKind.KeepAllHistoryQos;
            dataWriterQos.History.Depth = 150;

            // TODO: JLS, Verify the intent of this BadParameter test.
            DDS.TopicQos defaultTopicQos = null;
            rc = publisher.CopyFromTopicQos(ref qosHolder1, defaultTopicQos);
            if (rc != DDS.ReturnCode.BadParameter)
            {
                result.Result = "copy_from_topic_qos returns wrong code (RETCODE = " + rc + ").";
                return result;
            }
            result.Result = expResult;
            result.Verdict = Test.Framework.TestVerdict.Pass;
            return result;
        }
开发者ID:shizhexu,项目名称:opensplice,代码行数:35,代码来源:Publisher8.cs


示例9: Run

        public override Test.Framework.TestResult Run()
        {
            DDS.ITopic topic;
            DDS.InconsistentTopicStatus status = new DDS.InconsistentTopicStatus();
            string expResult = "Topic status test succeeded";
            Test.Framework.TestResult result;
            DDS.ReturnCode rc;
            result = new Test.Framework.TestResult(expResult, string.Empty, Test.Framework.TestVerdict.Pass,
                Test.Framework.TestVerdict.Fail);
            topic = (DDS.ITopic)this.ResolveObject("topic");

            rc = topic.GetInconsistentTopicStatus(ref status);
            if (rc != DDS.ReturnCode.Ok)
            {
                result.Result = "InconsistentTopicStatus could not be resolved.";
                return result;
            }
            if (status.TotalCount != 0)
            {
                result.Result = "InconsistentTopicStatus.TotalCount != 0.";
                return result;
            }
            if (status.TotalCountChange != 0)
            {
                result.Result = "InconsistentTopicStatus.TotalCountChange != 0.";
                return result;
            }
            result.Result = expResult;
            result.Verdict = Test.Framework.TestVerdict.Pass;
            return result;
        }
开发者ID:shizhexu,项目名称:opensplice,代码行数:31,代码来源:Status1.cs


示例10: Run

 public override Test.Framework.TestResult Run()
 {
     string expResult = "ContentFilteredTopic test succeeded";
     string[] expressionParameters;
     DDS.IDomainParticipant participant;
     DDS.ITopic topic;
     DDS.IContentFilteredTopic filteredTopic;
     Test.Framework.TestResult result;
     result = new Test.Framework.TestResult(expResult, string.Empty, Test.Framework.TestVerdict.Pass,
         Test.Framework.TestVerdict.Fail);
     topic = (DDS.ITopic)this.ResolveObject("topic");
     participant = (DDS.IDomainParticipant)this.ResolveObject("participant");
     expressionParameters = new string[102];
     Utils.FillStringArray(ref expressionParameters, "10");
     if (topic == null || participant == null)
     {
         System.Console.Error.WriteLine("participant or topic = null");
         result.Result = "precondition not met";
         return result;
     }
     expressionParameters[101] = "5";
     filteredTopic = participant.CreateContentFilteredTopic("filtered_topic", topic,
         "long_1 > %101", expressionParameters);
     if (filteredTopic != null)
     {
         System.Console.Out.WriteLine("NOTE\t\t: See STR/CP TH281");
         participant.DeleteContentFilteredTopic(filteredTopic);
         result.ExpectedVerdict = Test.Framework.TestVerdict.Fail;
         result.Result = "Could create a ContentFilteredTopic with an expression parameter %101 ";
         return result;
     }
     result.Result = expResult;
     result.Verdict = Test.Framework.TestVerdict.Pass;
     return result;
 }
开发者ID:shizhexu,项目名称:opensplice,代码行数:35,代码来源:DomainParticipant11.cs


示例11: Run

        public override Test.Framework.TestResult Run()
        {
            DDS.ReturnCode rc;
            string expResult = "struct array with correct size returns Ok";
            Test.Framework.TestResult result = new Test.Framework.TestResult(
                expResult,
                string.Empty,
                Test.Framework.TestVerdict.Pass,
                Test.Framework.TestVerdict.Fail);

            if (result.Result != string.Empty)
            {
                return result;
            }

            bce.message2 = new mod.embeddedStructType();
            bce.message2.tstArr = new mod.tst[3];
            for (int i = 0; i < 3; i++) {
                bce.message2.tstArr[i] = new mod.tst(); // Prevent uninitialized array from causing error.
            }
            rc = bce.datawriter2.Write(bce.message2, 0);
            if (rc != DDS.ReturnCode.Ok)
            {
                result.Result = "struct array with correct size did NOT return Ok.";
                return result;
            }
            result.Result = expResult;
            result.Verdict = Test.Framework.TestVerdict.Pass;
            return result;
        }
开发者ID:shizhexu,项目名称:opensplice,代码行数:30,代码来源:BoundsCheck15.cs


示例12: Run

        public override Test.Framework.TestResult Run(Test.Framework.TestCase testCase)
        {
            DDS.DomainParticipantFactory factory;
            DDS.IDomainParticipant participant;
			DDS.DomainParticipantQos pqosHolder = null;
            Test.Framework.TestResult result;
            result = new Test.Framework.TestResult("Initialization success", string.Empty, Test.Framework.TestVerdict.Pass,
                Test.Framework.TestVerdict.Fail);
            factory = DDS.DomainParticipantFactory.Instance;
            if (factory == null)
            {
                result.Result = "DomainParticipantFactory could not be initialized.";
                return result;
            }

            if (factory.GetDefaultParticipantQos(ref pqosHolder) != DDS.ReturnCode.Ok)
            {
                result.Result = "Default DomainParticipantQos could not be resolved.";
                return result;
            }
            participant = factory.CreateParticipant(DDS.DomainId.Default, pqosHolder);//, null, 0);
            if (participant == null)
            {
                result.Result = "Creation of DomainParticipant failed.";
                return result;
            }
            testCase.RegisterObject("participantQos", pqosHolder);
            testCase.RegisterObject("factory", factory);
            testCase.RegisterObject("participant", participant);
            result.Result = "Initialization success.";
            result.Verdict = Test.Framework.TestVerdict.Pass;
            return result;
        }
开发者ID:shizhexu,项目名称:opensplice,代码行数:33,代码来源:DomainParticipantItemInit.cs


示例13: Run

 public override Test.Framework.TestResult Run()
 {
     DDS.ISubscriber subscriber;
     string expResult = "Functions not supported yet.";
     Test.Framework.TestResult result;
     DDS.ReturnCode rc;
     result = new Test.Framework.TestResult(expResult, string.Empty, Test.Framework.TestVerdict
         .Pass, Test.Framework.TestVerdict.Fail);
     subscriber = (DDS.ISubscriber)this.ResolveObject("subscriber");
     subscriber.NotifyDataReaders();
     rc = subscriber.BeginAccess();
     if (rc != DDS.ReturnCode.Unsupported)
     {
         result.Result = "subscriber.begin_access has been implemented.";
         return result;
     }
     rc = subscriber.EndAccess();
     if (rc != DDS.ReturnCode.Unsupported)
     {
         result.Result = "subscriber.end_access has been implemented.";
         return result;
     }
     result.Result = "Functions not supported yet.";
     result.Verdict = Test.Framework.TestVerdict.Pass;
     return result;
 }
开发者ID:shizhexu,项目名称:opensplice,代码行数:26,代码来源:Subscriber8.cs


示例14: Run

        public override Test.Framework.TestResult Run()
        {
            DDS.ReturnCode rc;
            string expResult = "sequence of structs with length > bound returns BadParameter";
            Test.Framework.TestResult result = new Test.Framework.TestResult(
                expResult,
                string.Empty,
                Test.Framework.TestVerdict.Pass,
                Test.Framework.TestVerdict.Fail);

            if (result.Result != string.Empty)
            {
                return result;
            }

            bce.message2 = new mod.embeddedStructType();
            for (int i = 0; i < 3; i++) {
                bce.message2.tstArr[i] = new mod.tst(); // Prevent uninitialized array from causing error.
            }
            bce.message2.tstSeq = new mod.tst[4];
            for (int i = 0; i < 4; i++) {
                bce.message2.tstSeq[i] = new mod.tst(); // Prevent uninitialized sequence elements from causing error.
            }
            rc = bce.datawriter2.Write(bce.message2, 0);
            if (rc != DDS.ReturnCode.BadParameter)
            {
                result.Result = "sequence of structs with length > bound did NOT return BadParameter.";
                return result;
            }
            result.Result = expResult;
            result.Verdict = Test.Framework.TestVerdict.Pass;
            return result;
        }
开发者ID:shizhexu,项目名称:opensplice,代码行数:33,代码来源:BoundsCheck17.cs


示例15: Run

 public override Test.Framework.TestResult Run(Test.Framework.TestCase testCase)
 {
     DDS.IDomainParticipantFactory factory;
     DDS.IDomainParticipant participant;
     Test.Framework.TestResult result;
     DDS.ReturnCode rc;
     result = new Test.Framework.TestResult("Deinitialization success", string.Empty,
         Test.Framework.TestVerdict.Pass, Test.Framework.TestVerdict.Fail);
     factory = (DDS.IDomainParticipantFactory)testCase.ResolveObject("factory");
     participant = (DDS.IDomainParticipant)testCase.ResolveObject("participant");
     if (participant == null)
     {
         result.Result = "DomainParticipant could not be found.";
         return result;
     }
     rc = participant.DeleteContainedEntities();
     if (rc != DDS.ReturnCode.Ok)
     {
         result.Result = "Could not delete contained entities of DomainParticipant.";
         return result;
     }
     rc = factory.DeleteParticipant(participant);
     if (rc != DDS.ReturnCode.Ok)
     {
         result.Result = "Could not delete DomainParticipant.";
         return result;
     }
     testCase.UnregisterObject("participant");
     testCase.UnregisterObject("participantQos");
     testCase.UnregisterObject("factory");
     result.Result = "Deinitialization success.";
     result.Verdict = Test.Framework.TestVerdict.Pass;
     return result;
 }
开发者ID:shizhexu,项目名称:opensplice,代码行数:34,代码来源:BuiltinDeinit.cs


示例16: Run

 public override Test.Framework.TestResult Run(Test.Framework.TestCase testCase)
 {
     DDS.IDomainParticipant participant;
     DDS.ISubscriber subscriber;
     DDS.ReturnCode rc;
     Test.Framework.TestResult result;
     participant = (DDS.IDomainParticipant)testCase.ResolveObject("participant");
     subscriber = (DDS.ISubscriber)testCase.ResolveObject("subscriber");
     result = new Test.Framework.TestResult("Initialization success", string.Empty, Test.Framework.TestVerdict.Pass,
         Test.Framework.TestVerdict.Fail);
     if (participant == null || subscriber == null)
     {
         System.Console.Error.WriteLine("participant or subscriber = null");
         result.Result = "precondition not met";
         return result;
     }
     rc = participant.DeleteSubscriber(subscriber);
     if (rc != DDS.ReturnCode.Ok)
     {
         result.Result = "could not delete a subscriber";
         return result;
     }
     testCase.UnregisterObject("subscriber");
     result.Result = "Initialization success.";
     result.Verdict = Test.Framework.TestVerdict.Pass;
     return result;
 }
开发者ID:shizhexu,项目名称:opensplice,代码行数:27,代码来源:DomainParticipantItem2Deinit.cs


示例17: Run

 public override Test.Framework.TestResult Run(Test.Framework.TestCase testCase)
 {
     DDS.IDomainParticipant participant;
     mod.tstTypeSupport typeSupport;
     DDS.TopicQos topicQos;
     DDS.ITopic topic;
     DDS.ReturnCode rc;
     Test.Framework.TestResult result;
     participant = (DDS.IDomainParticipant)testCase.ResolveObject("participant");
     typeSupport = (mod.tstTypeSupport)testCase.ResolveObject("typeSupport");
     topicQos = (DDS.TopicQos)testCase.ResolveObject("topicQos");
     result = new Test.Framework.TestResult("Initialization 3 success", string.Empty,
         Test.Framework.TestVerdict.Pass, Test.Framework.TestVerdict.Fail);
     rc = typeSupport.RegisterType(participant, "my_other_type");
     if (rc != DDS.ReturnCode.Ok)
     {
         result.Result = "Register type failed.";
         return result;
     }
     topic = participant.CreateTopic("my_other_topic", "my_other_type", topicQos);//, null, 0);
     if (topic == null)
     {
         result.Result = "Topic could not be created.";
         return result;
     }
     testCase.RegisterObject("otherTopic", topic);
     result.Result = "Initialization success.";
     result.Verdict = Test.Framework.TestVerdict.Pass;
     return result;
 }
开发者ID:shizhexu,项目名称:opensplice,代码行数:30,代码来源:SubscriberItem3Init.cs


示例18: Run

        public override Test.Framework.TestResult Run()
        {
            Test.Framework.TestResult result;
            DDS.QosProvider qosProvider = null;
            DDS.DomainParticipantQos participantQos =
                test.sacs.QosComparer.defaultDomainParticipantQos;
            DDS.TopicQos topicQos =
                test.sacs.QosComparer.defaultTopicQos;
            DDS.SubscriberQos subscriberQos =
                test.sacs.QosComparer.defaultSubscriberQos;
            DDS.DataReaderQos readerQos =
                test.sacs.QosComparer.defaultDataReaderQos;
            DDS.PublisherQos publisherQos =
                test.sacs.QosComparer.defaultPublisherQos;
            DDS.DataWriterQos writerQos =
                test.sacs.QosComparer.defaultDataWriterQos;

            DDS.DomainParticipantQos xmlParticipantQos = new DDS.DomainParticipantQos ();
            DDS.TopicQos xmlTopicQos = new DDS.TopicQos ();
            DDS.SubscriberQos xmlSubscriberQos = new DDS.SubscriberQos ();
            DDS.DataReaderQos xmlReaderQos = new DDS.DataReaderQos ();
            DDS.PublisherQos xmlPublisherQos = new DDS.PublisherQos ();
            DDS.DataWriterQos xmlWriterQos = new DDS.DataWriterQos ();

            qosProvider = new DDS.QosProvider (this.uri, null);

            if (qosProvider.GetParticipantQos (ref xmlParticipantQos, null) != 0 ||
                qosProvider.GetTopicQos (ref xmlTopicQos, null) != 0 ||
                qosProvider.GetSubscriberQos (ref xmlSubscriberQos, null) != 0 ||
                qosProvider.GetDataReaderQos (ref xmlReaderQos, null) != 0 ||
                qosProvider.GetPublisherQos (ref xmlPublisherQos, null) != 0 ||
                qosProvider.GetDataWriterQos (ref xmlWriterQos, null) != 0)
            {
                result = new Test.Framework.TestResult (
                    "QosProvider should successfully parse XML file",
                    "QosProvider did not parse XML file " + uri,
                    Test.Framework.TestVerdict.Pass,
                    Test.Framework.TestVerdict.Fail);
            } else if (!QosComparer.DomainParticipantQosEquals (xmlParticipantQos, participantQos) ||
                       !QosComparer.TopicQosEquals (xmlTopicQos, topicQos) ||
                       !QosComparer.SubscriberQosEquals (xmlSubscriberQos, subscriberQos) ||
                       !QosComparer.DataReaderQosEquals (xmlReaderQos, readerQos) ||
                       !QosComparer.PublisherQosEquals (xmlPublisherQos, publisherQos) ||
                       !QosComparer.DataWriterQosEquals (xmlWriterQos, writerQos))
            {
                result = new Test.Framework.TestResult (
                    "QosProvider should successfully parse XML file",
                    "QosProvider did not correctly parse XML file " + uri,
                    Test.Framework.TestVerdict.Pass,
                    Test.Framework.TestVerdict.Fail);
            } else {
                result = new Test.Framework.TestResult (
                    "QosProvider should successfully parse XML file",
                    "QosProvider correctly parsed XML file " + uri,
                    Test.Framework.TestVerdict.Pass,
                    Test.Framework.TestVerdict.Pass);
            }

            return result;
        }
开发者ID:shizhexu,项目名称:opensplice,代码行数:60,代码来源:QosProviderDefaults.cs


示例19: Run

        public override Test.Framework.TestResult Run(Test.Framework.TestCase testCase)
        {
            DDS.IDomainParticipant participant;
			DDS.SubscriberQos subscriberQosHolder = null;
            DDS.ISubscriber subscriber;
            Test.Framework.TestResult result;
            DDS.ITopic topic;
            participant = (DDS.IDomainParticipant)testCase.ResolveObject("participant");
            topic = (DDS.ITopic)testCase.ResolveObject("topic");
            result = new Test.Framework.TestResult("Initialization success", string.Empty, Test.Framework.TestVerdict.Pass,
                Test.Framework.TestVerdict.Fail);
            if (participant == null || topic == null)
            {
                System.Console.Error.WriteLine("participant or topic = null");
                result.Result = "precondition not met";
                return result;
            }

            if (participant.GetDefaultSubscriberQos(ref subscriberQosHolder) != DDS.ReturnCode.Ok)
            {
                result.Result = "could not get default SubscriberQos";
                return result;
            }
            subscriber = participant.CreateSubscriber(subscriberQosHolder);//, null, DDS.StatusKind.Any);
            if (subscriber == null)
            {
                result.Result = "could create a Subscriber";
                return result;
            }
            testCase.RegisterObject("subscriber", subscriber);
            result.Result = "Initialization success.";
            result.Verdict = Test.Framework.TestVerdict.Pass;
            return result;
        }
开发者ID:shizhexu,项目名称:opensplice,代码行数:34,代码来源:DomainParticipantItem2Init.cs


示例20: Run

 public override Test.Framework.TestResult Run()
 {
     string filterExpression = "long_1 < %99";
     string[] expressionParameters = new string[] { "1", "2", "3" };
     string expResult = "ContentFilteredTopic test succeeded";
     DDS.IDomainParticipant participant;
     DDS.ITopic topic;
     DDS.IContentFilteredTopic filteredTopic;
     Test.Framework.TestResult result;
     topic = (DDS.ITopic)this.ResolveObject("topic");
     participant = (DDS.IDomainParticipant)this.ResolveObject("participant");
     result = new Test.Framework.TestResult(expResult, string.Empty, Test.Framework.TestVerdict.Pass,
         Test.Framework.TestVerdict.Fail);
     filteredTopic = participant.CreateContentFilteredTopic("tc4_filtered_topic", topic
         , filterExpression, expressionParameters);
     if (filteredTopic != null)
     {
         System.Console.Out.WriteLine("NOTE\t\t: See STR/CP TH282");
         participant.DeleteContentFilteredTopic(filteredTopic);
         result.ExpectedVerdict = Test.Framework.TestVerdict.Fail;
         result.Result = "could create a ContentFilteredTopic which refers to non existing param %99";
         return result;
     }
     result.Result = expResult;
     result.Verdict = Test.Framework.TestVerdict.Pass;
     return result;
 }
开发者ID:shizhexu,项目名称:opensplice,代码行数:27,代码来源:DomainParticipant12.cs



注:本文中的Test.Framework.TestResult类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Test.List类代码示例发布时间:2022-05-24
下一篇:
C# Test类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap