import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl221;
import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
-import org.opendaylight.transportpce.common.mapping.*;
+import org.opendaylight.transportpce.common.mapping.MappingUtils;
+import org.opendaylight.transportpce.common.mapping.MappingUtilsImpl;
+import org.opendaylight.transportpce.common.mapping.PortMapping;
+import org.opendaylight.transportpce.common.mapping.PortMappingImpl;
+import org.opendaylight.transportpce.common.mapping.PortMappingVersion121;
+import org.opendaylight.transportpce.common.mapping.PortMappingVersion221;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl121;
import org.opendaylight.transportpce.olm.util.TransactionUtils;
import org.opendaylight.transportpce.test.AbstractTest;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownInput;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.NodeId;
public class PowerMgmtTest extends AbstractTest {
new PortMappingVersion221(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
this.portMappingVersion121 =
new PortMappingVersion121(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
- this.portMapping = new PortMappingImpl(getDataBroker(), this.portMappingVersion22, this.mappingUtils,
- this.portMappingVersion121);
+ this.portMapping = new PortMappingImpl(getDataBroker(), this.portMappingVersion22, this.portMappingVersion121);
this.portMapping = Mockito.spy(this.portMapping);
this.powerMgmt = new PowerMgmtImpl(this.getDataBroker(), this.openRoadmInterfaces, this.crossConnect,
this.deviceTransactionManager);
}
+ @Test
+ public void testPowerTurnDown() {
+ ServicePowerTurndownInput input = OlmPowerServiceRpcImplUtil.getServicePowerTurndownInput();
+ boolean output = this.powerMgmt.powerTurnDown(input);
+ Assert.assertEquals(true, output);
+ }
+
+ @Test
+ public void testPowerTurnDown2() {
+ ServicePowerTurndownInput input = OlmPowerServiceRpcImplUtil.getServicePowerTurndownInput2();
+ boolean output = this.powerMgmt.powerTurnDown(input);
+ Assert.assertEquals(false, output);
+ }
+
+ @Test
+ public void testPowerTurnDown3() {
+ ServicePowerTurndownInput input = OlmPowerServiceRpcImplUtil.getServicePowerTurndownInput3();
+ boolean output = this.powerMgmt.powerTurnDown(input);
+ Assert.assertEquals(true, output);
+ }
+
+ @Test
+ public void testPowerTurnDown4() {
+ ServicePowerTurndownInput input = OlmPowerServiceRpcImplUtil.getServicePowerTurndownInput4();
+ boolean output = this.powerMgmt.powerTurnDown(input);
+ Assert.assertEquals(false, output);
+ }
+
@Test
public void testSetPowerPresentNodes() throws InterruptedException {
List<NodeId> nodes = TransactionUtils.getNodeIds();