/** Creates the shop itself */
  public void createShop() {
    myShop = ShopFactory.eINSTANCE.createShop();

    myCountry1 = ShopFactory.eINSTANCE.createCountry();
    myCountry1.setName("n1");
    myCountry1.setAbbreviation("1");
    myShop.getCountries().add(myCountry1);

    myCountry2 = ShopFactory.eINSTANCE.createCountry();
    myCountry2.setName("n2");
    myCountry2.setAbbreviation("2");
    myShop.getCountries().add(myCountry2);

    myCountry3 = ShopFactory.eINSTANCE.createCountry();
    myCountry3.setName("n3");
    myCountry3.setAbbreviation("3");
    myShop.getCountries().add(myCountry3);

    myCountry4 = ShopFactory.eINSTANCE.createCountry();
    myCountry4.setName("n4");
    myCountry4.setAbbreviation("4");
    myShop.getCountries().add(myCountry4);

    myContact1 = ShopFactory.eINSTANCE.createContact();
    myContact1.setName("a");
    myContact1.setCountry(myCountry1);
    myShop.getContacts().add(myContact1);

    myContact2 = ShopFactory.eINSTANCE.createContact();
    myContact2.setName("b");
    myContact2.setCountry(myCountry2);
    myShop.getContacts().add(myContact2);
  }
  /** Tests the different supported patterns */
  @Test
  public void filterPatternTest() {
    IFilteringTableAdapter.Factory.adapt(myViewer, myFilter);

    // Empty
    // myFilter.setText("");
    // yield();
    // assertEquals(myShop.getCountries().size(), myTable.getItemCount());

    // Plain
    myFilter.setText("A");
    yield();
    assertEquals(1, myTable.getItemCount());

    // Star
    myFilter.setText("*A");
    yield();
    assertEquals(2, myTable.getItemCount());

    // CamelCase
    myFilter.setText("BB");
    yield();
    assertEquals(1, myTable.getItemCount());

    // Empty
    myFilter.setText("");
    yield();
    assertEquals(myShop.getCountries().size(), myTable.getItemCount());
  }
  /** Tests the navigation between the filter and the table. */
  @Test
  public void navigationTest() {
    IFilteringTableAdapter.Factory.adapt(myViewer, myFilter);

    myFilter.setText("");
    assertEquals(myShop.getCountries().size(), myTable.getItemCount());

    myFilter.setFocus();

    postKeyStroke(myFilter, "ARROW_DOWN");
    yield();

    assertTrue(myTable.isFocusControl());
    assertEquals(0, myTable.getSelectionIndex());

    postKeyStroke(myTable, "ARROW_DOWN");
    yield();

    assertTrue(myTable.isFocusControl());
    assertEquals(1, myTable.getSelectionIndex());

    postKeyStroke(myTable, "ARROW_UP");
    yield();

    assertTrue(myTable.isFocusControl());
    assertEquals(0, myTable.getSelectionIndex());

    postKeyStroke(myTable, "ARROW_UP");
    yield();

    assertTrue(myFilter.isFocusControl());
  }
  /** Creates the shop itself */
  public void createShop() {
    myShop = ShopFactory.eINSTANCE.createShop();

    Country c;

    c = ShopFactory.eINSTANCE.createCountry();
    c.setName("A");
    c.setAbbreviation("AA");
    myShop.getCountries().add(c);

    c = ShopFactory.eINSTANCE.createCountry();
    c.setName("2A");
    c.setAbbreviation("BarBar");
    myShop.getCountries().add(c);

    c = ShopFactory.eINSTANCE.createCountry();
    c.setName("C");
    c.setAbbreviation("CC");
    myShop.getCountries().add(c);
  }