blob: f306948677a9703a8791296ce13b688fbe40760d [file] [log] [blame]
Alexander Afanasyevb0c78ea2014-04-15 18:12:04 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
Alexander Afanasyeve1e6f2a2014-04-25 11:28:12 -07003 * Copyright (c) 2014, Regents of the University of California.
4 *
5 * This file is part of NDN repo-ng (Next generation of NDN repository).
6 * See AUTHORS.md for complete list of repo-ng authors and contributors.
7 *
8 * repo-ng is free software: you can redistribute it and/or modify it under the terms
9 * of the GNU General Public License as published by the Free Software Foundation,
10 * either version 3 of the License, or (at your option) any later version.
11 *
12 * repo-ng is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
13 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * repo-ng, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
Alexander Afanasyevb0c78ea2014-04-15 18:12:04 -070018 */
19
20#ifndef REPO_TESTS_DATASET_FIXTURES_HPP
21#define REPO_TESTS_DATASET_FIXTURES_HPP
22
Alexander Afanasyeve291caf2014-04-25 11:17:36 -070023#include <ndn-cxx/security/key-chain.hpp>
Wentao Shang91fb4f22014-05-20 10:55:22 -070024#include <vector>
25#include <boost/mpl/vector.hpp>
Alexander Afanasyevb0c78ea2014-04-15 18:12:04 -070026
27namespace repo {
28namespace tests {
29
30static inline ndn::shared_ptr<ndn::Data>
31createData(const ndn::Name& name)
32{
33 static ndn::KeyChain keyChain;
34 static std::vector<uint8_t> content(1500, '-');
35
36 ndn::shared_ptr<ndn::Data> data = ndn::make_shared<ndn::Data>();
37 data->setName(name);
38 data->setContent(&content[0], content.size());
39 keyChain.sign(*data);
40
41 return data;
42}
43
44
45class DatasetBase
46{
47public:
48 typedef std::list<ndn::shared_ptr<ndn::Data> > DataContainer;
49 DataContainer data;
50
51 typedef std::list<std::pair<ndn::Interest, ndn::shared_ptr<ndn::Data> > > InterestContainer;
52 InterestContainer interests;
Shuo Chen9a43f162014-07-01 13:43:54 +080053
Weiqi Shi28a90fb2014-07-09 10:28:55 -070054 typedef std::list<std::pair<ndn::Interest, int > > InterestIdContainer;
Weiqi Shif0330d52014-07-09 10:54:27 -070055 InterestIdContainer interestsSelectors, interestDeleteCount;
Weiqi Shi28a90fb2014-07-09 10:28:55 -070056
57 typedef std::list<std::pair<int, ndn::shared_ptr<ndn::Data> > > IdContainer;
58 IdContainer ids, insert;
Shuo Chen9a43f162014-07-01 13:43:54 +080059
60 struct DataSetNameCompare
61 {
62 bool operator()(const ndn::Name& a, const ndn::Name& b) const
63 {
64 return a < b;
65 }
66 };
67
68 struct DataSetDataCompare
69 {
70 bool operator()(const Data& a, const Data& b) const
71 {
72 return a.getName() < b.getName();
73 }
74 };
Alexander Afanasyevb0c78ea2014-04-15 18:12:04 -070075};
76
77
78template<size_t N>
79class BaseSmoketestFixture : public DatasetBase
80{
81public:
82 static const std::string&
83 getName()
84 {
85 static std::string name = "BaseSmoketest";
86 return name;
87 }
88
89 BaseSmoketestFixture()
90 {
91 ndn::Name baseName("/x/y/z/test/1");
92 for (size_t i = 0; i < N; i++) {
93 ndn::Name name(baseName);
94 name.appendSegment(i);
95 ndn::shared_ptr<Data> data = createData(name);
96 this->data.push_back(data);
97
98 this->interests.push_back(std::make_pair(Interest(name), data));
Weiqi Shif0330d52014-07-09 10:54:27 -070099 this->ids.push_back(std::make_pair(i+1, data));
Alexander Afanasyevb0c78ea2014-04-15 18:12:04 -0700100 }
101 }
102};
103
104
105class BaseTestFixture : public DatasetBase
106{
107public:
108 static const std::string&
109 getName()
110 {
111 static std::string name = "BaseTest";
112 return name;
113 }
114
115 BaseTestFixture()
116 {
117 this->data.push_back(createData("/a"));
118 this->interests.push_back(std::make_pair(Interest("/a"), this->data.back()));
Weiqi Shif0330d52014-07-09 10:54:27 -0700119 this->ids.push_back(std::make_pair(1, this->data.back()));
Alexander Afanasyevb0c78ea2014-04-15 18:12:04 -0700120
121 this->data.push_back(createData("/a/b"));
122 this->interests.push_back(std::make_pair(Interest("/a/b"), this->data.back()));
Weiqi Shif0330d52014-07-09 10:54:27 -0700123 this->ids.push_back(std::make_pair(2, this->data.back()));
Alexander Afanasyevb0c78ea2014-04-15 18:12:04 -0700124
125 this->data.push_back(createData("/a/b/c"));
126 this->interests.push_back(std::make_pair(Interest("/a/b/c"), this->data.back()));
Weiqi Shif0330d52014-07-09 10:54:27 -0700127 this->ids.push_back(std::make_pair(3, this->data.back()));
Alexander Afanasyevb0c78ea2014-04-15 18:12:04 -0700128
129 this->data.push_back(createData("/a/b/c/d"));
130 this->interests.push_back(std::make_pair(Interest("/a/b/c/d"), this->data.back()));
Weiqi Shif0330d52014-07-09 10:54:27 -0700131 this->ids.push_back(std::make_pair(4, this->data.back()));
Alexander Afanasyevb0c78ea2014-04-15 18:12:04 -0700132 }
133};
134
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700135//Fetch by prefix is useless due to the database is fetched by id
Alexander Afanasyevb0c78ea2014-04-15 18:12:04 -0700136class FetchByPrefixTestFixture : public DatasetBase
137{
138public:
139 static const std::string&
140 getName()
141 {
142 static std::string name = "FetchByPrefix";
143 return name;
144 }
145
146 FetchByPrefixTestFixture()
147 {
148 this->data.push_back(createData("/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z"));
149 this->interests.push_back(std::make_pair(Interest("/a"),
150 this->data.back()));
151 this->interests.push_back(std::make_pair(Interest("/a/b"),
152 this->data.back()));
153 this->interests.push_back(std::make_pair(Interest("/a/b/c"),
154 this->data.back()));
155 this->interests.push_back(std::make_pair(Interest("/a/b/c/d"),
156 this->data.back()));
157 this->interests.push_back(std::make_pair(Interest("/a/b/c/d/e"),
158 this->data.back()));
159 this->interests.push_back(std::make_pair(Interest("/a/b/c/d/e/f"),
160 this->data.back()));
161 this->interests.push_back(std::make_pair(Interest("/a/b/c/d/e/f/g"),
162 this->data.back()));
163 this->interests.push_back(std::make_pair(Interest("/a/b/c/d/e/f/g/h"),
164 this->data.back()));
165 this->interests.push_back(std::make_pair(Interest("/a/b/c/d/e/f/g/h/i"),
166 this->data.back()));
167 this->interests.push_back(std::make_pair(Interest("/a/b/c/d/e/f/g/h/i/j"),
168 this->data.back()));
169 this->interests.push_back(std::make_pair(Interest("/a/b/c/d/e/f/g/h/i/j/k"),
170 this->data.back()));
171 this->interests.push_back(std::make_pair(Interest("/a/b/c/d/e/f/g/h/i/j/k/l"),
172 this->data.back()));
173 this->interests.push_back(std::make_pair(Interest("/a/b/c/d/e/f/g/h/i/j/k/l/m"),
174 this->data.back()));
175 this->interests.push_back(std::make_pair(Interest("/a/b/c/d/e/f/g/h/i/j/k/l/m/n"),
176 this->data.back()));
177 this->interests.push_back(std::make_pair(Interest("/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o"),
178 this->data.back()));
179 this->interests.push_back(std::make_pair(Interest("/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p"),
180 this->data.back()));
181 this->interests.push_back(std::make_pair(Interest("/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q"),
182 this->data.back()));
183 this->interests.push_back(std::make_pair(Interest("/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r"),
184 this->data.back()));
185 this->interests.push_back(std::make_pair(Interest("/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s"),
186 this->data.back()));
187 this->interests.push_back(std::make_pair(Interest("/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t"),
188 this->data.back()));
189 this->interests.push_back(std::make_pair(Interest("/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u"),
190 this->data.back()));
191 this->interests.push_back(
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700192 std::make_pair(Interest("/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v"),
193 this->data.back()));
Alexander Afanasyevb0c78ea2014-04-15 18:12:04 -0700194 this->interests.push_back(
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700195 std::make_pair(Interest("/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w"),
196 this->data.back()));
Alexander Afanasyevb0c78ea2014-04-15 18:12:04 -0700197 this->interests.push_back(
198 std::make_pair(Interest("/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x"),
199 this->data.back()));
200 this->interests.push_back(
201 std::make_pair(Interest("/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y"),
202 this->data.back()));
203 this->interests.push_back(
204 std::make_pair(Interest("/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z"),
205 this->data.back()));
206 }
207};
208
209
210class SelectorTestFixture : public DatasetBase
211{
212public:
213 static const std::string&
214 getName()
215 {
216 static std::string name = "SelectorTest";
217 return name;
218 }
219
220 SelectorTestFixture()
221 {
222 this->data.push_back(createData("/a/1"));
223 this->data.push_back(createData("/b/1"));
224 this->interests.push_back(std::make_pair(Interest()
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700225 .setName("/b")
226 .setSelectors(Selectors()
227 .setChildSelector(0)),
228 this->data.back()));
Alexander Afanasyevb0c78ea2014-04-15 18:12:04 -0700229
230 this->data.push_back(createData("/c/1"));
231 this->data.push_back(createData("/b/99"));
232 this->interests.push_back(std::make_pair(Interest()
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700233 .setName("/b")
234 .setSelectors(Selectors()
235 .setChildSelector(1)),
236 this->data.back()));
Alexander Afanasyevb0c78ea2014-04-15 18:12:04 -0700237 this->data.push_back(createData("/b/5"));
238 this->data.push_back(createData("/b/55"));
239 }
240};
241
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700242class IndexTestFixture : public DatasetBase
243{
244public:
245 static const std::string&
246 getName()
247 {
248 static std::string name = "IndexTest";
249 return name;
250 }
251
252 IndexTestFixture()
253 {
254 this->data.push_back(createData("/a/b/c"));
255 this->interests.push_back(std::make_pair(Interest("/a/b/c"), this->data.back()));
Weiqi Shif0330d52014-07-09 10:54:27 -0700256 this->ids.push_back(std::make_pair(1, this->data.back()));
257 this->insert.push_back(std::make_pair(1, this->data.back()));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700258
259 this->data.push_back(createData("/a/b/d/1"));
260 this->interests.push_back(std::make_pair(Interest("/a/b/d"), this->data.back()));
261 this->interests.push_back(std::make_pair(Interest("/a/b/d/1"), this->data.back()));
Weiqi Shif0330d52014-07-09 10:54:27 -0700262 this->ids.push_back(std::make_pair(2, this->data.back()));
263 this->ids.push_back(std::make_pair(2, this->data.back()));
264 this->insert.push_back(std::make_pair(2, this->data.back()));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700265
266 this->data.push_back(createData("/a/b/d/2"));
267 this->interests.push_back(std::make_pair(Interest("/a/b/d/2"), this->data.back()));
Weiqi Shif0330d52014-07-09 10:54:27 -0700268 this->ids.push_back(std::make_pair(3, this->data.back()));
269 this->insert.push_back(std::make_pair(3, this->data.back()));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700270
271 this->data.push_back(createData("/a/b/d/3"));
272 this->interests.push_back(std::make_pair(Interest("/a/b/d/3"), this->data.back()));
Weiqi Shif0330d52014-07-09 10:54:27 -0700273 this->ids.push_back(std::make_pair(4, this->data.back()));
274 this->insert.push_back(std::make_pair(4, this->data.back()));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700275
276 this->data.push_back(createData("/a/b/d/4/I"));
277 this->interests.push_back(std::make_pair(Interest("/a/b/d/4/I"), this->data.back()));
278 this->interests.push_back(std::make_pair(Interest("/a/b/d/4"), this->data.back()));
Weiqi Shif0330d52014-07-09 10:54:27 -0700279 this->ids.push_back(std::make_pair(5, this->data.back()));
280 this->ids.push_back(std::make_pair(5, this->data.back()));
281 this->insert.push_back(std::make_pair(5, this->data.back()));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700282
283 this->data.push_back(createData("/a/b/d/4"));
284 // this->ids.push_back(std::make_pair(7, this->data.back()));
Weiqi Shif0330d52014-07-09 10:54:27 -0700285 this->insert.push_back(std::make_pair(6, this->data.back()));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700286
287 this->data.push_back(createData("/a/b/d"));
288 // this->ids.push_back(std::make_pair(8, this->data.back()));
Weiqi Shif0330d52014-07-09 10:54:27 -0700289 this->insert.push_back(std::make_pair(7, this->data.back()));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700290
291 this->data.push_back(createData("/a/b/e/1"));
292 this->interests.push_back(std::make_pair(Interest("/a/b/e"), this->data.back()));
293 this->interests.push_back(std::make_pair(Interest("/a/b/e/1"), this->data.back()));
Weiqi Shif0330d52014-07-09 10:54:27 -0700294 this->ids.push_back(std::make_pair(8, this->data.back()));
295 this->ids.push_back(std::make_pair(8, this->data.back()));
296 this->insert.push_back(std::make_pair(8, this->data.back()));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700297
298 Selectors selector_keylocator;
299 ndn::SignatureSha256WithRsa rsaSignature(this->data.back()->getSignature());
300
301 this->data.push_back(createData("/a/b/e"));
Weiqi Shif0330d52014-07-09 10:54:27 -0700302 this->ids.push_back(std::make_pair(9, this->data.back()));
303 this->insert.push_back(std::make_pair(9, this->data.back()));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700304
305 Selectors selector;
306 selector.setMinSuffixComponents(3);
307 this->interestsSelectors.push_back(std::make_pair(Interest("/a/b/d").setSelectors(selector),
Weiqi Shif0330d52014-07-09 10:54:27 -0700308 5));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700309
310 selector.setMinSuffixComponents(-1);
311 selector.setChildSelector(0);
312 this->interestsSelectors.push_back(std::make_pair(Interest("/a/b/d").setSelectors(selector),
Weiqi Shif0330d52014-07-09 10:54:27 -0700313 2));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700314
315 selector.setMinSuffixComponents(2);
316 this->interestsSelectors.push_back(std::make_pair(Interest("/a/b/d").setSelectors(selector),
Weiqi Shif0330d52014-07-09 10:54:27 -0700317 2));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700318
319 selector.setChildSelector(1);
320 this->interestsSelectors.push_back(std::make_pair(Interest("/a/b/d").setSelectors(selector),
Weiqi Shif0330d52014-07-09 10:54:27 -0700321 6));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700322
323 selector.setChildSelector(-1);
324 selector.setMaxSuffixComponents(2);
325 this->interestsSelectors.push_back(std::make_pair(Interest("/a/b").setSelectors(selector),
Weiqi Shif0330d52014-07-09 10:54:27 -0700326 1));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700327
328 ndn::name::Component from("3");
329 ndn::name::Component to("4");
330 Exclude exclude;
331 exclude.excludeRange(from, to);
332 selector.setChildSelector(1);
333 selector.setExclude(exclude);
334 this->interestsSelectors.push_back(std::make_pair(Interest("/a/b/d").setSelectors(selector),
Weiqi Shif0330d52014-07-09 10:54:27 -0700335 3));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700336
337
338 KeyLocator keylocate = rsaSignature.getKeyLocator();
339 // std::cout<<"keylocator from data = "<<keylocate.wireEncode()<<std::endl;
340 selector_keylocator.setPublisherPublicKeyLocator(keylocate);
341 this->interestsSelectors.push_back(std::make_pair
342 (Interest("/a/b/e").setSelectors(selector_keylocator), 9));
343 }
344};
345
346class ChildSelectorTestFixture : public DatasetBase
347{
348public:
349 static const std::string&
350 getName()
351 {
352 static std::string name = "storage";
353 return name;
354 }
355
356 ChildSelectorTestFixture()
357 {
358 this->data.push_back(createData("/a/b/1"));
Weiqi Shif0330d52014-07-09 10:54:27 -0700359 this->insert.push_back(std::make_pair(1, this->data.back()));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700360 this->data.push_back(createData("/a/c/1"));
Weiqi Shif0330d52014-07-09 10:54:27 -0700361 this->insert.push_back(std::make_pair(2, this->data.back()));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700362
363 this->data.push_back(createData("/a/c/2"));
Weiqi Shif0330d52014-07-09 10:54:27 -0700364 this->insert.push_back(std::make_pair(3, this->data.back()));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700365
366 this->data.push_back(createData("/b"));
Weiqi Shif0330d52014-07-09 10:54:27 -0700367 this->insert.push_back(std::make_pair(4, this->data.back()));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700368
369 Selectors selector;
370 selector.setChildSelector(1);
371 this->interestsSelectors.push_back(std::make_pair(Interest("/a").setSelectors(selector),
Weiqi Shif0330d52014-07-09 10:54:27 -0700372 2));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700373 }
374};
375
376class StorageFixture : public DatasetBase
377{
378public:
379 static const std::string&
380 getName()
381 {
382 static std::string name = "storage";
383 return name;
384 }
385
386 StorageFixture()
387 {
388 this->data.push_back(createData("/a/b/c"));
389 this->interests.push_back(std::make_pair(Interest("/a/b/c"), this->data.back()));
Weiqi Shif0330d52014-07-09 10:54:27 -0700390 this->ids.push_back(std::make_pair(1, this->data.back()));
391 this->insert.push_back(std::make_pair(1, this->data.back()));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700392
393 this->data.push_back(createData("/a/b/d/1"));
394 this->interests.push_back(std::make_pair(Interest("/a/b/d/1"), this->data.back()));
Weiqi Shif0330d52014-07-09 10:54:27 -0700395 this->ids.push_back(std::make_pair(2, this->data.back()));
396 this->insert.push_back(std::make_pair(2, this->data.back()));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700397
398 this->data.push_back(createData("/a/b/d/2"));
399 this->interests.push_back(std::make_pair(Interest("/a/b/d/2"), this->data.back()));
Weiqi Shif0330d52014-07-09 10:54:27 -0700400 this->ids.push_back(std::make_pair(3, this->data.back()));
401 this->insert.push_back(std::make_pair(3, this->data.back()));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700402
403 this->data.push_back(createData("/a/b/d/3"));
404 this->interests.push_back(std::make_pair(Interest("/a/b/d/3"), this->data.back()));
Weiqi Shif0330d52014-07-09 10:54:27 -0700405 this->ids.push_back(std::make_pair(4, this->data.back()));
406 this->insert.push_back(std::make_pair(4, this->data.back()));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700407
408 this->data.push_back(createData("/a/b/d/4"));
Weiqi Shif0330d52014-07-09 10:54:27 -0700409 this->ids.push_back(std::make_pair(5, this->data.back()));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700410 this->interests.push_back(std::make_pair(Interest("/a/b/d/4"), this->data.back()));
Weiqi Shif0330d52014-07-09 10:54:27 -0700411 this->insert.push_back(std::make_pair(5, this->data.back()));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700412
413 this->data.push_back(createData("/a/b/e/1"));
414 this->interests.push_back(std::make_pair(Interest("/a/b/e/1"), this->data.back()));
Weiqi Shif0330d52014-07-09 10:54:27 -0700415 this->ids.push_back(std::make_pair(6, this->data.back()));
416 this->insert.push_back(std::make_pair(6, this->data.back()));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700417
418 Selectors selector_keylocator;
419 ndn::SignatureSha256WithRsa rsaSignature(this->data.back()->getSignature());
420
421 this->data.push_back(createData("/a/b/e/2"));
Weiqi Shif0330d52014-07-09 10:54:27 -0700422 this->ids.push_back(std::make_pair(7, this->data.back()));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700423 this->interests.push_back(std::make_pair(Interest("/a/b/e/2"), this->data.back()));
Weiqi Shif0330d52014-07-09 10:54:27 -0700424 this->insert.push_back(std::make_pair(7, this->data.back()));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700425
426 Selectors selector;
427 selector.setChildSelector(0);
Weiqi Shif0330d52014-07-09 10:54:27 -0700428 this->interestsSelectors.push_back(std::make_pair
429 (Interest("/a/b/d").setSelectors(selector), 2));
430 this->interestDeleteCount.push_back(std::make_pair
431 (Interest("/a/b/d").setSelectors(selector), 4));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700432
433
434 selector.setChildSelector(1);
Weiqi Shif0330d52014-07-09 10:54:27 -0700435 this->interestsSelectors.push_back(std::make_pair
436 (Interest("/a/b/d").setSelectors(selector), 5));
437 this->interestDeleteCount.push_back(std::make_pair
438 (Interest("/a/b/d").setSelectors(selector), 0));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700439
440 selector.setChildSelector(-1);
441 selector.setMaxSuffixComponents(2);
Weiqi Shif0330d52014-07-09 10:54:27 -0700442 this->interestsSelectors.push_back(std::make_pair
443 (Interest("/a/b").setSelectors(selector), 1));
444 this->interestDeleteCount.push_back(std::make_pair
445 (Interest("/a/b").setSelectors(selector), 1));
446
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700447 ndn::name::Component from("3");
448 ndn::name::Component to("4");
449 Exclude exclude;
450 exclude.excludeRange(from, to);
451 selector.setChildSelector(1);
452 selector.setExclude(exclude);
Weiqi Shif0330d52014-07-09 10:54:27 -0700453 this->interestsSelectors.push_back(std::make_pair
454 (Interest("/a/b/d").setSelectors(selector), 3));
455 this->interestDeleteCount.push_back(std::make_pair
456 (Interest("/a/b/d").setSelectors(selector), 0));
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700457
458
459 KeyLocator keylocate = rsaSignature.getKeyLocator();
460 selector_keylocator.setPublisherPublicKeyLocator(keylocate);
461 this->interestsSelectors.push_back(std::make_pair
462 (Interest("/a/b/e").setSelectors(selector_keylocator),
Weiqi Shif0330d52014-07-09 10:54:27 -0700463 6));
464 this->interestDeleteCount
465 .push_back(std::make_pair(Interest("/a/b/e")
466 .setSelectors(selector_keylocator), 2));
467
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700468 }
469};
Alexander Afanasyevb0c78ea2014-04-15 18:12:04 -0700470
471typedef boost::mpl::vector< BaseTestFixture,
472 FetchByPrefixTestFixture,
473 SelectorTestFixture,
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700474 BaseSmoketestFixture<10> > DatasetFixtures;
475
476typedef boost::mpl::vector< BaseTestFixture,
Weiqi Shi28a90fb2014-07-09 10:28:55 -0700477 BaseSmoketestFixture<10> > DatasetFixtures_Sqlite;
478
479typedef boost::mpl::vector<IndexTestFixture> DatasetFixtures_Index;
480typedef boost::mpl::vector<StorageFixture> DatasetFixtures_Storage;
481typedef boost::mpl::vector<ChildSelectorTestFixture> DatasetFixtures_Selector;
Alexander Afanasyevb0c78ea2014-04-15 18:12:04 -0700482
483} // namespace tests
484} // namespace repo
485
486#endif // REPO_TESTS_DATASET_FIXTURES_HPP