diff --git a/src/test/java/com/intel/jndn/management/ControlResponseTest.java b/src/test/java/com/intel/jndn/management/ControlResponseTest.java
new file mode 100644
index 0000000..5d026e0
--- /dev/null
+++ b/src/test/java/com/intel/jndn/management/ControlResponseTest.java
@@ -0,0 +1,52 @@
+/*
+ * File name: ControlResponseTest.java
+ * 
+ * Purpose: Test encoding/decoding of ControlResponses.
+ * 
+ * © Copyright Intel Corporation. All rights reserved.
+ * Intel Corporation, 2200 Mission College Boulevard,
+ * Santa Clara, CA 95052-8119, USA
+ */
+package com.intel.jndn.management;
+
+import com.intel.jndn.management.types.ControlResponse;
+import junit.framework.Assert;
+import net.named_data.jndn.ControlParameters;
+import net.named_data.jndn.util.Blob;
+import org.junit.Test;
+
+/**
+ * Test encoding/decoding of ControlResponses.
+ *
+ * @author Andrew Brown <andrew.brown@intel.com>
+ */
+public class ControlResponseTest {
+
+	/**
+	 * Test encoding/decoding
+	 *
+	 * @throws java.lang.Exception
+	 */
+	@Test
+	public void testEncodeDecode() throws Exception {
+		ControlParameters parameters = new ControlParameters();
+		parameters.setFaceId(3);
+		ControlResponse response = new ControlResponse();
+		response.setStatusCode(404);
+		response.setStatusText("Not Found");
+		response.getBody().add(parameters);
+
+		// encode
+		Blob encoded = response.wireEncode();
+
+		// decode
+		ControlResponse decoded = new ControlResponse();
+		decoded.wireDecode(encoded.buf());
+
+		// test
+		Assert.assertEquals(response.getStatusCode(), decoded.getStatusCode());
+		Assert.assertEquals(response.getStatusText(), decoded.getStatusText());
+		Assert.assertEquals(response.getBody().size(), decoded.getBody().size());
+		Assert.assertEquals(response.getBody().get(0).getFaceId(), decoded.getBody().get(0).getFaceId());
+	}
+}
diff --git a/src/test/java/com/intel/jndn/management/FaceStatusTest.java b/src/test/java/com/intel/jndn/management/FaceStatusTest.java
index c4d5ba0..f0d3eaf 100644
--- a/src/test/java/com/intel/jndn/management/FaceStatusTest.java
+++ b/src/test/java/com/intel/jndn/management/FaceStatusTest.java
@@ -10,8 +10,11 @@
  */
 package com.intel.jndn.management;
 
+import com.intel.jndn.management.types.StatusDataset;
+import com.intel.jndn.management.types.FaceStatus;
 import com.intel.jndn.utils.Client;
 import java.util.List;
+import junit.framework.Assert;
 import net.named_data.jndn.Data;
 import net.named_data.jndn.Face;
 import net.named_data.jndn.Interest;
