public void testWithEveryoneHavingASingletonView() throws Exception {
   // Inject view {A} into A, B and C:
   injectView(Util.createView(a.getAddress(), 10, a.getAddress()), a);
   injectView(Util.createView(b.getAddress(), 10, b.getAddress()), b);
   injectView(Util.createView(c.getAddress(), 10, c.getAddress()), c);
   sendAndCheckMessages(5, a, b, c);
 }
Пример #2
0
 /** Creates a singleton view for each channel listed and injects it */
 protected static void createPartition(JChannel... channels) {
   for (JChannel ch : channels) {
     View view = Util.createView(ch.getAddress(), 5, ch.getAddress());
     GMS gms = (GMS) ch.getProtocolStack().findProtocol(GMS.class);
     gms.installView(view);
   }
 }
  /**
   * Verifies that unicasts are received correctly by all participants after an overlapping merge.
   * The following steps are executed:
   *
   * <ol>
   *   <li/>Group is {A,B,C}, A is the coordinator
   *   <li/>MERGE2 is removed from all members
   *   <li/>VERIFY_SUSPECT is removed from all members
   *   <li/>Everyone sends 5 unicast messages to everyone else
   *   <li/>A VIEW(B,C) is injected into B and C
   *   <li/>B and C install {B,C}
   *   <li/>B and C trash the connection table for A in UNICAST
   *   <li/>A still has view {A,B,C} and all connection tables intact in UNICAST
   *   <li/>We now send N unicasts from everyone to everyone else, all the unicasts should be
   *       received.
   * </ol>
   */
  public void testWithViewBC() throws Exception {

    System.out.println("A's view: " + a.getView());

    // Inject view {B,C} into B and C:
    View new_view = Util.createView(b.getAddress(), 10, b.getAddress(), c.getAddress());
    injectView(new_view, b, c);
    assertEquals("A's view is " + a.getView(), 3, a.getView().size());
    assertEquals("B's view is " + b.getView(), 2, b.getView().size());
    assertEquals("C's view is " + c.getView(), 2, c.getView().size());
    sendAndCheckMessages(5, a, b, c);
  }
 public void testWithViewC() throws Exception {
   // Inject view {A} into A, B and C:
   View new_view = Util.createView(c.getAddress(), 10, c.getAddress());
   injectView(new_view, a, b, c);
   sendAndCheckMessages(5, a, b, c);
 }