You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TestTester.java 861B

12345678910111213141516171819202122232425262728293031
  1. import org.aspectj.testing.Tester;
  2. public class TestTester {
  3. public static void main (String[] args) {
  4. Tester.event("1");
  5. Tester.note("note 1");
  6. Tester.note("note 2");
  7. int i = 1;
  8. Tester.check("note " + (i++));
  9. Tester.check("note " + (i++), "second note failed");
  10. new TestTester().run();
  11. Tester.checkAllEvents(); // does this empty
  12. // now check(String[])
  13. Tester.clear();
  14. Tester.event("one");
  15. Tester.event("two");
  16. Tester.checkEvents(new String[] { "one", "two"});
  17. }
  18. static {
  19. Tester.expectEvent("1");
  20. Tester.expectEvent("2");
  21. }
  22. public void run() {
  23. Tester.event("2");
  24. Tester.check(true, "no failure");
  25. Tester.checkEqual("1", "1", "no failure");
  26. Tester.checkEqual("1", "1");
  27. }
  28. }