Add instructions to invoke the linter and code formatter plugins to the README and...
[aai/schema-service.git] / aai-schema-gen / src / test / java / org / onap / aai / schemagen / genxsd / DeleteFootnoteSetTest.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  */
20
21 package org.onap.aai.schemagen.genxsd;
22
23 import static org.hamcrest.CoreMatchers.is;
24 import static org.hamcrest.MatcherAssert.assertThat;
25
26 import java.util.Arrays;
27 import java.util.Collection;
28
29 import org.junit.Before;
30 import org.junit.Test;
31 import org.junit.runner.RunWith;
32 import org.junit.runners.Parameterized;
33 import org.junit.runners.Parameterized.Parameters;
34
35 @RunWith(Parameterized.class)
36 public class DeleteFootnoteSetTest {
37     String targetNode;
38     String flavor;
39     String result;
40     DeleteFootnoteSet footnotes = null;
41
42     @Parameters
43     public static Collection<String[]> testConditions() {
44         String inputs[][] = {
45             {"vserver", "(1)",
46                 "\n      -(1) IF this VSERVER node is deleted, this FROM node is DELETED also\n"},
47             {"ctag-pool", "(2)",
48                 "\n      -(2) IF this CTAG-POOL node is deleted, this TO node is DELETED also\n"},
49             {"pserver", "(3)",
50                 "\n      -(3) IF this FROM node is deleted, this PSERVER is DELETED also\n"},
51             {"oam-network", "(4)",
52                 "\n      -(4) IF this TO node is deleted, this OAM-NETWORK is DELETED also\n"},
53             {"dvs-switch", "(1)",
54                 "\n      -(1) IF this DVS-SWITCH node is deleted, this FROM node is DELETED also\n"},
55             {"availability-zone", "(3)",
56                 "\n      -(3) IF this FROM node is deleted, this AVAILABILITY-ZONE is DELETED also\n"}};
57         return (Arrays.asList(inputs));
58     }
59
60     public DeleteFootnoteSetTest(String targetNode, String flavor, String result) {
61         super();
62         this.targetNode = targetNode;
63         this.flavor = flavor;
64         this.result = result;
65     }
66
67     @Before
68     public void setUp() throws Exception {
69         footnotes = new DeleteFootnoteSet(this.targetNode);
70     }
71
72     @Test
73     public void testDeleteFootnoteSet() {
74         assertThat(footnotes.targetNode, is(this.targetNode));
75     }
76
77     @Test
78     public void testAdd() {
79         footnotes.add(this.flavor);
80         assertThat(footnotes.footnotes.size(), is(1));
81     }
82
83     @Test
84     public void testToString() {
85         footnotes.add(this.flavor);
86         assertThat(footnotes.toString(), is(this.result));
87     }
88
89 }