summaryrefslogtreecommitdiffstats
path: root/aai-schema/src
diff options
context:
space:
mode:
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>2022-09-17 20:42:06 +0200
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>2022-09-17 20:42:06 +0200
commite0ad4f2890f9f933199bc6f1b3f0e988da471aa9 (patch)
tree0c42f25d258aeb0327cdafab0012ddbba13e040d /aai-schema/src
parent1b2c97dbc18bc0db5610fc18e9ae690b7a40d06d (diff)
Replace all tab characters in java files with two spaces to remove linter warning
Issue-ID: AAI-3525 Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de> Change-Id: I36cf7b83dd33c3b69de51e56e00bbd93a79c5ec4
Diffstat (limited to 'aai-schema/src')
-rw-r--r--aai-schema/src/test/java/org/onap/aai/schema/ValidateOXMTest.java124
1 files changed, 62 insertions, 62 deletions
diff --git a/aai-schema/src/test/java/org/onap/aai/schema/ValidateOXMTest.java b/aai-schema/src/test/java/org/onap/aai/schema/ValidateOXMTest.java
index a65ddd9..222ed05 100644
--- a/aai-schema/src/test/java/org/onap/aai/schema/ValidateOXMTest.java
+++ b/aai-schema/src/test/java/org/onap/aai/schema/ValidateOXMTest.java
@@ -311,68 +311,68 @@ public class ValidateOXMTest {
* @throws ParserConfigurationException
*/
@Test
- public void verifyAllUriTemplateHaveNamespace()
- throws XPathExpressionException, IOException, SAXException, ParserConfigurationException {
- boolean foundIssue = false;
- List<File> fileList = getOxmSchemaFiles();
- fileList.addAll(getOnapOxmSchemaFiles());
- StringBuilder msg = new StringBuilder();
- for (File file : fileList) {
- msg.append(file.getAbsolutePath().replaceAll(".*aai-schema", ""));
- msg.append("\n");
- Document xmlDocument = getDocument(file);
- XPath xPath = XPathFactory.newInstance().newXPath();
- String expression = "/xml-bindings/java-types/java-type["
- + "count(xml-properties/xml-property[@name='namespace']) > 0 " + "]";
- NodeList nodeList = (NodeList) xPath.compile(expression).evaluate(xmlDocument, XPathConstants.NODESET);
-
- for (int i = 0; i < nodeList.getLength(); i++) {
- String name = nodeList.item(i).getAttributes().getNamedItem("name").getNodeValue();
-
- NodeList childNodeList = (NodeList) nodeList.item(i).getChildNodes();
- for (int j = 0; j < childNodeList.getLength(); j++) {
-
- String nodeName = childNodeList.item(j).getNodeName();
- NodeList xmlPropertyNodeList = childNodeList.item(j).getChildNodes();
- if (XMLPROPERTIES.equals(nodeName)) {
-
- String namespaceVal = "";
- String uriTemplateVal = "";
- for (int k = 0; k < xmlPropertyNodeList.getLength(); k++) {
-
- if ("xml-property".equals(xmlPropertyNodeList.item(k).getNodeName())) {
-
- NamedNodeMap attributes = xmlPropertyNodeList.item(k).getAttributes();
-
- if ("namespace".equals(attributes.getNamedItem("name").getNodeValue())) {
- namespaceVal = attributes.getNamedItem("value").getNodeValue();
- }
- if ("uriTemplate".equals(attributes.getNamedItem("name").getNodeValue())) {
- uriTemplateVal = attributes.getNamedItem("value").getNodeValue();
- }
-
- }
-
- }
-
- if (!uriTemplateVal.startsWith("/" + namespaceVal + "/")) {
- foundIssue = true;
- msg.append("\t");
- msg.append(uriTemplateVal);
- msg.append("\n");
- }
-
- }
- }
-
- }
- }
- if (foundIssue) {
- System.out.println(msg.toString());
- fail("uriTemplate doesnt start with /namespace/.");
- }
-
- }
+ public void verifyAllUriTemplateHaveNamespace()
+ throws XPathExpressionException, IOException, SAXException, ParserConfigurationException {
+ boolean foundIssue = false;
+ List<File> fileList = getOxmSchemaFiles();
+ fileList.addAll(getOnapOxmSchemaFiles());
+ StringBuilder msg = new StringBuilder();
+ for (File file : fileList) {
+ msg.append(file.getAbsolutePath().replaceAll(".*aai-schema", ""));
+ msg.append("\n");
+ Document xmlDocument = getDocument(file);
+ XPath xPath = XPathFactory.newInstance().newXPath();
+ String expression = "/xml-bindings/java-types/java-type["
+ + "count(xml-properties/xml-property[@name='namespace']) > 0 " + "]";
+ NodeList nodeList = (NodeList) xPath.compile(expression).evaluate(xmlDocument, XPathConstants.NODESET);
+
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ String name = nodeList.item(i).getAttributes().getNamedItem("name").getNodeValue();
+
+ NodeList childNodeList = (NodeList) nodeList.item(i).getChildNodes();
+ for (int j = 0; j < childNodeList.getLength(); j++) {
+
+ String nodeName = childNodeList.item(j).getNodeName();
+ NodeList xmlPropertyNodeList = childNodeList.item(j).getChildNodes();
+ if (XMLPROPERTIES.equals(nodeName)) {
+
+ String namespaceVal = "";
+ String uriTemplateVal = "";
+ for (int k = 0; k < xmlPropertyNodeList.getLength(); k++) {
+
+ if ("xml-property".equals(xmlPropertyNodeList.item(k).getNodeName())) {
+
+ NamedNodeMap attributes = xmlPropertyNodeList.item(k).getAttributes();
+
+ if ("namespace".equals(attributes.getNamedItem("name").getNodeValue())) {
+ namespaceVal = attributes.getNamedItem("value").getNodeValue();
+ }
+ if ("uriTemplate".equals(attributes.getNamedItem("name").getNodeValue())) {
+ uriTemplateVal = attributes.getNamedItem("value").getNodeValue();
+ }
+
+ }
+
+ }
+
+ if (!uriTemplateVal.startsWith("/" + namespaceVal + "/")) {
+ foundIssue = true;
+ msg.append("\t");
+ msg.append(uriTemplateVal);
+ msg.append("\n");
+ }
+
+ }
+ }
+
+ }
+ }
+ if (foundIssue) {
+ System.out.println(msg.toString());
+ fail("uriTemplate doesnt start with /namespace/.");
+ }
+
+ }
/**