2 * Copyright (c) 2015 Cable Television Laboratories, 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.pcmm.gates.impl;
10 import org.junit.Assert;
11 import org.junit.Test;
14 * Tests the data holder class SessionClassID to ensure both construction and byte parsing result in correct object
17 public class SessionClassIDTest {
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());
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());