2 * ============LICENSE_START=======================================================
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
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=========================================================
20 package org.onap.aai.util.genxsd;
22 import static org.junit.Assert.*;
23 import static org.mockito.Mockito.*;
25 import java.util.Arrays;
26 import java.util.Collection;
28 import org.mockito.runners.MockitoJUnitRunner;
29 import static org.hamcrest.MatcherAssert.assertThat;
30 import static org.hamcrest.CoreMatchers.is;
31 import org.mockito.BDDMockito;
32 import org.mockito.InjectMocks;
33 import org.hamcrest.Matcher;
34 import org.junit.runners.*;
35 import org.junit.runners.Parameterized.Parameters;
36 import org.junit.Before;
37 import org.junit.BeforeClass;
38 import org.junit.Test;
39 import org.junit.runner.RunWith;
41 @RunWith(Parameterized.class)
42 public class DeleteFootnoteSetTest {
46 DeleteFootnoteSet footnotes = null;
49 public static Collection<String[]> testConditions() {
50 String inputs [][] = {
51 {"vserver","(1)", "\n -(1) IF this VSERVER node is deleted, this FROM node is DELETED also\n"},
52 {"ctag-pool","(2)", "\n -(2) IF this CTAG-POOL node is deleted, this TO node is DELETED also\n"},
53 {"pserver","(3)", "\n -(3) IF this FROM node is deleted, this PSERVER is DELETED also\n"},
54 {"oam-network","(4)", "\n -(4) IF this TO node is deleted, this OAM-NETWORK is DELETED also\n"},
55 {"dvs-switch","(1)", "\n -(1) IF this DVS-SWITCH node is deleted, this FROM node is DELETED also\n"},
56 {"availability-zone","(3)", "\n -(3) IF this FROM node is deleted, this AVAILABILITY-ZONE is DELETED also\n"}
58 return (Arrays.asList(inputs));
61 public DeleteFootnoteSetTest(String targetNode, String flavor, String result) {
63 this.targetNode = targetNode;
69 public void setUp() throws Exception {
70 footnotes = new DeleteFootnoteSet(this.targetNode);
74 public void testDeleteFootnoteSet() {
75 assertThat(footnotes.targetNode, is(this.targetNode));
79 public void testAdd() {
80 footnotes.add(this.flavor);
81 assertThat(footnotes.footnotes.size(), is(1));
85 public void testToString() {
86 footnotes.add(this.flavor);
87 assertThat(footnotes.toString(), is(this.result));