aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/pnf
diff options
context:
space:
mode:
Diffstat (limited to 'vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/pnf')
-rw-r--r--vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/pnf/pnf.model.info.spec.ts58
-rw-r--r--vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/pnf/pnf.model.info.ts7
2 files changed, 6 insertions, 59 deletions
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/pnf/pnf.model.info.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/pnf/pnf.model.info.spec.ts
index 8a09372e0..8675d36f2 100644
--- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/pnf/pnf.model.info.spec.ts
+++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/pnf/pnf.model.info.spec.ts
@@ -14,6 +14,8 @@ import {MockNgRedux, NgReduxTestingModule} from "@angular-redux/store/testing";
import {HttpClient, HttpHandler} from "@angular/common/http";
import {CollectionResourceModel} from "../../../../../shared/models/collectionResourceModel";
import {ComponentInfoType} from "../../../component-info/component-info-model";
+import {VNFModel} from "../../../../../shared/models/vnfModel";
+import {PNFModel} from "../../../../../shared/models/pnfModel";
describe('PNF model info', () => {
@@ -77,61 +79,7 @@ describe('PNF model info', () => {
});
test('getModel should return pnf model', () => {
- let model: CollectionResourceModel = pnfModel.getModel('PNF1', <any>{
- originalName : 'PNF1'
- }, getServiceHierarchy());
- expect(model.type).toEqual('PNF');
+ expect(pnfModel.getModel({})).toBeInstanceOf(PNFModel);
});
- function getServiceHierarchy(){
- return {
- "service": {
- "uuid": "12550cd7-7708-4f53-a09e-41d3d6327ebc",
- "invariantUuid": "561faa57-7bbb-40ec-a81c-c0d4133e98d4",
- "name": "AIM Transport SVC_ym161f",
- "version": "1.0",
- "toscaModelURL": null,
- "category": "Network L1-3",
- "serviceType": "TRANSPORT",
- "serviceRole": "AIM",
- "description": "AIM Transport service",
- "serviceEcompNaming": "true",
- "instantiationType": "Macro",
- "inputs": {},
- "vidNotions": {
- "instantiationUI": "legacy",
- "modelCategory": "other",
- "viewEditUI": "legacy"
- }
- },
- "vnfs": {},
- "networks": {},
- "collectionResources": {},
- "configurations": {},
- "fabricConfigurations": {},
- "serviceProxies": {},
- "vfModules": {},
- "volumeGroups": {},
- "pnfs": {
- "PNF1": {
- "uuid": "1c831fa9-28a6-4778-8c1d-80b9e769f2ed",
- "invariantUuid": "74e13a12-dac9-4fba-b102-cd242d9e7f02",
- "description": "AIM Transport service",
- "name": "AIM PNF Model",
- "version": "1.0",
- "customizationUuid": "dce78da7-c842-47a1-aba2-2de1cd03ab7a",
- "inputs": {},
- "commands": {},
- "properties": {
- "nf_function": "SDNGW",
- "nf_role": "pD2IPE",
- "ecomp_generated_naming": "false",
- "nf_type": "ROUTER"
- },
- "type": "PNF"
- }
- },
- "vnfGroups": {}
- }
- }
})
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/pnf/pnf.model.info.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/pnf/pnf.model.info.ts
index b87551547..a7931b232 100644
--- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/pnf/pnf.model.info.ts
+++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/pnf/pnf.model.info.ts
@@ -5,8 +5,8 @@ import {ITreeNode} from "angular-tree-component/dist/defs/api";
import {AvailableNodeIcons} from "../../../available-models-tree/available-models-tree.service";
import {PnfInstance} from "app/shared/models/pnfInstance";
import {PNFModel} from "../../../../../shared/models/pnfModel";
-import {PnfTreeNode} from "../../../../../shared/models/pnfTreeNode";
import {SharedTreeService} from "../../shared.tree.service";
+import {NodeModelResponseInterface} from "../../../../../shared/models/nodeModel";
export class PnfModelInfo implements ILevelNodeInfo{
@@ -31,9 +31,8 @@ export class PnfModelInfo implements ILevelNodeInfo{
return {};
}
- getModel = (pnfModelId: string, instance: PnfInstance, serviceHierarchy): PNFModel => {
- const uniqueIdOrName = this._sharedTreeService.modelUniqueNameOrId(instance);
- return new PNFModel(this._sharedTreeService.modelByIdentifiers(serviceHierarchy, this.name, uniqueIdOrName, pnfModelId));
+ getModel = (instanceModel: any): PNFModel => {
+ return new PNFModel(instanceModel);
};
getNextLevelObject(): any { return null; }