aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authormark.j.leonard <mark.j.leonard@gmail.com>2019-03-26 13:38:40 +0000
committermark.j.leonard <mark.j.leonard@gmail.com>2019-03-28 13:19:09 +0000
commitbfde3ef00beb3c6f31cebfd12e90b9b9cdcc492e (patch)
treebe8321d3f3216b152d186f0bd23a2694bf0c7183 /src/test
parent8a7d9a0d7782b9339810b02208620bdd2f0a12b2 (diff)
Remove all references to artifactgenerator config
Delete the artifact-generator.properties file. Remove all related functionality from the code. Change-Id: I652d99b6424bb60af5820f5afb97ef139e3f9511 Issue-ID: AAI-2284 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/onap/aai/babel/parser/TestArtifactGeneratorToscaParser.java13
-rw-r--r--src/test/java/org/onap/aai/babel/service/TestCsarToXmlConverter.java20
-rw-r--r--src/test/java/org/onap/aai/babel/util/ArtifactTestUtils.java14
-rw-r--r--src/test/java/org/onap/aai/babel/util/Resources.java1
-rw-r--r--src/test/java/org/onap/aai/babel/xml/generator/TestAaiArtifactGenerator.java1
-rw-r--r--src/test/java/org/onap/aai/babel/xml/generator/model/TestModel.java6
-rw-r--r--src/test/java/org/onap/aai/babel/xml/generator/model/TestVfModule.java6
-rw-r--r--src/test/java/org/onap/aai/babel/xml/generator/model/TestWidget.java6
-rw-r--r--src/test/resources/artifact-generator.properties0
9 files changed, 6 insertions, 61 deletions
diff --git a/src/test/java/org/onap/aai/babel/parser/TestArtifactGeneratorToscaParser.java b/src/test/java/org/onap/aai/babel/parser/TestArtifactGeneratorToscaParser.java
index 7bc9fa8..50812c9 100644
--- a/src/test/java/org/onap/aai/babel/parser/TestArtifactGeneratorToscaParser.java
+++ b/src/test/java/org/onap/aai/babel/parser/TestArtifactGeneratorToscaParser.java
@@ -57,18 +57,6 @@ public class TestArtifactGeneratorToscaParser {
private static final String TEST_UUID = "1234";
/**
- * Initialize the Generator with an invalid artifact generator properties file path.
- *
- * @throws IOException
- * if an error occurs reading the configuration properties
- */
- @Test(expected = IllegalArgumentException.class)
- public void testMissingPropertiesFile() throws IOException {
- System.setProperty(ArtifactGeneratorToscaParser.PROPERTY_ARTIFACT_GENERATOR_CONFIG_FILE, "non-existent.file");
- ArtifactGeneratorToscaParser.initWidgetConfiguration();
- }
-
- /**
* Initialize the Generator with an invalid mappings file path.
*
* @throws IOException
@@ -176,7 +164,6 @@ public class TestArtifactGeneratorToscaParser {
public void testAddWidgetToService() throws IOException, XmlArtifactGenerationException {
ArtifactTestUtils testUtils = new ArtifactTestUtils();
testUtils.loadWidgetMappings();
- testUtils.loadWidgetToUuidMappings();
Model serviceModel = new Service();
Resource resourceModel = new Resource(WidgetType.valueOf("VF"), false);
diff --git a/src/test/java/org/onap/aai/babel/service/TestCsarToXmlConverter.java b/src/test/java/org/onap/aai/babel/service/TestCsarToXmlConverter.java
index 244eccd..184623c 100644
--- a/src/test/java/org/onap/aai/babel/service/TestCsarToXmlConverter.java
+++ b/src/test/java/org/onap/aai/babel/service/TestCsarToXmlConverter.java
@@ -101,26 +101,6 @@ public class TestCsarToXmlConverter {
}
/**
- * Test that an Exception is thrown when the Artifact Generator properties are not present.
- *
- * @throws CsarConverterException
- * if there is an error either extracting the YAML files or generating XML artifacts
- * @throws IOException
- * if an I/O exception occurs loading the test CSAR file
- */
- @Test
- public void testArtifactGeneratorConfigMissing() throws CsarConverterException, IOException {
- exception.expect(IllegalArgumentException.class);
- exception.expectMessage("Cannot generate artifacts. System property "
- + ArtifactGeneratorToscaParser.PROPERTY_ARTIFACT_GENERATOR_CONFIG_FILE + " not configured");
-
- // Unset the required system property
- System.clearProperty(ArtifactGeneratorToscaParser.PROPERTY_ARTIFACT_GENERATOR_CONFIG_FILE);
- converter.generateXmlFromCsar(CsarTest.SD_WAN_CSAR_FILE.getContent(), CsarTest.SD_WAN_CSAR_FILE.getName(),
- SERVICE_VERSION);
- }
-
- /**
* Test that an Exception is thrown when the Artifact Generator's TOSCA Mappings configuration file is not present.
*
* @throws CsarConverterException
diff --git a/src/test/java/org/onap/aai/babel/util/ArtifactTestUtils.java b/src/test/java/org/onap/aai/babel/util/ArtifactTestUtils.java
index 164c80b..066911e 100644
--- a/src/test/java/org/onap/aai/babel/util/ArtifactTestUtils.java
+++ b/src/test/java/org/onap/aai/babel/util/ArtifactTestUtils.java
@@ -44,7 +44,6 @@ import org.apache.commons.io.IOUtils;
import org.custommonkey.xmlunit.Diff;
import org.onap.aai.babel.parser.ArtifactGeneratorToscaParser;
import org.onap.aai.babel.xml.generator.data.Artifact;
-import org.onap.aai.babel.xml.generator.data.WidgetConfigurationUtil;
import org.xml.sax.SAXException;
/**
@@ -60,24 +59,11 @@ public class ArtifactTestUtils {
* Initialize System Properties for test configuration files.
*/
public void setGeneratorSystemProperties() {
- System.setProperty(ArtifactGeneratorToscaParser.PROPERTY_ARTIFACT_GENERATOR_CONFIG_FILE,
- getResourcePath(Resources.ARTIFACT_GENERATOR_CONFIG));
-
System.setProperty(ArtifactGeneratorToscaParser.PROPERTY_TOSCA_MAPPING_FILE,
getResourcePath(Resources.TOSCA_MAPPING_CONFIG));
}
/**
- * Load the Widget to UUID mappings from the Artifact Generator Properties (resource).
- *
- * @throws IOException
- * if the properties file is not loaded
- */
- public void loadWidgetToUuidMappings() throws IOException {
- WidgetConfigurationUtil.setConfig(getResourceAsProperties(Resources.ARTIFACT_GENERATOR_CONFIG));
- }
-
- /**
* Load the Widget type mappings (resource).
*
* @throws IOException
diff --git a/src/test/java/org/onap/aai/babel/util/Resources.java b/src/test/java/org/onap/aai/babel/util/Resources.java
index 72b0d1a..e089670 100644
--- a/src/test/java/org/onap/aai/babel/util/Resources.java
+++ b/src/test/java/org/onap/aai/babel/util/Resources.java
@@ -26,7 +26,6 @@ package org.onap.aai.babel.util;
*/
public class Resources {
- public static final String ARTIFACT_GENERATOR_CONFIG = "artifact-generator.properties";
public static final String TOSCA_MAPPING_CONFIG = "tosca-mappings.json";
public static final String EMPTY_TOSCA_MAPPING_CONFIG = "empty-tosca-mappings.json";
public static final String INVALID_TOSCA_MAPPING_CONFIG = "invalid-tosca-mappings.json";
diff --git a/src/test/java/org/onap/aai/babel/xml/generator/TestAaiArtifactGenerator.java b/src/test/java/org/onap/aai/babel/xml/generator/TestAaiArtifactGenerator.java
index 2668e1e..b29d0d7 100644
--- a/src/test/java/org/onap/aai/babel/xml/generator/TestAaiArtifactGenerator.java
+++ b/src/test/java/org/onap/aai/babel/xml/generator/TestAaiArtifactGenerator.java
@@ -88,7 +88,6 @@ public class TestAaiArtifactGenerator {
public void testParserWithIncompleteMappings()
throws SdcToscaParserException, IOException, XmlArtifactGenerationException {
testUtils.loadWidgetMappings();
- testUtils.loadWidgetToUuidMappings();
AaiArtifactGenerator artifactGenerator = new AaiArtifactGenerator();
WidgetType.clearElements(); // Remove all WidgetTypes so that the generator fails
diff --git a/src/test/java/org/onap/aai/babel/xml/generator/model/TestModel.java b/src/test/java/org/onap/aai/babel/xml/generator/model/TestModel.java
index f1a579e..9fc5928 100644
--- a/src/test/java/org/onap/aai/babel/xml/generator/model/TestModel.java
+++ b/src/test/java/org/onap/aai/babel/xml/generator/model/TestModel.java
@@ -37,16 +37,14 @@ import org.onap.aai.babel.util.ArtifactTestUtils;
public class TestModel {
/**
- * Load the Widget Configuration, including the type mappings and the UUID mappings.
+ * Load the Widget mapping configuration.
*
* @throws IOException
* if the mappings configuration cannot be loaded
*/
@BeforeClass
public static void setup() throws IOException {
- ArtifactTestUtils util = new ArtifactTestUtils();
- util.loadWidgetToUuidMappings();
- util.loadWidgetMappings();
+ new ArtifactTestUtils().loadWidgetMappings();
}
@Test
diff --git a/src/test/java/org/onap/aai/babel/xml/generator/model/TestVfModule.java b/src/test/java/org/onap/aai/babel/xml/generator/model/TestVfModule.java
index 38931fb..88555ee 100644
--- a/src/test/java/org/onap/aai/babel/xml/generator/model/TestVfModule.java
+++ b/src/test/java/org/onap/aai/babel/xml/generator/model/TestVfModule.java
@@ -41,16 +41,14 @@ import org.onap.aai.babel.xml.generator.XmlArtifactGenerationException;
public class TestVfModule {
/**
- * Load the Widget Configuration, including the type mappings and the UUID mappings.
+ * Load the Widget mappings configuration.
*
* @throws IOException
* if the mappings configuration cannot be loaded
*/
@BeforeClass
public static void setup() throws IOException {
- ArtifactTestUtils util = new ArtifactTestUtils();
- util.loadWidgetToUuidMappings();
- util.loadWidgetMappings();
+ new ArtifactTestUtils().loadWidgetMappings();
}
/**
diff --git a/src/test/java/org/onap/aai/babel/xml/generator/model/TestWidget.java b/src/test/java/org/onap/aai/babel/xml/generator/model/TestWidget.java
index e5702ac..fec3479 100644
--- a/src/test/java/org/onap/aai/babel/xml/generator/model/TestWidget.java
+++ b/src/test/java/org/onap/aai/babel/xml/generator/model/TestWidget.java
@@ -39,16 +39,14 @@ import org.onap.aai.babel.xml.generator.types.ModelType;
public class TestWidget {
/**
- * Load the Widget Configuration, including the type mappings and the UUID mappings.
+ * Load the Widget mappings configuration.
*
* @throws IOException
* if the mappings configuration cannot be loaded
*/
@BeforeClass
public static void setup() throws IOException {
- ArtifactTestUtils util = new ArtifactTestUtils();
- util.loadWidgetToUuidMappings();
- util.loadWidgetMappings();
+ new ArtifactTestUtils().loadWidgetMappings();
}
@Test
diff --git a/src/test/resources/artifact-generator.properties b/src/test/resources/artifact-generator.properties
deleted file mode 100644
index e69de29..0000000
--- a/src/test/resources/artifact-generator.properties
+++ /dev/null