From 280f8015d06af1f41a3ef12e8300801c7a5e0d54 Mon Sep 17 00:00:00 2001 From: AviZi Date: Fri, 9 Jun 2017 02:39:56 +0300 Subject: [SDC-29] Amdocs OnBoard 1707 initial commit. Change-Id: Ie4d12a3f574008b792899b368a0902a8b46b5370 Signed-off-by: AviZi --- .../SoftwareProductAttachmentsFactories.js | 106 +++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductAttachmentsFactories.js (limited to 'openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductAttachmentsFactories.js') diff --git a/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductAttachmentsFactories.js b/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductAttachmentsFactories.js new file mode 100644 index 0000000000..eb010da790 --- /dev/null +++ b/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductAttachmentsFactories.js @@ -0,0 +1,106 @@ +/*! + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ +import {Factory} from 'rosie'; +import randomstring from 'randomstring'; + +export const VSPAttachmentsErrorFactory = new Factory() + .attrs({ + level: 'WARNING' + }) + .sequence('message', index => `error no. ${index}`); + +export const VSPHeatFactory = new Factory() + .attrs({ + fileName: () => `${randomstring.generate()}.yaml`, + env: { + fileName: () => `${randomstring.generate()}.env` + }, + errors: Factory.buildList(VSPAttachmentsErrorFactory) + }); + +export const VSPAttachmentTreeNodeFactory = new Factory() + .attrs({ + name: 'HEAT', + type: 'heat' + }); + +export const VSPAttachmentTreeNodeWithChildrenFactory = new Factory() + .extend(VSPAttachmentTreeNodeFactory) + .attrs({ + expanded: true, + children: [] + }); + +export const VSPAttachmentDetailedError = new Factory() + .attrs({ + level: 'WARNING', + errorMessage: 'Resource is not defined as output and thus cannot be Shared. resource id - network_4', + name: () => `${randomstring.generate()}.yaml`, + hasParent: false, + parentName: 'HEAT', + type: 'heat' + }); + +export const HeatSetupModuleBase = new Factory() + .option('name', 0) + .attr('name', ['name'], (name) => { + return name ? randomstring.generate(5) : ''; + }) + .attrs({ + isBase: false, + yaml: () => {return 'yaml_' + randomstring.generate(5) + '.yaml';}, + env: () => {return 'env_' + randomstring.generate(5) + '.env';}, + vol: () => {return 'vol_' + randomstring.generate(5) + '.vol';}, + volEnv: () => {return 'volEnv_' + randomstring.generate(5) + '.env';} + }); + +export const heatSetupManifest = new Factory() + .attrs({ + modules: [ + { + name: 'BASE_sdjflsjldfsd', + isBase: true, + yaml: 'yaml_filename9.yaml', + env: 'env_filename8.env', + vol: 'vol_filename5.vol', + volEnv: 'vol_env_filename1.8.vol', + + }, + { + name: 'MODULE_asdkjfhkajsf', + isBase: false, + yaml: 'yaml_filename.yaml', + env: 'env_filename.env', + vol: 'vol_filename.vol', + volEnv: 'vol_env_filename.vol', + + } + ], + unassigned: [ + 'hot-nimbus-oam-volumes_v1.0.env', + 'hot-nimbus-oam_v1.0.env', + 'hot-nimbus-oam-volumes_v1.1.env', + 'hot-nimbus-oam-volumes_v2.0.env', + 'vol_filename2.vol', + 'hot-nimbus-oam-volumes_v4.0.env', + 'hot-nimbus-oam-volumes_v5.0.env', + 'hot-nimbus-oam_v6.0.env', + 'hot-nimbus-oam-volumes_v7.0.env', + 'vol_filename1.vol' + ], + artifacts: ['hot-nimbus-oam_v3.0.env'], + nested: ['nested-ppd_v1.1.yaml', 'nested-ppd_v1.0.yaml', 'nested-ppd_v8.0.yaml'] + }); -- cgit 1.2.3-korg