2 * ============LICENSE_START=======================================================
\r
4 * ================================================================================
\r
5 * Copyright 2018 TechMahindra
\r
6 *=================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============LICENSE_END=========================================================
\r
20 package org.openecomp.mso.bpmn.core.domain;
\r
22 import static org.junit.Assert.*;
\r
24 import org.junit.Test;
\r
26 public class ResourceTest {
\r
27 private Resource resource = new Resource() {
\r
28 private static final long serialVersionUID = 1L;
\r
32 ModelInfo model = new ModelInfo();
\r
33 ResourceInstance ri = new ResourceInstance();
\r
34 HomingSolution hs = new HomingSolution();
\r
35 ResourceType rt = ResourceType.VNF;
\r
36 public long concurrencyCounter = 1L;
\r
37 long initval = resource.getConcurrencyCounter();
\r
40 public void testResource() {
\r
41 resource.setResourceId("resourceId");
\r
42 resource.setModelInfo(model);
\r
43 resource.setResourceInstance(ri);
\r
44 resource.setHomingSolution(hs);
\r
45 resource.setCurrentHomingSolution(hs);
\r
46 resource.setResourceType(rt);
\r
47 resource.setToscaNodeType("toscaNodeType");
\r
48 resource.setResourceInstanceId("newInstanceId");
\r
49 resource.setResourceInstanceName("newInstanceName");
\r
50 resource.incrementConcurrencyCounter();
\r
51 assertEquals(resource.getResourceId(), "resourceId");
\r
52 assertEquals(resource.getModelInfo(), model);
\r
53 assertEquals(resource.getResourceInstance(), ri);
\r
54 assertEquals(resource.getHomingSolution(), hs);
\r
55 assertEquals(resource.getCurrentHomingSolution(), hs);
\r
56 assertEquals(resource.getResourceType(), rt);
\r
57 assertEquals(resource.getToscaNodeType(), "toscaNodeType");
\r
58 assertEquals(resource.getResourceInstanceId(), "newInstanceId");
\r
59 assertEquals(resource.getResourceInstanceName(), "newInstanceName");
\r
60 assertEquals(resource.getConcurrencyCounter(), initval+1);
\r