### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/regression/AssertionTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AssertionTest.java,v retrieving revision 1.17.4.1 diff -u -r1.17.4.1 AssertionTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/AssertionTest.java 15 Sep 2006 11:11:12 -0000 1.17.4.1 +++ src/org/eclipse/jdt/core/tests/compiler/regression/AssertionTest.java 9 Nov 2006 00:49:38 -0000 @@ -309,4 +309,130 @@ }, "SUCCESS"); // expected output } + + + /** + * http://dev.eclipse.org/bugs/show_bug.cgi?id=163600 + */ + public void test014() { + this.runConformTest( + new String[] { + "X.java", + "public class X {\n" + + "\n" + + " public static class Foo {\n" + + " public void myMethod(boolean trash) {\n" + + " System.out.println(\"Expecting class Foo\");\n" + + " Class c = Foo.class;\n" + + " System.out.println(\"Got the class \" + c);\n" + + " }\n" + + " }\n" + + " public static class Bar {\n" + + " public void myMethod(boolean doAssert) {\n" + + " System.out.println(\"Expecting class Bar\");\n" + + " Class c = Bar.class;\n" + + " System.out.println(\"Got the class \" + c);\n" + + " assert c.getName().endsWith(\"Bar\");\n" + + " }\n" + + " }\n" + + " public static void main(String[] args) {\n" + + " new Foo().myMethod(false);\n" + + " new Bar().myMethod(false);\n" + + " }\n" + + "}" + }, + "Expecting class Foo\n" + + "Got the class class X$Foo\n" + + "Expecting class Bar\n" + + "Got the class class X$Bar"); // expected output + } + + /** + * http://dev.eclipse.org/bugs/show_bug.cgi?id=163600 + */ + public void test015() { + this.runConformTest( + new String[] { + "X.java", + "public class X {\n" + + "\n" + + " public static class Foo {\n" + + " public void myMethod(boolean trash) {\n" + + " System.out.println(\"Expecting class Foo\");\n" + + " Class c = Foo.class;\n" + + " System.out.println(\"Got the class \" + c);\n" + + " }\n" + + " }\n" + + " public static class Bar {\n" + + " public void myMethod(boolean doAssert) {\n" + + " System.out.println(\"Expecting class Bar\");\n" + + " Class c = Bar.class;\n" + + " try {\n" + + " assert c.getName().endsWith(\"Bar2\");\n" + + " } catch(AssertionError e) {\n" + + " System.out.println(\"SUCCESS\");\n" + + " }\n" + + " System.out.println(\"Got the class \" + c);\n" + + " }\n" + + " }\n" + + " public static void main(String[] args) {\n" + + " new Foo().myMethod(false);\n" + + " new Bar().myMethod(false);\n" + + " }\n" + + "}" + }, + "Expecting class Foo\n" + + "Got the class class X$Foo\n" + + "Expecting class Bar\n" + + "SUCCESS\n" + + "Got the class class X$Bar", + null, // use default classpath + true, // flush previous output dir content + new String[] {"-ea"}); + } + + /** + * http://dev.eclipse.org/bugs/show_bug.cgi?id=163600 + */ + public void test016() { + this.runConformTest( + new String[] { + "X.java", + "public class X {\n" + + "\n" + + " public static class Foo {\n" + + " public void myMethod(boolean trash) {\n" + + " System.out.println(\"Expecting class Foo\");\n" + + " Class c = Foo.class;\n" + + " System.out.println(\"Got the class \" + c);\n" + + " }\n" + + " }\n" + + " public static class Bar {\n" + + " public void myMethod(boolean doAssert) {\n" + + " System.out.println(\"Expecting class Bar\");\n" + + " Class c = Bar.class;\n" + + " try {\n" + + " assert c.getName().endsWith(\"Bar2\");\n" + + " System.out.println(\"SUCCESS\");\n" + + " } catch(AssertionError e) {\n" + + " System.out.println(\"FAILED\");\n" + + " }\n" + + " System.out.println(\"Got the class \" + c);\n" + + " }\n" + + " }\n" + + " public static void main(String[] args) {\n" + + " new Foo().myMethod(false);\n" + + " new Bar().myMethod(false);\n" + + " }\n" + + "}" + }, + "Expecting class Foo\n" + + "Got the class class X$Foo\n" + + "Expecting class Bar\n" + + "SUCCESS\n" + + "Got the class class X$Bar", + null, // use default classpath + true, // flush previous output dir content + new String[] {"-da"}); + } }