Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import org.aspectj.testing.Tester;
  2. import org.aspectj.testing.Tester;
  3. public class PR584 {
  4. public static void main(String[] args) {
  5. Tester.expectEvent("foo ok");
  6. Tester.expectEvent("foo test2");
  7. Foo foo = new Foo("foo");
  8. /** @testcase PR#584 constructing inner classes using qualified new expression */
  9. Foo.Test test1 = foo.new Test();
  10. Foo.Test test2 = foo.new Test() {
  11. public void foo() {
  12. Tester.event(getFoo().baz + " test2");
  13. }
  14. };
  15. test1.foo();
  16. test2.foo();
  17. /** @testcase PR#584 constructing static inner classes using new expression */
  18. Foo.StaticTest test3 = new Foo.StaticTest();
  19. Tester.expectEvent("static foo");
  20. test3.staticBaz = "static foo";
  21. test3.staticFoo();
  22. Tester.checkAllEvents();
  23. }
  24. }
  25. class Foo {
  26. public String baz;
  27. public Foo(String baz) { this.baz = baz; }
  28. public static class StaticTest {
  29. static String staticBaz;
  30. public void staticFoo() { Tester.event(staticBaz); }
  31. }
  32. public class Test {
  33. public Foo getFoo() { return Foo.this; }
  34. public void foo() { Tester.event(baz + " ok"); }
  35. }
  36. }