Example #1
0
 @Test
 public void testFilterListenerNoError() throws Exception {
   AssertionCCNHandle getHandle = AssertionCCNHandle.open();
   ContentName filter = testHelper.getTestNamespace("testNoError");
   FilterListenerTester flt = new FilterListenerTester();
   getHandle.registerFilter(filter, flt);
   putHandle.expressInterest(new Interest(filter), new InterestListenerTester());
   getHandle.checkError(WAIT_TIME);
 }
Example #2
0
 @Test
 public void testFilterListenerAssertError() throws Exception {
   AssertionCCNHandle getHandle = AssertionCCNHandle.open();
   ContentName filter = testHelper.getTestNamespace("testFilterListenerAssertError");
   FilterListenerTester flt = new FilterListenerTester();
   getHandle.registerFilter(filter, flt);
   putHandle.expressInterest(new Interest(filter), new InterestListenerTester());
   getHandle.checkError(WAIT_TIME);
   ContentName pastFilter = new ContentName(filter, "pastFilter");
   putHandle.expressInterest(new Interest(pastFilter), new InterestListenerTester());
   try {
     getHandle.checkError(WAIT_TIME);
   } catch (AssertionFailedError afe) {
     return;
   }
   Assert.fail("Missed an assertion error we should have seen");
 }