2 * ============LICENSE_START===================================================
3 * SPARKY (AAI UI service)
4 * ============================================================================
5 * Copyright © 2017 AT&T Intellectual Property.
6 * Copyright © 2017 Amdocs
8 * ============================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=====================================================
22 * ECOMP and OpenECOMP are trademarks
23 * and service marks of AT&T Intellectual Property.
26 package org.onap.aai.sparky.viewandinspect.entity;
28 import static org.junit.Assert.assertEquals;
29 import static org.junit.Assert.assertNotNull;
30 import static org.junit.Assert.assertTrue;
32 import org.junit.Before;
33 import org.junit.Test;
34 import org.onap.aai.sparky.viewandinspect.config.VisualizationConfigs;
35 import org.onap.aai.sparky.viewandinspect.enumeration.NodeProcessingState;
37 public class NodeMetaTest {
39 private NodeMeta nodeMeta;
40 private NodeProcessingState nodeProcessingState;
41 private NodeDebug nodeDebug;
42 private VisualizationConfigs visualizationConfigs;
45 public void init() throws Exception {
46 this.visualizationConfigs = new VisualizationConfigs();
47 nodeMeta = new NodeMeta(visualizationConfigs);
48 nodeDebug = new NodeDebug();
53 public void updateValues() {
55 nodeMeta.setAtMaxDepth(true);
56 assertTrue(nodeMeta.isAtMaxDepth());
57 nodeMeta.setSelfLinkResolved(true);
58 assertTrue(nodeMeta.isSelfLinkResolved());
59 nodeMeta.setProcessingState(nodeProcessingState.READY);
60 assertNotNull(nodeMeta.getProcessingState());
61 nodeMeta.setProcessingErrorOccurred(true);
62 assertTrue(nodeMeta.isProcessingErrorOccurred());
63 nodeMeta.setHasNeighbors(true);
64 assertTrue(nodeMeta.isHasNeighbors());
65 nodeMeta.setNeighborsProcessed(true);
66 assertTrue(nodeMeta.isNeighborsProcessed());
67 nodeMeta.setNodeDepth(3);
68 assertEquals(3,nodeMeta.getNodeDepth());
69 nodeMeta.setNodeDebug(nodeDebug);
70 assertNotNull(nodeMeta.getNodeDebug());
71 nodeMeta.setClassName("generalNodeClass");
72 assertNotNull(nodeMeta.getClassName());
73 nodeMeta.setNumInboundNeighbors(34);
74 assertEquals(34,nodeMeta.getNumInboundNeighbors());
75 nodeMeta.setNumOutboundNeighbors(43);
76 assertEquals(43,nodeMeta.getNumOutboundNeighbors());
77 nodeMeta.setSelfLinkResponseTimeInMs(43);
78 assertEquals(43,nodeMeta.getSelfLinkResponseTimeInMs());
79 nodeMeta.setNodeIssue(true);
80 assertTrue(nodeMeta.isNodeIssue());
81 nodeMeta.setNodeValidated(true);
82 assertTrue(nodeMeta.isNodeValidated());
83 nodeMeta.setSearchTarget(true);
84 assertTrue(nodeMeta.isSearchTarget());