@@ -30,24 +33,55 @@
  * @author Andrew Brown <andrew.brown@intel.com>
  */
 public class FaceStatusTest {
-	
+
 	private static final Logger logger = LogManager.getLogger();
 
 	/**
+	 * Test encoding/decoding
+	 *
+	 * @throws java.lang.Exception
+	 */
+	@Test
+	public void testEncodeDecode() throws Exception {
+		FaceStatus status = new FaceStatus();
+		status.setFaceId(42);
+		status.setUri("...");
+		status.setLocalUri("...");
+
+		// encode
+		Blob encoded = status.wireEncode();
+
+		// decode
+		FaceStatus decoded = new FaceStatus();
+		decoded.wireDecode(encoded.buf());
+
+		// test
+		Assert.assertEquals(status.getFaceId(), decoded.getFaceId());
+		Assert.assertEquals(status.getUri(), decoded.getUri());
+		Assert.assertEquals(status.getLocalUri(), decoded.getLocalUri());
+		Assert.assertEquals(status.getExpirationPeriod(), decoded.getExpirationPeriod());
+		Assert.assertEquals(status.getFaceScope(), decoded.getFaceScope());
+		Assert.assertEquals(status.getFacePersistency(), decoded.getFacePersistency());
+		Assert.assertEquals(status.getLinkType(), decoded.getLinkType());
+		Assert.assertEquals(status.getInBytes(), decoded.getInBytes());
+		Assert.assertEquals(status.getOutBytes(), decoded.getOutBytes());
+	}
+
+	/**
 	 * Test of decode method, of class FaceStatus.
 	 *
 	 * @throws java.lang.Exception
 	 */
 	@Test
-	public void testDecode() throws Exception {
+	public void testDecodeFakeData() throws Exception {
 		Data data = getFaceData(true);
-		List<FaceStatus> results = FaceStatus.decode(data);
+		List<FaceStatus> results = StatusDataset.wireDecode(data.getContent(), FaceStatus.class);
 		assertTrue(results.size() > 4);
 		for (FaceStatus f : results) {
 			// the first face (face 1) should always be the internal face
-			if (f.faceId == 1) {
-				assertEquals("internal://", f.uri);
-				assertEquals("internal://", f.localUri);
+			if (f.getFaceId() == 1) {
+				assertEquals("internal://", f.getUri());
+				assertEquals("internal://", f.getLocalUri());
 			}
 		}
 	}
@@ -58,15 +92,15 @@
 	 * @param args
 	 * @throws EncodingException
 	 */
-	public static void main(String[] args) throws EncodingException {
+	public static void main(String[] args) throws Exception {
 		Data data = getFaceData(false);
-		List<FaceStatus> results = FaceStatus.decode(data);
+		List<FaceStatus> results = StatusDataset.wireDecode(data.getContent(), FaceStatus.class);
 		assertTrue(results.size() > 4);
 		for (FaceStatus f : results) {
 			// the first face (face 1) should always be the internal face
-			if (f.faceId == 1) {
-				assertEquals("internal://", f.uri);
-				assertEquals("internal://", f.localUri);
+			if (f.getFaceId() == 1) {
+				assertEquals("internal://", f.getUri());
+				assertEquals("internal://", f.getLocalUri());
 			}
 		}
 	}
diff --git a/src/test/java/com/intel/jndn/management/FibEntryTest.java b/src/test/java/com/intel/jndn/management/FibEntryTest.java
new file mode 100644
index 0000000..85ac273
--- /dev/null
+++ b/src/test/java/com/intel/jndn/management/FibEntryTest.java
@@ -0,0 +1,85 @@
+/*
+ * File name: FibEntryTest.java
+ * 
+ * Purpose: Test encode/decode of FibEntry and NextHopRecord
+ * 
+ * © Copyright Intel Corporation. All rights reserved.
+ * Intel Corporation, 2200 Mission College Boulevard,
+ * Santa Clara, CA 95052-8119, USA
+ */
+package com.intel.jndn.management;
+
+import com.intel.jndn.management.types.StatusDataset;
+import com.intel.jndn.management.types.NextHopRecord;
+import com.intel.jndn.management.types.FibEntry;
+import com.intel.jndn.utils.Client;
+import java.util.List;
+import junit.framework.Assert;
+import net.named_data.jndn.Data;
+import net.named_data.jndn.Face;
+import net.named_data.jndn.Interest;
+import net.named_data.jndn.Name;
+import net.named_data.jndn.encoding.EncodingException;
+import net.named_data.jndn.util.Blob;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import org.junit.Test;
+
+/**
+ * Test encode/decode of FibEntry and NextHopRecord
+ *
+ * @author Andrew Brown <andrew.brown@intel.com>
+ */
+public class FibEntryTest {
+
+	/**
+	 * Test encoding/decoding
+	 *
+	 * @throws java.lang.Exception
+	 */
+	@Test
+	public void testEncodeDecode() throws Exception {
+		NextHopRecord nextHopRecord = new NextHopRecord();
+		nextHopRecord.setFaceId(42);
+		nextHopRecord.setCost(100);
+		FibEntry entry = new FibEntry();
+		entry.setName(new Name("/fib/entry/test"));
+		entry.getRecords().add(nextHopRecord);
+
+		// encode
+		Blob encoded = entry.wireEncode();
+
+		// decode
+		FibEntry decoded = new FibEntry();
+		decoded.wireDecode(encoded.buf());
+
+		// test
+		Assert.assertEquals(entry.getName().toUri(), decoded.getName().toUri());
+		Assert.assertEquals(entry.getRecords().get(0).getFaceId(), decoded.getRecords().get(0).getFaceId());
+		Assert.assertEquals(entry.getRecords().get(0).getCost(), decoded.getRecords().get(0).getCost());
+	}
+
+	/**
+	 * Integration test to run on actual system
+	 *
+	 * @param args
+	 * @throws EncodingException
+	 */
+	public static void main(String[] args) throws Exception {
+		Face forwarder = new Face("localhost");
+
+		// build management Interest packet; see http://redmine.named-data.net/projects/nfd/wiki/StatusDataset
+		Interest interest = new Interest(new Name("/localhost/nfd/fib/list"));
+		interest.setMustBeFresh(true);
+		interest.setChildSelector(Interest.CHILD_SELECTOR_RIGHT);
+		interest.setInterestLifetimeMilliseconds(2000.0);
+
+		// send packet
+		Data data = Client.getDefault().getSync(forwarder, interest);
+
+		// decode results
+		List<FibEntry> results = StatusDataset.wireDecode(data.getContent(), FibEntry.class);
+		assertTrue(results.size() > 0);
+		assertEquals("/localhost/nfd", results.get(0).getName().toUri());
+	}
+}
diff --git a/src/test/java/com/intel/jndn/management/RibEntryTest.java b/src/test/java/com/intel/jndn/management/RibEntryTest.java
new file mode 100644
index 0000000..96dd70b
--- /dev/null
+++ b/src/test/java/com/intel/jndn/management/RibEntryTest.java
@@ -0,0 +1,87 @@
+/*
+ * File name: RibEntryTest.java
+ * 
+ * Purpose: Test encoding/decoding for RibEntry.
+ * 
+ * © Copyright Intel Corporation. All rights reserved.
+ * Intel Corporation, 2200 Mission College Boulevard,
+ * Santa Clara, CA 95052-8119, USA
+ */
+package com.intel.jndn.management;
+
+import com.intel.jndn.management.types.StatusDataset;
+import com.intel.jndn.management.types.RibEntry;
+import com.intel.jndn.management.types.Route;
+import com.intel.jndn.utils.Client;
+import java.util.List;
+import junit.framework.Assert;
+import net.named_data.jndn.Data;
+import net.named_data.jndn.Face;
+import net.named_data.jndn.Interest;
+import net.named_data.jndn.Name;
+import net.named_data.jndn.encoding.EncodingException;
+import net.named_data.jndn.util.Blob;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import org.junit.Test;
+
+/**
+ * Test encoding/decoding for RibEntry.
+ *
+ * @author Andrew Brown <andrew.brown@intel.com>
+ */
+public class RibEntryTest {
+
+	/**
+	 * Test encoding/decoding
+	 *
+	 * @throws java.lang.Exception
+	 */
+	@Test
+	public void testEncodeDecode() throws Exception {
+		Route route = new Route();
+		route.setFaceId(42);
+		route.setCost(100);
+		route.setOrigin(0);
+		RibEntry entry = new RibEntry();
+		entry.setName(new Name("/rib/entry/test"));
+		entry.getRoutes().add(route);
+
+		// encode
+		Blob encoded = entry.wireEncode();
+
+		// decode
+		RibEntry decoded = new RibEntry();
+		decoded.wireDecode(encoded.buf());
+
+		// test
+		Assert.assertEquals(entry.getName().toUri(), decoded.getName().toUri());
+		Assert.assertEquals(entry.getRoutes().get(0).getFaceId(), decoded.getRoutes().get(0).getFaceId());
+		Assert.assertEquals(entry.getRoutes().get(0).getCost(), decoded.getRoutes().get(0).getCost());
+		Assert.assertEquals(entry.getRoutes().get(0).getOrigin(), decoded.getRoutes().get(0).getOrigin());
+	}
+
+	/**
+	 * Integration test to run on actual system
+	 *
+	 * @param args
+	 * @throws EncodingException
+	 */
+	public static void main(String[] args) throws Exception {
+		Face forwarder = new Face("localhost");
+
+		// build management Interest packet; see http://redmine.named-data.net/projects/nfd/wiki/StatusDataset
+		Interest interest = new Interest(new Name("/localhost/nfd/rib/list"));
+		interest.setMustBeFresh(true);
+		interest.setChildSelector(Interest.CHILD_SELECTOR_RIGHT);
+		interest.setInterestLifetimeMilliseconds(2000.0);
+
+		// send packet
+		Data data = Client.getDefault().getSync(forwarder, interest);
+
+		// decode results
+		List<RibEntry> results = StatusDataset.wireDecode(data.getContent(), RibEntry.class);
+		assertTrue(results.size() > 0);
+		assertEquals("/localhost/nfd", results.get(0).getName().toUri());
+	}
+}
