/src/main/resources/com/onresolve/jira/groovy/test/TestFireEventWhen.groovy

https://bitbucket.org/sorin/jira-plugin-intellij · Groovy · 55 lines · 32 code · 15 blank · 8 comment · 0 complexity · f16a2ebe2dd1b6c4d68a3cb3ba36d12c MD5 · raw file

  1. package com.onresolve.jira.groovy.test
  2. import com.atlassian.jira.issue.comments.Comment
  3. import org.apache.log4j.Category
  4. import org.junit.After
  5. import org.junit.Before
  6. import org.junit.Test
  7. import static junit.framework.Assert.assertNotNull
  8. /**
  9. * User: jechlin2
  10. * Date: 13-Dec-2010
  11. * Time: 17:36:00
  12. */
  13. class TestFireEventWhen extends BaseSubTaskTest {
  14. Category log = Category.getInstance(this.class)
  15. @Before
  16. public void setUp() {
  17. log.debug ("setUp")
  18. log.debug ("issueType: ${issueType.getName()}")
  19. assertNotNull(project)
  20. issue = componentManager.getIssueFactory().getIssue()
  21. issue.setProject(project.getGenericValue())
  22. issue.setSummary "my summary"
  23. issue.setReporterId "admin"
  24. issue.setIssueType issueType.getGenericValue()
  25. issue.setPriorityId('2')
  26. issueManager.createIssue(adminUser, issue);
  27. log.debug ("Created issue: $issue")
  28. }
  29. @After
  30. public void tearDown() {
  31. deleteIssue(issue);
  32. }
  33. @Test
  34. public void testSubTasksResolved() {
  35. // test with no sub-tasks
  36. Comment comment = componentManager.getCommentManager().create(issue, adminUser.name, "My comment", false)
  37. // doesn't work
  38. // runner.run(FireEventWhen.class.getName(), [transientVars: [issue: issue, commentValue: comment], Event: '2', username:adminUser.name] as Map<String, Object>)
  39. }
  40. }