c420075105067ec26d76e8bfc045b2aec60bd620
[ccsdk/sli/adaptors.git] / resource-assignment / provider / src / test / java / jtest / org / onap / ccsdk / sli / adaptors / ra / TestReserve.java
1 package jtest.org.onap.ccsdk.sli.adaptors.ra;
2
3 import java.util.ArrayList;
4 import java.util.HashMap;
5 import java.util.List;
6 import java.util.Map;
7 import org.junit.Assert;
8 import org.junit.FixMethodOrder;
9 import org.junit.Test;
10 import org.junit.runner.RunWith;
11 import org.junit.runners.MethodSorters;
12 import org.onap.ccsdk.sli.adaptors.ra.ResourceAllocator;
13 import org.onap.ccsdk.sli.adaptors.ra.comp.ResourceEntity;
14 import org.onap.ccsdk.sli.adaptors.ra.comp.ResourceRequest;
15 import org.onap.ccsdk.sli.adaptors.ra.comp.ResourceResponse;
16 import org.onap.ccsdk.sli.adaptors.ra.comp.ResourceTarget;
17 import org.onap.ccsdk.sli.adaptors.rm.data.AllocationStatus;
18 import org.onap.ccsdk.sli.adaptors.util.str.StrUtil;
19 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
20 import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus;
21 import org.slf4j.Logger;
22 import org.slf4j.LoggerFactory;
23 import org.springframework.beans.factory.annotation.Autowired;
24 import org.springframework.jdbc.core.JdbcTemplate;
25 import org.springframework.test.context.ContextConfiguration;
26 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
27 import jtest.util.org.onap.ccsdk.sli.adaptors.ra.TestTable;
28
29 @RunWith(SpringJUnit4ClassRunner.class)
30 @ContextConfiguration(locations = {"classpath:test-context.xml"})
31 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
32 public class TestReserve {
33
34     private static final Logger log = LoggerFactory.getLogger(TestReserve.class);
35
36     private JdbcTemplate jdbcTemplate;
37
38     private static final String[] RESOURCE_COLUMNS = {"asset_id", "resource_name", "resource_type", "lt_used"};
39
40     private static final String[] ALLOCATION_ITEM_COLUMNS = {"resource_id", "application_id", "resource_set_id",
41             "resource_union_id", "resource_share_group_list", "lt_used", "allocation_time"};
42
43
44     @Autowired
45     public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
46         this.jdbcTemplate = jdbcTemplate;
47     }
48
49     @Autowired(required = true)
50     private ResourceAllocator resourceAllocator;
51
52     /*
53      * @Autowired(required = true) private ResourceAllocatorApi resourceAllocatorApi;
54      */
55
56     @Autowired(required = true)
57     private DataSetup dataSetup;
58
59     @Test
60     public void test001() throws Exception {
61         String t = "001";
62         log.info("============== reserve " + t + " ================================");
63         log.info("=== Test successful response - new start - all resources available");
64
65         // String service1 = "reserve" + t + "/service1";
66
67         dataSetup.cleanup();
68
69         TestTable resource = new TestTable(jdbcTemplate, "RESOURCE", "resource_id", RESOURCE_COLUMNS);
70         TestTable allocationItem =
71                 new TestTable(jdbcTemplate, "ALLOCATION_ITEM", "allocation_item_id", ALLOCATION_ITEM_COLUMNS);
72
73
74         SvcLogicContext ctx = new SvcLogicContext();
75         ctx.setAttribute("ra-input.service-model", "ADIG");
76         ctx.setAttribute("ra-input.check-only", "false");
77         ctx.setAttribute("ra-input.reservation-entity-type", "SI");
78         ctx.setAttribute("ra-input.reservation-entity-id", "ICOREPVCID-123456");
79         ctx.setAttribute("ra-input.reservation-entity-data.service-speed", "100");
80         ctx.setAttribute("ra-input.reservation-entity-data.service-speed-unit", "Mbps");
81
82         ctx.setAttribute("ra-input.reservation-target-data.vnf-type", "VPE");
83         ctx.setAttribute("ra-input.reservation-target-data.vpe-name", "mdt300vpe54");
84         ctx.setAttribute("ra-input.reservation-target-id", "mdt300vpe54");
85         ctx.setAttribute("ra-input.reservation-target-type", "VNF");
86
87         ctx.setAttribute("ra-input.reservation-target-data.max-vpe-bandwidth-mbps", "5000");
88
89
90         QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
91
92         Assert.assertTrue(st == QueryStatus.SUCCESS);
93
94         resource.print();
95         allocationItem.print();
96
97         ctx.setAttribute("ra-input.service-model", "ADIG");
98         ctx.setAttribute("ra-input.check-only", "false");
99         ctx.setAttribute("ra-input.reservation-entity-type", "SI");
100         ctx.setAttribute("ra-input.reservation-entity-id", "ICOREPVCID-123456");
101         ctx.setAttribute("ra-input.reservation-entity-data.service-speed", "100");
102         ctx.setAttribute("ra-input.reservation-entity-data.service-speed-unit", "Mbps");
103
104         ctx.setAttribute("ra-input.reservation-target-data.service-speed", "100");
105         ctx.setAttribute("ra-input.reservation-target-data.service-speed-unit", "Mbps");
106         ctx.setAttribute("ra-input.reservation-target-id", "ICORESITEID-123456");
107         ctx.setAttribute("ra-input.reservation-target-type", "Port");
108
109
110         st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
111
112         Assert.assertTrue(st == QueryStatus.SUCCESS);
113
114         ctx.setAttribute("ra-input.service-model", "ADIG");
115         ctx.setAttribute("ra-input.check-only", "false");
116         ctx.setAttribute("ra-input.reservation-entity-type", "SI");
117         ctx.setAttribute("ra-input.reservation-entity-id", "ICOREPVCID-123456");
118         ctx.setAttribute("ra-input.reservation-entity-data.service-speed", "100");
119         ctx.setAttribute("ra-input.reservation-entity-data.service-speed-unit", "Mbps");
120
121         ctx.setAttribute("ra-input.reservation-target-data.vnf-type", "VPE");
122         ctx.setAttribute("ra-input.reservation-target-data.vpe-name", "mdt300vpe54");
123         ctx.setAttribute("ra-input.reservation-target-id", "mdt300vpe54");
124         ctx.setAttribute("ra-input.reservation-target-type", "AffinityLink");
125
126
127         st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
128
129         Assert.assertTrue(st == QueryStatus.SUCCESS);
130
131         resource.print();
132         allocationItem.print();
133
134
135         /* Query Using ReservationEntityId using ServiceLogicContext */
136         ctx = new SvcLogicContext();
137         ctx.setAttribute("ra-input.service-model", "ADIG");
138         ctx.setAttribute("ra-input.reservation-entity-id", "ICOREPVCID-123456");
139         ctx.setAttribute("ra-input.reservation-entity-type", "SI");
140
141
142         st = resourceAllocator.query("NetworkCapacity", false, null, null, null, null, ctx);
143         Assert.assertTrue(st == QueryStatus.SUCCESS);
144
145
146         /* Query Using ReservationTargetId using ServiceLogicContext */
147         ctx = new SvcLogicContext();
148         ctx.setAttribute("ra-input.service-model", "ADIG");
149         ctx.setAttribute("ra-input.reservation-target-id", "ICORESITEID-123456");
150         ctx.setAttribute("ra-input.reservation-target-type", "Port");
151         ctx.setAttribute("ra-input.resource-name", "Bandwidth");
152
153         st = resourceAllocator.query("NetworkCapacity", false, null, null, null, null, ctx);
154         Assert.assertTrue(st == QueryStatus.SUCCESS);
155
156         log.info("========================  Query Using ResourceEntity==============================");
157         /* Query Using ResourceEntity bean */
158         ResourceEntity sd = new ResourceEntity();
159         sd.resourceEntityId = "ICOREPVCID-123456";
160         sd.resourceEntityType = "SI";
161
162
163         ResourceRequest rr = new ResourceRequest();
164         rr.serviceModel = "ADIG";
165         rr.resourceName = "cust-vlan-id";
166         rr.requestType = "New";
167         rr.rangeMaxOverride = -1;
168         rr.rangeMinOverride = -1;
169
170         List<ResourceResponse> rsList = new ArrayList<>();
171         resourceAllocator.query(sd, null, null, rsList);
172
173         rsList.forEach(r -> {
174             StrUtil.info(log, r);
175         });
176
177         log.info("========================  release Using ResourceEntity==============================");
178         rsList = new ArrayList<>();
179         AllocationStatus status = resourceAllocator.release(sd);
180         Assert.assertTrue(status == AllocationStatus.Success);
181
182
183         log.info("========================  Query Using ResourceEntity==============================");
184         rsList = new ArrayList<>();
185         resourceAllocator.query(sd, null, null, rsList);
186
187
188         rsList.forEach(r -> {
189             StrUtil.info(log, r);
190         });
191
192     }
193
194     @Test
195     public void test002() throws Exception {
196         String t = "002";
197         log.info("============== reserve " + t + " ================================");
198         log.info("=== Test successful response - new start - all resources available");
199
200         Map<String, String> data = new HashMap<>();
201         data.put("service-speed", "100");
202         data.put("service-speed-unit", "Mbps");
203
204         ResourceEntity sd = new ResourceEntity();
205         sd.resourceEntityId = "ICOREPVCID-123456";
206         sd.resourceEntityType = "SI";
207         sd.data = data;
208
209         data = new HashMap<>();
210         data.put("vnf-type", "VPE");
211         data.put("vpe-name", "mdt300vpe54");
212         data.put("max-vpe-bandwidth-mbps", "5000");
213
214         ResourceTarget rt = new ResourceTarget();
215         rt.resourceTargetId = "mdt300vpe54";
216         rt.resourceTargetType = "VNF";
217         rt.data = data;
218
219         ResourceRequest rr = new ResourceRequest();
220         rr.serviceModel = "ADIG";
221         // rr.resourceName = "cust-vlan-id";
222         rr.requestType = "New";
223         rr.rangeMaxOverride = -1;
224         rr.rangeMinOverride = -1;
225
226         List<ResourceResponse> rsList = new ArrayList<>();
227
228         resourceAllocator.reserve(sd, rt, rr, rsList);
229
230         rsList.forEach(r -> {
231             StrUtil.info(log, r);
232         });
233
234         log.info("========================  Query + t ==============================");
235         rsList = new ArrayList<>();
236         resourceAllocator.query(sd, null, rr, rsList);
237
238         rsList.forEach(r -> {
239             StrUtil.info(log, r);
240         });
241
242     }
243     
244     
245     @Test
246         public void test003() throws Exception {
247                 String t = "003";
248                 log.info("============== reserve " + t + " ================================");
249                 log.info("=== Test successful response - new start - all resources available");
250                 
251                 ResourceEntity sd = new ResourceEntity();
252                 sd.resourceEntityId = "gblond2003me6";
253                 sd.resourceEntityType = "VNF";
254                 
255                 ResourceTarget rt = new ResourceTarget();
256                 rt.resourceTargetId = "MDTWNJ21A5";
257                 rt.resourceTargetType = "Site";
258
259                 
260                 ResourceRequest rr= new ResourceRequest();
261                 rr.serviceModel = "MY-SERV-MODEL";
262                 rr.resourceName = "VPE-Cust";
263                 //rr.requestType = "New";
264                 //rr.rangeMaxOverride = 5;
265                 //rr.rangeMinOverride = 5;
266                 
267                 List <ResourceResponse> rsList = new ArrayList<ResourceResponse>();
268                 resourceAllocator.reserve(sd, rt, rr, rsList);
269                 
270                 rsList.forEach(r -> {
271                         StrUtil.info(log, r);
272                 });
273                 
274                 log.info("========================  Query + t ==============================");
275                 rsList = new ArrayList<org.onap.ccsdk.sli.adaptors.ra.comp.ResourceResponse>();
276                 resourceAllocator.query(sd, null, rr, rsList);
277                 
278                 rsList.forEach(r -> {
279                         StrUtil.info(log, r);
280                 });
281
282         }
283         
284         
285         
286         
287         @Test
288         public void test004() throws Exception {
289                 String t = "004";
290                 log.info("============== reserve " + t + " ================================");
291                 log.info("=== Test successful response - new start - all resources available");
292                 
293                 ResourceEntity sd = new ResourceEntity();
294                 sd.resourceEntityId = "gblond2003me6";
295                 sd.resourceEntityType = "VNF";
296                 
297                 ResourceTarget rt = new ResourceTarget();
298                 rt.resourceTargetId = "MDTWNJ21A5";
299                 rt.resourceTargetType = "Site";
300
301                 List<ResourceRequest> rrs = new ArrayList<ResourceRequest>();
302                 ResourceRequest rr= new ResourceRequest();
303                 rr.serviceModel = "MY-SERV-MODEL";
304                 rr.resourceName = "VPE-Cust";
305                 rrs.add(rr);
306                 
307                 rr= new ResourceRequest();
308                 rr.serviceModel = "MY-SERV-MODEL";
309                 rr.resourceName = "VPE-Core1";
310                 rrs.add(rr);
311                 
312                 rr= new ResourceRequest();
313                 rr.serviceModel = "MY-SERV-MODEL";
314                 rr.resourceName = "VPE-Core2";
315                 rrs.add(rr);
316                 
317                 
318                 
319                 List <ResourceResponse> rsList = new ArrayList<ResourceResponse>();
320                 //resourceAllocator.reserve(sd, rt, rrs, rsList);
321                 
322                 rsList.forEach(r -> {
323                         StrUtil.info(log, r);
324                 });
325                 
326                 log.info("========================  Query + t ==============================");
327                 rsList = new ArrayList<org.onap.ccsdk.sli.adaptors.ra.comp.ResourceResponse>();
328                 resourceAllocator.query(sd, null, rr, rsList);
329                 
330                 rsList.forEach(r -> {
331                         StrUtil.info(log, r);
332                 });
333
334         }
335         
336         
337         @Test
338         public void test005() throws Exception {
339                 String t = "005";
340                 log.info("============== reserve " + t + " ================================");
341                 log.info("=== Test successful response - new start - all resources available");
342
343                 //String service1 = "reserve" + t + "/service1";
344
345                 dataSetup.cleanup();
346                 
347                 TestTable resource = new TestTable(jdbcTemplate, "RESOURCE", "resource_id", RESOURCE_COLUMNS);
348                 TestTable allocationItem = new TestTable(jdbcTemplate, "ALLOCATION_ITEM", "allocation_item_id",
349                                 ALLOCATION_ITEM_COLUMNS);
350                 
351                 
352                 SvcLogicContext ctx = new SvcLogicContext();
353                 ctx.setAttribute("ra-input.service-model", "MY-SERV-MODEL-1");
354                 ctx.setAttribute("ra-input.check-only", "false");
355                 ctx.setAttribute("ra-input.reservation-entity-type", "VPE-Cust");
356                 ctx.setAttribute("ra-input.reservation-entity-id", "gblond2003me6");
357
358                 ctx.setAttribute("ra-input.reservation-target-id", "MDTWNJ21A5");
359                 ctx.setAttribute("ra-input.reservation-target-type", "Site");
360                 
361                 ctx.setAttribute("ra-input.resource-name", "cust-vlan-id");
362
363                 
364                 QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
365                 
366                 Assert.assertTrue(st == QueryStatus.SUCCESS);
367                 
368                 resource.print();
369                 allocationItem.print();
370                 
371                 ctx = new SvcLogicContext();
372                 ctx.setAttribute("ra-input.service-model", "MY-SERV-MODEL-1");
373                 ctx.setAttribute("ra-input.check-only", "false");
374                 ctx.setAttribute("ra-input.reservation-entity-type", "VPE-Core1");
375                 ctx.setAttribute("ra-input.reservation-entity-id", "gblond2003me6");
376
377                 ctx.setAttribute("ra-input.reservation-target-id", "MDTWNJ21A5");
378                 ctx.setAttribute("ra-input.reservation-target-type", "Site");
379                 
380                 ctx.setAttribute("ra-input.resource-name", "vlan-id-inner");
381
382                 
383                 st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
384                 
385                 Assert.assertTrue(st == QueryStatus.SUCCESS);
386                 
387                 resource.print();
388                 allocationItem.print();
389                 
390                 ctx = new SvcLogicContext();
391                 ctx.setAttribute("ra-input.service-model", "MY-SERV-MODEL-1");
392                 ctx.setAttribute("ra-input.check-only", "false");
393                 ctx.setAttribute("ra-input.reservation-entity-type", "VPE-Core2");
394                 ctx.setAttribute("ra-input.reservation-entity-id", "gblond2003me6");
395
396                 ctx.setAttribute("ra-input.reservation-target-id", "MDTWNJ21A5");
397                 ctx.setAttribute("ra-input.reservation-target-type", "Site");
398                 
399                 ctx.setAttribute("ra-input.resource-name", "vlan-id-inner");
400                 ctx.setAttribute("ra-input.replace", "false");
401
402                 
403                 st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
404                 
405                 Assert.assertTrue(st == QueryStatus.SUCCESS);
406                 
407                 resource.print();
408                 allocationItem.print();
409                 
410                 
411                 /*Query Using ReservationEntityId using ServiceLogicContext*/
412                 ctx = new SvcLogicContext();
413                 ctx.setAttribute("ra-input.service-model", "MY-SERV-MODEL-1");
414                 ctx.setAttribute("ra-input.reservation-entity-id", "gblond2003me6");
415                 ctx.setAttribute("ra-input.reservation-entity-type", "VPE-Core1");
416
417                 
418                 st = resourceAllocator.query("NetworkCapacity", false, null, null, null, null, ctx);
419                 Assert.assertTrue(st == QueryStatus.SUCCESS);
420
421                 
422                 /*Query Using ReservationTargetId using ServiceLogicContext*/
423                 ctx = new SvcLogicContext();
424                 ctx.setAttribute("ra-input.service-model", "MY-SERV-MODEL-1");
425                 ctx.setAttribute("ra-input.reservation-target-id", "MDTWNJ21A5");
426                 ctx.setAttribute("ra-input.reservation-target-type", "Site");
427                 ctx.setAttribute("ra-input.resource-name", "vlan-id-inner");
428                 
429                 st = resourceAllocator.query("NetworkCapacity", false, null, null, null, null, ctx);
430                 Assert.assertTrue(st == QueryStatus.SUCCESS);
431                 
432                 log.info("========================  Query Using ResourceEntity==============================");
433                 /*Query Using ResourceEntity bean*/
434                 ResourceEntity sd = new ResourceEntity();
435                 sd.resourceEntityId = "gblond2003me6";
436                 sd.resourceEntityType = "VPE-Core1";
437
438                 
439                 ResourceRequest rr= new ResourceRequest();
440                 rr.serviceModel = "MY-SERV-MODEL-1";
441                 rr.resourceName = "vlan-id-inner";
442                 rr.requestType = "New";
443                 rr.rangeMaxOverride = -1;
444                 rr.rangeMinOverride = -1;
445                 
446                 List <ResourceResponse> rsList = new ArrayList<ResourceResponse>();
447                 resourceAllocator.query(sd, null, null, rsList);
448                 
449                 rsList.forEach(r -> {
450                         StrUtil.info(log, r);
451                 });
452                 
453                 /*log.info("========================  release Using ResourceEntity==============================");
454                 rsList = new ArrayList<ResourceResponse>();
455                 AllocationStatus status = resourceAllocator.release(sd);
456                 Assert.assertTrue(status == AllocationStatus.Success);
457                 
458                 
459                 log.info("========================  Query Using ResourceEntity==============================");
460                 rsList = new ArrayList<ResourceResponse>();
461                 resourceAllocator.query(sd, null, null, rsList);
462                 
463                 
464                 rsList.forEach(r -> {
465                         StrUtil.info(log, r);
466                 });*/
467                 
468         }
469         
470         
471         
472         @Test
473         public void test006() throws Exception {
474                 String t = "006";
475                 log.info("============== reserve " + t + " ================================");
476                 log.info("=== Test successful response - new start - all resources available");
477                 
478                 ResourceEntity sd = new ResourceEntity();
479                 sd.resourceEntityId = "gblond2003me6";
480                 sd.resourceEntityType = "VPE-Cust";
481                 
482                 ResourceTarget rt = new ResourceTarget();
483                 rt.resourceTargetId = "MDTWNJ21A5";
484                 rt.resourceTargetType = "Site";
485
486
487                 ResourceRequest rr= new ResourceRequest();
488                 rr.serviceModel = "MY-SERV-MODEL-1";
489                 rr.resourceName = "cust-vlan-id";
490         
491                 
492                 List <ResourceResponse> rsList = new ArrayList<ResourceResponse>();
493                 resourceAllocator.reserve(sd, rt, rr, rsList);
494                 
495                 rsList.forEach(r -> {
496                         StrUtil.info(log, r);
497                 });
498                 
499                 log.info("========================  Query + t ==============================");
500                 rsList = new ArrayList<org.onap.ccsdk.sli.adaptors.ra.comp.ResourceResponse>();
501                 resourceAllocator.query(sd, null, rr, rsList);
502                 
503                 rsList.forEach(r -> {
504                         StrUtil.info(log, r);
505                 });
506
507         }
508         
509         @Test
510         public void test007() throws Exception {
511                 String t = "007";
512                 log.info("============== reserve " + t + " ================================");
513                 log.info("=== Test successful response - new start - all resources available");
514                 
515                 dataSetup.cleanup();
516                 
517                 TestTable resource = new TestTable(jdbcTemplate, "RESOURCE", "resource_id", RESOURCE_COLUMNS);
518                 TestTable allocationItem = new TestTable(jdbcTemplate, "ALLOCATION_ITEM", "allocation_item_id",
519                                 ALLOCATION_ITEM_COLUMNS);
520                 
521                 
522                 ResourceEntity sd = new ResourceEntity();
523                 sd.resourceEntityId = "gblond2003me6";
524                 sd.resourceEntityType = "VPE";
525                 sd.resourceEntityVersion = "1";
526                 
527                 ResourceTarget rt = new ResourceTarget();
528                 rt.resourceTargetId = "MDTWNJ21A5";
529                 rt.resourceTargetType = "Site";
530
531
532                 ResourceRequest rr= new ResourceRequest();
533                 rr.serviceModel = "MY-SERV-MODEL";
534                 //rr.resourceName = "vlan-id-outer";
535                 rr.endPointPosition="VPE-Cust";
536                 rr.rangeMaxOverride = -1;
537                 rr.rangeMinOverride = -1;
538         
539                 
540                 List <ResourceResponse> rsList = new ArrayList<ResourceResponse>();
541                 resourceAllocator.reserve(sd, rt, rr, rsList);
542                 
543                 //VPE-Core1
544                 sd = new ResourceEntity();
545                 sd.resourceEntityId = "gblond2003me6";
546                 sd.resourceEntityType = "VPE";
547                 sd.resourceEntityVersion = "1";
548                 
549                 rt = new ResourceTarget();
550                 rt.resourceTargetId = "MDTWNJ21A5";
551                 rt.resourceTargetType = "Site";
552
553
554                 rr= new ResourceRequest();
555                 rr.serviceModel = "MY-SERV-MODEL";
556                 //rr.resourceName = "vlan-id-filter";
557                 rr.endPointPosition="VPE-Core1";
558                 rr.rangeMaxOverride = -1;
559                 rr.rangeMinOverride = -1;
560         
561                 
562                 rsList = new ArrayList<ResourceResponse>();
563                 resourceAllocator.reserve(sd, rt, rr, rsList);
564                 
565                 
566                 //VPE-Core2
567                 sd = new ResourceEntity();
568                 sd.resourceEntityId = "gblond2003me6";
569                 sd.resourceEntityType = "VPE";
570                 sd.resourceEntityVersion = "1";
571                 
572                 rt = new ResourceTarget();
573                 rt.resourceTargetId = "MDTWNJ21A5";
574                 rt.resourceTargetType = "Site";
575
576
577                 rr= new ResourceRequest();
578                 rr.serviceModel = "MY-SERV-MODEL";
579                 //rr.resourceName = "vlan-id-filter";
580                 rr.endPointPosition="VPE-Core2";
581                 rr.rangeMaxOverride = -1;
582                 rr.rangeMinOverride = -1;
583         
584                 
585                 rsList = new ArrayList<ResourceResponse>();
586                 resourceAllocator.reserve(sd, rt, rr, rsList);
587                 
588                 
589                 //VPE-Core3
590                 sd = new ResourceEntity();
591                 sd.resourceEntityId = "gblond2003me6";
592                 sd.resourceEntityType = "VPE";
593                 sd.resourceEntityVersion = "1";
594                 
595                 rt = new ResourceTarget();
596                 rt.resourceTargetId = "MDTWNJ21A5";
597                 rt.resourceTargetType = "Site";
598
599
600                 rr= new ResourceRequest();
601                 rr.serviceModel = "MY-SERV-MODEL";
602                 //rr.resourceName = "vlan-id-filter";
603                 rr.endPointPosition="VPE-Core3";
604                 rr.rangeMaxOverride = -1;
605                 rr.rangeMinOverride = -1;
606         
607                 
608                 rsList = new ArrayList<ResourceResponse>();
609                 resourceAllocator.reserve(sd, rt, rr, rsList);
610                 
611                 rsList.forEach(r -> {
612                         StrUtil.info(log, r);
613                 });
614                 
615                 resource.print();
616                 allocationItem.print();
617                 
618                 log.info("========================  Query + t ==============================");
619                 rsList = new ArrayList<org.onap.ccsdk.sli.adaptors.ra.comp.ResourceResponse>();
620                 resourceAllocator.query(sd, null, rr, rsList);
621                 
622                 rsList.forEach(r -> {
623                         StrUtil.info(log, r);
624                 });
625                 
626                 
627                 
628                 SvcLogicContext ctx = new SvcLogicContext();
629                 ctx.setAttribute("ra-input.reservation-entity-id", "gblond2003me6");
630                 ctx.setAttribute("ra-input.reservation-entity-type", "VPE");
631
632                 
633                 QueryStatus st = resourceAllocator.release("NetworkCapacity", "gblond2003me6", ctx);
634                 Assert.assertTrue(st == QueryStatus.SUCCESS);
635
636         }
637 }