Replace all tab characters in java files with two spaces to remove linter warning
[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 package org.onap.aai.schemagen.genxsd;
21
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;
27
28 import java.util.Arrays;
29 import java.util.Collection;
30
31 import static org.hamcrest.CoreMatchers.is;
32 import static org.hamcrest.MatcherAssert.assertThat;
33
34 @RunWith(Parameterized.class)
35 public class DeleteFootnoteSetTest {
36   String targetNode;
37   String flavor;
38   String result;
39   DeleteFootnoteSet footnotes = null;
40
41   @Parameters
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"}
50     };
51     return (Arrays.asList(inputs));
52   }
53
54   public DeleteFootnoteSetTest(String targetNode, String flavor, String result) {
55     super();
56     this.targetNode = targetNode;
57     this.flavor = flavor;
58     this.result=result;
59   }
60
61   @Before
62   public void setUp() throws Exception {
63     footnotes = new DeleteFootnoteSet(this.targetNode);
64   }
65
66   @Test
67   public void testDeleteFootnoteSet() {
68     assertThat(footnotes.targetNode, is(this.targetNode));
69   }
70
71   @Test
72   public void testAdd() {
73     footnotes.add(this.flavor);
74     assertThat(footnotes.footnotes.size(), is(1));
75   }
76
77   @Test
78   public void testToString() {
79     footnotes.add(this.flavor);
80     assertThat(footnotes.toString(), is(this.result));
81   }
82
83 }