From 9bae143d3310eb57bfbb0674f62f278f740db0f4 Mon Sep 17 00:00:00 2001 From: "Kajur, Harish (vk250x)" Date: Thu, 1 Nov 2018 15:44:03 -0400 Subject: Replace platform specific line seperators System Issue-ID: AAI-1463 Change-Id: Ibdd3803dd825342d54dfa1b008f1a8c2d78d6198 Signed-off-by: Kajur, Harish (vk250x) --- .../java/org/onap/aai/util/genxsd/HTMLfromOXM.java | 64 ++--- .../org/onap/aai/util/genxsd/OxmFileProcessor.java | 4 + .../java/org/onap/aai/util/genxsd/XSDElement.java | 31 ++- .../org/onap/aai/util/genxsd/HTMLfromOXMTest.java | 276 +++++++++++---------- .../org/onap/aai/util/genxsd/XSDElementTest.java | 10 +- 5 files changed, 196 insertions(+), 189 deletions(-) diff --git a/aai-core/src/main/java/org/onap/aai/util/genxsd/HTMLfromOXM.java b/aai-core/src/main/java/org/onap/aai/util/genxsd/HTMLfromOXM.java index b1a4d919..7d3b37d1 100644 --- a/aai-core/src/main/java/org/onap/aai/util/genxsd/HTMLfromOXM.java +++ b/aai-core/src/main/java/org/onap/aai/util/genxsd/HTMLfromOXM.java @@ -28,7 +28,7 @@ import java.util.List; import javax.xml.parsers.ParserConfigurationException; -import org.apache.commons.lang.StringUtils; + import org.onap.aai.config.SpringContextAware; import org.onap.aai.edges.EdgeIngestor; import org.onap.aai.edges.exceptions.EdgeRuleNotFoundException; @@ -42,16 +42,12 @@ import org.slf4j.LoggerFactory; import org.w3c.dom.Attr; import org.w3c.dom.Element; import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; -import com.google.common.base.CaseFormat; - public class HTMLfromOXM extends OxmFileProcessor { private static final Logger logger = LoggerFactory.getLogger("HTMLfromOXM.class"); - public static final String LINE_SEPARATOR = System.getProperty("line.separator"); private String maxOccurs; @@ -77,7 +73,7 @@ public class HTMLfromOXM extends OxmFileProcessor { public String getDocumentHeader() { StringBuffer sb = new StringBuffer(); logger.trace("processing starts"); - sb.append("\n"); + sb.append("" + LINE_SEPARATOR); String namespace = "org.onap"; if (v.compareTo(getSchemaVersions().getNamespaceChangeVersion()) < 0 ) { namespace = "org.openecomp"; @@ -85,22 +81,22 @@ public class HTMLfromOXM extends OxmFileProcessor { if ( versionUsesAnnotations(v.toString()) ) { sb.append("\n\n"); + + LINE_SEPARATOR + + "xmlns:jaxb=\"http://java.sun.com/xml/ns/jaxb\"" + LINE_SEPARATOR + + " jaxb:version=\"2.1\"" + LINE_SEPARATOR + + " xmlns:annox=\"http://annox.dev.java.net\"" + LINE_SEPARATOR + + " jaxb:extensionBindingPrefixes=\"annox\">" + DOUBLE_LINE_SEPARATOR); } else { sb.append("\n\n"); + + v.toString() + "\" xmlns:tns=\"http://" + namespace + ".aai.inventory/" + v.toString() + "\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">" + DOUBLE_LINE_SEPARATOR); } return sb.toString(); } - @Override public String process() throws ParserConfigurationException, SAXException, IOException, AAIException, FileNotFoundException, EdgeRuleNotFoundException { StringBuilder sb = new StringBuilder(); + try { init(); } catch(Exception e) { @@ -141,11 +137,10 @@ public class HTMLfromOXM extends OxmFileProcessor { sb.append(processJavaTypeElement( javaTypeName, javaTypeElement, sbInventory )); } sb.append(sbInventory); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append("\n"); - StringBuilder invalidSb = new StringBuilder(); + sb.append(" " + LINE_SEPARATOR); + sb.append(" " + LINE_SEPARATOR); + sb.append(" " + LINE_SEPARATOR); + sb.append("" + LINE_SEPARATOR); return sb.toString(); } @@ -156,6 +151,14 @@ public class HTMLfromOXM extends OxmFileProcessor { String pattern = "^[a-z0-9-]*$"; return name.matches(pattern); } + + protected boolean skipCheck( String javaAttribute ) { + if ( javaAttribute.equals("model") + || javaAttribute.equals("eventHeader") ) { + return true; + } + return false; + } public String processJavaTypeElement( String javaTypeName, Element javaType_Element, StringBuilder sbInventory) { String xmlRootElementName = getXMLRootElementName(javaType_Element); @@ -183,15 +186,15 @@ public class HTMLfromOXM extends OxmFileProcessor { if ( xmlElementNodes.getLength() > 0 ) { if ( !processingInventory || !hasPreviousInventory ) { - sb1.append(" \n"); - sb1.append(" \n"); + sb1.append(" " + LINE_SEPARATOR); + sb1.append(" " + LINE_SEPARATOR); XSDElement javaTypeElement = new XSDElement(javaType_Element, maxOccurs); logger.debug("XSDElement name: "+javaTypeElement.name()); if(versionUsesAnnotations(v.toString())) { sb1.append(javaTypeElement.getHTMLAnnotation("class", " ")); } - sb1.append(" \n"); + sb1.append(" " + LINE_SEPARATOR); } Element javatypeElement; for ( int i = 0; i < xmlElementNodes.getLength(); ++i ) { @@ -205,7 +208,6 @@ public class HTMLfromOXM extends OxmFileProcessor { if ( elementType.contains("." + v.toString() + ".") && !generatedJavaType.containsKey(addType) ) { generatedJavaType.put(addType, elementType); javatypeElement = getJavaTypeElement(addType, processingInventory); - sb.append(processJavaTypeElement( addType, javatypeElement, null )); } if ("Nodes".equals(addType)) { @@ -216,18 +218,18 @@ public class HTMLfromOXM extends OxmFileProcessor { sb1.append(xmlElementElement.getHTMLElement(v, versionUsesAnnotations(v.toString()), this)); } if ( !processingInventory ) { - sb1.append(" \n"); - sb1.append(" \n"); - sb1.append(" \n"); + sb1.append(" " + LINE_SEPARATOR); + sb1.append(" " + LINE_SEPARATOR); + sb1.append(" " + LINE_SEPARATOR); } } if ( xmlElementNodes.getLength() < 1 ) { - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); + sb.append(" " + LINE_SEPARATOR); + sb.append(" " + LINE_SEPARATOR); + sb.append(" " + LINE_SEPARATOR); + sb.append(" " + LINE_SEPARATOR); + sb.append(" " + LINE_SEPARATOR); generatedJavaType.put(javaTypeName, null); return sb.toString(); } @@ -283,4 +285,4 @@ public class HTMLfromOXM extends OxmFileProcessor { } return false; } -} \ No newline at end of file +} diff --git a/aai-core/src/main/java/org/onap/aai/util/genxsd/OxmFileProcessor.java b/aai-core/src/main/java/org/onap/aai/util/genxsd/OxmFileProcessor.java index 44e5a9f8..a758be50 100644 --- a/aai-core/src/main/java/org/onap/aai/util/genxsd/OxmFileProcessor.java +++ b/aai-core/src/main/java/org/onap/aai/util/genxsd/OxmFileProcessor.java @@ -62,6 +62,10 @@ import org.xml.sax.SAXException; import org.xml.sax.InputSource; public abstract class OxmFileProcessor { + + public static final String LINE_SEPARATOR = System.getProperty("line.separator"); + public static final String DOUBLE_LINE_SEPARATOR = System.getProperty("line.separator") + System.getProperty("line.separator"); + EdgeIngestor ei; NodeIngestor ni; protected Set namespaceFilter; diff --git a/aai-core/src/main/java/org/onap/aai/util/genxsd/XSDElement.java b/aai-core/src/main/java/org/onap/aai/util/genxsd/XSDElement.java index 1494b8f6..9de7967e 100644 --- a/aai-core/src/main/java/org/onap/aai/util/genxsd/XSDElement.java +++ b/aai-core/src/main/java/org/onap/aai/util/genxsd/XSDElement.java @@ -314,11 +314,11 @@ public class XSDElement implements Element { } if(useAnnotation) { String annotation = new XSDElement(xmlElementElement, maxOccurs).getHTMLAnnotation("field", " "); - sbElement.append(StringUtils.isNotEmpty(annotation) ? ">\n" : ""); + sbElement.append(StringUtils.isNotEmpty(annotation) ? ">" + OxmFileProcessor.LINE_SEPARATOR : ""); sbElement.append(annotation); - sbElement.append(StringUtils.isNotEmpty(annotation) ? " \n" : "/>\n" ); + sbElement.append(StringUtils.isNotEmpty(annotation) ? " " + OxmFileProcessor.LINE_SEPARATOR : "/>" + OxmFileProcessor.LINE_SEPARATOR ); } else { - sbElement.append("/>\n"); + sbElement.append("/>" + OxmFileProcessor.LINE_SEPARATOR); } return this.getHTMLElementWrapper(sbElement.toString(), v, useAnnotation); // return sbElement.toString(); @@ -346,18 +346,18 @@ public class XSDElement implements Element { if ( elementIsRequired == null || !elementIsRequired.equals("true")||addType != null) { sbElement.append(" minOccurs=\"0\""); } - sbElement.append(">\n"); - sbElement.append(" \n"); + sbElement.append(">" + OxmFileProcessor.LINE_SEPARATOR); + sbElement.append(" " + OxmFileProcessor.LINE_SEPARATOR); if(useAnnotation) { XSDElement javaTypeElement = new XSDElement((Element)this.getParentNode(), maxOccurs); sbElement.append(javaTypeElement.getHTMLAnnotation("class", " ")); } - sbElement.append(" \n"); + sbElement.append(" " + OxmFileProcessor.LINE_SEPARATOR); sbElement.append(" "); sbElement.append(unwrappedElement); - sbElement.append(" \n"); - sbElement.append(" \n"); - sbElement.append(" \n"); + sbElement.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sbElement.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sbElement.append(" " + OxmFileProcessor.LINE_SEPARATOR); return sbElement.toString(); } @@ -394,12 +394,12 @@ public class XSDElement implements Element { if(metadata.size() == 0) { return ""; } - sb.append(indentation +"\r\n"); + sb.append(indentation +"" + OxmFileProcessor.LINE_SEPARATOR); sb.append( - indentation + " \r\n" + - indentation + " @org.onap.aai.annotations.Metadata(" + Joiner.on(",").join(metadata) + ")\r\n" + - indentation + " \r\n"); - sb.append(indentation +"\r\n"); + indentation + " " + OxmFileProcessor.LINE_SEPARATOR + + indentation + " @org.onap.aai.annotations.Metadata(" + Joiner.on(",").join(metadata) + ")" + OxmFileProcessor.LINE_SEPARATOR + + indentation + " " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(indentation +"" + OxmFileProcessor.LINE_SEPARATOR); return sb.toString(); } @@ -731,5 +731,4 @@ public class XSDElement implements Element { } -} - +} \ No newline at end of file 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("\n"); - sb.append("\n\n"); + sb.append("" + OxmFileProcessor.LINE_SEPARATOR); + sb.append("" + 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(" \n"); - sb.append(" \n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" @org.onap.aai.annotations.Metadata(description=\"Object that group service instances.\",indexedProps=\"service-type\",dependentOn=\"customer\",container=\"service-subscriptions\",crossEntityReference=\"service-instance,service-type\")\r\n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" @org.onap.aai.annotations.Metadata(isKey=true,description=\"Value defined by orchestration to identify this service.\")\r\n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" @org.onap.aai.annotations.Metadata(description=\"This property will be deleted from A&AI in the near future. Only stop gap solution.\")\r\n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" @org.onap.aai.annotations.Metadata(description=\"Used for optimistic concurrency. Must be empty on create, valid on update and delete.\")\r\n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" @org.onap.aai.annotations.Metadata(description=\"Collection of objects that group service instances.\")\r\n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \r\n"); - sb.append(" \r\n"); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" @org.onap.aai.annotations.Metadata(description=\"Object that group service instances.\",indexedProps=\"service-type\",dependentOn=\"customer\",container=\"service-subscriptions\",crossEntityReference=\"service-instance,service-type\")" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" @org.onap.aai.annotations.Metadata(isKey=true,description=\"Value defined by orchestration to identify this service.\")" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" @org.onap.aai.annotations.Metadata(description=\"This property will be deleted from A&AI in the near future. Only stop gap solution.\")" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" @org.onap.aai.annotations.Metadata(description=\"Used for optimistic concurrency. Must be empty on create, valid on update and delete.\")" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" @org.onap.aai.annotations.Metadata(description=\"Collection of objects that group service instances.\")" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); if ( sbopt == 0 ) { - sb.append(" @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\")\r\n"); + sb.append(" @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\")" + OxmFileProcessor.LINE_SEPARATOR); } else { - sb.append(" @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\")\r\n"); + sb.append(" @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\")" + OxmFileProcessor.LINE_SEPARATOR); } - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" @org.onap.aai.annotations.Metadata(isKey=true,description=\"Global customer id used across to uniquely identify customer.\")\r\n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" @org.onap.aai.annotations.Metadata(description=\"Subscriber name, an alternate way to retrieve a customer.\")\r\n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" \n"); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" @org.onap.aai.annotations.Metadata(isKey=true,description=\"Global customer id used across to uniquely identify customer.\")" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" @org.onap.aai.annotations.Metadata(description=\"Subscriber name, an alternate way to retrieve a customer.\")" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); if ( sbopt == 0 ) { - sb.append(" \n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" @org.onap.aai.annotations.Metadata(description=\"Subscriber type, a way to provide VID with only the INFRA customers.\",defaultValue=\"CUST\")\r\n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" @org.onap.aai.annotations.Metadata(description=\"Used for optimistic concurrency. Must be empty on create, valid on update and delete.\")\r\n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" \n"); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" @org.onap.aai.annotations.Metadata(description=\"Subscriber type, a way to provide VID with only the INFRA customers.\",defaultValue=\"CUST\")" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" @org.onap.aai.annotations.Metadata(description=\"Used for optimistic concurrency. Must be empty on create, valid on update and delete.\")" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); } else { - sb.append(" \n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" @org.onap.aai.annotations.Metadata(description=\"Used for optimistic concurrency. Must be empty on create, valid on update and delete.\")\r\n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" @org.onap.aai.annotations.Metadata(description=\"Subscriber type, a way to provide VID with only the INFRA customers.\",defaultValue=\"CUST\")\r\n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" \n"); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" @org.onap.aai.annotations.Metadata(description=\"Used for optimistic concurrency. Must be empty on create, valid on update and delete.\")" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" @org.onap.aai.annotations.Metadata(description=\"Subscriber type, a way to provide VID with only the INFRA customers.\",defaultValue=\"CUST\")" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); } - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" @org.onap.aai.annotations.Metadata(description=\"Collection of customer identifiers to provide linkage back to BSS information.\")\r\n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" @org.onap.aai.annotations.Metadata(description=\"Namespace for business related constructs\")\r\n"); - sb.append(" \r\n"); - sb.append(" \r\n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append(" \n"); - sb.append("\n"); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" @org.onap.aai.annotations.Metadata(description=\"Collection of customer identifiers to provide linkage back to BSS information.\")" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" @org.onap.aai.annotations.Metadata(description=\"Namespace for business related constructs\")" + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append(" " + OxmFileProcessor.LINE_SEPARATOR); + sb.append("" + 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 target = new ArrayList(); - target.add(" \r\n \r\n @org.onap.aai.annotations.Metadata(description=\"Namespace for business related constructs\")\r\n \r\n \r\n"); - target.add(" \r\n \r\n @org.onap.aai.annotations.Metadata(description=\"Collection of customer identifiers to provide linkage back to BSS information.\")\r\n \r\n \r\n"); - target.add(" \r\n \r\n @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\")\r\n \r\n \r\n"); - target.add(" \r\n \r\n @org.onap.aai.annotations.Metadata(description=\"Collection of objects that group service instances.\")\r\n \r\n \r\n"); - target.add(" \r\n \r\n @org.onap.aai.annotations.Metadata(description=\"Object that group service instances.\",indexedProps=\"service-type\",dependentOn=\"customer\",container=\"service-subscriptions\",crossEntityReference=\"service-instance,service-type\")\r\n \r\n \r\n"); + target.add(" " + OxmFileProcessor.LINE_SEPARATOR + " " + OxmFileProcessor.LINE_SEPARATOR + " @org.onap.aai.annotations.Metadata(description=\"Namespace for business related constructs\")" + OxmFileProcessor.LINE_SEPARATOR + " " + OxmFileProcessor.LINE_SEPARATOR + " " + OxmFileProcessor.LINE_SEPARATOR); + target.add(" " + OxmFileProcessor.LINE_SEPARATOR + " " + OxmFileProcessor.LINE_SEPARATOR + " @org.onap.aai.annotations.Metadata(description=\"Collection of customer identifiers to provide linkage back to BSS information.\")" + OxmFileProcessor.LINE_SEPARATOR + " " + OxmFileProcessor.LINE_SEPARATOR + " " + OxmFileProcessor.LINE_SEPARATOR); + target.add(" " + OxmFileProcessor.LINE_SEPARATOR + " " + OxmFileProcessor.LINE_SEPARATOR + " @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\")" + OxmFileProcessor.LINE_SEPARATOR + " " + OxmFileProcessor.LINE_SEPARATOR + " " + OxmFileProcessor.LINE_SEPARATOR); + target.add(" " + OxmFileProcessor.LINE_SEPARATOR + " " + OxmFileProcessor.LINE_SEPARATOR + " @org.onap.aai.annotations.Metadata(description=\"Collection of objects that group service instances.\")" + OxmFileProcessor.LINE_SEPARATOR + " " + OxmFileProcessor.LINE_SEPARATOR + " " + OxmFileProcessor.LINE_SEPARATOR); + target.add(" " + OxmFileProcessor.LINE_SEPARATOR + " " + OxmFileProcessor.LINE_SEPARATOR + " @org.onap.aai.annotations.Metadata(description=\"Object that group service instances.\",indexedProps=\"service-type\",dependentOn=\"customer\",container=\"service-subscriptions\",crossEntityReference=\"service-instance,service-type\")" + OxmFileProcessor.LINE_SEPARATOR + " " + OxmFileProcessor.LINE_SEPARATOR + " " + OxmFileProcessor.LINE_SEPARATOR); List annotes = new ArrayList(); for ( int i = 0; i < javaTypeNodes.getLength(); ++ i ) { XSDElement javaTypeElement = new XSDElement((Element) javaTypeNodes.item(i)); -- cgit 1.2.3-korg