Fix license header violations in sal-distributed-datastore
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / identifiers / TransactionChainIdentifierTest.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. 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
9 package org.opendaylight.controller.cluster.datastore.identifiers;
10
11 import static org.junit.Assert.assertEquals;
12 import org.junit.Test;
13
14 public class TransactionChainIdentifierTest {
15     @Test
16     public void testToString(){
17         TransactionChainIdentifier transactionChainIdentifier = new TransactionChainIdentifier("member-1", 99);
18
19         String id = transactionChainIdentifier.toString();
20
21         assertEquals("member-1-chn-99", id);
22     }
23
24     @Test
25     public void testNewTransactionIdentifier(){
26         TransactionChainIdentifier transactionChainIdentifier = new TransactionChainIdentifier("member-1", 99);
27
28         TransactionIdentifier txId1 = transactionChainIdentifier.newTransactionIdentifier();
29
30         assertEquals("member-1-chn-99-txn-1", txId1.toString());
31
32         TransactionIdentifier txId2 = transactionChainIdentifier.newTransactionIdentifier();
33
34         assertEquals("member-1-chn-99-txn-2", txId2.toString());
35     }
36
37 }