2 * Copyright (c) 2013 Cisco Systems, Inc. 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.protocol.bgp.concepts;
10 import static org.junit.Assert.assertArrayEquals;
12 import org.junit.Test;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.ClusterIdentifier;
15 public class ClusterIdentifierTest {
18 public void testClusterIdentifier() {
19 final ClusterIdentifier id = new ClusterIdentifier(new byte[] { 13, 14, 15, 16 });
20 // FIXME: uncomment, once the generated code has length precondition
22 // new ClusterIdentifier(new byte[] { 5, 6 });
23 // fail("Cluster ID is invalid!");
24 // } catch (final IllegalArgumentException e) {
25 // assertEquals("Invalid Cluster ID", e.getMessage());
28 final ClusterIdentifier id1 = new ClusterIdentifier(new byte[] { 13, 14, 15, 16 });
30 // FIXME: BUG-80 : uncomment, once it's done
31 // assertEquals(id1.toString(), id.toString());
33 assertArrayEquals(id1.getValue(), new byte[] { 13, 14, 15, 16 });