2 * ============LICENSE_START=======================================================
3 * ONAP : ccsdk features
4 * ================================================================================
5 * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property.
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
22 package org.onap.ccsdk.features.sdnr.wt.dataprovider.test;
24 public class TestYangCloning {
27 public void testEquipment() {
28 EquipmentBuilder equipmentBuilder = new EquipmentBuilder();
29 equipmentBuilder.setUuid( new UniversalId("EquipmentId"));
30 equipmentBuilder.setContainedHolder(Arrays.asList(new ContainedHolderBuilder()
31 .setUuid(new UniversalId("HolderId"))
32 .setAdministrativeState(AdministrativeState.Locked)
33 .setSupportedEquipment(Arrays.asList("eq1"))
35 Equipment equipment = equipmentBuilder.build();
36 InventoryEntity output = YangToolsCloner.instance().cloneToBuilder(equipment, new InventoryBuilder())
37 .setNodeId("node1").setUuid("a.a.a").setId("node1"+"/"+"a.a.a").build();
40 System.out.println("source:");
41 System.out.println(equipment);
42 System.out.println("result:");
43 System.out.println(output);
48 public void testFaultCurrent() {
49 ProblemNotificationXml source = new ProblemNotificationXml("node", "uuid", "problem", InternalSeverity.Critical,54,InternalDateAndTime.getTestpattern());
50 FaultcurrentEntity output = YangToolsCloner.instance().clone(source,Faultcurrent.class);
52 System.out.println("source:");
53 System.out.println(source);
54 System.out.println("result:");
55 System.out.println(output);