@Override
 protected void setUpQRPTables() throws Exception {
   QueryRouteTable qrt = new QueryRouteTable();
   qrt.add(match);
   for (Message m : qrt.encode(new QueryRouteTable())) ULTRAPEER[0].send(m);
   ULTRAPEER[0].flush();
 }
  public void testQRP() throws Exception {
    RoutedConnection c = connectionManager.getInitializedConnections().get(0);
    c.getRoutedConnectionStatistics().incrementNextQRPForwardTime(0);
    PatchTableMessage ptm =
        BlockingConnectionUtils.getFirstInstanceOfMessageType(
            testUP[0], PatchTableMessage.class, 22000);
    assertNotNull(ptm);
    QueryRouteTable qrt = new QueryRouteTable();
    qrt.patch(ptm);

    // initially, the qrp words should be included
    assertTrue(qrt.contains(queryRequestFactory.createQuery("badger")));

    // change some words, an updated qrp should be sent shortly
    SearchSettings.LIME_QRP_ENTRIES.set(new String[] {"mushroom"});
    c.getRoutedConnectionStatistics().incrementNextQRPForwardTime(0);
    triggerSimppUpdate();
    ptm =
        BlockingConnectionUtils.getFirstInstanceOfMessageType(
            testUP[0], PatchTableMessage.class, 12000);
    assertNotNull(ptm);
    qrt.patch(ptm);

    // the new word should be there, the old one gone.
    assertTrue(qrt.contains(queryRequestFactory.createQuery("mushroom")));
    assertFalse(qrt.contains(queryRequestFactory.createQuery("badger")));
  }
  @Override
  public void setUpQRPTables() throws Exception {
    // 3. routed leaf, with route table for "test"
    QueryRouteTable qrt = new QueryRouteTable();
    qrt.add("berkeley");
    qrt.add("susheel");
    qrt.addIndivisible(UrnHelper.UNIQUE_SHA1.toString());
    for (Iterator iter = qrt.encode(null).iterator(); iter.hasNext(); ) {
      LEAF[0].send((RouteTableMessage) iter.next());
      LEAF[0].flush();
    }

    // for Ultrapeer 1
    qrt = new QueryRouteTable();
    qrt.add("leehsus");
    qrt.add("berkeley");
    for (Iterator iter = qrt.encode(null).iterator(); iter.hasNext(); ) {
      ULTRAPEER[0].send((RouteTableMessage) iter.next());
      ULTRAPEER[0].flush();
    }
  }