X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=olm%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Folm%2Fstub%2FOlmServiceStub.java;fp=olm%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Folm%2Fstub%2FOlmServiceStub.java;h=96803ef066f356dea0df9dc695856e2d12905d1f;hb=431af557ffb3c6f36d4ad8324f36391a1b9bc9af;hp=0000000000000000000000000000000000000000;hpb=0779ad5796bb645690874959c9a891c42e2f7175;p=transportpce.git diff --git a/olm/src/test/java/org/opendaylight/transportpce/olm/stub/OlmServiceStub.java b/olm/src/test/java/org/opendaylight/transportpce/olm/stub/OlmServiceStub.java new file mode 100644 index 000000000..96803ef06 --- /dev/null +++ b/olm/src/test/java/org/opendaylight/transportpce/olm/stub/OlmServiceStub.java @@ -0,0 +1,66 @@ +/* + * Copyright © 2018 Orange Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.transportpce.olm.stub; + +import com.google.common.util.concurrent.ListenableFuture; +import java.util.ArrayList; + +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossBaseInput; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossBaseOutput; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossCurrentInput; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.CalculateSpanlossCurrentOutput; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmInput; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmOutput; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmOutputBuilder; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerResetInput; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerResetOutput; +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.ServicePowerSetupOutput; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupOutputBuilder; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownInput; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownOutput; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownOutputBuilder; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.TransportpceOlmService; +import org.opendaylight.yangtools.yang.common.RpcResult; +import org.opendaylight.yangtools.yang.common.RpcResultBuilder; + +public class OlmServiceStub implements TransportpceOlmService { + + @Override public ListenableFuture> calculateSpanlossCurrent( + CalculateSpanlossCurrentInput input) { + return null; + } + + @Override public ListenableFuture> getPm(GetPmInput input) { + GetPmOutput output = new GetPmOutputBuilder() + .setNodeId("node1").setMeasurements(new ArrayList<>()).build(); + return RpcResultBuilder.success( + output).buildFuture(); + } + + @Override public ListenableFuture> servicePowerTurndown( + ServicePowerTurndownInput input) { + return RpcResultBuilder.success((new ServicePowerTurndownOutputBuilder()) + .setResult("Success").build()).buildFuture(); + } + + @Override public ListenableFuture> calculateSpanlossBase( + CalculateSpanlossBaseInput input) { + return null; + } + + @Override public ListenableFuture> servicePowerReset( + ServicePowerResetInput input) { + return null; + } + + @Override public ListenableFuture> servicePowerSetup( + ServicePowerSetupInput input) { + return RpcResultBuilder.success(new ServicePowerSetupOutputBuilder().build()).buildFuture(); + } +}