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.schemagen.genxsd;
22 import org.junit.Before;
23 import org.junit.Test;
24 import org.junit.runner.RunWith;
25 import org.junit.runners.Parameterized;
26 import org.junit.runners.Parameterized.Parameters;
28 import java.util.Arrays;
29 import java.util.Collection;
31 import static org.hamcrest.CoreMatchers.is;
32 import static org.hamcrest.MatcherAssert.assertThat;
34 @RunWith(Parameterized.class)
35 public class DeleteFootnoteSetTest {
39 DeleteFootnoteSet footnotes = null;
42 public static Collection<String[]> testConditions() {
43 String inputs [][] = {
44 {"vserver","(1)", "\n -(1) IF this VSERVER node is deleted, this FROM node is DELETED also\n"},
45 {"ctag-pool","(2)", "\n -(2) IF this CTAG-POOL node is deleted, this TO node is DELETED also\n"},
46 {"pserver","(3)", "\n -(3) IF this FROM node is deleted, this PSERVER is DELETED also\n"},
47 {"oam-network","(4)", "\n -(4) IF this TO node is deleted, this OAM-NETWORK is DELETED also\n"},
48 {"dvs-switch","(1)", "\n -(1) IF this DVS-SWITCH node is deleted, this FROM node is DELETED also\n"},
49 {"availability-zone","(3)", "\n -(3) IF this FROM node is deleted, this AVAILABILITY-ZONE is DELETED also\n"}
51 return (Arrays.asList(inputs));
54 public DeleteFootnoteSetTest(String targetNode, String flavor, String result) {
56 this.targetNode = targetNode;
62 public void setUp() throws Exception {
63 footnotes = new DeleteFootnoteSet(this.targetNode);
67 public void testDeleteFootnoteSet() {
68 assertThat(footnotes.targetNode, is(this.targetNode));
72 public void testAdd() {
73 footnotes.add(this.flavor);
74 assertThat(footnotes.footnotes.size(), is(1));
78 public void testToString() {
79 footnotes.add(this.flavor);
80 assertThat(footnotes.toString(), is(this.result));