Esempio n. 1
0
  /**
   * Verify that the Meta-Persistence header is correctly verified
   *
   * @throws Exception
   */
  public void verifyMetaPersistence() throws Exception {
    Builder b = new Builder();
    b.setIncludeResource("foo.xml;literal='I exist'");
    Jar inner = b.build();
    assertTrue(b.check());

    Jar outer = new Jar("x");
    outer.putResource("foo.jar", new JarResource(inner));
    Manifest m = new Manifest();
    m.getMainAttributes()
        .putValue(Constants.META_PERSISTENCE, "foo.jar, foo.jar!/foo.xml, absent.xml");
    outer.setManifest(m);
    Verifier v = new Verifier(outer);
    v.verifyMetaPersistence();
    assertTrue(v.check("Meta-Persistence refers to resources not in the bundle: \\[absent.xml\\]"));
  }
Esempio n. 2
0
 public static void testFailedOSGiJar() throws Exception {
   Jar jar = new Jar("jar/osgi.residential-4.3.0.jar");
   Verifier v = new Verifier(jar);
   assertTrue(v.check());
 }