Add missing license headers
[packetcable.git] / packetcable-driver / src / test / java / org / pcmm / gates / impl / SessionClassIDTest.java
1 /*
2  * Copyright (c) 2015 Cable Television Laboratories, 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 package org.pcmm.gates.impl;
9
10 import org.junit.Assert;
11 import org.junit.Test;
12
13 /**
14  * Tests the data holder class SessionClassID to ensure both construction and byte parsing result in correct object
15  * creation.
16  */
17 public class SessionClassIDTest {
18
19     @Test
20     public void constructor1() {
21         final SessionClassID sessionClassID = new SessionClassID((byte)1);
22         Assert.assertEquals((byte)1, sessionClassID.toSingleByte());
23         Assert.assertEquals((byte)1 >> 2, sessionClassID.getPriority());
24         Assert.assertEquals((byte)1 >> 3, sessionClassID.getPreemption());
25     }
26
27     @Test
28     public void constructor2() {
29         final SessionClassID sessionClassID = new SessionClassID((byte)1, (byte)3, (byte)4);
30         Assert.assertEquals((byte)1, sessionClassID.toSingleByte());
31         Assert.assertEquals((byte)3, sessionClassID.getPriority());
32         Assert.assertEquals((byte)4, sessionClassID.getPreemption());
33     }
34 }