comparison UnitTestsSources/ServerIndexTests.cpp @ 2815:925d8dc03a23

unserialization of jobs from plugins
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 11 Sep 2018 16:34:21 +0200
parents 06c0a6b8a871
children c277e0421200
comparison
equal deleted inserted replaced
2814:7d1d3136f6cf 2815:925d8dc03a23
673 673
674 SystemToolbox::RemoveFile(path + "/index"); 674 SystemToolbox::RemoveFile(path + "/index");
675 FilesystemStorage storage(path); 675 FilesystemStorage storage(path);
676 DatabaseWrapper db; // The SQLite DB is in memory 676 DatabaseWrapper db; // The SQLite DB is in memory
677 db.Open(); 677 db.Open();
678 ServerContext context(db, storage, true /* running unit tests */, 678 ServerContext context(db, storage, true /* running unit tests */);
679 false /* don't reload jobs */); 679 context.SetupJobsEngine(true, false);
680
680 ServerIndex& index = context.GetIndex(); 681 ServerIndex& index = context.GetIndex();
681 682
682 ASSERT_EQ(1u, index.IncrementGlobalSequence(GlobalProperty_AnonymizationSequence)); 683 ASSERT_EQ(1u, index.IncrementGlobalSequence(GlobalProperty_AnonymizationSequence));
683 ASSERT_EQ(2u, index.IncrementGlobalSequence(GlobalProperty_AnonymizationSequence)); 684 ASSERT_EQ(2u, index.IncrementGlobalSequence(GlobalProperty_AnonymizationSequence));
684 ASSERT_EQ(3u, index.IncrementGlobalSequence(GlobalProperty_AnonymizationSequence)); 685 ASSERT_EQ(3u, index.IncrementGlobalSequence(GlobalProperty_AnonymizationSequence));
772 773
773 SystemToolbox::RemoveFile(path + "/index"); 774 SystemToolbox::RemoveFile(path + "/index");
774 FilesystemStorage storage(path); 775 FilesystemStorage storage(path);
775 DatabaseWrapper db; // The SQLite DB is in memory 776 DatabaseWrapper db; // The SQLite DB is in memory
776 db.Open(); 777 db.Open();
777 ServerContext context(db, storage, true /* running unit tests */, 778 ServerContext context(db, storage, true /* running unit tests */);
778 false /* don't reload jobs */); 779 context.SetupJobsEngine(true, false);
779 ServerIndex& index = context.GetIndex(); 780 ServerIndex& index = context.GetIndex();
780 781
781 index.SetMaximumStorageSize(10); 782 index.SetMaximumStorageSize(10);
782 783
783 Json::Value tmp; 784 Json::Value tmp;