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.

AbstractRunSpecTest.java 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* *******************************************************************
  2. * Copyright (c) 1999-2001 Xerox Corporation,
  3. * 2002 Palo Alto Research Center, Incorporated (PARC).
  4. * All rights reserved.
  5. * This program and the accompanying materials are made available
  6. * under the terms of the Eclipse Public License v1.0
  7. * which accompanies this distribution and is available at
  8. * http://www.eclipse.org/legal/epl-v10.html
  9. *
  10. * Contributors:
  11. * Xerox/PARC initial implementation
  12. * ******************************************************************/
  13. package org.aspectj.testing.harness.bridge;
  14. import java.io.PrintWriter;
  15. import java.util.List;
  16. import org.aspectj.testing.run.IRunIterator;
  17. import org.aspectj.testing.xml.XMLWriter;
  18. import junit.framework.TestCase;
  19. /**
  20. *
  21. */
  22. public class AbstractRunSpecTest extends TestCase {
  23. public AbstractRunSpecTest(String name) {
  24. super(name);
  25. }
  26. public void testXmlWrite() {
  27. AbstractRunSpec spec = new TestSpec();
  28. spec.setOptions("-option1,-option2");
  29. spec.setKeywords("keyword1, keyword2");
  30. spec.setPaths("path1.java, path2.java");
  31. spec.setDescription("some description, with extra");
  32. XMLWriter out = new XMLWriter(new PrintWriter(System.out));
  33. spec.writeXml(out);
  34. //out.close();//FIXME this close System.out and makes the IntelliJ test runner hang (AV)
  35. }
  36. public void testSetOptions() {
  37. AbstractRunSpec spec = new TestSpec();
  38. spec.setOptions("1,2");
  39. List options = spec.getOptionsList();
  40. String s = "" + options;
  41. assertTrue(s, "[1, 2]".equals(s));
  42. }
  43. static class TestSpec extends AbstractRunSpec {
  44. TestSpec() {
  45. super("testspec");
  46. }
  47. /**
  48. * @see org.aspectj.testing.harness.bridge.AbstractRunSpec#makeRunIterator(Sandbox, Validator)
  49. */
  50. public IRunIterator makeRunIterator(
  51. Sandbox sandbox,
  52. Validator validator) {
  53. return null;
  54. }
  55. }
  56. }