From bf6ccadd95d2e23246a51380ee38c0b45667c979 Mon Sep 17 00:00:00 2001 From: "matus.kubica" Date: Thu, 30 Mar 2017 13:08:36 +0200 Subject: [PATCH] ClosedTransactionException unit test Change-Id: Ib86fe2e8e6ece0c5cc41efdcae02223cf94d362b Signed-off-by: matus.kubica --- .../ClosedTransactionExceptionTest.java | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/commands/ClosedTransactionExceptionTest.java diff --git a/opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/commands/ClosedTransactionExceptionTest.java b/opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/commands/ClosedTransactionExceptionTest.java new file mode 100644 index 0000000000..e3750ae886 --- /dev/null +++ b/opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/commands/ClosedTransactionExceptionTest.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2017 Pantheon Technologies s.r.o. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.cluster.access.commands; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; + +import org.junit.Assert; +import org.junit.Test; +import org.opendaylight.controller.cluster.access.concepts.RequestExceptionTest; + +public class ClosedTransactionExceptionTest extends RequestExceptionTest { + + private static final ClosedTransactionException OBJECT = new ClosedTransactionException(true); + + @Override + protected void isRetriable() { + assertFalse(OBJECT.isRetriable()); + } + + @Override + protected void checkMessage() { + final String message = OBJECT.getMessage(); + assertEquals("Transaction has been " + "committed", message); + assertNull(OBJECT.getCause()); + } + + @Test + public void testIsSuccessful() throws Exception { + Assert.assertEquals(true, OBJECT.isSuccessful()); + } + +} \ No newline at end of file -- 2.36.6