< prev index next >

test/jdk/java/util/jar/JarFile/mrjar/MultiReleaseJarSecurity.java

Print this page




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 8132734 8144062
  27  * @summary Test potential security related issues
  28  * @library /lib/testlibrary/java/util/jar
  29  * @build Compiler JarBuilder CreateMultiReleaseTestJars


  30  * @run testng MultiReleaseJarSecurity
  31  */
  32 
  33 import java.io.File;
  34 import java.io.IOException;
  35 import java.io.InputStream;
  36 import java.nio.file.Files;
  37 import java.security.CodeSigner;
  38 import java.security.cert.Certificate;
  39 import java.util.Arrays;
  40 import java.util.jar.JarEntry;
  41 import java.util.jar.JarFile;
  42 import java.util.zip.ZipFile;
  43 




  44 import org.testng.Assert;
  45 import org.testng.annotations.AfterClass;
  46 import org.testng.annotations.BeforeClass;
  47 import org.testng.annotations.Test;
  48 
  49 public class MultiReleaseJarSecurity {
  50 
  51     static final int MAJOR_VERSION = Runtime.version().major();
  52 
  53     String userdir = System.getProperty("user.dir",".");
  54     File multirelease = new File(userdir, "multi-release.jar");
  55     File signedmultirelease = new File(userdir, "signed-multi-release.jar");
  56 
  57     @BeforeClass
  58     public void initialize() throws Exception {
  59         CreateMultiReleaseTestJars creator =  new CreateMultiReleaseTestJars();
  60         creator.compileEntries();
  61         creator.buildMultiReleaseJar();
  62         creator.buildSignedMultiReleaseJar();
  63     }




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 8132734 8144062
  27  * @summary Test potential security related issues
  28  * @library /lib /test/lib
  29  * @build jdk.test.lib.compiler.Compiler
  30  *        jdk.test.lib.util.JarBuilder
  31  *        mrjar.CreateMultiReleaseTestJars
  32  * @run testng MultiReleaseJarSecurity
  33  */
  34 
  35 import java.io.File;
  36 import java.io.IOException;
  37 import java.io.InputStream;
  38 import java.nio.file.Files;
  39 import java.security.CodeSigner;
  40 import java.security.cert.Certificate;
  41 import java.util.Arrays;
  42 import java.util.jar.JarEntry;
  43 import java.util.jar.JarFile;
  44 import java.util.zip.ZipFile;
  45 
  46 import jdk.test.lib.compiler.Compiler;
  47 import jdk.test.lib.util.JarBuilder;
  48 import mrjar.CreateMultiReleaseTestJars;
  49 
  50 import org.testng.Assert;
  51 import org.testng.annotations.AfterClass;
  52 import org.testng.annotations.BeforeClass;
  53 import org.testng.annotations.Test;
  54 
  55 public class MultiReleaseJarSecurity {
  56 
  57     static final int MAJOR_VERSION = Runtime.version().major();
  58 
  59     String userdir = System.getProperty("user.dir",".");
  60     File multirelease = new File(userdir, "multi-release.jar");
  61     File signedmultirelease = new File(userdir, "signed-multi-release.jar");
  62 
  63     @BeforeClass
  64     public void initialize() throws Exception {
  65         CreateMultiReleaseTestJars creator =  new CreateMultiReleaseTestJars();
  66         creator.compileEntries();
  67         creator.buildMultiReleaseJar();
  68         creator.buildSignedMultiReleaseJar();
  69     }


< prev index next >