Search in sources :

Example 1 with CleanInstructionsInputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.CleanInstructionsInputBuilder in project bgpcep by opendaylight.

the class ProgrammingServiceImplTest method testCleanInstructions.

@Test
public void testCleanInstructions() throws Exception {
    final SubmitInstructionInput mockedSubmit1 = getMockedSubmitInstructionInput("mockedSubmit1");
    this.testedProgrammingService.scheduleInstruction(mockedSubmit1);
    final SubmitInstructionInput mockedSubmit2 = getMockedSubmitInstructionInput("mockedSubmit2", "mockedSubmit1");
    this.testedProgrammingService.scheduleInstruction(mockedSubmit2);
    final CleanInstructionsInputBuilder cleanInstructionsInputBuilder = new CleanInstructionsInputBuilder();
    final CleanInstructionsInput cleanInstructionsInput = cleanInstructionsInputBuilder.setId(Lists.newArrayList(mockedSubmit1.getId(), mockedSubmit2.getId())).build();
    ListenableFuture<RpcResult<CleanInstructionsOutput>> cleanedInstructionOutput = this.testedProgrammingService.cleanInstructions(cleanInstructionsInput);
    assertCleanInstructionOutput(cleanedInstructionOutput, 2);
    this.testedProgrammingService.cancelInstruction(getCancelInstruction("mockedSubmit1"));
    cleanedInstructionOutput = this.testedProgrammingService.cleanInstructions(cleanInstructionsInput);
    assertCleanInstructionOutput(cleanedInstructionOutput, 0);
    checkNotPresentOperational(getDataBroker(), buildInstructionIID(mockedSubmit1.getId()));
    checkNotPresentOperational(getDataBroker(), buildInstructionIID(mockedSubmit2.getId()));
}
Also used : CleanInstructionsInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.CleanInstructionsInputBuilder) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) CleanInstructionsInput(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.CleanInstructionsInput) SubmitInstructionInput(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.SubmitInstructionInput) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 CleanInstructionsInput (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.CleanInstructionsInput)1 CleanInstructionsInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.CleanInstructionsInputBuilder)1 SubmitInstructionInput (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.SubmitInstructionInput)1 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)1