### Question:
FramedProtocolAttribute extends Attribute { public int getFraming() { return framing; } FramedProtocolAttribute(byte[] octets);  FramedProtocolAttribute(int framing); int getFraming(); String toStringImpl(); static final int PPP; static final int SLIP; static final int ARAP; static final int GANDALF; static final int XYLOGICS; static final int X_75; }### Answer:
@Test public void testLowest() throws IOException { final FramedProtocolAttribute a = new FramedProtocolAttribute(0); Assert.assertEquals(a.getFraming(), 0, "frame should be 0"); final byte[] bytes = a.getOctets(); Assert.assertEquals(bytes[0], AttributeType.FRAMED_PROTOCOL.getTypeCode()); Assert.assertEquals(bytes[1], 6); Assert.assertEquals(bytes[2], 0); Assert.assertEquals(bytes[3], 0); Assert.assertEquals(bytes[4], 0); Assert.assertEquals(bytes[5], 0); }
@Test public void testHighest() throws IOException { final FramedProtocolAttribute a = new FramedProtocolAttribute(65535); Assert.assertEquals(a.getFraming(), 65535, "should be 65535"); final byte[] bytes = a.getOctets(); Assert.assertEquals(bytes[0], AttributeType.FRAMED_PROTOCOL.getTypeCode()); Assert.assertEquals(bytes[1], 6); Assert.assertEquals(bytes[2], 0); Assert.assertEquals(bytes[3], 0); Assert.assertEquals(bytes[4], (byte) 255); Assert.assertEquals(bytes[5], (byte) 255); }
@Test public void testMaxFromRawBytes() throws IOException { final byte[] raw = new byte[] {(byte) AttributeType.FRAMED_PROTOCOL.getTypeCode(), 6, 0, 0, (byte) 255, (byte) 255}; final FramedProtocolAttribute a = new FramedProtocolAttribute(raw); Assert.assertEquals(a.getFraming(), 65535); Assert.assertEquals(a.getType(), AttributeType.FRAMED_PROTOCOL); }
@Test public void testMinFromRawBytes() throws IOException { final byte[] raw = new byte[] {(byte) AttributeType.FRAMED_PROTOCOL.getTypeCode(), 6, 0, 0, 0, 0}; final FramedProtocolAttribute a = new FramedProtocolAttribute(raw); Assert.assertEquals(a.getFraming(), 0); Assert.assertEquals(a.getType(), AttributeType.FRAMED_PROTOCOL); }
@Test public void testPPP() throws IOException { final byte type = (byte) AttributeType.FRAMED_PROTOCOL.getTypeCode(); final byte[] raw = new byte[] {type, 6, 0, 0, 0, FramedProtocolAttribute.PPP}; final FramedProtocolAttribute a = new FramedProtocolAttribute(raw); Assert.assertEquals(a.getFraming(), FramedProtocolAttribute.PPP); Assert.assertEquals(a.getType(), AttributeType.FRAMED_PROTOCOL); }