From fa2e088e613c35fbfd4a19ac0e0cb88ce9ef7448 Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Thu, 10 Nov 2022 20:45:04 +0000 Subject: Update aai-schema-ingest dependency in the schema-service - SchemaVersions object is being renamed to SchemaConfigVersions in aai-schema-ingest > 1.4.0 - add logback config to set log level to INFO, since a test run would otherwise generate 6GB worth of logs (when piped into a file) Issue-ID: AAI-3592 Signed-off-by: Fiete Ostkamp Change-Id: I7e0a6f4577d2254d8f58956f4ad3ea39bd74dc8d --- aai-schema-gen/pom.xml | 10 +- .../org/onap/aai/schemagen/AutoGenerateHtml.java | 53 ++-- .../java/org/onap/aai/schemagen/GenerateXsd.java | 13 +- .../onap/aai/schemagen/SchemaConfiguration.java | 27 +- .../schemagen/SwaggerGenerationConfiguration.java | 18 +- .../schemagen/genxsd/ConfigTranslatorForDocs.java | 17 +- .../org/onap/aai/schemagen/genxsd/HTMLfromOXM.java | 8 +- .../aai/schemagen/genxsd/NodesYAMLfromOXM.java | 8 +- .../aai/schemagen/genxsd/OxmFileProcessor.java | 17 +- .../org/onap/aai/schemagen/genxsd/YAMLfromOXM.java | 6 +- .../aai/schemagen/swagger/GenerateSwagger.java | 10 +- aai-schema-gen/src/main/resources/logback.xml | 295 +++++++++++++++++++++ .../org/onap/aai/schemagen/GenerateXsdTest.java | 18 +- .../aai/schemagen/genxsd/EdgeDescriptionTest.java | 10 +- .../onap/aai/schemagen/genxsd/HTMLfromOXMTest.java | 20 +- .../aai/schemagen/genxsd/NodesYAMLfromOXMTest.java | 22 +- .../schemagen/genxsd/PutRelationPathSetTest.java | 8 +- .../onap/aai/schemagen/genxsd/YAMLfromOXMTest.java | 32 +-- .../TestUtilConfigTranslatorforBusiness.java | 10 +- .../TestUtilConfigTranslatorforDataLink.java | 6 +- .../TestUtilConfigTranslatorforEdges.java | 10 +- .../dbedgerules/DbEdgeBusinessRules_test.json | 74 +++--- .../dbedgerules/EdgeDescriptionRules_test.json | 39 --- 23 files changed, 505 insertions(+), 226 deletions(-) create mode 100644 aai-schema-gen/src/main/resources/logback.xml delete mode 100644 aai-schema-gen/src/test/resources/dbedgerules/EdgeDescriptionRules_test.json diff --git a/aai-schema-gen/pom.xml b/aai-schema-gen/pom.xml index 3030346..31da141 100644 --- a/aai-schema-gen/pom.xml +++ b/aai-schema-gen/pom.xml @@ -21,8 +21,8 @@ --> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 org.onap.aai.schema-service @@ -34,7 +34,7 @@ https://nexus.onap.org - https://wiki.onap.org/ + https://wiki.onap.org/ v19 onap /aai @@ -660,7 +660,7 @@ org.onap.aai.aai-common aai-schema-ingest - 1.4.0 + 1.9.3 compile @@ -765,4 +765,4 @@ - + \ No newline at end of file diff --git a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/AutoGenerateHtml.java b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/AutoGenerateHtml.java index 9460175..f279aef 100644 --- a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/AutoGenerateHtml.java +++ b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/AutoGenerateHtml.java @@ -22,8 +22,6 @@ package org.onap.aai.schemagen; -import freemarker.template.TemplateException; - import java.io.File; import java.io.IOException; import java.util.Collections; @@ -31,13 +29,15 @@ import java.util.List; import java.util.ListIterator; import org.onap.aai.schemagen.swagger.GenerateSwagger; +import org.onap.aai.setup.SchemaConfigVersions; import org.onap.aai.setup.SchemaVersion; -import org.onap.aai.setup.SchemaVersions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeansException; import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import freemarker.template.TemplateException; + public class AutoGenerateHtml { private static Logger logger = LoggerFactory.getLogger(AutoGenerateHtml.class); @@ -53,31 +53,32 @@ public class AutoGenerateHtml { try (AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext( "org.onap.aai.setup", "org.onap.aai.schemagen")) { - SchemaVersions schemaVersions = ctx.getBean(SchemaVersions.class); - List versionsToGen = schemaVersions.getVersions(); - Collections.sort(versionsToGen); - Collections.reverse(versionsToGen); - ListIterator versionIterator = versionsToGen.listIterator(); - String schemaDir; - if (System.getProperty("user.dir") != null - && !System.getProperty("user.dir").contains(DEFAULT_RUN_DIR)) { - schemaDir = ALT_SCHEMA_DIR; - } else { - schemaDir = DEFAULT_SCHEMA_DIR; - } - String release = System.getProperty("aai.release", "onap"); - while (versionIterator.hasNext()) { - System.setProperty(AAI_GENERATE_VERSION, versionIterator.next().toString()); - String yamlFile = - schemaDir + "/src/main/resources/" + release + "/aai_swagger_yaml/aai_swagger_" - + System.getProperty(AAI_GENERATE_VERSION) + ".yaml"; - File swaggerYamlFile = new File(yamlFile); - if (swaggerYamlFile.exists()) { - GenerateSwagger.schemaVersions = schemaVersions; - GenerateSwagger.main(args); - } + SchemaConfigVersions schemaConfigVersions = ctx.getBean(SchemaConfigVersions.class); + + List versionsToGen = schemaConfigVersions.getVersions(); + Collections.sort(versionsToGen); + Collections.reverse(versionsToGen); + ListIterator versionIterator = versionsToGen.listIterator(); + String schemaDir; + if (System.getProperty("user.dir") != null + && !System.getProperty("user.dir").contains(DEFAULT_RUN_DIR)) { + schemaDir = ALT_SCHEMA_DIR; + } else { + schemaDir = DEFAULT_SCHEMA_DIR; + } + String release = System.getProperty("aai.release", "onap"); + while (versionIterator.hasNext()) { + System.setProperty(AAI_GENERATE_VERSION, versionIterator.next().toString()); + String yamlFile = + schemaDir + "/src/main/resources/" + release + "/aai_swagger_yaml/aai_swagger_" + + System.getProperty(AAI_GENERATE_VERSION) + ".yaml"; + File swaggerYamlFile = new File(yamlFile); + if (swaggerYamlFile.exists()) { + GenerateSwagger.schemaConfigVersions = schemaConfigVersions; + GenerateSwagger.main(args); } + } } catch (BeansException e) { logger.warn("Unable to initialize AnnotationConfigApplicationContext ", e); } diff --git a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/GenerateXsd.java b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/GenerateXsd.java index 2655e3c..f9e7b4d 100644 --- a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/GenerateXsd.java +++ b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/GenerateXsd.java @@ -37,8 +37,8 @@ import java.util.Map; import org.onap.aai.schemagen.genxsd.HTMLfromOXM; import org.onap.aai.schemagen.genxsd.NodesYAMLfromOXM; import org.onap.aai.schemagen.genxsd.YAMLfromOXM; +import org.onap.aai.setup.SchemaConfigVersions; import org.onap.aai.setup.SchemaVersion; -import org.onap.aai.setup.SchemaVersions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeansException; @@ -109,11 +109,12 @@ public class GenerateXsd { return true; } - SchemaVersions schemaVersions = SpringContextAware.getBean(SchemaVersions.class); - if (schemaVersions == null) { + SchemaConfigVersions schemaConfigVersions = + SpringContextAware.getBean(SchemaConfigVersions.class); + if (schemaConfigVersions == null) { return false; } - for (SchemaVersion v : schemaVersions.getVersions()) { + for (SchemaVersion v : schemaConfigVersions.getVersions()) { if (v.toString().equals(versionToGen)) { return true; } @@ -156,7 +157,7 @@ public class GenerateXsd { try (AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext( "org.onap.aai.setup", "org.onap.aai.schemagen")) { - SchemaVersions schemaVersions = ctx.getBean(SchemaVersions.class); + SchemaConfigVersions schemaConfigVersions = ctx.getBean(SchemaConfigVersions.class); if (!fileTypeToGen.equals(GENERATE_TYPE_XSD) && !fileTypeToGen.equals(GENERATE_TYPE_YAML)) { @@ -173,7 +174,7 @@ public class GenerateXsd { System.err.println("Invalid version passed. " + versionToGen); System.exit(1); } else if ("ALL".equalsIgnoreCase(versionToGen)) { - versionsToGen = schemaVersions.getVersions(); + versionsToGen = schemaConfigVersions.getVersions(); Collections.sort(versionsToGen); Collections.reverse(versionsToGen); } else { diff --git a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/SchemaConfiguration.java b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/SchemaConfiguration.java index 4657862..12afcaf 100644 --- a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/SchemaConfiguration.java +++ b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/SchemaConfiguration.java @@ -22,12 +22,15 @@ package org.onap.aai.schemagen; +import java.util.HashSet; +import java.util.Set; + import org.onap.aai.edges.EdgeIngestor; import org.onap.aai.nodes.NodeIngestor; import org.onap.aai.setup.AAIConfigTranslator; -import org.onap.aai.setup.ConfigTranslator; +import org.onap.aai.setup.SchemaConfigVersions; import org.onap.aai.setup.SchemaLocationsBean; -import org.onap.aai.setup.SchemaVersions; +import org.onap.aai.setup.Translator; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -36,19 +39,23 @@ public class SchemaConfiguration { @Bean public EdgeIngestor edgeIngestor(SchemaLocationsBean schemaLocationsBean, - SchemaVersions schemaVersions) { - return new EdgeIngestor(configTranslator(schemaLocationsBean, schemaVersions), - schemaVersions); + SchemaConfigVersions schemaConfigVersions) { + return new EdgeIngestor(configTranslators(schemaLocationsBean, schemaConfigVersions)); } @Bean(name = "nodeIngestor") - public NodeIngestor nodeIngestor(ConfigTranslator configTranslator) { - return new NodeIngestor(configTranslator); + public NodeIngestor nodeIngestor(SchemaLocationsBean schemaLocationsBean, + SchemaConfigVersions schemaConfigVersions) { + return new NodeIngestor(configTranslators(schemaLocationsBean, schemaConfigVersions)); } @Bean(name = "configTranslator") - public ConfigTranslator configTranslator(SchemaLocationsBean schemaLocationsBean, - SchemaVersions schemaVersions) { - return new AAIConfigTranslator(schemaLocationsBean, schemaVersions); + public Set configTranslators(SchemaLocationsBean schemaLocationsBean, + SchemaConfigVersions schemaConfigVersions) { + Set translators = new HashSet<>(); + AAIConfigTranslator translator = + new AAIConfigTranslator(schemaLocationsBean, schemaConfigVersions); + translators.add(translator); + return translators; } } diff --git a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/SwaggerGenerationConfiguration.java b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/SwaggerGenerationConfiguration.java index 0370e8b..aa8b508 100644 --- a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/SwaggerGenerationConfiguration.java +++ b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/SwaggerGenerationConfiguration.java @@ -27,7 +27,7 @@ import org.onap.aai.nodes.NodeIngestor; import org.onap.aai.schemagen.genxsd.HTMLfromOXM; import org.onap.aai.schemagen.genxsd.NodesYAMLfromOXM; import org.onap.aai.schemagen.genxsd.YAMLfromOXM; -import org.onap.aai.setup.SchemaVersions; +import org.onap.aai.setup.SchemaConfigVersions; import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.context.annotation.Bean; @@ -45,23 +45,23 @@ public class SwaggerGenerationConfiguration { @Bean @Scope(scopeName = ConfigurableBeanFactory.SCOPE_PROTOTYPE) - public NodesYAMLfromOXM nodesYamlFromOXM(SchemaVersions schemaVersions, + public NodesYAMLfromOXM nodesYamlFromOXM(SchemaConfigVersions schemaConfigVersions, NodeIngestor nodeIngestor, EdgeIngestor edgeIngestor) { - return new NodesYAMLfromOXM(basePath, schemaVersions, nodeIngestor, edgeIngestor); + return new NodesYAMLfromOXM(basePath, schemaConfigVersions, nodeIngestor, edgeIngestor); } @Bean @Scope(scopeName = ConfigurableBeanFactory.SCOPE_PROTOTYPE) - public HTMLfromOXM htmlFromOXM(SchemaVersions schemaVersions, NodeIngestor nodeIngestor, - EdgeIngestor edgeIngestor) { - return new HTMLfromOXM(maxOccurs, schemaVersions, nodeIngestor, edgeIngestor); + public HTMLfromOXM htmlFromOXM(SchemaConfigVersions schemaConfigVersions, + NodeIngestor nodeIngestor, EdgeIngestor edgeIngestor) { + return new HTMLfromOXM(maxOccurs, schemaConfigVersions, nodeIngestor, edgeIngestor); } @Bean @Scope(scopeName = ConfigurableBeanFactory.SCOPE_PROTOTYPE) - public YAMLfromOXM yamlFromOXM(SchemaVersions schemaVersions, NodeIngestor nodeIngestor, - EdgeIngestor edgeIngestor) { - return new YAMLfromOXM(basePath, schemaVersions, nodeIngestor, edgeIngestor); + public YAMLfromOXM yamlFromOXM(SchemaConfigVersions schemaConfigVersions, + NodeIngestor nodeIngestor, EdgeIngestor edgeIngestor) { + return new YAMLfromOXM(basePath, schemaConfigVersions, nodeIngestor, edgeIngestor); } } diff --git a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/ConfigTranslatorForDocs.java b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/ConfigTranslatorForDocs.java index 87ba528..ca1c71e 100644 --- a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/ConfigTranslatorForDocs.java +++ b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/ConfigTranslatorForDocs.java @@ -22,17 +22,22 @@ package org.onap.aai.schemagen.genxsd; import java.io.File; import java.io.FilenameFilter; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; -import org.onap.aai.setup.ConfigTranslator; +import org.onap.aai.setup.AAIConfigTranslator; +import org.onap.aai.setup.SchemaConfigVersions; import org.onap.aai.setup.SchemaLocationsBean; import org.onap.aai.setup.SchemaVersion; -import org.onap.aai.setup.SchemaVersions; -public class ConfigTranslatorForDocs extends ConfigTranslator { +public class ConfigTranslatorForDocs extends AAIConfigTranslator { - public ConfigTranslatorForDocs(SchemaLocationsBean bean, SchemaVersions schemaVersions) { - super(bean, schemaVersions); + public ConfigTranslatorForDocs(SchemaLocationsBean bean, + SchemaConfigVersions schemaConfigVersions) { + super(bean, schemaConfigVersions); } @Override diff --git a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/HTMLfromOXM.java b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/HTMLfromOXM.java index c1cf5ac..5779e6d 100644 --- a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/HTMLfromOXM.java +++ b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/HTMLfromOXM.java @@ -32,8 +32,8 @@ import javax.xml.parsers.ParserConfigurationException; import org.onap.aai.edges.EdgeIngestor; import org.onap.aai.edges.exceptions.EdgeRuleNotFoundException; import org.onap.aai.nodes.NodeIngestor; +import org.onap.aai.setup.SchemaConfigVersions; import org.onap.aai.setup.SchemaVersion; -import org.onap.aai.setup.SchemaVersions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Attr; @@ -48,9 +48,9 @@ public class HTMLfromOXM extends OxmFileProcessor { private String maxOccurs; - public HTMLfromOXM(String maxOccurs, SchemaVersions schemaVersions, NodeIngestor ni, + public HTMLfromOXM(String maxOccurs, SchemaConfigVersions schemaConfigVersions, NodeIngestor ni, EdgeIngestor ei) { - super(schemaVersions, ni, ei); + super(schemaConfigVersions, ni, ei); this.maxOccurs = maxOccurs; } @@ -76,7 +76,7 @@ public class HTMLfromOXM extends OxmFileProcessor { sb.append("") .append(LINE_SEPARATOR); String namespace = "org.onap"; - if (v.compareTo(getSchemaVersions().getNamespaceChangeVersion()) < 0) { + if (v.compareTo(getSchemaConfigVersions().getNamespaceChangeVersion()) < 0) { namespace = "org.openecomp"; } sb.append( diff --git a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/NodesYAMLfromOXM.java b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/NodesYAMLfromOXM.java index 77c76cb..92cc4a0 100644 --- a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/NodesYAMLfromOXM.java +++ b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/NodesYAMLfromOXM.java @@ -49,8 +49,8 @@ import org.onap.aai.edges.EdgeRule; import org.onap.aai.edges.EdgeRuleQuery; import org.onap.aai.edges.exceptions.EdgeRuleNotFoundException; import org.onap.aai.nodes.NodeIngestor; +import org.onap.aai.setup.SchemaConfigVersions; import org.onap.aai.setup.SchemaVersion; -import org.onap.aai.setup.SchemaVersions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Element; @@ -71,9 +71,9 @@ public class NodesYAMLfromOXM extends OxmFileProcessor { private final String basePath; - public NodesYAMLfromOXM(String basePath, SchemaVersions schemaVersions, NodeIngestor ni, - EdgeIngestor ei) { - super(schemaVersions, ni, ei); + public NodesYAMLfromOXM(String basePath, SchemaConfigVersions schemaConfigVersions, + NodeIngestor ni, EdgeIngestor ei) { + super(schemaConfigVersions, ni, ei); this.basePath = basePath; } diff --git a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/OxmFileProcessor.java b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/OxmFileProcessor.java index 150bab7..684c2e8 100644 --- a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/OxmFileProcessor.java +++ b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/OxmFileProcessor.java @@ -40,8 +40,8 @@ import javax.xml.parsers.ParserConfigurationException; import org.onap.aai.edges.EdgeIngestor; import org.onap.aai.edges.exceptions.EdgeRuleNotFoundException; import org.onap.aai.nodes.NodeIngestor; +import org.onap.aai.setup.SchemaConfigVersions; import org.onap.aai.setup.SchemaVersion; -import org.onap.aai.setup.SchemaVersions; import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -70,7 +70,7 @@ public abstract class OxmFileProcessor { protected SchemaVersion v; protected Document doc = null; protected String apiVersion = null; - protected SchemaVersions schemaVersions; + protected SchemaConfigVersions schemaConfigVersions; protected Map combinedJavaTypes; protected String apiVersionFmt = null; protected List topLevelPaths = new ArrayList(); @@ -81,8 +81,9 @@ public abstract class OxmFileProcessor { EdgeIngestor ei; NodeIngestor ni; - public OxmFileProcessor(SchemaVersions schemaVersions, NodeIngestor ni, EdgeIngestor ei) { - this.schemaVersions = schemaVersions; + public OxmFileProcessor(SchemaConfigVersions schemaConfigVersions, NodeIngestor ni, + EdgeIngestor ei) { + this.schemaConfigVersions = schemaConfigVersions; this.ni = ni; this.ei = ei; } @@ -137,12 +138,12 @@ public abstract class OxmFileProcessor { this.ei = ei; } - public SchemaVersions getSchemaVersions() { - return schemaVersions; + public SchemaConfigVersions getSchemaConfigVersions() { + return schemaConfigVersions; } - public void setSchemaVersions(SchemaVersions schemaVersions) { - this.schemaVersions = schemaVersions; + public void setSchemaConfigVersions(SchemaConfigVersions schemaConfigVersions) { + this.schemaConfigVersions = schemaConfigVersions; } protected void getTopLevelPaths(XSDElement elem) { diff --git a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/YAMLfromOXM.java b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/YAMLfromOXM.java index 3b8fa4d..0ded250 100644 --- a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/YAMLfromOXM.java +++ b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/YAMLfromOXM.java @@ -49,8 +49,8 @@ import org.onap.aai.edges.EdgeRule; import org.onap.aai.edges.EdgeRuleQuery; import org.onap.aai.edges.exceptions.EdgeRuleNotFoundException; import org.onap.aai.nodes.NodeIngestor; +import org.onap.aai.setup.SchemaConfigVersions; import org.onap.aai.setup.SchemaVersion; -import org.onap.aai.setup.SchemaVersions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Element; @@ -72,9 +72,9 @@ public class YAMLfromOXM extends OxmFileProcessor { private String basePath; - public YAMLfromOXM(String basePath, SchemaVersions schemaVersions, NodeIngestor ni, + public YAMLfromOXM(String basePath, SchemaConfigVersions schemaConfigVersions, NodeIngestor ni, EdgeIngestor ei) { - super(schemaVersions, ni, ei); + super(schemaConfigVersions, ni, ei); this.basePath = basePath; } diff --git a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/swagger/GenerateSwagger.java b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/swagger/GenerateSwagger.java index b467e33..c050063 100644 --- a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/swagger/GenerateSwagger.java +++ b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/swagger/GenerateSwagger.java @@ -45,7 +45,7 @@ import java.util.Set; import java.util.TreeMap; import java.util.stream.Collectors; -import org.onap.aai.setup.SchemaVersions; +import org.onap.aai.setup.SchemaConfigVersions; public class GenerateSwagger { @@ -58,16 +58,16 @@ public class GenerateSwagger { // used to check to see if program is run from aai-schema-gen public static final String DEFAULT_RUN_DIR = "aai-schema-gen"; - public static SchemaVersions schemaVersions; + public static SchemaConfigVersions schemaConfigVersions; - public SchemaVersions getSchemaVersions() { - return schemaVersions; + public SchemaConfigVersions getSchemaConfigVersions() { + return schemaConfigVersions; } public static void main(String[] args) throws IOException, TemplateException { // SchemaVersions schemaVersions = SpringContextAware.getBean(SchemaVersions.class); - String CURRENT_VERSION = schemaVersions.getDefaultVersion().toString(); + String CURRENT_VERSION = schemaConfigVersions.getDefaultVersion().toString(); String schemaDir = System.getProperty("aai.schema.dir"); String versionToGenerate = System.getProperty("aai.generate.version"); String wikiLink = System.getProperty("aai.wiki.link"); diff --git a/aai-schema-gen/src/main/resources/logback.xml b/aai-schema-gen/src/main/resources/logback.xml new file mode 100644 index 0000000..34d802d --- /dev/null +++ b/aai-schema-gen/src/main/resources/logback.xml @@ -0,0 +1,295 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + %clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx} + + + + + + ${logDirectory}/rest/sane.log + + ${logDirectory}/rest/sane.log.%d{yyyy-MM-dd} + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{1024} - %msg%n + + + + + + 1000 + true + + + + + ${logDirectory}/rest/metrics.log + + ${logDirectory}/rest/metrics.log.%d{yyyy-MM-dd} + + + ${metricPattern} + + + + 1000 + true + + + + + + INFO + ACCEPT + DENY + + ${logDirectory}/rest/debug.log + + ${logDirectory}/rest/debug.log.%d{yyyy-MM-dd} + + + + ${debugPattern} + + + + + 1000 + + true + + + + ${logDirectory}/rest/error.log + + ${logDirectory}/rest/error.log.%d{yyyy-MM-dd} + + + + WARN + + + ${errorPattern} + + + + + 1000 + + + + + ${logDirectory}/rest/audit.log + + ${logDirectory}/rest/audit.log.%d{yyyy-MM-dd} + + + + ${auditPattern} + + + + + 1000 + true + + + + + + DEBUG + ACCEPT + DENY + + ${logDirectory}/rest/translog.log + + ${logDirectory}/rest/translog.log.%d{yyyy-MM-dd} + + + + ${transLogPattern} + + + + + 1000 + true + + + + + + WARN + + ${logDirectory}/external/external.log + + ${logDirectory}/external/external.log.%d{yyyy-MM-dd} + + + + ${debugPattern} + + + + + + DEBUG + + ${logDirectory}/auth/auth.log + + ${logDirectory}/auth/auth.log.%d{yyyy-MM-dd} + + + + %d{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}[%thread] %-5level %logger{1024} - %msg%n + + + + 1000 + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aai-schema-gen/src/test/java/org/onap/aai/schemagen/GenerateXsdTest.java b/aai-schema-gen/src/test/java/org/onap/aai/schemagen/GenerateXsdTest.java index 0b99454..9b28e3b 100644 --- a/aai-schema-gen/src/test/java/org/onap/aai/schemagen/GenerateXsdTest.java +++ b/aai-schema-gen/src/test/java/org/onap/aai/schemagen/GenerateXsdTest.java @@ -33,11 +33,15 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.onap.aai.edges.EdgeIngestor; import org.onap.aai.nodes.NodeIngestor; -import org.onap.aai.schemagen.genxsd.*; +import org.onap.aai.schemagen.genxsd.HTMLfromOXM; +import org.onap.aai.schemagen.genxsd.HTMLfromOXMTest; +import org.onap.aai.schemagen.genxsd.XSDElementTest; +import org.onap.aai.schemagen.genxsd.YAMLfromOXM; +import org.onap.aai.schemagen.genxsd.YAMLfromOXMTest; import org.onap.aai.schemagen.testutils.TestUtilConfigTranslatorforBusiness; +import org.onap.aai.setup.SchemaConfigVersions; import org.onap.aai.setup.SchemaLocationsBean; import org.onap.aai.setup.SchemaVersion; -import org.onap.aai.setup.SchemaVersions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -50,7 +54,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @ContextConfiguration( classes = {SchemaLocationsBean.class, TestUtilConfigTranslatorforBusiness.class, EdgeIngestor.class, NodeIngestor.class, SwaggerGenerationConfiguration.class, - SchemaVersions.class}) + SchemaConfigVersions.class}) @TestPropertySource(properties = {"schema.uri.base.path = /aai", "schema.xsd.maxoccurs = 5000"}) public class GenerateXsdTest { private static final Logger logger = LoggerFactory.getLogger("GenerateXsd.class"); @@ -67,7 +71,7 @@ public class GenerateXsdTest { HTMLfromOXM htmlFromOxm; @Autowired - SchemaVersions schemaVersions; + SchemaConfigVersions schemaConfigVersions; @BeforeClass public static void setUpBeforeClass() throws Exception { @@ -96,7 +100,7 @@ public class GenerateXsdTest { @Test public void test_generateSwaggerFromOxmFile() { - SchemaVersion v = schemaVersions.getAppRootVersion(); + SchemaVersion v = schemaConfigVersions.getAppRootVersion(); String apiVersion = v.toString(); String fileContent = null; try { @@ -112,7 +116,7 @@ public class GenerateXsdTest { @Test public void test_generateXSDFromOxmFile() { - SchemaVersion v = schemaVersions.getAppRootVersion(); + SchemaVersion v = schemaConfigVersions.getAppRootVersion(); String fileContent = null; try { htmlFromOxm.setXmlVersion(testXML, v); @@ -126,7 +130,7 @@ public class GenerateXsdTest { @Test public void testGetAPIVersion() { - GenerateXsd.apiVersion = schemaVersions.getAppRootVersion().toString(); + GenerateXsd.apiVersion = schemaConfigVersions.getAppRootVersion().toString(); assertThat(GenerateXsd.getAPIVersion(), is("v11")); } diff --git a/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/EdgeDescriptionTest.java b/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/EdgeDescriptionTest.java index 1469272..046f961 100644 --- a/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/EdgeDescriptionTest.java +++ b/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/EdgeDescriptionTest.java @@ -29,7 +29,11 @@ import com.google.common.collect.Multimap; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; -import java.util.*; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.SortedSet; +import java.util.TreeSet; import org.junit.AfterClass; import org.junit.Before; @@ -41,9 +45,9 @@ import org.onap.aai.edges.EdgeRule; import org.onap.aai.edges.exceptions.EdgeRuleNotFoundException; import org.onap.aai.schemagen.testutils.TestUtilConfigTranslatorforEdges; import org.onap.aai.setup.ConfigTranslator; +import org.onap.aai.setup.SchemaConfigVersions; import org.onap.aai.setup.SchemaLocationsBean; import org.onap.aai.setup.SchemaVersion; -import org.onap.aai.setup.SchemaVersions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.TestPropertySource; @@ -51,7 +55,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration( - classes = {SchemaVersions.class, SchemaLocationsBean.class, + classes = {SchemaConfigVersions.class, SchemaLocationsBean.class, TestUtilConfigTranslatorforEdges.class, EdgeIngestor.class}) @TestPropertySource( properties = { diff --git a/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/HTMLfromOXMTest.java b/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/HTMLfromOXMTest.java index d4a6517..46f90ce 100644 --- a/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/HTMLfromOXMTest.java +++ b/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/HTMLfromOXMTest.java @@ -40,9 +40,9 @@ import org.onap.aai.edges.EdgeIngestor; import org.onap.aai.nodes.NodeIngestor; import org.onap.aai.schemagen.SwaggerGenerationConfiguration; import org.onap.aai.schemagen.testutils.TestUtilConfigTranslatorforBusiness; +import org.onap.aai.setup.SchemaConfigVersions; import org.onap.aai.setup.SchemaLocationsBean; import org.onap.aai.setup.SchemaVersion; -import org.onap.aai.setup.SchemaVersions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -54,7 +54,7 @@ import org.w3c.dom.Element; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration( - classes = {SchemaVersions.class, SchemaLocationsBean.class, + classes = {SchemaConfigVersions.class, SchemaLocationsBean.class, TestUtilConfigTranslatorforBusiness.class, EdgeIngestor.class, NodeIngestor.class, SwaggerGenerationConfiguration.class @@ -71,7 +71,7 @@ public class HTMLfromOXMTest { HTMLfromOXM htmlFromOxm; @Autowired - SchemaVersions schemaVersions; + SchemaConfigVersions schemaConfigVersions; @BeforeClass public static void setUpContext() throws Exception { @@ -102,11 +102,11 @@ public class HTMLfromOXMTest { @Test public void testGetDocumentHeader() { - SchemaVersion v = schemaVersions.getAppRootVersion(); + SchemaVersion v = schemaConfigVersions.getAppRootVersion(); String header = null; try { htmlFromOxm.setXmlVersion(testXML, v); - htmlFromOxm.setSchemaVersions(schemaVersions); + htmlFromOxm.setSchemaConfigVersions(schemaConfigVersions); header = htmlFromOxm.getDocumentHeader(); } catch (Exception e) { e.printStackTrace(); @@ -118,7 +118,7 @@ public class HTMLfromOXMTest { @Test public void testProcess() { - SchemaVersion v = schemaVersions.getAppRootVersion(); + SchemaVersion v = schemaConfigVersions.getAppRootVersion(); String fileContent = null; try { htmlFromOxm.setXmlVersion(testXML, v); @@ -133,7 +133,7 @@ public class HTMLfromOXMTest { @Test public void testProcessWithCombiningJavaTypes() { - SchemaVersion v = schemaVersions.getAppRootVersion(); + SchemaVersion v = schemaConfigVersions.getAppRootVersion(); String fileContent = null; try { setUp(1); @@ -158,7 +158,7 @@ public class HTMLfromOXMTest { bw = Files.newBufferedWriter(path, charset); bw.write(testXML); bw.close(); - SchemaVersion v = schemaVersions.getAppRootVersion(); + SchemaVersion v = schemaConfigVersions.getAppRootVersion(); String fileContent = null; try { htmlFromOxm.setXmlVersion(testXML, v); @@ -174,7 +174,7 @@ public class HTMLfromOXMTest { @Test public void testHTMLfromOXMStringVersion() { - SchemaVersion v = schemaVersions.getAppRootVersion(); + SchemaVersion v = schemaConfigVersions.getAppRootVersion(); String fileContent = null; try { htmlFromOxm.setXmlVersion(testXML, v); @@ -190,7 +190,7 @@ public class HTMLfromOXMTest { @Test public void testProcessJavaTypeElement() { String target = "Element=java-type/Customer"; - SchemaVersion v = schemaVersions.getAppRootVersion(); + SchemaVersion v = schemaConfigVersions.getAppRootVersion(); Element customer = null; try { htmlFromOxm.setXmlVersion(testXML, v); diff --git a/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/NodesYAMLfromOXMTest.java b/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/NodesYAMLfromOXMTest.java index 468de16..ac225f0 100644 --- a/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/NodesYAMLfromOXMTest.java +++ b/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/NodesYAMLfromOXMTest.java @@ -40,9 +40,9 @@ import org.onap.aai.edges.EdgeIngestor; import org.onap.aai.nodes.NodeIngestor; import org.onap.aai.schemagen.SwaggerGenerationConfiguration; import org.onap.aai.schemagen.testutils.TestUtilConfigTranslatorforEdges; +import org.onap.aai.setup.SchemaConfigVersions; import org.onap.aai.setup.SchemaLocationsBean; import org.onap.aai.setup.SchemaVersion; -import org.onap.aai.setup.SchemaVersions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -54,7 +54,7 @@ import org.w3c.dom.Element; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration( - classes = {SchemaVersions.class, SchemaLocationsBean.class, + classes = {SchemaConfigVersions.class, SchemaLocationsBean.class, TestUtilConfigTranslatorforEdges.class, EdgeIngestor.class, NodeIngestor.class, SwaggerGenerationConfiguration.class @@ -72,7 +72,7 @@ public class NodesYAMLfromOXMTest { @Autowired NodesYAMLfromOXM nodesYamlFromOxm; @Autowired - SchemaVersions schemaVersions; + SchemaConfigVersions schemaConfigVersions; @BeforeClass public static void setUpBeforeClass() throws Exception { @@ -103,7 +103,7 @@ public class NodesYAMLfromOXMTest { @Test public void testGetDocumentHeader() { - SchemaVersion v = schemaVersions.getAppRootVersion(); + SchemaVersion v = schemaConfigVersions.getAppRootVersion(); String apiVersion = v.toString(); String header = null; try { @@ -119,7 +119,7 @@ public class NodesYAMLfromOXMTest { @Test public void testProcess() { - SchemaVersion v = schemaVersions.getAppRootVersion(); + SchemaVersion v = schemaConfigVersions.getAppRootVersion(); String apiVersion = v.toString(); String fileContent = null; try { @@ -142,7 +142,7 @@ public class NodesYAMLfromOXMTest { bw = Files.newBufferedWriter(path, charset); bw.write(testXML); bw.close(); - SchemaVersion v = schemaVersions.getAppRootVersion(); + SchemaVersion v = schemaConfigVersions.getAppRootVersion(); String apiVersion = v.toString(); String fileContent = null; try { @@ -157,7 +157,7 @@ public class NodesYAMLfromOXMTest { @Test public void testNodesYAMLfromOXMStringVersionFile() { - SchemaVersion v = schemaVersions.getAppRootVersion(); + SchemaVersion v = schemaConfigVersions.getAppRootVersion(); String apiVersion = v.toString(); String fileContent = null; try { @@ -171,7 +171,7 @@ public class NodesYAMLfromOXMTest { @Test public void testAppendDefinitions() { - SchemaVersion v = schemaVersions.getAppRootVersion(); + SchemaVersion v = schemaConfigVersions.getAppRootVersion(); String apiVersion = v.toString(); String definitions = null; try { @@ -187,7 +187,7 @@ public class NodesYAMLfromOXMTest { @Test public void testGetXMLRootElementName() { String target = "RootElement=customer"; - SchemaVersion v = schemaVersions.getAppRootVersion(); + SchemaVersion v = schemaConfigVersions.getAppRootVersion(); String apiVersion = v.toString(); Element customer = null; String root = null; @@ -205,7 +205,7 @@ public class NodesYAMLfromOXMTest { @Test public void testGetXmlRootElementName() { String target = "RootElement=customer"; - SchemaVersion v = schemaVersions.getAppRootVersion(); + SchemaVersion v = schemaConfigVersions.getAppRootVersion(); String apiVersion = v.toString(); String root = null; try { @@ -221,7 +221,7 @@ public class NodesYAMLfromOXMTest { @Test public void testGetJavaTypeElementSwagger() { String target = "Element=java-type/Customer"; - SchemaVersion v = schemaVersions.getAppRootVersion(); + SchemaVersion v = schemaConfigVersions.getAppRootVersion(); String apiVersion = v.toString(); Element customer = null; try { diff --git a/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/PutRelationPathSetTest.java b/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/PutRelationPathSetTest.java index 09a8dd4..b955f96 100644 --- a/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/PutRelationPathSetTest.java +++ b/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/PutRelationPathSetTest.java @@ -35,15 +35,15 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.onap.aai.edges.EdgeIngestor; import org.onap.aai.schemagen.GenerateXsd; +import org.onap.aai.setup.SchemaConfigVersions; import org.onap.aai.setup.SchemaVersion; -import org.onap.aai.setup.SchemaVersions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(classes = {SchemaVersions.class, EdgeIngestor.class}) +@ContextConfiguration(classes = {SchemaConfigVersions.class, EdgeIngestor.class}) @TestPropertySource(properties = {"schema.uri.base.path = /aai"}) @Ignore("This test needs to get major rework done as it is written very poorly") public class PutRelationPathSetTest { @@ -61,14 +61,14 @@ public class PutRelationPathSetTest { "/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/availability-zones/availability-zone/{availability-zone-name}/relationship-list/relationship"; PutRelationPathSet prp = null; @Autowired - SchemaVersions schemaVersions; + SchemaConfigVersions schemaConfigVersions; @Autowired EdgeIngestor edgeIngestor; @Before public void setUpBeforeClass() throws Exception { - v = schemaVersions.getDefaultVersion(); + v = schemaConfigVersions.getDefaultVersion(); relationsFile = new File(GenerateXsd.getYamlDir() + "/relations/" + v.toString() + "/createOrUpdateCloudInfrastructureCloudRegionsCloudRegionAvailabilityZonesAvailabilityZone.json"); diff --git a/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/YAMLfromOXMTest.java b/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/YAMLfromOXMTest.java index 1d06c38..ed13981 100644 --- a/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/YAMLfromOXMTest.java +++ b/aai-schema-gen/src/test/java/org/onap/aai/schemagen/genxsd/YAMLfromOXMTest.java @@ -48,9 +48,9 @@ import org.onap.aai.edges.exceptions.EdgeRuleNotFoundException; import org.onap.aai.nodes.NodeIngestor; import org.onap.aai.schemagen.SwaggerGenerationConfiguration; import org.onap.aai.schemagen.testutils.TestUtilConfigTranslatorforBusiness; +import org.onap.aai.setup.SchemaConfigVersions; import org.onap.aai.setup.SchemaLocationsBean; import org.onap.aai.setup.SchemaVersion; -import org.onap.aai.setup.SchemaVersions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -63,9 +63,9 @@ import org.w3c.dom.Element; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration( - classes = {SchemaVersions.class, SchemaLocationsBean.class, - TestUtilConfigTranslatorforBusiness.class, SchemaVersions.class, EdgeIngestor.class, - NodeIngestor.class, SwaggerGenerationConfiguration.class + classes = {SchemaConfigVersions.class, SchemaLocationsBean.class, + TestUtilConfigTranslatorforBusiness.class, EdgeIngestor.class, NodeIngestor.class, + SwaggerGenerationConfiguration.class }) @TestPropertySource(properties = {"schema.uri.base.path = /aai", "schema.xsd.maxoccurs = 5000"}) @@ -88,7 +88,7 @@ public class YAMLfromOXMTest { YAMLfromOXM yamlFromOxm; @Autowired - SchemaVersions schemaVersions; + SchemaConfigVersions schemaConfigVersions; @BeforeClass public static void setUpBeforeClass() throws Exception { @@ -131,7 +131,7 @@ public class YAMLfromOXMTest { @Test public void AtestIngestors() throws EdgeRuleNotFoundException { Multimap results = - edgeIngestor.getAllRules(schemaVersions.getDefaultVersion()); + edgeIngestor.getAllRules(schemaConfigVersions.getDefaultVersion()); SortedSet ss = new TreeSet(results.keySet()); for (String key : ss) { results.get(key).stream().filter((i) -> ((!i.isPrivateEdge()))).forEach((i) -> { @@ -139,13 +139,13 @@ public class YAMLfromOXMTest { System.out.println(ed.getRuleKey()); }); } - Document doc = nodeIngestor.getSchema(schemaVersions.getDefaultVersion()); + Document doc = nodeIngestor.getSchema(schemaConfigVersions.getDefaultVersion()); assertNotNull(doc); } @Test public void testGetDocumentHeader() { - SchemaVersion v = schemaVersions.getAppRootVersion(); + SchemaVersion v = schemaConfigVersions.getAppRootVersion(); String apiVersion = v.toString(); String header = null; try { @@ -160,7 +160,7 @@ public class YAMLfromOXMTest { @Test public void testProcess() { - SchemaVersion v = schemaVersions.getAppRootVersion(); + SchemaVersion v = schemaConfigVersions.getAppRootVersion(); String apiVersion = v.toString(); String fileContent = null; try { @@ -183,7 +183,7 @@ public class YAMLfromOXMTest { bw = Files.newBufferedWriter(path, charset); bw.write(testXML); bw.close(); - SchemaVersion v = schemaVersions.getAppRootVersion(); + SchemaVersion v = schemaConfigVersions.getAppRootVersion(); String apiVersion = v.toString(); String fileContent = null; try { @@ -199,7 +199,7 @@ public class YAMLfromOXMTest { @Test public void testYAMLfromOXMStringVersionFile() { - SchemaVersion v = schemaVersions.getAppRootVersion(); + SchemaVersion v = schemaConfigVersions.getAppRootVersion(); String apiVersion = v.toString(); String fileContent = null; try { @@ -220,7 +220,7 @@ public class YAMLfromOXMTest { // TODO Auto-generated catch block e1.printStackTrace(); } - SchemaVersion v = schemaVersions.getAppRootVersion(); + SchemaVersion v = schemaConfigVersions.getAppRootVersion(); String apiVersion = v.toString(); String fileContent = null; try { @@ -235,7 +235,7 @@ public class YAMLfromOXMTest { @Test public void testAppendDefinitions() { - SchemaVersion v = schemaVersions.getAppRootVersion(); + SchemaVersion v = schemaConfigVersions.getAppRootVersion(); String apiVersion = v.toString(); String definitions = null; try { @@ -252,7 +252,7 @@ public class YAMLfromOXMTest { @Test public void testGetXMLRootElementName() { String target = "RootElement=customer"; - SchemaVersion v = schemaVersions.getAppRootVersion(); + SchemaVersion v = schemaConfigVersions.getAppRootVersion(); String apiVersion = v.toString(); Element customer = null; String root = null; @@ -270,7 +270,7 @@ public class YAMLfromOXMTest { @Test public void testGetXmlRootElementName() { String target = "RootElement=customer"; - SchemaVersion v = schemaVersions.getAppRootVersion(); + SchemaVersion v = schemaConfigVersions.getAppRootVersion(); String apiVersion = v.toString(); String root = null; try { @@ -286,7 +286,7 @@ public class YAMLfromOXMTest { @Test public void testGetJavaTypeElementSwagger() { String target = "Element=java-type/Customer"; - SchemaVersion v = schemaVersions.getAppRootVersion(); + SchemaVersion v = schemaConfigVersions.getAppRootVersion(); String apiVersion = v.toString(); Element customer = null; try { diff --git a/aai-schema-gen/src/test/java/org/onap/aai/schemagen/testutils/TestUtilConfigTranslatorforBusiness.java b/aai-schema-gen/src/test/java/org/onap/aai/schemagen/testutils/TestUtilConfigTranslatorforBusiness.java index fdc2002..cfa51c4 100644 --- a/aai-schema-gen/src/test/java/org/onap/aai/schemagen/testutils/TestUtilConfigTranslatorforBusiness.java +++ b/aai-schema-gen/src/test/java/org/onap/aai/schemagen/testutils/TestUtilConfigTranslatorforBusiness.java @@ -25,16 +25,16 @@ import java.util.List; import java.util.Map; import java.util.TreeMap; -import org.onap.aai.setup.ConfigTranslator; +import org.onap.aai.setup.AAIConfigTranslator; +import org.onap.aai.setup.SchemaConfigVersions; import org.onap.aai.setup.SchemaLocationsBean; import org.onap.aai.setup.SchemaVersion; -import org.onap.aai.setup.SchemaVersions; -public class TestUtilConfigTranslatorforBusiness extends ConfigTranslator { +public class TestUtilConfigTranslatorforBusiness extends AAIConfigTranslator { public TestUtilConfigTranslatorforBusiness(SchemaLocationsBean bean, - SchemaVersions schemaVersions) { - super(bean, schemaVersions); + SchemaConfigVersions schemaConfigVersions) { + super(bean, schemaConfigVersions); } @Override diff --git a/aai-schema-gen/src/test/java/org/onap/aai/schemagen/testutils/TestUtilConfigTranslatorforDataLink.java b/aai-schema-gen/src/test/java/org/onap/aai/schemagen/testutils/TestUtilConfigTranslatorforDataLink.java index 7fdcc34..e1522fa 100644 --- a/aai-schema-gen/src/test/java/org/onap/aai/schemagen/testutils/TestUtilConfigTranslatorforDataLink.java +++ b/aai-schema-gen/src/test/java/org/onap/aai/schemagen/testutils/TestUtilConfigTranslatorforDataLink.java @@ -26,15 +26,15 @@ import java.util.Map; import java.util.TreeMap; import org.onap.aai.setup.ConfigTranslator; +import org.onap.aai.setup.SchemaConfigVersions; import org.onap.aai.setup.SchemaLocationsBean; import org.onap.aai.setup.SchemaVersion; -import org.onap.aai.setup.SchemaVersions; public class TestUtilConfigTranslatorforDataLink extends ConfigTranslator { public TestUtilConfigTranslatorforDataLink(SchemaLocationsBean bean, - SchemaVersions schemaVersions) { - super(bean, schemaVersions); + SchemaConfigVersions schemaConfigVersions) { + super(bean, schemaConfigVersions); } @Override diff --git a/aai-schema-gen/src/test/java/org/onap/aai/schemagen/testutils/TestUtilConfigTranslatorforEdges.java b/aai-schema-gen/src/test/java/org/onap/aai/schemagen/testutils/TestUtilConfigTranslatorforEdges.java index ca45b9d..ae0ede9 100644 --- a/aai-schema-gen/src/test/java/org/onap/aai/schemagen/testutils/TestUtilConfigTranslatorforEdges.java +++ b/aai-schema-gen/src/test/java/org/onap/aai/schemagen/testutils/TestUtilConfigTranslatorforEdges.java @@ -25,16 +25,16 @@ import java.util.List; import java.util.Map; import java.util.TreeMap; -import org.onap.aai.setup.ConfigTranslator; +import org.onap.aai.setup.AAIConfigTranslator; +import org.onap.aai.setup.SchemaConfigVersions; import org.onap.aai.setup.SchemaLocationsBean; import org.onap.aai.setup.SchemaVersion; -import org.onap.aai.setup.SchemaVersions; -public class TestUtilConfigTranslatorforEdges extends ConfigTranslator { +public class TestUtilConfigTranslatorforEdges extends AAIConfigTranslator { public TestUtilConfigTranslatorforEdges(SchemaLocationsBean bean, - SchemaVersions schemaVersions) { - super(bean, schemaVersions); + SchemaConfigVersions schemaConfigVersions) { + super(bean, schemaConfigVersions); } @Override diff --git a/aai-schema-gen/src/test/resources/dbedgerules/DbEdgeBusinessRules_test.json b/aai-schema-gen/src/test/resources/dbedgerules/DbEdgeBusinessRules_test.json index c25f1fb..c69b741 100644 --- a/aai-schema-gen/src/test/resources/dbedgerules/DbEdgeBusinessRules_test.json +++ b/aai-schema-gen/src/test/resources/dbedgerules/DbEdgeBusinessRules_test.json @@ -1,39 +1,39 @@ { - "rules": [ - { - "from": "service-subscription", - "to": "customer", - "label": "org.onap.relationships.inventory.BelongsTo", - "direction": "OUT", - "multiplicity": "MANY2ONE", - "contains-other-v": "!${direction}", - "delete-other-v": "!${direction}", - "prevent-delete": "NONE", - "default": "true", - "description":"" - }, - { - "from": "service-instance", - "to": "service-subscription", - "label": "org.onap.relationships.inventory.BelongsTo", - "direction": "OUT", - "multiplicity": "MANY2ONE", - "contains-other-v": "!${direction}", - "delete-other-v": "!${direction}", - "prevent-delete": "NONE", - "default": "true", - "description":"" - }, - { - "from": "service-subscription", - "to": "tenant", - "label": "org.onap.relationships.inventory.Uses", - "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "prevent-delete": "NONE", - "default": "true", - "description":"" - } ] + "rules": [ + { + "from": "service-subscription", + "to": "customer", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "prevent-delete": "NONE", + "default": "true", + "description":"" + }, + { + "from": "service-instance", + "to": "service-subscription", + "label": "org.onap.relationships.inventory.BelongsTo", + "direction": "OUT", + "multiplicity": "MANY2ONE", + "contains-other-v": "!${direction}", + "delete-other-v": "!${direction}", + "prevent-delete": "NONE", + "default": "true", + "description":"" + }, + { + "from": "service-subscription", + "to": "tenant", + "label": "org.onap.relationships.inventory.Uses", + "direction": "OUT", + "multiplicity": "MANY2MANY", + "contains-other-v": "NONE", + "delete-other-v": "NONE", + "prevent-delete": "NONE", + "default": "true", + "description":"" + } ] } diff --git a/aai-schema-gen/src/test/resources/dbedgerules/EdgeDescriptionRules_test.json b/aai-schema-gen/src/test/resources/dbedgerules/EdgeDescriptionRules_test.json deleted file mode 100644 index c25f1fb..0000000 --- a/aai-schema-gen/src/test/resources/dbedgerules/EdgeDescriptionRules_test.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "rules": [ - { - "from": "service-subscription", - "to": "customer", - "label": "org.onap.relationships.inventory.BelongsTo", - "direction": "OUT", - "multiplicity": "MANY2ONE", - "contains-other-v": "!${direction}", - "delete-other-v": "!${direction}", - "prevent-delete": "NONE", - "default": "true", - "description":"" - }, - { - "from": "service-instance", - "to": "service-subscription", - "label": "org.onap.relationships.inventory.BelongsTo", - "direction": "OUT", - "multiplicity": "MANY2ONE", - "contains-other-v": "!${direction}", - "delete-other-v": "!${direction}", - "prevent-delete": "NONE", - "default": "true", - "description":"" - }, - { - "from": "service-subscription", - "to": "tenant", - "label": "org.onap.relationships.inventory.Uses", - "direction": "OUT", - "multiplicity": "MANY2MANY", - "contains-other-v": "NONE", - "delete-other-v": "NONE", - "prevent-delete": "NONE", - "default": "true", - "description":"" - } ] -} -- cgit 1.2.3-korg