Code example for JarEntry

0
        method = "JarOutputStream", 
        args = {java.io.OutputStream.class, java.util.jar.Manifest.class}
    ) 
    @KnownFailure("Maybe not a failure, but dalvikvm -jar is not supported (, as yet).") 
    public void test_jar_class_path() throws Exception { 
        File fooJar = File.createTempFile("hyts_", ".jar");
        File barJar = File.createTempFile("hyts_", ".jar");
        fooJar.deleteOnExit();
        barJar.deleteOnExit();
 
        // create the manifest 
        Manifest man = new Manifest();
        Attributes att = man.getMainAttributes();
        att.put(Attributes.Name.MANIFEST_VERSION, "1.0");
        att.put(Attributes.Name.MAIN_CLASS, "foo.bar.execjartest.Foo");
        att.put(Attributes.Name.CLASS_PATH, barJar.getName());
 
        File resources = Support_Resources.createTempFolder();
 
        JarOutputStream joutFoo = new JarOutputStream(new FileOutputStream(
                fooJar), man);