Update aai-schema-ingest dependency in the schema-service
[aai/schema-service.git] / aai-schema-gen / src / test / java / org / onap / aai / schemagen / genxsd / HTMLfromOXMTest.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.junit.Assert.assertThat;
25
26 import java.io.BufferedWriter;
27 import java.io.File;
28 import java.io.FileWriter;
29 import java.io.IOException;
30 import java.nio.charset.Charset;
31 import java.nio.file.Files;
32 import java.nio.file.Path;
33 import java.nio.file.Paths;
34
35 import org.junit.Before;
36 import org.junit.BeforeClass;
37 import org.junit.Test;
38 import org.junit.runner.RunWith;
39 import org.onap.aai.edges.EdgeIngestor;
40 import org.onap.aai.nodes.NodeIngestor;
41 import org.onap.aai.schemagen.SwaggerGenerationConfiguration;
42 import org.onap.aai.schemagen.testutils.TestUtilConfigTranslatorforBusiness;
43 import org.onap.aai.setup.SchemaConfigVersions;
44 import org.onap.aai.setup.SchemaLocationsBean;
45 import org.onap.aai.setup.SchemaVersion;
46 import org.slf4j.Logger;
47 import org.slf4j.LoggerFactory;
48 import org.springframework.beans.factory.annotation.Autowired;
49 import org.springframework.context.annotation.AnnotationConfigApplicationContext;
50 import org.springframework.test.context.ContextConfiguration;
51 import org.springframework.test.context.TestPropertySource;
52 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
53 import org.w3c.dom.Element;
54
55 @RunWith(SpringJUnit4ClassRunner.class)
56 @ContextConfiguration(
57     classes = {SchemaConfigVersions.class, SchemaLocationsBean.class,
58         TestUtilConfigTranslatorforBusiness.class, EdgeIngestor.class, NodeIngestor.class,
59         SwaggerGenerationConfiguration.class
60
61     })
62 @TestPropertySource(properties = {"schema.uri.base.path = /aai", "schema.xsd.maxoccurs = 5000"})
63 public class HTMLfromOXMTest {
64     private static final Logger logger = LoggerFactory.getLogger("HTMLfromOXMTest.class");
65     private static final String OXMFILENAME = "src/test/resources/oxm/business_oxm_v11.xml";
66     public static AnnotationConfigApplicationContext ctx = null;
67     private static String testXML;
68     protected static final String SERVICE_NAME = "JUNIT";
69
70     @Autowired
71     HTMLfromOXM htmlFromOxm;
72
73     @Autowired
74     SchemaConfigVersions schemaConfigVersions;
75
76     @BeforeClass
77     public static void setUpContext() throws Exception {
78
79     }
80
81     @BeforeClass
82     public static void setupBundleconfig() throws Exception {
83         System.setProperty("AJSC_HOME", ".");
84         System.setProperty("BUNDLECONFIG_DIR", "src/test/resources/bundleconfig-local");
85         System.setProperty("aai.service.name", SERVICE_NAME);
86     }
87
88     @Before
89     public void setUp() throws Exception {
90         setUp(0);
91     }
92
93     public void setUp(int sbopt) throws Exception {
94         XSDElementTest x = new XSDElementTest();
95         x.setUp(sbopt);
96         testXML = x.testXML;
97         logger.debug(testXML);
98         BufferedWriter bw = new BufferedWriter(new FileWriter(OXMFILENAME));
99         bw.write(testXML);
100         bw.close();
101     }
102
103     @Test
104     public void testGetDocumentHeader() {
105         SchemaVersion v = schemaConfigVersions.getAppRootVersion();
106         String header = null;
107         try {
108             htmlFromOxm.setXmlVersion(testXML, v);
109             htmlFromOxm.setSchemaConfigVersions(schemaConfigVersions);
110             header = htmlFromOxm.getDocumentHeader();
111         } catch (Exception e) {
112             e.printStackTrace();
113         }
114         logger.debug("Header:");
115         logger.debug(header);
116         assertThat(header, is(HTMLheader()));
117     }
118
119     @Test
120     public void testProcess() {
121         SchemaVersion v = schemaConfigVersions.getAppRootVersion();
122         String fileContent = null;
123         try {
124             htmlFromOxm.setXmlVersion(testXML, v);
125             fileContent = htmlFromOxm.process();
126         } catch (Exception e) {
127             e.printStackTrace();
128         }
129         logger.debug("FileContent-I:");
130         logger.debug(fileContent);
131         assertThat(fileContent, is(HTMLresult(0)));
132     }
133
134     @Test
135     public void testProcessWithCombiningJavaTypes() {
136         SchemaVersion v = schemaConfigVersions.getAppRootVersion();
137         String fileContent = null;
138         try {
139             setUp(1);
140             htmlFromOxm.setXmlVersion(testXML, v);
141             fileContent = htmlFromOxm.process();
142         } catch (Exception e) {
143             e.printStackTrace();
144         }
145         logger.debug("FileContent-I:");
146         logger.debug(fileContent);
147         assertThat(fileContent, is(HTMLresult(1)));
148     }
149
150     @Test
151     public void testHTMLfromOXMFileVersion() throws IOException {
152         String outfileName = "testXML.xml";
153         File XMLfile = new File(outfileName);
154         XMLfile.createNewFile();
155         BufferedWriter bw = null;
156         Charset charset = Charset.forName("UTF-8");
157         Path path = Paths.get(outfileName);
158         bw = Files.newBufferedWriter(path, charset);
159         bw.write(testXML);
160         bw.close();
161         SchemaVersion v = schemaConfigVersions.getAppRootVersion();
162         String fileContent = null;
163         try {
164             htmlFromOxm.setXmlVersion(testXML, v);
165             fileContent = htmlFromOxm.process();
166         } catch (Exception e) {
167             e.printStackTrace();
168         }
169         XMLfile.delete();
170         logger.debug("FileContent-I:");
171         logger.debug(fileContent);
172         assertThat(fileContent, is(HTMLresult(0)));
173     }
174
175     @Test
176     public void testHTMLfromOXMStringVersion() {
177         SchemaVersion v = schemaConfigVersions.getAppRootVersion();
178         String fileContent = null;
179         try {
180             htmlFromOxm.setXmlVersion(testXML, v);
181             fileContent = htmlFromOxm.process();
182         } catch (Exception e) {
183             e.printStackTrace();
184         }
185         logger.debug("FileContent-II:");
186         logger.debug(fileContent);
187         assertThat(fileContent, is(HTMLresult(0)));
188     }
189
190     @Test
191     public void testProcessJavaTypeElement() {
192         String target = "Element=java-type/Customer";
193         SchemaVersion v = schemaConfigVersions.getAppRootVersion();
194         Element customer = null;
195         try {
196             htmlFromOxm.setXmlVersion(testXML, v);
197             htmlFromOxm.process();
198             customer = htmlFromOxm.getJavaTypeElementSwagger("Customer");
199         } catch (Exception e) {
200             e.printStackTrace();
201         }
202         logger.debug("Element:");
203         logger.debug("Element=" + customer.getNodeName() + "/" + customer.getAttribute("name"));
204         assertThat("Element=" + customer.getNodeName() + "/" + customer.getAttribute("name"),
205             is(target));
206     }
207
208     public String HTMLresult() {
209         return HTMLresult(0);
210     }
211
212     public String HTMLresult(int sbopt) {
213         StringBuilder sb = new StringBuilder(32368);
214         sb.append(HTMLheader());
215         sb.append(HTMLdefs(sbopt));
216         return sb.toString();
217     }
218
219     public String HTMLheader() {
220         StringBuilder sb = new StringBuilder(1500);
221         sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
222             + OxmFileProcessor.LINE_SEPARATOR);
223         sb.append(
224             "<xs:schema elementFormDefault=\"qualified\" version=\"1.0\" targetNamespace=\"http://org.onap.aai.inventory/v11\" xmlns:tns=\"http://org.onap.aai.inventory/v11\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\""
225                 + OxmFileProcessor.LINE_SEPARATOR + "xmlns:jaxb=\"http://java.sun.com/xml/ns/jaxb\""
226                 + OxmFileProcessor.LINE_SEPARATOR);
227         sb.append("    jaxb:version=\"2.1\"" + OxmFileProcessor.LINE_SEPARATOR);
228         sb.append(
229             "    xmlns:annox=\"http://annox.dev.java.net\"" + OxmFileProcessor.LINE_SEPARATOR);
230         sb.append("    jaxb:extensionBindingPrefixes=\"annox\">"
231             + OxmFileProcessor.DOUBLE_LINE_SEPARATOR);
232         return sb.toString();
233     }
234
235     public String HTMLdefs() {
236         return HTMLdefs(0);
237     }
238
239     public String HTMLdefs(int sbopt) {
240         StringBuilder sb = new StringBuilder(1500);
241         sb.append("  <xs:element name=\"service-subscription\">" + OxmFileProcessor.LINE_SEPARATOR);
242         sb.append("    <xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR);
243         sb.append("      <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
244         sb.append("        <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
245         sb.append(
246             "          <annox:annotate target=\"class\">@org.onap.aai.annotations.Metadata(description=\"Object that group service instances.\",indexedProps=\"service-type\",dependentOn=\"customer\",container=\"service-subscriptions\",crossEntityReference=\"service-instance,service-type\")</annox:annotate>"
247                 + OxmFileProcessor.LINE_SEPARATOR);
248         sb.append("        </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
249         sb.append("      </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
250         sb.append("      <xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR);
251         sb.append("        <xs:element name=\"service-type\" type=\"xs:string\" minOccurs=\"0\">"
252             + OxmFileProcessor.LINE_SEPARATOR);
253         sb.append("          <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
254         sb.append("            <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
255         sb.append(
256             "              <annox:annotate target=\"field\">@org.onap.aai.annotations.Metadata(isKey=true,description=\"Value defined by orchestration to identify this service.\")</annox:annotate>"
257                 + OxmFileProcessor.LINE_SEPARATOR);
258         sb.append("            </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
259         sb.append("          </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
260         sb.append("        </xs:element>" + OxmFileProcessor.LINE_SEPARATOR);
261         sb.append(
262             "        <xs:element name=\"temp-ub-sub-account-id\" type=\"xs:string\" minOccurs=\"0\">"
263                 + OxmFileProcessor.LINE_SEPARATOR);
264         sb.append("          <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
265         sb.append("            <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
266         sb.append(
267             "              <annox:annotate target=\"field\">@org.onap.aai.annotations.Metadata(description=\"This property will be deleted from A&amp;AI in the near future. Only stop gap solution.\")</annox:annotate>"
268                 + OxmFileProcessor.LINE_SEPARATOR);
269         sb.append("            </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
270         sb.append("          </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
271         sb.append("        </xs:element>" + OxmFileProcessor.LINE_SEPARATOR);
272         sb.append(
273             "        <xs:element name=\"resource-version\" type=\"xs:string\" minOccurs=\"0\">"
274                 + OxmFileProcessor.LINE_SEPARATOR);
275         sb.append("          <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
276         sb.append("            <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
277         sb.append(
278             "              <annox:annotate target=\"field\">@org.onap.aai.annotations.Metadata(description=\"Used for optimistic concurrency.  Must be empty on create, valid on update and delete.\")</annox:annotate>"
279                 + OxmFileProcessor.LINE_SEPARATOR);
280         sb.append("            </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
281         sb.append("          </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
282         sb.append("        </xs:element>" + OxmFileProcessor.LINE_SEPARATOR);
283         sb.append("      </xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR);
284         sb.append("    </xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR);
285         sb.append("  </xs:element>" + OxmFileProcessor.LINE_SEPARATOR);
286         sb.append(
287             "  <xs:element name=\"service-subscriptions\">" + OxmFileProcessor.LINE_SEPARATOR);
288         sb.append("    <xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR);
289         sb.append("      <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
290         sb.append("        <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
291         sb.append(
292             "          <annox:annotate target=\"class\">@org.onap.aai.annotations.Metadata(description=\"Collection of objects that group service instances.\")</annox:annotate>"
293                 + OxmFileProcessor.LINE_SEPARATOR);
294         sb.append("        </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
295         sb.append("      </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
296         sb.append("      <xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR);
297         sb.append(
298             "        <xs:element ref=\"tns:service-subscription\" minOccurs=\"0\" maxOccurs=\"5000\"/>"
299                 + OxmFileProcessor.LINE_SEPARATOR);
300         sb.append("      </xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR);
301         sb.append("    </xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR);
302         sb.append("  </xs:element>" + OxmFileProcessor.LINE_SEPARATOR);
303         sb.append("  <xs:element name=\"customer\">" + OxmFileProcessor.LINE_SEPARATOR);
304         sb.append("    <xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR);
305         sb.append("      <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
306         sb.append("        <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
307         if (sbopt == 0) {
308             sb.append(
309                 "          <annox:annotate target=\"class\">@org.onap.aai.annotations.Metadata(description=\"customer identifiers to provide linkage back to BSS information.\",nameProps=\"subscriber-name\",indexedProps=\"subscriber-name,global-customer-id,subscriber-type\",searchable=\"global-customer-id,subscriber-name\",uniqueProps=\"global-customer-id\",container=\"customers\",namespace=\"business\")</annox:annotate>"
310                     + OxmFileProcessor.LINE_SEPARATOR);
311         } else {
312             sb.append(
313                 "          <annox:annotate target=\"class\">@org.onap.aai.annotations.Metadata(description=\"customer identifiers to provide linkage back to BSS information.\",nameProps=\"subscriber-name\",indexedProps=\"subscriber-type,subscriber-name,global-customer-id\",searchable=\"global-customer-id,subscriber-name\",uniqueProps=\"global-customer-id\",container=\"customers\",namespace=\"business\")</annox:annotate>"
314                     + OxmFileProcessor.LINE_SEPARATOR);
315         }
316         sb.append("        </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
317         sb.append("      </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
318         sb.append("      <xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR);
319         sb.append(
320             "        <xs:element name=\"global-customer-id\" type=\"xs:string\" minOccurs=\"0\">"
321                 + OxmFileProcessor.LINE_SEPARATOR);
322         sb.append("          <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
323         sb.append("            <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
324         sb.append(
325             "              <annox:annotate target=\"field\">@org.onap.aai.annotations.Metadata(isKey=true,description=\"Global customer id used across to uniquely identify customer.\")</annox:annotate>"
326                 + OxmFileProcessor.LINE_SEPARATOR);
327         sb.append("            </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
328         sb.append("          </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
329         sb.append("        </xs:element>" + OxmFileProcessor.LINE_SEPARATOR);
330         sb.append("        <xs:element name=\"subscriber-name\" type=\"xs:string\" minOccurs=\"0\">"
331             + OxmFileProcessor.LINE_SEPARATOR);
332         sb.append("          <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
333         sb.append("            <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
334         sb.append(
335             "              <annox:annotate target=\"field\">@org.onap.aai.annotations.Metadata(description=\"Subscriber name, an alternate way to retrieve a customer.\")</annox:annotate>"
336                 + OxmFileProcessor.LINE_SEPARATOR);
337         sb.append("            </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
338         sb.append("          </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
339         sb.append("        </xs:element>" + OxmFileProcessor.LINE_SEPARATOR);
340         if (sbopt == 0) {
341             sb.append(
342                 "        <xs:element name=\"subscriber-type\" type=\"xs:string\" minOccurs=\"0\">"
343                     + OxmFileProcessor.LINE_SEPARATOR);
344             sb.append("          <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
345             sb.append("            <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
346             sb.append(
347                 "              <annox:annotate target=\"field\">@org.onap.aai.annotations.Metadata(description=\"Subscriber type, a way to provide VID with only the INFRA customers.\",defaultValue=\"CUST\")</annox:annotate>"
348                     + OxmFileProcessor.LINE_SEPARATOR);
349             sb.append("            </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
350             sb.append("          </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
351             sb.append("        </xs:element>" + OxmFileProcessor.LINE_SEPARATOR);
352             sb.append(
353                 "        <xs:element name=\"resource-version\" type=\"xs:string\" minOccurs=\"0\">"
354                     + OxmFileProcessor.LINE_SEPARATOR);
355             sb.append("          <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
356             sb.append("            <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
357             sb.append(
358                 "              <annox:annotate target=\"field\">@org.onap.aai.annotations.Metadata(description=\"Used for optimistic concurrency.  Must be empty on create, valid on update and delete.\")</annox:annotate>"
359                     + OxmFileProcessor.LINE_SEPARATOR);
360             sb.append("            </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
361             sb.append("          </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
362             sb.append("        </xs:element>" + OxmFileProcessor.LINE_SEPARATOR);
363         } else {
364             sb.append(
365                 "        <xs:element name=\"resource-version\" type=\"xs:string\" minOccurs=\"0\">"
366                     + OxmFileProcessor.LINE_SEPARATOR);
367             sb.append("          <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
368             sb.append("            <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
369             sb.append(
370                 "              <annox:annotate target=\"field\">@org.onap.aai.annotations.Metadata(description=\"Used for optimistic concurrency.  Must be empty on create, valid on update and delete.\")</annox:annotate>"
371                     + OxmFileProcessor.LINE_SEPARATOR);
372             sb.append("            </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
373             sb.append("          </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
374             sb.append("        </xs:element>" + OxmFileProcessor.LINE_SEPARATOR);
375             sb.append(
376                 "        <xs:element name=\"subscriber-type\" type=\"xs:string\" minOccurs=\"0\">"
377                     + OxmFileProcessor.LINE_SEPARATOR);
378             sb.append("          <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
379             sb.append("            <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
380             sb.append(
381                 "              <annox:annotate target=\"field\">@org.onap.aai.annotations.Metadata(description=\"Subscriber type, a way to provide VID with only the INFRA customers.\",defaultValue=\"CUST\")</annox:annotate>"
382                     + OxmFileProcessor.LINE_SEPARATOR);
383             sb.append("            </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
384             sb.append("          </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
385             sb.append("        </xs:element>" + OxmFileProcessor.LINE_SEPARATOR);
386
387         }
388         sb.append("        <xs:element ref=\"tns:service-subscriptions\" minOccurs=\"0\"/>"
389             + OxmFileProcessor.LINE_SEPARATOR);
390         sb.append("      </xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR);
391         sb.append("    </xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR);
392         sb.append("  </xs:element>" + OxmFileProcessor.LINE_SEPARATOR);
393         sb.append("  <xs:element name=\"customers\">" + OxmFileProcessor.LINE_SEPARATOR);
394         sb.append("    <xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR);
395         sb.append("      <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
396         sb.append("        <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
397         sb.append(
398             "          <annox:annotate target=\"class\">@org.onap.aai.annotations.Metadata(description=\"Collection of customer identifiers to provide linkage back to BSS information.\")</annox:annotate>"
399                 + OxmFileProcessor.LINE_SEPARATOR);
400         sb.append("        </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
401         sb.append("      </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
402         sb.append("      <xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR);
403         sb.append("        <xs:element ref=\"tns:customer\" minOccurs=\"0\" maxOccurs=\"5000\"/>"
404             + OxmFileProcessor.LINE_SEPARATOR);
405         sb.append("      </xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR);
406         sb.append("    </xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR);
407         sb.append("  </xs:element>" + OxmFileProcessor.LINE_SEPARATOR);
408         sb.append("  <xs:element name=\"business\">" + OxmFileProcessor.LINE_SEPARATOR);
409         sb.append("    <xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR);
410         sb.append("      <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
411         sb.append("        <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
412         sb.append(
413             "          <annox:annotate target=\"class\">@org.onap.aai.annotations.Metadata(description=\"Namespace for business related constructs\")</annox:annotate>"
414                 + OxmFileProcessor.LINE_SEPARATOR);
415         sb.append("        </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR);
416         sb.append("      </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR);
417         sb.append("      <xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR);
418         sb.append("        <xs:element ref=\"tns:customers\" minOccurs=\"0\"/>"
419             + OxmFileProcessor.LINE_SEPARATOR);
420         sb.append("      </xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR);
421         sb.append("    </xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR);
422         sb.append("  </xs:element>" + OxmFileProcessor.LINE_SEPARATOR);
423         sb.append("  <xs:element name=\"inventory\">" + OxmFileProcessor.LINE_SEPARATOR);
424         sb.append("    <xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR);
425         sb.append("      <xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR);
426         sb.append("        <xs:element ref=\"tns:business\" minOccurs=\"0\"/>"
427             + OxmFileProcessor.LINE_SEPARATOR);
428         sb.append("      </xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR);
429         sb.append("    </xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR);
430         sb.append("  </xs:element>" + OxmFileProcessor.LINE_SEPARATOR);
431         sb.append("</xs:schema>" + OxmFileProcessor.LINE_SEPARATOR);
432         return sb.toString();
433     }
434 }