diff options
author | 2016-10-27 09:28:49 +0000 | |
---|---|---|
committer | 2016-10-27 09:28:49 +0000 | |
commit | fb734fa273373b0719b3db32332370df5223b8f6 (patch) | |
tree | 0697e064615d3b1662252ae9d1e0cf65a7452af0 /catalog-core/catalog-mgr/src/test/java | |
parent | 5f6c112e62c87f0b6aa86df22888b70ad68d2207 (diff) | |
parent | e1ae56c72fa016eddcb52f8046524c20f09cc1a6 (diff) |
Merge "TOSCA-152 Add metadata and service Template original Id property for service Template table"
Diffstat (limited to 'catalog-core/catalog-mgr/src/test/java')
2 files changed, 16 insertions, 2 deletions
diff --git a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/TemplateManagerTest.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/TemplateManagerTest.java index 93faff11..b977832f 100644 --- a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/TemplateManagerTest.java +++ b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/TemplateManagerTest.java @@ -75,6 +75,8 @@ public class TemplateManagerTest { serviceData.setOperations("SDFSDFDSERWERWE"); serviceData.setVendor("ZTE"); serviceData.setVersion("v1.0"); + serviceData.setMetadata("metadata"); + serviceData.setServiceTemplateOriginalId("NS_01"); NodeTemplateData nodeData = new NodeTemplateData(); nodeData.setName("node"); nodeData.setNodeTemplateId("30001"); @@ -112,6 +114,8 @@ public class TemplateManagerTest { serviceData.setServiceTemplateId("20001"); serviceData.setVendor("ZTE"); serviceData.setVersion("v1.0"); + serviceData.setMetadata("metadata"); + serviceData.setServiceTemplateOriginalId("NS_01"); NodeTemplateData nodeData = new NodeTemplateData(); nodeData.setName("node"); nodeData.setServiceTemplateId("20001"); @@ -136,7 +140,17 @@ public class TemplateManagerTest { } Assert.assertTrue(list.size() > 0); } - + @Test + public void testQueryServiceTemplateByIdAndMetadataIsNotNull() { + ArrayList<ServiceTemplateData> list = new ArrayList<ServiceTemplateData>(); + try { + list = manager.queryServiceTemplateById("20001"); + } catch (CatalogResourceException e1) { + Assert.fail("Exception" + e1.getMessage()); + } + Assert + .assertTrue(list.size() > 0 && "NS_01".equals(list.get(0).getServiceTemplateOriginalId())); + } @Test public void testQueryServiceTemplate() { diff --git a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/H2DbServerUtil.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/H2DbServerUtil.java index d609182c..327de491 100644 --- a/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/H2DbServerUtil.java +++ b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/H2DbServerUtil.java @@ -56,7 +56,7 @@ public class H2DbServerUtil { /** * test. */ - public static void main() { + public static void main(String args[]) { H2DbServer.startUp(); H2DbServerUtil.initTable(); H2DbServer.shutDown(); |