/* * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions.
*/
/* * @test * @bug 8153654 8176333 * @summary Tests for jdeps tool with multi-release jar files * @modules jdk.jdeps/com.sun.tools.jdeps * @library mrjar mrjar/base mrjar/9 mrjar/10 mrjar/v9 mrjar/v10 * @build test.* p.* q.* foo/* Main * @run testng MultiReleaseJar
*/
// build Version.jar, Version_9.jar and main.jar
Result r = run("jar -cf Version.jar -C base test --release 9 -C 9 test --release 10 -C 10 test");
checkResult(r);
r = run("jar -cf Version_9.jar -C base test --release 9 -C 9 test");
checkResult(r);
r = run("jar -cf Main.jar Main.class");
checkResult(r);
r = run("jar -cf Foo.jar -C base p");
checkResult(r);
// Version_9.jar does not have any version 10 entry
r = run("jdeps -v -R -cp Version_9.jar --module-path Foo.jar --multi-release 10 " + path);
checkResult(r, true,
name + " -> Version_9.jar",
name + " -> foo",
name + " -> java.base", "Main", "Main", "Main", "Main", "Version_9.jar ->", "9/test.NonPublic", "9/test.NonPublic", "9/test.Version", "9/test.Version", "9/test.Version", "9/test.Version", "foo", "Foo.jar", "requires mandated java.base", "foo -> java.base", "p.Foo"
);
}
@Test publicvoid ps_and_qs() throws Exception { // build the jar file
Result r = run("jar -cf PQ.jar -C base p --release 9 -C v9 p -C v9 q --release 10 -C v10 q");
checkResult(r);
r = run("jdeps -v -R -cp PQ.jar --multi-release base PQ.jar");
checkResult(r, true, "PQ.jar -> java.base", "p.Foo"
);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.