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.

AjcTest.java 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /* *******************************************************************
  2. * Copyright (c) 2004 IBM Corporation
  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. * Adrian Colyer,
  11. * ******************************************************************/
  12. package org.aspectj.testing;
  13. import java.util.ArrayList;
  14. import java.util.Iterator;
  15. import java.util.List;
  16. import org.aspectj.tools.ajc.AjcTestCase;
  17. /**
  18. * @author colyer
  19. *
  20. * TODO To change the template for this generated type comment go to
  21. * Window - Preferences - Java - Code Style - Code Templates
  22. */
  23. public class AjcTest {
  24. private List testSteps = new ArrayList();
  25. private String dir;
  26. private String pr;
  27. private String title;
  28. private String keywords;
  29. private String comment;
  30. public AjcTest() {
  31. }
  32. public void addTestStep(ITestStep step) {
  33. testSteps.add(step);
  34. step.setTest(this);
  35. }
  36. public void runTest(AjcTestCase testCase) {
  37. try {
  38. System.out.print("TEST: " + getTitle() + "\t");
  39. for (Iterator iter = testSteps.iterator(); iter.hasNext();) {
  40. ITestStep step = (ITestStep) iter.next();
  41. step.setBaseDir(getDir());
  42. System.out.print(".");
  43. step.execute(testCase);
  44. }
  45. } finally {
  46. System.out.println("DONE");
  47. }
  48. }
  49. /**
  50. * @return Returns the comment.
  51. */
  52. public String getComment() {
  53. return comment;
  54. }
  55. /**
  56. * @param comment The comment to set.
  57. */
  58. public void setComment(String comment) {
  59. this.comment = comment;
  60. }
  61. /**
  62. * @return Returns the dir.
  63. */
  64. public String getDir() {
  65. return dir;
  66. }
  67. /**
  68. * @param dir The dir to set.
  69. */
  70. public void setDir(String dir) {
  71. dir = "../tests/" + dir;
  72. this.dir = dir;
  73. }
  74. /**
  75. * @return Returns the keywords.
  76. */
  77. public String getKeywords() {
  78. return keywords;
  79. }
  80. /**
  81. * @param keywords The keywords to set.
  82. */
  83. public void setKeywords(String keywords) {
  84. this.keywords = keywords;
  85. }
  86. /**
  87. * @return Returns the pr.
  88. */
  89. public String getPr() {
  90. return pr;
  91. }
  92. /**
  93. * @param pr The pr to set.
  94. */
  95. public void setPr(String pr) {
  96. this.pr = pr;
  97. }
  98. /**
  99. * @return Returns the title.
  100. */
  101. public String getTitle() {
  102. return title;
  103. }
  104. /**
  105. * @param title The title to set.
  106. */
  107. public void setTitle(String title) {
  108. this.title = title;
  109. }
  110. }