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.

Test2a.java 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* *******************************************************************
  2. * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Common Public License v1.0
  6. * which accompanies this distribution and is available at
  7. * http://www.eclipse.org/legal/cpl-v10.html
  8. *
  9. * Contributors:
  10. * PARC initial implementation
  11. * ******************************************************************/
  12. package tests;
  13. import figures.*;
  14. import junit.framework.*;
  15. public class Test2a extends Test {
  16. public Test2a(String name) { super(name); }
  17. public static void main(String[] args) {
  18. junit.textui.TestRunner.run(Test2a.class);
  19. }
  20. public void setUp() {
  21. super.setUp();
  22. }
  23. public void testTooSmall() {
  24. try {
  25. p1.setX(-10);
  26. fail("should have thrown IllegalArgumentException");
  27. } catch (IllegalArgumentException ea) {
  28. }
  29. }
  30. public void testTooBig() {
  31. try {
  32. p1.setY(1000);
  33. fail("should have thrown IllegalArgumentException");
  34. } catch (IllegalArgumentException ea) {
  35. }
  36. }
  37. public void testMove() {
  38. try {
  39. l1.move(-500, -500);
  40. fail("should have thrown IllegalArgumentException");
  41. } catch (IllegalArgumentException ea) {
  42. }
  43. }
  44. }