Example #1
0
  void assertContents(String path, String pattern, boolean recurse, String member, boolean mustfind)
      throws IOException {
    Context context = new Context(null, getClass().getClassLoader(), 1, "src/test/osgi.jar");
    Enumeration e = context.findEntries(path, "*.class", recurse);
    boolean found = false;
    while (e.hasMoreElements()) {
      URL url = (URL) e.nextElement();
      if (url.getPath().endsWith(member)) {
        found = true;

        break;
      }
    }
    if (found == mustfind) return;

    if (mustfind) fail("No such member: " + member + " in " + pattern);
    else fail("Unexpected member: " + member + " in " + pattern);
  }