diff options
author | rv871f <richard.vondadelszen@amdocs.com> | 2018-09-21 13:42:04 -0400 |
---|---|---|
committer | rv871f <richard.vondadelszen@amdocs.com> | 2018-09-21 15:07:02 -0400 |
commit | 595db0f0c860c722aa79e94b464fc10c30a86dd3 (patch) | |
tree | 925b500f92331cf05cb90498e4169c12bf7fcc1a /src/test/java | |
parent | 7507624e55109e81185be1acdd8f912e9abfbfcc (diff) |
1.3.0 schema ingest changes
Issue-ID: AAI-1670
Change-Id: I402e56f0371f60641190e182bff4c3b954ad8987
Signed-off-by: rv871f <richard.vondadelszen@amdocs.com>
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/org/onap/aai/schema/OxmModelLoaderTest.java | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/test/java/org/onap/aai/schema/OxmModelLoaderTest.java b/src/test/java/org/onap/aai/schema/OxmModelLoaderTest.java index 060e5ed..f3e9091 100644 --- a/src/test/java/org/onap/aai/schema/OxmModelLoaderTest.java +++ b/src/test/java/org/onap/aai/schema/OxmModelLoaderTest.java @@ -20,29 +20,44 @@ */ package org.onap.aai.schema; + import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; + import java.util.ArrayList; + import org.eclipse.persistence.dynamic.DynamicType; import org.eclipse.persistence.internal.helper.DatabaseField; import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext; import org.eclipse.persistence.mappings.DatabaseMapping; import org.junit.Test; -import org.onap.aai.schema.OxmModelLoader; +import org.junit.runner.RunWith; +import org.onap.aai.setup.SchemaLocationsBean; +import org.onap.aai.setup.SchemaVersions; import org.onap.aai.util.EntityOxmReferenceHelper; import org.onap.aai.util.ExternalOxmModelProcessor; -import org.onap.aai.setup.Version; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration("file:src/test/resources/spring-beans/data-router-oxm.xml") public class OxmModelLoaderTest { + @Autowired + private SchemaVersions schemaVersions; + @Autowired + private SchemaLocationsBean schemaLocationsBean; + @Test public void testLoadingMultipleOxmFiles() { + ArrayList<ExternalOxmModelProcessor> externalOxmModelProcessors = new ArrayList<ExternalOxmModelProcessor>(); externalOxmModelProcessors.add(EntityOxmReferenceHelper.getInstance()); OxmModelLoader.registerExternalOxmModelProcessors(externalOxmModelProcessors); - OxmModelLoader.loadModels(); + OxmModelLoader.loadModels(schemaVersions, schemaLocationsBean); - DynamicJAXBContext jaxbContext = OxmModelLoader.getContextForVersion(Version.getLatest().toString()); + DynamicJAXBContext jaxbContext = OxmModelLoader.getContextForVersion("v13", schemaVersions, schemaLocationsBean); DynamicType pserver = jaxbContext.getDynamicType("Pserver"); DynamicType genericVnf = jaxbContext.getDynamicType("GenericVnf"); @@ -63,6 +78,7 @@ public class OxmModelLoaderTest { String keyName = f.getName().substring(0, f.getName().indexOf("/")); assertTrue(keyName.equals("vnf-id")); } - + } + } |