364
364
inJobs.back().IDFromEndpoint.ChangePath("/arex/job5");
366
366
inJobs.push_back(inJobs.back());
368
// Identical jobs in job list is not allowed.
369
CPPUNIT_ASSERT(!Arc::Job::WriteJobsToTruncatedFile(jobfile, inJobs));
370
CPPUNIT_ASSERT(!Arc::Job::WriteJobsToFile(jobfile, inJobs, newJobs));
367
inJobs.back().Name = "Job5New";
369
// Duplicate jobs will be overwritten.
370
CPPUNIT_ASSERT(Arc::Job::WriteJobsToTruncatedFile(jobfile, inJobs));
371
CPPUNIT_ASSERT(Arc::Job::ReadAllJobsFromFile(jobfile, outJobs));
372
CPPUNIT_ASSERT_EQUAL(4, (int)outJobs.size());
373
CPPUNIT_ASSERT_EQUAL(inJobs.back().Name, outJobs.back().Name);
376
CPPUNIT_ASSERT(Arc::Job::WriteJobsToTruncatedFile(jobfile, std::list<Arc::Job>()));
378
CPPUNIT_ASSERT(Arc::Job::WriteJobsToFile(jobfile, inJobs, newJobs));
379
CPPUNIT_ASSERT_EQUAL(4, (int)newJobs.size());
380
CPPUNIT_ASSERT(Arc::Job::ReadAllJobsFromFile(jobfile, outJobs));
381
CPPUNIT_ASSERT_EQUAL(4, (int)outJobs.size());
382
CPPUNIT_ASSERT_EQUAL(inJobs.back().Name, outJobs.back().Name);
371
384
inJobs.pop_back();
373
386
// Adding more jobs to file.