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.

Test3e.java 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 Eclipse Public License v1.0
  6. * which accompanies this distribution and is available at
  7. * http://www.eclipse.org/legal/epl-v10.html
  8. *
  9. * Contributors:
  10. * PARC initial implementation
  11. * ******************************************************************/
  12. package tests;
  13. import figures.*;
  14. import support.Log;
  15. import junit.framework.*;
  16. import java.util.List;
  17. import java.util.Arrays;
  18. public class Test3e extends CoreTest {
  19. public static void main(String[] args) {
  20. junit.textui.TestRunner.run(Test3e.class);
  21. }
  22. public void testDuplicateAdd() {
  23. Log.clear();
  24. Point p1 = new Point(10, 100);
  25. Group g1 = new Group(p1);
  26. try {
  27. Group g2 = new Group(p1);
  28. fail("should have thrown IllegalStateException");
  29. } catch (IllegalStateException ea) {
  30. assertEquals(g1.toString(), ea.getMessage());
  31. }
  32. }
  33. }