From e0ad4f2890f9f933199bc6f1b3f0e988da471aa9 Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Sat, 17 Sep 2022 20:42:06 +0200 Subject: Replace all tab characters in java files with two spaces to remove linter warning Issue-ID: AAI-3525 Signed-off-by: Fiete Ostkamp Change-Id: I36cf7b83dd33c3b69de51e56e00bbd93a79c5ec4 --- .../java/org/onap/aai/schema/ValidateOXMTest.java | 124 ++++++++++----------- 1 file changed, 62 insertions(+), 62 deletions(-) (limited to 'aai-schema/src') 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 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 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/."); + } + + } /** -- cgit 1.2.3-korg