Move {Identifiable,Persistent,}Payload
[controller.git] / opendaylight / md-sal / cds-access-client / src / test / java / org / opendaylight / controller / cluster / access / client / HaltedTransmitQueueTest.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.cluster.access.client;
9
10 import com.google.common.base.Ticker;
11 import java.util.function.Consumer;
12 import org.junit.Assert;
13 import org.junit.Test;
14 import org.opendaylight.controller.cluster.access.commands.TransactionPurgeRequest;
15 import org.opendaylight.controller.cluster.access.concepts.Request;
16 import org.opendaylight.controller.cluster.access.concepts.Response;
17
18 public class HaltedTransmitQueueTest extends AbstractTransmitQueueTest<TransmitQueue.Halted> {
19
20     @Override
21     protected int getMaxInFlightMessages() {
22         return 0;
23     }
24
25     @Override
26     protected TransmitQueue.Halted createQueue() {
27         return new TransmitQueue.Halted(0);
28     }
29
30     @Test
31     @Override
32     public void testCanTransmitCount() {
33         Assert.assertFalse(queue.canTransmitCount(0) > 0);
34     }
35
36     @Test(expected = UnsupportedOperationException.class)
37     @Override
38     public void testTransmit() {
39         final Request<?, ?> request = new TransactionPurgeRequest(TRANSACTION_IDENTIFIER, 0L, probe.ref());
40         final Consumer<Response<?, ?>> callback = createConsumerMock();
41         final long now = Ticker.systemTicker().read();
42         final ConnectionEntry entry = new ConnectionEntry(request, callback, now);
43         queue.transmit(entry, now);
44     }
45
46 }