e59573d7afb6c6ca28463cc714fdbb9064cc4269
[aai/traversal.git] /
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *    http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20 package org.onap.aai.rest.history;
21
22 import com.google.gson.JsonArray;
23 import com.google.gson.JsonElement;
24 import com.google.gson.JsonParser;
25 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
26 import org.janusgraph.core.JanusGraphTransaction;
27 import org.junit.Ignore;
28 import org.junit.Test;
29 import org.onap.aai.PayloadUtil;
30 import org.onap.aai.db.props.AAIProperties;
31 import org.onap.aai.dbmap.AAIGraph;
32 import org.slf4j.Logger;
33 import org.slf4j.LoggerFactory;
34 import org.springframework.http.HttpEntity;
35 import org.springframework.http.HttpMethod;
36 import org.springframework.http.HttpStatus;
37 import org.springframework.http.ResponseEntity;
38
39 import java.util.*;
40
41 import static org.hamcrest.CoreMatchers.is;
42 import static org.junit.Assert.*;
43
44 @Ignore("The lifecycle format requires the history schema to be loaded.  " +
45                 "Because aaigraph is a singleton its very complicated to have 2 different schemas loaded for testing.  " +
46                 "This needs to be addressed.")
47 public class DslConsumerHistoryLifecycleSingleNodeTest extends AbstractSpringHistoryRestTest {
48
49         private static final Logger LOGGER = LoggerFactory.getLogger(DslConsumerHistoryLifecycleSingleNodeTest.class);
50
51         @Override
52         public void createTestGraph() {
53                 JanusGraphTransaction transaction = AAIGraph.getInstance().getGraph().newTransaction();
54                 boolean success = true;
55                 try {
56                         GraphTraversalSource g = transaction.traversal();
57                         /*
58                         Pserver
59                                 - created pserver @ time 100
60                                         - equip-type = first-ps-type
61                                 - update equip-type @ 500
62                                         - equip-type = first-ps-type-update
63                                 - deleted pserver @ time 1000
64                          */
65                         g.addV().property(AAIProperties.NODE_TYPE, "pserver",
66                                         AAIProperties.SOURCE_OF_TRUTH, "JUNIT-C",
67                                         AAIProperties.START_TX_ID, "JUNIT-C",
68                                         AAIProperties.END_SOT, "JUNIT-D",
69                                         AAIProperties.END_TX_ID, "JUNIT-D",
70                                         AAIProperties.START_TS, 100L,
71                                         AAIProperties.END_TS, 1000L
72                         )
73                                         .property(AAIProperties.AAI_URI, "/cloud-infrastructure/pservers/pserver/test-pserver-dsl",
74                                                         AAIProperties.SOURCE_OF_TRUTH, "JUNIT-C",
75                                                         AAIProperties.START_TX_ID, "JUNIT-C",
76                                                         AAIProperties.END_SOT, "JUNIT-D",
77                                                         AAIProperties.END_TX_ID, "JUNIT-D",
78                                                         AAIProperties.START_TS, 100L,
79                                                         AAIProperties.END_TS, 1000L
80                                         )
81                                         .property(AAIProperties.RESOURCE_VERSION, "100",
82                                                         AAIProperties.SOURCE_OF_TRUTH, "JUNIT-C",
83                                                         AAIProperties.START_TX_ID, "JUNIT-C",
84                                                         AAIProperties.END_SOT, "JUNIT-U",
85                                                         AAIProperties.END_TX_ID, "JUNIT-U",
86                                                         AAIProperties.START_TS, 100L,
87                                                         AAIProperties.END_TS, 500L
88                                         )
89                                         .property(AAIProperties.RESOURCE_VERSION, "500",
90                                                         AAIProperties.SOURCE_OF_TRUTH, "JUNIT-U",
91                                                         AAIProperties.START_TX_ID, "JUNIT-U",
92                                                         AAIProperties.END_SOT, "JUNIT-D",
93                                                         AAIProperties.END_TX_ID, "JUNIT-D",
94                                                         AAIProperties.START_TS, 500L,
95                                                         AAIProperties.END_TS, 1000L
96                                         )
97                                         .property("hostname", "test-pserver-dsl",
98                                                         AAIProperties.SOURCE_OF_TRUTH, "JUNIT-C",
99                                                         AAIProperties.START_TX_ID, "JUNIT-C",
100                                                         AAIProperties.END_SOT, "JUNIT-D",
101                                                         AAIProperties.END_TX_ID, "JUNIT-D",
102                                                         AAIProperties.START_TS, 100L,
103                                                         AAIProperties.END_TS, 1000L
104                                         )
105                                         .property("in-maint", false,
106                                                         AAIProperties.SOURCE_OF_TRUTH, "JUNIT-C",
107                                                         AAIProperties.START_TX_ID, "JUNIT-C",
108                                                         AAIProperties.END_SOT, "JUNIT-D",
109                                                         AAIProperties.END_TX_ID, "JUNIT-D",
110                                                         AAIProperties.START_TS, 100L,
111                                                         AAIProperties.END_TS, 1000L
112                                         )
113                                         .property("equip-type", "first-ps-type",
114                                                         AAIProperties.SOURCE_OF_TRUTH, "JUNIT-C",
115                                                         AAIProperties.START_TX_ID, "JUNIT-C",
116                                                         AAIProperties.END_SOT, "JUNIT-U",
117                                                         AAIProperties.END_TX_ID, "JUNIT-U",
118                                                         AAIProperties.START_TS, 100L,
119                                                         AAIProperties.END_TS, 500L
120                                         )
121                                         .property("equip-type", "first-ps-type-update",
122                                                         AAIProperties.SOURCE_OF_TRUTH, "JUNIT-U",
123                                                         AAIProperties.START_TX_ID, "JUNIT-U",
124                                                         AAIProperties.END_SOT, "JUNIT-D",
125                                                         AAIProperties.END_TX_ID, "JUNIT-D",
126                                                         AAIProperties.START_TS, 500L,
127                                                         AAIProperties.END_TS, 1000L
128                                         )
129                                         .property(AAIProperties.SOURCE_OF_TRUTH, "JUNIT-C",
130                                                         AAIProperties.SOURCE_OF_TRUTH, "JUNIT-C",
131                                                         AAIProperties.START_TX_ID, "JUNIT-C",
132                                                         AAIProperties.END_SOT, "JUNIT-D",
133                                                         AAIProperties.END_TX_ID, "JUNIT-D",
134                                                         AAIProperties.START_TS, 100L,
135                                                         AAIProperties.END_TS, 1000L
136                                         )
137                                         .property(AAIProperties.END_SOT, "JUNIT-D",
138                                                         AAIProperties.SOURCE_OF_TRUTH, "JUNIT-D",
139                                                         AAIProperties.START_TX_ID, "JUNIT-D",
140                                                         AAIProperties.END_SOT, "JUNIT-D",
141                                                         AAIProperties.END_TX_ID, "JUNIT-D",
142                                                         AAIProperties.START_TS, 100L,
143                                                         AAIProperties.END_TS, 1000L
144                                         )
145                                         .property(AAIProperties.START_TS, 100L,
146                                                         AAIProperties.SOURCE_OF_TRUTH, "JUNIT-C",
147                                                         AAIProperties.START_TX_ID, "JUNIT-C",
148                                                         AAIProperties.END_SOT, "JUNIT-D",
149                                                         AAIProperties.END_TX_ID, "JUNIT-D",
150                                                         AAIProperties.START_TS, 100L,
151                                                         AAIProperties.END_TS, 1000L
152                                         )
153                                         .property(AAIProperties.END_TS, 1000L,
154                                                         AAIProperties.SOURCE_OF_TRUTH, "JUNIT-D",
155                                                         AAIProperties.START_TX_ID, "JUNIT-D",
156                                                         AAIProperties.END_SOT, "JUNIT-D",
157                                                         AAIProperties.END_TX_ID, "JUNIT-D",
158                                                         AAIProperties.START_TS, 1000L,
159                                                         AAIProperties.END_TS, 1000L
160                                         )
161                                         .next();
162
163                 } catch (Exception ex) {
164                         success = false;
165                 } finally {
166                         if (success) {
167                                 transaction.commit();
168                         } else {
169                                 transaction.rollback();
170                                 fail("Unable to setup the graph");
171                         }
172                 }
173         }
174
175         private JsonArray getResultsForPserverLookupByHostname(String endpoint) throws Exception {
176                 return getResultsForPserverLookupByHostnameAndAnother(endpoint, "");
177         }
178
179         private JsonArray getResultsForPserverLookupByHostnameAndAnother(String endpoint, String additionalFilterInParen) throws Exception {
180                 Map<String, String> dslQueryMap = new HashMap<>();
181                 dslQueryMap.put("dsl-query", "pserver*('hostname','test-pserver-dsl')" + additionalFilterInParen);
182                 String payload = PayloadUtil.getTemplatePayload("dsl-query.json", dslQueryMap);
183                 httpEntity = new HttpEntity(payload, headers);
184                 ResponseEntity responseEntity = restTemplate.exchange(baseUrl + endpoint, HttpMethod.PUT, httpEntity, String.class);
185                 JsonArray results = new JsonParser().parse(responseEntity.getBody().toString()).getAsJsonObject().getAsJsonArray("results");
186                 LOGGER.debug("Response for PUT request with uri {} : {}", baseUrl + endpoint, responseEntity.getBody());
187
188                 assertNotNull("Response from /aai/v14/dsl is not null", responseEntity);
189                 assertEquals("Expected the response to be 200", HttpStatus.OK, responseEntity.getStatusCode());
190                 return results;
191         }
192
193
194         private void verifyEquipTypeValues(JsonArray results, String... expectedEquipTypes) {
195                 List<String> expected = Arrays.asList(expectedEquipTypes);
196                 final List<String> actualEquipType = new ArrayList<>();
197                 for (JsonElement result : results) {
198                         for (JsonElement property : result.getAsJsonObject().get("properties").getAsJsonArray()) {
199                                 if (property.getAsJsonObject().get("key").getAsString().equals("equip-type")) {
200                                         if (property.getAsJsonObject().has("value") && !property.getAsJsonObject().get("value").isJsonNull()) {
201                                                 actualEquipType.add(property.getAsJsonObject().get("value").getAsString());
202                                         } else {
203                                                 actualEquipType.add(null);
204                                         }
205                                 }
206                         }
207                 }
208                 assertThat("Verify equip-type in lifecycle", actualEquipType, is(expected));
209         }
210
211         private void verifyEquipTypeSoTs(JsonArray results, String... expectedSTOs) {
212                 List<String> expected = Arrays.asList(expectedSTOs);
213                 final List<String> actualEquipType = new ArrayList<>();
214                 for (JsonElement result : results) {
215                         for (JsonElement property : result.getAsJsonObject().get("properties").getAsJsonArray()) {
216                                 if (property.getAsJsonObject().get("key").getAsString().equals("equip-type")) {
217                                         if (property.getAsJsonObject().has("sot") && !property.getAsJsonObject().get("sot").isJsonNull()) {
218                                                 actualEquipType.add(property.getAsJsonObject().get("sot").getAsString());
219                                         } else {
220                                                 actualEquipType.add(null);
221                                         }
222                                 }
223                         }
224                 }
225                 assertThat("Verify equip-type SoTs in lifecycle", actualEquipType, is(expected));
226         }
227
228         private void verifyEquipTypeTxId(JsonArray results, String... expectedSTOs) {
229                 List<String> expected = Arrays.asList(expectedSTOs);
230                 final List<String> actualEquipType = new ArrayList<>();
231                 for (JsonElement result : results) {
232                         for (JsonElement property : result.getAsJsonObject().get("properties").getAsJsonArray()) {
233                                 if (property.getAsJsonObject().get("key").getAsString().equals("equip-type")) {
234                                         if (property.getAsJsonObject().has("tx-id") && !property.getAsJsonObject().get("tx-id").isJsonNull()) {
235                                                 actualEquipType.add(property.getAsJsonObject().get("tx-id").getAsString());
236                                         } else {
237                                                 actualEquipType.add(null);
238                                         }
239                                 }
240                         }
241                 }
242                 assertThat("Verify equip-type tx-ids in lifecycle", actualEquipType, is(expected));
243         }
244
245         private void verifyEquipTypeTimestamps(JsonArray results, Long... expectedSTOs) {
246                 List<Long> expected = Arrays.asList(expectedSTOs);
247                 final List<Long> actualEquipType = new ArrayList<>();
248                 for (JsonElement result : results) {
249                         for (JsonElement property : result.getAsJsonObject().get("properties").getAsJsonArray()) {
250                                 if (property.getAsJsonObject().get("key").getAsString().equals("equip-type")) {
251                                         if (property.getAsJsonObject().has("timestamp") && !property.getAsJsonObject().get("timestamp").isJsonNull()) {
252                                                 actualEquipType.add(property.getAsJsonObject().get("timestamp").getAsLong());
253                                         } else {
254                                                 actualEquipType.add(null);
255                                         }
256                                 }
257                         }
258                 }
259                 assertThat("Verify equip-type timestamps in lifecycle", actualEquipType, is(expected));
260         }
261
262         private void verifyNodeTimestamps(JsonArray results, Long... nodeTimestamps) {
263                 List<Long> expected = Arrays.asList(nodeTimestamps);
264                 final List<Long> actualEquipType = new ArrayList<>();
265                 for (JsonElement result : results) {
266                         result.getAsJsonObject().get("node-actions").getAsJsonArray().forEach(jsonElement ->
267                                         actualEquipType.add(jsonElement.getAsJsonObject().get("timestamp").getAsLong()));
268                 }
269                 assertThat("Verify node-changes timestamps in lifecycle", actualEquipType, is(expected));
270         }
271
272
273         @Test
274         public void lifecycleQueryNoStartOrEndTsTest() throws Exception {
275
276                 String endpoint = "/aai/v14/dsl?format=lifecycle";
277                 JsonArray results = getResultsForPserverLookupByHostname(endpoint);
278                 assertEquals("Result size", 1, results.size());
279
280                 verifyEquipTypeValues(results, "first-ps-type-update", "first-ps-type");
281                 verifyEquipTypeSoTs(results, "JUNIT-U", "JUNIT-C");
282                 verifyEquipTypeTxId(results, "JUNIT-U", "JUNIT-C");
283                 verifyEquipTypeTimestamps(results, 500L, 100L);
284                 verifyNodeTimestamps(results, 1000L, 100L);
285
286
287                 String equipType = "first-ps-type";
288                 results = getResultsForPserverLookupByHostnameAndAnother(endpoint, "('equip-type','" + equipType + "')");
289                 assertEquals("Filter equip-type on " + equipType, 1, results.size());
290                 verifyEquipTypeValues(results, "first-ps-type-update", "first-ps-type");
291                 verifyEquipTypeSoTs(results, "JUNIT-U", "JUNIT-C");
292                 verifyEquipTypeTxId(results, "JUNIT-U", "JUNIT-C");
293                 verifyEquipTypeTimestamps(results, 500L, 100L);
294                 verifyNodeTimestamps(results, 1000L, 100L);
295
296                 equipType = "other-ps-type-recreated";
297                 results = getResultsForPserverLookupByHostnameAndAnother(endpoint, "('equip-type','" + equipType + "')");
298                 assertEquals("Filter equip-type on " + equipType, 0, results.size());
299         }
300
301
302
303         @Test
304         public void lifecycleQueryStartTsBeforeCreationTimeTest() throws Exception {
305
306                 String endpoint = "/aai/v14/dsl?format=lifecycle&startTs=50";
307                 JsonArray results = getResultsForPserverLookupByHostname(endpoint);
308                 assertEquals("Result size", 1, results.size());
309
310                 verifyEquipTypeValues(results, "first-ps-type-update", "first-ps-type");
311                 verifyEquipTypeSoTs(results, "JUNIT-U", "JUNIT-C");
312                 verifyEquipTypeTxId(results, "JUNIT-U", "JUNIT-C");
313                 verifyEquipTypeTimestamps(results, 500L, 100L);
314                 verifyNodeTimestamps(results, 1000L, 100L);
315
316
317                 String equipType = "first-ps-type";
318                 results = getResultsForPserverLookupByHostnameAndAnother(endpoint, "('equip-type','" + equipType + "')");
319                 assertEquals("Filter equip-type on " + equipType, 1, results.size());
320                 verifyEquipTypeValues(results, "first-ps-type-update", "first-ps-type");
321                 verifyEquipTypeSoTs(results, "JUNIT-U", "JUNIT-C");
322                 verifyEquipTypeTxId(results, "JUNIT-U", "JUNIT-C");
323                 verifyEquipTypeTimestamps(results, 500L, 100L);
324                 verifyNodeTimestamps(results, 1000L, 100L);
325
326                 equipType = "other-ps-type-recreated";
327                 results = getResultsForPserverLookupByHostnameAndAnother(endpoint, "('equip-type','" + equipType + "')");
328                 assertEquals("Filter equip-type on " + equipType, 0, results.size());
329         }
330
331         @Test
332         public void lifecycleQueryStartTsAtCreationTimeTest() throws Exception {
333
334                 String endpoint = "/aai/v14/dsl?format=lifecycle&startTs=100";
335                 JsonArray results = getResultsForPserverLookupByHostname(endpoint);
336                 assertEquals("Result size", 1, results.size());
337
338                 verifyEquipTypeValues(results, "first-ps-type-update", "first-ps-type");
339                 verifyEquipTypeSoTs(results, "JUNIT-U", "JUNIT-C");
340                 verifyEquipTypeTxId(results, "JUNIT-U", "JUNIT-C");
341                 verifyEquipTypeTimestamps(results, 500L, 100L);
342                 verifyNodeTimestamps(results, 1000L, 100L);
343
344
345                 String equipType = "first-ps-type";
346                 results = getResultsForPserverLookupByHostnameAndAnother(endpoint, "('equip-type','" + equipType + "')");
347                 assertEquals("Filter equip-type on " + equipType, 1, results.size());
348                 verifyEquipTypeValues(results, "first-ps-type-update", "first-ps-type");
349                 verifyEquipTypeSoTs(results, "JUNIT-U", "JUNIT-C");
350                 verifyEquipTypeTxId(results, "JUNIT-U", "JUNIT-C");
351                 verifyEquipTypeTimestamps(results, 500L, 100L);
352                 verifyNodeTimestamps(results, 1000L, 100L);
353
354                 equipType = "other-ps-type-recreated";
355                 results = getResultsForPserverLookupByHostnameAndAnother(endpoint, "('equip-type','" + equipType + "')");
356                 assertEquals("Filter equip-type on " + equipType, 0, results.size());
357         }
358
359         @Test
360         public void lifecycleQueryStartTsAfterCreationTimeTest() throws Exception {
361
362                 String endpoint = "/aai/v14/dsl?format=lifecycle&startTs=300";
363                 JsonArray results = getResultsForPserverLookupByHostname(endpoint);
364                 assertEquals("Result size", 1, results.size());
365
366                 verifyEquipTypeValues(results, "first-ps-type-update");
367                 verifyEquipTypeSoTs(results, "JUNIT-U");
368                 verifyEquipTypeTxId(results, "JUNIT-U");
369                 verifyEquipTypeTimestamps(results, 500L);
370                 verifyNodeTimestamps(results, 1000L);
371
372
373                 String equipType = "first-ps-type";
374                 results = getResultsForPserverLookupByHostnameAndAnother(endpoint, "('equip-type','" + equipType + "')");
375                 assertEquals("Filter equip-type on " + equipType, 1, results.size());
376                 verifyEquipTypeValues(results, "first-ps-type-update");
377                 verifyEquipTypeSoTs(results, "JUNIT-U");
378                 verifyEquipTypeTxId(results, "JUNIT-U");
379                 verifyEquipTypeTimestamps(results, 500L);
380                 verifyNodeTimestamps(results, 1000L);
381
382                 equipType = "other-ps-type-recreated";
383                 results = getResultsForPserverLookupByHostnameAndAnother(endpoint, "('equip-type','" + equipType + "')");
384                 assertEquals("Filter equip-type on " + equipType, 0, results.size());
385         }
386
387         @Test
388         public void lifecycleQueryStartTsAtUpdateTimeTest() throws Exception {
389
390                 String endpoint = "/aai/v14/dsl?format=lifecycle&startTs=500";
391                 JsonArray results = getResultsForPserverLookupByHostname(endpoint);
392                 assertEquals("Result size", 1, results.size());
393
394                 verifyEquipTypeValues(results, "first-ps-type-update");
395                 verifyEquipTypeSoTs(results, "JUNIT-U");
396                 verifyEquipTypeTxId(results, "JUNIT-U");
397                 verifyEquipTypeTimestamps(results, 500L);
398                 verifyNodeTimestamps(results, 1000L);
399
400
401                 String equipType = "first-ps-type";
402                 results = getResultsForPserverLookupByHostnameAndAnother(endpoint, "('equip-type','" + equipType + "')");
403                 assertEquals("Filter equip-type on " + equipType, 1, results.size());
404                 verifyEquipTypeValues(results, "first-ps-type-update");
405                 verifyEquipTypeSoTs(results, "JUNIT-U");
406                 verifyEquipTypeTxId(results, "JUNIT-U");
407                 verifyEquipTypeTimestamps(results, 500L);
408                 verifyNodeTimestamps(results, 1000L);
409
410                 equipType = "other-ps-type-recreated";
411                 results = getResultsForPserverLookupByHostnameAndAnother(endpoint, "('equip-type','" + equipType + "')");
412                 assertEquals("Filter equip-type on " + equipType, 0, results.size());
413         }
414
415         @Test
416         public void lifecycleQueryStartTsAfterUpdateTimeTest() throws Exception {
417
418                 String endpoint = "/aai/v14/dsl?format=lifecycle&startTs=700";
419                 JsonArray results = getResultsForPserverLookupByHostname(endpoint);
420                 assertEquals("Result size", 1, results.size());
421
422                 verifyEquipTypeValues(results);
423                 verifyEquipTypeSoTs(results);
424                 verifyEquipTypeTxId(results);
425                 verifyEquipTypeTimestamps(results);
426                 verifyNodeTimestamps(results, 1000L);
427
428
429                 String equipType = "first-ps-type";
430                 results = getResultsForPserverLookupByHostnameAndAnother(endpoint, "('equip-type','" + equipType + "')");
431                 assertEquals("Filter equip-type on " + equipType, 0, results.size());
432
433                 equipType = "other-ps-type-recreated";
434                 results = getResultsForPserverLookupByHostnameAndAnother(endpoint, "('equip-type','" + equipType + "')");
435                 assertEquals("Filter equip-type on " + equipType, 0, results.size());
436         }
437
438         @Test
439         public void lifecycleQueryStartTsAtDeleteTimeTest() throws Exception {
440
441                 String endpoint = "/aai/v14/dsl?format=lifecycle&startTs=1000";
442                 JsonArray results = getResultsForPserverLookupByHostname(endpoint);
443                 assertEquals("Result size", 1, results.size());
444                 assertEquals("properties size should be 0", results.get(0).getAsJsonObject().get("properties").getAsJsonArray().size(), 0);
445
446                 String equipType = "first-ps-type";
447                 results = getResultsForPserverLookupByHostnameAndAnother(endpoint, "('equip-type','" + equipType + "')");
448                 assertEquals("Filter equip-type on " + equipType, 0, results.size());
449         }
450
451         @Test
452         public void lifecycleQueryStartTsAfterDeleteTimeTest() throws Exception {
453
454                 String endpoint = "/aai/v14/dsl?format=lifecycle&startTs=5000";
455                 JsonArray results = getResultsForPserverLookupByHostname(endpoint);
456                 assertEquals("Result size", 0, results.size());
457
458                 String equipType = "first-ps-type";
459                 results = getResultsForPserverLookupByHostnameAndAnother(endpoint, "('equip-type','" + equipType + "')");
460                 assertEquals("Filter equip-type on " + equipType, 0, results.size());
461
462                 equipType = "other-ps-type-recreated";
463                 results = getResultsForPserverLookupByHostnameAndAnother(endpoint, "('equip-type','" + equipType + "')");
464                 assertEquals("Filter equip-type on " + equipType, 0, results.size());
465         }
466
467 }