2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.sdc.be.datatypes.elements;
23 import org.junit.Assert;
24 import org.junit.Test;
26 import java.util.LinkedList;
27 import java.util.List;
29 public class PropertyRuleTest {
31 private PropertyRule createTestSubject() {
32 return new PropertyRule();
36 public void testConstructor() throws Exception {
37 PropertyRule testSubject;
41 testSubject = createTestSubject();
42 new PropertyRule(new LinkedList<>(), "");
46 public void testGetRule() throws Exception {
47 PropertyRule testSubject;
51 testSubject = createTestSubject();
52 result = testSubject.getRule();
56 public void testSetRule() throws Exception {
57 PropertyRule testSubject;
58 List<String> rule = null;
61 testSubject = createTestSubject();
62 testSubject.setRule(rule);
66 public void testGetValue() throws Exception {
67 PropertyRule testSubject;
71 testSubject = createTestSubject();
72 result = testSubject.getValue();
76 public void testSetValue() throws Exception {
77 PropertyRule testSubject;
81 testSubject = createTestSubject();
82 testSubject.setValue(value);
86 public void testGetFirstToken() throws Exception {
87 PropertyRule testSubject;
91 testSubject = createTestSubject();
92 result = testSubject.getFirstToken();
96 public void testGetToken() throws Exception {
97 PropertyRule testSubject;
102 testSubject = createTestSubject();
103 result = testSubject.getToken(tokenNumber);
107 public void testGetRuleSize() throws Exception {
108 PropertyRule testSubject;
112 testSubject = createTestSubject();
113 result = testSubject.getRuleSize();
117 public void testToString() throws Exception {
118 PropertyRule testSubject;
122 testSubject = createTestSubject();
123 result = testSubject.toString();
127 public void testCompareRule() throws Exception {
128 PropertyRule testSubject;
129 PropertyRule comparedPropertyRule = null;
133 testSubject = createTestSubject();
134 comparedPropertyRule = null;
135 result = testSubject.compareRule(comparedPropertyRule);
136 Assert.assertEquals(false, result);
140 public void testReplaceFirstToken() throws Exception {
141 PropertyRule testSubject;
145 testSubject = createTestSubject();
146 testSubject.replaceFirstToken(token);