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