Search in sources :

Example 6 with Nanotime

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

the class ProgrammingServiceImplTest method getMockedSubmitInstructionInput.

private static SubmitInstructionInput getMockedSubmitInstructionInput(final String id, final Optional<Nanotime> deadline, final String... dependencyIds) {
    final SubmitInstructionInput mockedSubmitInstruction = mock(SubmitInstructionInput.class);
    doReturn(PcepUpdateTunnelInput.class).when(mockedSubmitInstruction).getImplementedInterface();
    final List<InstructionId> dependencies = Lists.newArrayList();
    for (final String dependencyId : dependencyIds) {
        dependencies.add(new InstructionId(dependencyId));
    }
    doReturn(dependencies).when(mockedSubmitInstruction).getPreconditions();
    doReturn(new InstructionId(id)).when(mockedSubmitInstruction).getId();
    doReturn(deadline.isPresent() ? deadline.get() : new Nanotime(BigInteger.valueOf(Long.MAX_VALUE))).when(mockedSubmitInstruction).getDeadline();
    return mockedSubmitInstruction;
}
Also used : InstructionId(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.InstructionId) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) SubmitInstructionInput(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.SubmitInstructionInput) Nanotime(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.Nanotime)

Aggregations

Nanotime (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.Nanotime)6 BigInteger (java.math.BigInteger)4 Test (org.junit.Test)4 Instruction (org.opendaylight.bgpcep.programming.spi.Instruction)4 SubmitInstructionInput (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.SubmitInstructionInput)4 InstructionId (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.InstructionId)2 Timeout (io.netty.util.Timeout)1 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)1 SchedulerException (org.opendaylight.bgpcep.programming.spi.SchedulerException)1 DuplicateInstructionId (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.DuplicateInstructionId)1 UnknownInstruction (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.UnknownInstruction)1 FailureBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.submit.instruction.output.result.failure._case.FailureBuilder)1