diff --git a/tests/test-encode-decode-Interest.cpp b/tests/test-encode-decode-Interest.cpp
index bba7596..d715c85 100644
--- a/tests/test-encode-decode-Interest.cpp
+++ b/tests/test-encode-decode-Interest.cpp
@@ -7,7 +7,6 @@
 #include <sstream>
 #include <iostream>
 #include <ndn-cpp/Interest.hpp>
-#include <ndn-cpp/c/network/TcpTransport.h>
 
 using namespace std;
 using namespace ndn;
@@ -38,36 +37,17 @@
 {
   try {
     Interest interest;
-#if 0
     interest.decode(Interest1, sizeof(Interest1));
     cout << "Interest name " << interest.getName().to_uri() << endl;
     cout << "Interest minSuffixComponents " << interest.getMinSuffixComponents() << endl;
     cout << "Interest publisherPublicKeyDigest length " << interest.getPublisherPublicKeyDigest().getPublisherPublicKeyDigest().size() << endl;
     cout << "Interest excludeEntryCount " << interest.getExclude().getEntryCount() << endl;
     cout << "InterestLifetimeMilliseconds " << interest.getInterestLifetimeMilliseconds() << endl;
-#endif
     
     vector<unsigned char> encoding;
     interest.encode(encoding);
     cout << "Interest encoding length " << encoding.size() << " vs. sizeof(Interest1) " << sizeof(Interest1) << endl;
 
-    struct ndn_TcpTransport transport;
-    ndn_TcpTransport_init(&transport);
-    ndn_Error error;
-    if (error = ndn_TcpTransport_connect(&transport, (char *)"E.hub.ndn.ucla.edu", 9695))
-      return error;
-    if (error = ndn_TcpTransport_send(&transport, &encoding[0], encoding.size()))
-      return error;
-    
-    unsigned char buffer[1000];
-    unsigned int nBytes;
-    if (error = ndn_TcpTransport_receive(&transport, buffer, sizeof(buffer), &nBytes))
-      return error;
-    
-    for (int i = 0; i < nBytes; ++i)
-      printf("%02X ", (unsigned int)buffer[i]);
-    
-#if 0
     Interest reDecodedInterest;
     reDecodedInterest.decode(encoding);
     cout << "Re-decoded Interest name " << reDecodedInterest.getName().to_uri() << endl;
@@ -75,7 +55,6 @@
     cout << "Re-decoded Interest publisherPublicKeyDigest length " << reDecodedInterest.getPublisherPublicKeyDigest().getPublisherPublicKeyDigest().size() << endl;
     cout << "Re-decoded Interest excludeEntryCount " << reDecodedInterest.getExclude().getEntryCount() << endl;
     cout << "Re-decoded InterestLifetimeMilliseconds " << reDecodedInterest.getInterestLifetimeMilliseconds() << endl;
-#endif
   } catch (exception &e) {
     cout << "exception: " << e.what() << endl;
   }
diff --git a/tests/test-get-async.cpp b/tests/test-get-async.cpp
new file mode 100644
index 0000000..a185386
--- /dev/null
+++ b/tests/test-get-async.cpp
@@ -0,0 +1,49 @@
+/**
+ * @author: Jeff Thompson
+ * See COPYING for copyright and distribution information.
+ */
+
+#include <cstdlib>
+#include <sstream>
+#include <iostream>
+#include <ndn-cpp/Interest.hpp>
+#include <ndn-cpp/ContentObject.hpp>
+#include <ndn-cpp/c/network/TcpTransport.h>
+
+using namespace std;
+using namespace ndn;
+int main(int argc, char** argv)
+{
+  try {
+    Interest interest;    
+    interest.getName() = Name("/ndn/ucla.edu/apps/ndn-js-test/hello.txt/level2/%FD%05%0B%16%7D%95%0E");
+    vector<unsigned char> encoding;
+    interest.encode(encoding);
+
+    struct ndn_TcpTransport transport;
+    ndn_TcpTransport_init(&transport);
+    ndn_Error error;
+    if (error = ndn_TcpTransport_connect(&transport, (char *)"E.hub.ndn.ucla.edu", 9695))
+      return error;
+    if (error = ndn_TcpTransport_send(&transport, &encoding[0], encoding.size()))
+      return error;
+
+    unsigned char buffer[8000];
+    unsigned int nBytes;
+    while (1) {
+      if (error = ndn_TcpTransport_receive(&transport, buffer, sizeof(buffer), &nBytes))
+        return error;
+      if (buffer[0] == 0x04)
+        break;    
+    }
+    
+    for (int i = 0; i < nBytes; ++i)
+      printf("%02X ", (unsigned int)buffer[i]);
+    
+    ContentObject contentObject;
+    contentObject.decode(buffer, nBytes);
+  } catch (exception &e) {
+    cout << "exception: " << e.what() << endl;
+  }
+  return 0;
+}
