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 8007907
27 * @summary javap, method com.sun.tools.javap.Main.run returns 0 even in case
28 * of class not found error
29 * @modules jdk.compiler
30 */
31
32 import java.io.IOException;
33 import java.io.PrintWriter;
34 import java.io.StringWriter;
35
36 public class JavapReturns0AfterClassNotFoundTest {
37
38 static final String fileNotFoundErrorMsg =
39 "Error: class not found: Unexisting.class";
40 static final String exitCodeClassNotFoundAssertionMsg =
41 "Javap's exit code for class not found should be 1";
42 static final String classNotFoundMsgAssertionMsg =
43 "Javap's error message for class not found is incorrect";
44
45 public static void main(String args[]) throws Exception {
46 new JavapReturns0AfterClassNotFoundTest().run();
47 }
48
49 void run() throws IOException {
|
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 8007907
27 * @summary javap, method com.sun.tools.javap.Main.run returns 0 even in case
28 * of class not found error
29 * @modules jdk.jdeps
30 */
31
32 import java.io.IOException;
33 import java.io.PrintWriter;
34 import java.io.StringWriter;
35
36 public class JavapReturns0AfterClassNotFoundTest {
37
38 static final String fileNotFoundErrorMsg =
39 "Error: class not found: Unexisting.class";
40 static final String exitCodeClassNotFoundAssertionMsg =
41 "Javap's exit code for class not found should be 1";
42 static final String classNotFoundMsgAssertionMsg =
43 "Javap's error message for class not found is incorrect";
44
45 public static void main(String args[]) throws Exception {
46 new JavapReturns0AfterClassNotFoundTest().run();
47 }
48
49 void run() throws IOException {
|