2 * Copyright (c) 2017 Pantheon Technologies s.r.o. and others. All rights reserved.
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
8 package org.opendaylight.controller.cluster.databroker;
10 import static org.mockito.Mockito.times;
11 import static org.mockito.Mockito.verify;
13 import org.junit.Test;
14 import org.opendaylight.controller.cluster.access.concepts.ClientIdentifier;
15 import org.opendaylight.controller.cluster.access.concepts.FrontendIdentifier;
16 import org.opendaylight.controller.cluster.access.concepts.FrontendType;
17 import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier;
18 import org.opendaylight.controller.cluster.access.concepts.MemberName;
19 import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
20 import org.opendaylight.controller.cluster.databroker.actors.dds.AbstractClientHandle;
22 public abstract class ClientBackedTransactionTest<T extends ClientBackedTransaction<?>> {
23 private static FrontendIdentifier FRONTEND_ID = FrontendIdentifier.create(
24 MemberName.forName("member"), FrontendType.forName("frontend"));
25 protected static final ClientIdentifier CLIENT_ID = ClientIdentifier.create(FRONTEND_ID, 0);
27 private static LocalHistoryIdentifier HISTORY_ID = new LocalHistoryIdentifier(CLIENT_ID, 0);
28 protected static final TransactionIdentifier TRANSACTION_ID = new TransactionIdentifier(HISTORY_ID, 0);
33 public void testClose() {
34 final AbstractClientHandle<?> delegate = object().delegate();
36 // Called twice because of immediate cleaning
37 verify(delegate, times(2)).abort();