diff options
author | Kajur, Harish (vk250x) <vk250x@att.com> | 2018-11-01 15:44:03 -0400 |
---|---|---|
committer | Kajur, Harish (vk250x) <vk250x@att.com> | 2018-11-01 15:44:09 -0400 |
commit | 9bae143d3310eb57bfbb0674f62f278f740db0f4 (patch) | |
tree | cf1e08c39254d408f0a5726439288f8053f89ca3 /aai-core/src/test | |
parent | 653948302e921dbcee24ed6746c73557c0b54c92 (diff) |
Replace platform specific line seperators System
Issue-ID: AAI-1463
Change-Id: Ibdd3803dd825342d54dfa1b008f1a8c2d78d6198
Signed-off-by: Kajur, Harish (vk250x) <vk250x@att.com>
Diffstat (limited to 'aai-core/src/test')
-rw-r--r-- | aai-core/src/test/java/org/onap/aai/util/genxsd/HTMLfromOXMTest.java | 276 | ||||
-rw-r--r-- | aai-core/src/test/java/org/onap/aai/util/genxsd/XSDElementTest.java | 10 |
2 files changed, 144 insertions, 142 deletions
diff --git a/aai-core/src/test/java/org/onap/aai/util/genxsd/HTMLfromOXMTest.java b/aai-core/src/test/java/org/onap/aai/util/genxsd/HTMLfromOXMTest.java index 5e019196..57835b50 100644 --- a/aai-core/src/test/java/org/onap/aai/util/genxsd/HTMLfromOXMTest.java +++ b/aai-core/src/test/java/org/onap/aai/util/genxsd/HTMLfromOXMTest.java @@ -33,6 +33,7 @@ import java.nio.file.Paths; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; import org.onap.aai.config.SwaggerGenerationConfiguration; import org.onap.aai.setup.SchemaVersion; @@ -140,7 +141,7 @@ public class HTMLfromOXMTest { logger.debug(fileContent); assertThat(fileContent, is(HTMLresult(0))); } - + @Test public void testProcessWithCombiningJavaTypes() { SchemaVersion v = schemaVersions.getAppRootVersion(); @@ -226,11 +227,11 @@ public class HTMLfromOXMTest { public String HTMLheader() { StringBuilder sb = new StringBuilder(1500); - sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"); - 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\"\nxmlns:jaxb=\"http://java.sun.com/xml/ns/jaxb\"\r\n"); - sb.append(" jaxb:version=\"2.1\"\r\n"); - sb.append(" xmlns:annox=\"http://annox.dev.java.net\"\r\n"); - sb.append(" jaxb:extensionBindingPrefixes=\"annox\">\n\n"); + sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" + OxmFileProcessor.LINE_SEPARATOR); + 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); + sb.append(" jaxb:version=\"2.1\"" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" xmlns:annox=\"http://annox.dev.java.net\"" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" jaxb:extensionBindingPrefixes=\"annox\">" + OxmFileProcessor.DOUBLE_LINE_SEPARATOR); return sb.toString(); } @@ -239,144 +240,145 @@ public class HTMLfromOXMTest { } public String HTMLdefs(int sbopt) { StringBuilder sb = new StringBuilder(1500); - sb.append(" <xs:element name=\"service-subscription\">\n"); - sb.append(" <xs:complexType>\n"); - sb.append(" <xs:annotation>\r\n"); - sb.append(" <xs:appinfo>\r\n"); - 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>\r\n"); - sb.append(" </xs:appinfo>\r\n"); - sb.append(" </xs:annotation>\r\n"); - sb.append(" <xs:sequence>\n"); - sb.append(" <xs:element name=\"service-type\" type=\"xs:string\" minOccurs=\"0\">\n"); - sb.append(" <xs:annotation>\r\n"); - sb.append(" <xs:appinfo>\r\n"); - sb.append(" <annox:annotate target=\"field\">@org.onap.aai.annotations.Metadata(isKey=true,description=\"Value defined by orchestration to identify this service.\")</annox:annotate>\r\n"); - sb.append(" </xs:appinfo>\r\n"); - sb.append(" </xs:annotation>\r\n"); - sb.append(" </xs:element>\n"); - sb.append(" <xs:element name=\"temp-ub-sub-account-id\" type=\"xs:string\" minOccurs=\"0\">\n"); - sb.append(" <xs:annotation>\r\n"); - sb.append(" <xs:appinfo>\r\n"); - sb.append(" <annox:annotate target=\"field\">@org.onap.aai.annotations.Metadata(description=\"This property will be deleted from A&AI in the near future. Only stop gap solution.\")</annox:annotate>\r\n"); - sb.append(" </xs:appinfo>\r\n"); - sb.append(" </xs:annotation>\r\n"); - sb.append(" </xs:element>\n"); - sb.append(" <xs:element name=\"resource-version\" type=\"xs:string\" minOccurs=\"0\">\n"); - sb.append(" <xs:annotation>\r\n"); - sb.append(" <xs:appinfo>\r\n"); - 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>\r\n"); - sb.append(" </xs:appinfo>\r\n"); - sb.append(" </xs:annotation>\r\n"); - sb.append(" </xs:element>\n"); - sb.append(" </xs:sequence>\n"); - sb.append(" </xs:complexType>\n"); - sb.append(" </xs:element>\n"); - sb.append(" <xs:element name=\"service-subscriptions\">\n"); - sb.append(" <xs:complexType>\n"); - sb.append(" <xs:annotation>\r\n"); - sb.append(" <xs:appinfo>\r\n"); - sb.append(" <annox:annotate target=\"class\">@org.onap.aai.annotations.Metadata(description=\"Collection of objects that group service instances.\")</annox:annotate>\r\n"); - sb.append(" </xs:appinfo>\r\n"); - sb.append(" </xs:annotation>\r\n"); - sb.append(" <xs:sequence>\n"); - sb.append(" <xs:element ref=\"tns:service-subscription\" minOccurs=\"0\" maxOccurs=\"5000\"/>\n"); - sb.append(" </xs:sequence>\n"); - sb.append(" </xs:complexType>\n"); - sb.append(" </xs:element>\n"); - sb.append(" <xs:element name=\"customer\">\n"); - sb.append(" <xs:complexType>\n"); - sb.append(" <xs:annotation>\r\n"); - sb.append(" <xs:appinfo>\r\n"); + sb.append(" <xs:element name=\"service-subscription\">" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + 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); + sb.append(" </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:element name=\"service-type\" type=\"xs:string\" minOccurs=\"0\">" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + 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); + sb.append(" </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:element>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:element name=\"temp-ub-sub-account-id\" type=\"xs:string\" minOccurs=\"0\">" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <annox:annotate target=\"field\">@org.onap.aai.annotations.Metadata(description=\"This property will be deleted from A&AI in the near future. Only stop gap solution.\")</annox:annotate>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:element>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:element name=\"resource-version\" type=\"xs:string\" minOccurs=\"0\">" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + 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); + sb.append(" </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:element>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:element>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:element name=\"service-subscriptions\">" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <annox:annotate target=\"class\">@org.onap.aai.annotations.Metadata(description=\"Collection of objects that group service instances.\")</annox:annotate>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:element ref=\"tns:service-subscription\" minOccurs=\"0\" maxOccurs=\"5000\"/>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:element>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:element name=\"customer\">" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); if ( sbopt == 0 ) { - 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>\r\n"); + 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); } else { - 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>\r\n"); + 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); } - sb.append(" </xs:appinfo>\r\n"); - sb.append(" </xs:annotation>\r\n"); - sb.append(" <xs:sequence>\n"); - sb.append(" <xs:element name=\"global-customer-id\" type=\"xs:string\" minOccurs=\"0\">\n"); - sb.append(" <xs:annotation>\r\n"); - sb.append(" <xs:appinfo>\r\n"); - 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>\r\n"); - sb.append(" </xs:appinfo>\r\n"); - sb.append(" </xs:annotation>\r\n"); - sb.append(" </xs:element>\n"); - sb.append(" <xs:element name=\"subscriber-name\" type=\"xs:string\" minOccurs=\"0\">\n"); - sb.append(" <xs:annotation>\r\n"); - sb.append(" <xs:appinfo>\r\n"); - sb.append(" <annox:annotate target=\"field\">@org.onap.aai.annotations.Metadata(description=\"Subscriber name, an alternate way to retrieve a customer.\")</annox:annotate>\r\n"); - sb.append(" </xs:appinfo>\r\n"); - sb.append(" </xs:annotation>\r\n"); - sb.append(" </xs:element>\n"); + sb.append(" </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:element name=\"global-customer-id\" type=\"xs:string\" minOccurs=\"0\">" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + 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); + sb.append(" </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:element>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:element name=\"subscriber-name\" type=\"xs:string\" minOccurs=\"0\">" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + 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); + sb.append(" </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:element>" + OxmFileProcessor.LINE_SEPARATOR); if ( sbopt == 0 ) { - sb.append(" <xs:element name=\"subscriber-type\" type=\"xs:string\" minOccurs=\"0\">\n"); - sb.append(" <xs:annotation>\r\n"); - sb.append(" <xs:appinfo>\r\n"); - 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>\r\n"); - sb.append(" </xs:appinfo>\r\n"); - sb.append(" </xs:annotation>\r\n"); - sb.append(" </xs:element>\n"); - sb.append(" <xs:element name=\"resource-version\" type=\"xs:string\" minOccurs=\"0\">\n"); - sb.append(" <xs:annotation>\r\n"); - sb.append(" <xs:appinfo>\r\n"); - 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>\r\n"); - sb.append(" </xs:appinfo>\r\n"); - sb.append(" </xs:annotation>\r\n"); - sb.append(" </xs:element>\n"); + sb.append(" <xs:element name=\"subscriber-type\" type=\"xs:string\" minOccurs=\"0\">" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + 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); + sb.append(" </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:element>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:element name=\"resource-version\" type=\"xs:string\" minOccurs=\"0\">" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + 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); + sb.append(" </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:element>" + OxmFileProcessor.LINE_SEPARATOR); } else { - sb.append(" <xs:element name=\"resource-version\" type=\"xs:string\" minOccurs=\"0\">\n"); - sb.append(" <xs:annotation>\r\n"); - sb.append(" <xs:appinfo>\r\n"); - 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>\r\n"); - sb.append(" </xs:appinfo>\r\n"); - sb.append(" </xs:annotation>\r\n"); - sb.append(" </xs:element>\n"); - sb.append(" <xs:element name=\"subscriber-type\" type=\"xs:string\" minOccurs=\"0\">\n"); - sb.append(" <xs:annotation>\r\n"); - sb.append(" <xs:appinfo>\r\n"); - 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>\r\n"); - sb.append(" </xs:appinfo>\r\n"); - sb.append(" </xs:annotation>\r\n"); - sb.append(" </xs:element>\n"); + sb.append(" <xs:element name=\"resource-version\" type=\"xs:string\" minOccurs=\"0\">" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + 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); + sb.append(" </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:element>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:element name=\"subscriber-type\" type=\"xs:string\" minOccurs=\"0\">" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + 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); + sb.append(" </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:element>" + OxmFileProcessor.LINE_SEPARATOR); } - sb.append(" <xs:element ref=\"tns:service-subscriptions\" minOccurs=\"0\"/>\n"); - sb.append(" </xs:sequence>\n"); - sb.append(" </xs:complexType>\n"); - sb.append(" </xs:element>\n"); - sb.append(" <xs:element name=\"customers\">\n"); - sb.append(" <xs:complexType>\n"); - sb.append(" <xs:annotation>\r\n"); - sb.append(" <xs:appinfo>\r\n"); - 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>\r\n"); - sb.append(" </xs:appinfo>\r\n"); - sb.append(" </xs:annotation>\r\n"); - sb.append(" <xs:sequence>\n"); - sb.append(" <xs:element ref=\"tns:customer\" minOccurs=\"0\" maxOccurs=\"5000\"/>\n"); - sb.append(" </xs:sequence>\n"); - sb.append(" </xs:complexType>\n"); - sb.append(" </xs:element>\n"); - sb.append(" <xs:element name=\"business\">\n"); - sb.append(" <xs:complexType>\n"); - sb.append(" <xs:annotation>\r\n"); - sb.append(" <xs:appinfo>\r\n"); - sb.append(" <annox:annotate target=\"class\">@org.onap.aai.annotations.Metadata(description=\"Namespace for business related constructs\")</annox:annotate>\r\n"); - sb.append(" </xs:appinfo>\r\n"); - sb.append(" </xs:annotation>\r\n"); - sb.append(" <xs:sequence>\n"); - sb.append(" <xs:element ref=\"tns:customers\" minOccurs=\"0\"/>\n"); - sb.append(" </xs:sequence>\n"); - sb.append(" </xs:complexType>\n"); - sb.append(" </xs:element>\n"); - sb.append(" <xs:element name=\"inventory\">\n"); - sb.append(" <xs:complexType>\n"); - sb.append(" <xs:sequence>\n"); - sb.append(" <xs:element ref=\"tns:business\" minOccurs=\"0\"/>\n"); - sb.append(" </xs:sequence>\n"); - sb.append(" </xs:complexType>\n"); - sb.append(" </xs:element>\n"); - sb.append("</xs:schema>\n"); + sb.append(" <xs:element ref=\"tns:service-subscriptions\" minOccurs=\"0\"/>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:element>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:element name=\"customers\">" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + 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); + sb.append(" </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:element ref=\"tns:customer\" minOccurs=\"0\" maxOccurs=\"5000\"/>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:element>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:element name=\"business\">" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <annox:annotate target=\"class\">@org.onap.aai.annotations.Metadata(description=\"Namespace for business related constructs\")</annox:annotate>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:element ref=\"tns:customers\" minOccurs=\"0\"/>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:element>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:element name=\"inventory\">" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" <xs:element ref=\"tns:business\" minOccurs=\"0\"/>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:sequence>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:complexType>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" </xs:element>" + OxmFileProcessor.LINE_SEPARATOR); + sb.append("</xs:schema>" + OxmFileProcessor.LINE_SEPARATOR); return sb.toString(); } } + diff --git a/aai-core/src/test/java/org/onap/aai/util/genxsd/XSDElementTest.java b/aai-core/src/test/java/org/onap/aai/util/genxsd/XSDElementTest.java index 7f0d1ed7..cfab4cc2 100644 --- a/aai-core/src/test/java/org/onap/aai/util/genxsd/XSDElementTest.java +++ b/aai-core/src/test/java/org/onap/aai/util/genxsd/XSDElementTest.java @@ -564,11 +564,11 @@ public class XSDElementTest { @Test public void testGetHTMLAnnotation() { ArrayList<String> target = new ArrayList<String>(); - target.add(" <xs:annotation>\r\n <xs:appinfo>\r\n <annox:annotate target=\"Business\">@org.onap.aai.annotations.Metadata(description=\"Namespace for business related constructs\")</annox:annotate>\r\n </xs:appinfo>\r\n </xs:annotation>\r\n"); - target.add(" <xs:annotation>\r\n <xs:appinfo>\r\n <annox:annotate target=\"Customers\">@org.onap.aai.annotations.Metadata(description=\"Collection of customer identifiers to provide linkage back to BSS information.\")</annox:annotate>\r\n </xs:appinfo>\r\n </xs:annotation>\r\n"); - target.add(" <xs:annotation>\r\n <xs:appinfo>\r\n <annox:annotate target=\"Customer\">@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>\r\n </xs:appinfo>\r\n </xs:annotation>\r\n"); - target.add(" <xs:annotation>\r\n <xs:appinfo>\r\n <annox:annotate target=\"ServiceSubscriptions\">@org.onap.aai.annotations.Metadata(description=\"Collection of objects that group service instances.\")</annox:annotate>\r\n </xs:appinfo>\r\n </xs:annotation>\r\n"); - target.add(" <xs:annotation>\r\n <xs:appinfo>\r\n <annox:annotate target=\"ServiceSubscription\">@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>\r\n </xs:appinfo>\r\n </xs:annotation>\r\n"); + target.add(" <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR + " <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR + " <annox:annotate target=\"Business\">@org.onap.aai.annotations.Metadata(description=\"Namespace for business related constructs\")</annox:annotate>" + OxmFileProcessor.LINE_SEPARATOR + " </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR + " </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + target.add(" <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR + " <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR + " <annox:annotate target=\"Customers\">@org.onap.aai.annotations.Metadata(description=\"Collection of customer identifiers to provide linkage back to BSS information.\")</annox:annotate>" + OxmFileProcessor.LINE_SEPARATOR + " </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR + " </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + target.add(" <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR + " <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR + " <annox:annotate target=\"Customer\">@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 + " </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR + " </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + target.add(" <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR + " <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR + " <annox:annotate target=\"ServiceSubscriptions\">@org.onap.aai.annotations.Metadata(description=\"Collection of objects that group service instances.\")</annox:annotate>" + OxmFileProcessor.LINE_SEPARATOR + " </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR + " </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); + target.add(" <xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR + " <xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR + " <annox:annotate target=\"ServiceSubscription\">@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 + " </xs:appinfo>" + OxmFileProcessor.LINE_SEPARATOR + " </xs:annotation>" + OxmFileProcessor.LINE_SEPARATOR); List<String> annotes = new ArrayList<String>(); for ( int i = 0; i < javaTypeNodes.getLength(); ++ i ) { XSDElement javaTypeElement = new XSDElement((Element) javaTypeNodes.item(i)); |