|
Lines 44-49
Link Here
|
| 44 |
|
44 |
|
| 45 |
} |
45 |
} |
| 46 |
|
46 |
|
|
|
47 |
public void testTemplateNullKeyTrailingCharacters() { |
| 48 |
String template = "${task.status} - ${connector.task.prefix} ${task.key}: ${task.description}"; |
| 49 |
|
| 50 |
String taskId = "12345678"; |
| 51 |
TaskTask testTask = new TaskTask("no url", taskId, "summary"); |
| 52 |
testTask.setTaskKey(null); |
| 53 |
testTask.setSummary("TestSummary"); |
| 54 |
|
| 55 |
String commitComment = FocusedTeamUiPlugin.getDefault().getCommitTemplateManager().generateComment(testTask, |
| 56 |
template); |
| 57 |
assertTrue(commitComment.contains(testTask.getSummary())); |
| 58 |
|
| 59 |
assertTrue(commitComment.contains(":")); |
| 60 |
} |
| 61 |
|
| 62 |
public void testTemplateCollapseWhitespace() { |
| 63 |
String template = "${task.status} - ${connector.task.prefix} ${task.key} ${task.key} : ${task.description}"; |
| 64 |
|
| 65 |
String taskId = "12345678"; |
| 66 |
TaskTask testTask = new TaskTask("no url", taskId, "summary"); |
| 67 |
testTask.setTaskKey(null); |
| 68 |
testTask.setSummary("TestSummary"); |
| 69 |
|
| 70 |
String commitComment = FocusedTeamUiPlugin.getDefault().getCommitTemplateManager().generateComment(testTask, |
| 71 |
template); |
| 72 |
assertTrue(commitComment.contains(testTask.getSummary())); |
| 73 |
|
| 74 |
assertFalse(commitComment.contains(" ")); |
| 75 |
} |
| 76 |
|
| 47 |
public void testRepositoryTaskCommentParsing() { |
77 |
public void testRepositoryTaskCommentParsing() { |
| 48 |
String template = FocusedTeamUiPlugin.getDefault().getPreferenceStore().getString( |
78 |
String template = FocusedTeamUiPlugin.getDefault().getPreferenceStore().getString( |
| 49 |
FocusedTeamUiPlugin.COMMIT_TEMPLATE); |
79 |
FocusedTeamUiPlugin.COMMIT_TEMPLATE); |