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.

Test3c.java 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 v 2.0
  6. * which accompanies this distribution and is available at
  7. * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
  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 Test3c extends CoreTest {
  19. public static void main(String[] args) {
  20. junit.textui.TestRunner.run(Test3c.class);
  21. }
  22. public void testCreateWithPointLog() {
  23. Log.clear();
  24. Point p1 = new Point(10, 100);
  25. Group g = new Group(p1);
  26. List foundLog = Log.getData();
  27. List desiredLog =
  28. Arrays.asList(new String[] {
  29. "adding Point"
  30. });
  31. assertEquals(desiredLog, foundLog);
  32. }
  33. public void testCreateWithoutPointLog() {
  34. Log.clear();
  35. Point p1 = new Point(10, 100);
  36. Point p2 = new Point(20, 200);
  37. Line l = new Line(p1, p2);
  38. Group g = new Group(l);
  39. List foundLog = Log.getData();
  40. List desiredLog = Arrays.asList(new String[] {});
  41. assertEquals(desiredLog, foundLog);
  42. }
  43. }