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);
 }
示例#2
0
 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);
 }
示例#3
0
        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);
        }
 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);
 }
 public override Test.Framework.TestResult Run(Test.Framework.TestCase testCase)
 {
     //resolve reader
     //resolve writer
     //resolve contentFilteredTopic
     //resolve publisher
     //resolve subscriber
     DDS.IDomainParticipant    participant;
     DDS.IContentFilteredTopic contentFilteredTopic;
     DDS.IPublisher            publisher;
     DDS.ISubscriber           subscriber;
     mod.tstDataReader         reader;
     mod.tstDataWriter         writer;
     Test.Framework.TestResult result;
     DDS.ReturnCode            rc;
     result = new Test.Framework.TestResult("Deinitialization success", string.Empty,
                                            Test.Framework.TestVerdict.Pass, Test.Framework.TestVerdict.Fail);
     participant          = (DDS.IDomainParticipant)testCase.ResolveObject("participant");
     contentFilteredTopic = (DDS.IContentFilteredTopic)testCase.ResolveObject("filteredTopic"
                                                                              );
     publisher  = (DDS.IPublisher)testCase.ResolveObject("publisher");
     subscriber = (DDS.ISubscriber)testCase.ResolveObject("subscriber");
     reader     = (mod.tstDataReader)testCase.ResolveObject("reader");
     writer     = (mod.tstDataWriter)testCase.ResolveObject("writer");
     rc         = publisher.DeleteDataWriter(writer);
     if (rc != DDS.ReturnCode.Ok)
     {
         result.Result = "Could not delete DataWriter.";
         return(result);
     }
     rc = subscriber.DeleteDataReader(reader);
     if (rc != DDS.ReturnCode.Ok)
     {
         result.Result = "Could not delete DataReader.";
         return(result);
     }
     rc = participant.DeleteContentFilteredTopic(contentFilteredTopic);
     if (rc != DDS.ReturnCode.Ok)
     {
         result.Result = "Could not delete ContentFilteredTopic.";
         return(result);
     }
     rc = participant.DeletePublisher(publisher);
     if (rc != DDS.ReturnCode.Ok)
     {
         result.Result = "Could not delete Publisher.";
         return(result);
     }
     rc = participant.DeleteSubscriber(subscriber);
     if (rc != DDS.ReturnCode.Ok)
     {
         result.Result = "Could not delete Subscriber.";
         return(result);
     }
     testCase.UnregisterObject("filteredTopic");
     testCase.UnregisterObject("publisher");
     testCase.UnregisterObject("subscriber");
     testCase.UnregisterObject("reader");
     testCase.UnregisterObject("writer");
     testCase.UnregisterObject("dataReaderQos");
     result.Result  = "Deinitialization success.";
     result.Verdict = Test.Framework.TestVerdict.Pass;
     return(result);
 }