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.access.commands;
10 import com.google.common.base.MoreObjects;
11 import org.junit.Assert;
12 import org.junit.Test;
13 import org.opendaylight.controller.cluster.access.ABIVersion;
15 public class ExistsTransactionSuccessTest extends AbstractTransactionSuccessTest<ExistsTransactionSuccess> {
16 private static final boolean EXISTS = true;
18 private static final ExistsTransactionSuccess OBJECT = new ExistsTransactionSuccess(
19 TRANSACTION_IDENTIFIER, 0, EXISTS);
22 public void getExists() throws Exception {
23 final boolean result = OBJECT.getExists();
24 Assert.assertEquals(EXISTS, result);
28 public void externalizableProxy() throws Exception {
29 final ExistsTransactionSuccessProxyV1 proxy = OBJECT.externalizableProxy(ABIVersion.BORON);
30 Assert.assertNotNull(proxy);
34 public void cloneAsVersion() throws Exception {
35 final ExistsTransactionSuccess clone = OBJECT.cloneAsVersion(ABIVersion.BORON);
36 Assert.assertEquals(OBJECT, clone);
40 public void addToStringAttributes() throws Exception {
41 final MoreObjects.ToStringHelper result = OBJECT.addToStringAttributes(MoreObjects.toStringHelper(OBJECT));
42 Assert.assertTrue(result.toString().contains("exists=" + EXISTS));