f92d45a0623665cf761d7715281c53f1d9c6b65d
[controller.git] / third-party / openflowj / src / test / java / org / openflow / protocol / OFBarrierReplyTest.java
1
2 /*
3  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
4  *
5  * This program and the accompanying materials are made available under the
6  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7  * and is available at http://www.eclipse.org/legal/epl-v10.html
8  */
9
10 package org.openflow.protocol;
11
12 import java.nio.ByteBuffer;
13
14 import junit.framework.TestCase;
15
16 import org.openflow.util.OFTestCase;
17
18 public class OFBarrierReplyTest extends OFTestCase {
19     public void testWriteRead() throws Exception {
20         OFBarrierReply msg = (OFBarrierReply) messageFactory
21                 .getMessage(OFType.BARRIER_REPLY);
22         ByteBuffer bb = ByteBuffer.allocate(1024);
23         bb.clear();
24         msg.writeTo(bb);
25         bb.flip();
26         msg.readFrom(bb);
27         TestCase.assertEquals(OFType.BARRIER_REPLY, msg.getType());
28     }
29 }