comparison UnitTestsSources/MultiThreadingTests.cpp @ 2812:ea7aea6f6a95

improved naming of methods in IJob
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 06 Sep 2018 16:23:40 +0200
parents 7cfc8d266f41
children 925d8dc03a23
comparison
equal deleted inserted replaced
2811:7cfc8d266f41 2812:ea7aea6f6a95
93 93
94 virtual void Start() 94 virtual void Start()
95 { 95 {
96 } 96 }
97 97
98 virtual void SignalResubmit() 98 virtual void Reset()
99 { 99 {
100 } 100 }
101 101
102 virtual JobStepResult ExecuteStep() 102 virtual JobStepResult Step()
103 { 103 {
104 if (fails_) 104 if (fails_)
105 { 105 {
106 return JobStepResult::Failure(ErrorCode_ParameterOutOfRange); 106 return JobStepResult::Failure(ErrorCode_ParameterOutOfRange);
107 } 107 }
114 count_++; 114 count_++;
115 return JobStepResult::Continue(); 115 return JobStepResult::Continue();
116 } 116 }
117 } 117 }
118 118
119 virtual void ReleaseResources(JobReleaseReason reason) 119 virtual void Stop(JobStopReason reason)
120 { 120 {
121 } 121 }
122 122
123 virtual float GetProgress() 123 virtual float GetProgress()
124 { 124 {
160 DummyInstancesJob(const Json::Value& value) : 160 DummyInstancesJob(const Json::Value& value) :
161 SetOfInstancesJob(value) 161 SetOfInstancesJob(value)
162 { 162 {
163 } 163 }
164 164
165 virtual void ReleaseResources(JobReleaseReason reason) 165 virtual void Stop(JobStopReason reason)
166 { 166 {
167 } 167 }
168 168
169 virtual void GetJobType(std::string& s) 169 virtual void GetJobType(std::string& s)
170 { 170 {
960 job.SetDescription("description"); 960 job.SetDescription("description");
961 job.AddInstance("hello"); 961 job.AddInstance("hello");
962 job.AddInstance("nope"); 962 job.AddInstance("nope");
963 job.AddInstance("world"); 963 job.AddInstance("world");
964 job.SetPermissive(true); 964 job.SetPermissive(true);
965 ASSERT_THROW(job.ExecuteStep(), OrthancException); // Not started yet 965 ASSERT_THROW(job.Step(), OrthancException); // Not started yet
966 job.Start(); 966 job.Start();
967 job.ExecuteStep(); 967 job.Step();
968 job.ExecuteStep(); 968 job.Step();
969 969
970 { 970 {
971 DummyUnserializer unserializer; 971 DummyUnserializer unserializer;
972 ASSERT_TRUE(CheckIdempotentSerialization(unserializer, job)); 972 ASSERT_TRUE(CheckIdempotentSerialization(unserializer, job));
973 } 973 }
1014 lock.AddInput(a, s2); 1014 lock.AddInput(a, s2);
1015 lock.SetDicomAssociationTimeout(200); 1015 lock.SetDicomAssociationTimeout(200);
1016 lock.SetTrailingOperationTimeout(300); 1016 lock.SetTrailingOperationTimeout(300);
1017 } 1017 }
1018 1018
1019 ASSERT_EQ(JobStepCode_Continue, job.ExecuteStep().GetCode()); 1019 ASSERT_EQ(JobStepCode_Continue, job.Step().GetCode());
1020 1020
1021 { 1021 {
1022 GenericJobUnserializer unserializer; 1022 GenericJobUnserializer unserializer;
1023 ASSERT_TRUE(CheckIdempotentSerialization(unserializer, job)); 1023 ASSERT_TRUE(CheckIdempotentSerialization(unserializer, job));
1024 } 1024 }