Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2012-02-08 16:46:40 -0500
committerJeff Johnston2012-02-08 18:14:31 -0500
commitfa676dcc7e12f3f7c2717cdcb2265961ecf6b3d1 (patch)
treefb6b4a8ae5b16fc7dfe177857ffef0a9638e3854 /changelog
parentfd7d2ad58a526a6baa97c1fead0ca691f6a67c44 (diff)
downloadorg.eclipse.linuxtools-fa676dcc7e12f3f7c2717cdcb2265961ecf6b3d1.tar.gz
org.eclipse.linuxtools-fa676dcc7e12f3f7c2717cdcb2265961ecf6b3d1.tar.xz
org.eclipse.linuxtools-fa676dcc7e12f3f7c2717cdcb2265961ecf6b3d1.zip
Test for bug #366854.
Diffstat (limited to 'changelog')
-rw-r--r--changelog/org.eclipse.linuxtools.changelog.tests/ChangeLog5
-rw-r--r--changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/core/formatters/tests/GNUFormatTest.java19
2 files changed, 11 insertions, 13 deletions
diff --git a/changelog/org.eclipse.linuxtools.changelog.tests/ChangeLog b/changelog/org.eclipse.linuxtools.changelog.tests/ChangeLog
index a0d7669329..e15296108e 100644
--- a/changelog/org.eclipse.linuxtools.changelog.tests/ChangeLog
+++ b/changelog/org.eclipse.linuxtools.changelog.tests/ChangeLog
@@ -1,3 +1,8 @@
+2012-02-08 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves bug #366854.
+ * src/org/eclipse/linuxtools/changelog/core/formatters/tests/GNUFormatTest.java (canHaveEntriesWithDefaultTextAndSomeModificationToAnExistingFile2): New test.
+
2011-01-19 Jeff Johnston <jjohnstn@redhat.com>
* src/org/eclipse/linuxtools/changelog/core/tests/ChangeLogWriterTest.java (testWriteChangeLog): Close
diff --git a/changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/core/formatters/tests/GNUFormatTest.java b/changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/core/formatters/tests/GNUFormatTest.java
index 41f4fb010b..07133a9fc3 100644
--- a/changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/core/formatters/tests/GNUFormatTest.java
+++ b/changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/core/formatters/tests/GNUFormatTest.java
@@ -441,12 +441,13 @@ public class GNUFormatTest {
/**
* Test for a changelog entry with items for removed files, new files and modified
- * existing files. This test should also catch Eclipse Bz #331244 regressions.
+ * existing files. This test differs from the previous in that the ChangeLog is
+ * empty to start with. This verifies Bz #366854 fix.
*
* @throws Exception
*/
@Test
- public void canHaveEntriesWithDefaultTextAndSomeModificationToAnExistingFile() throws Exception {
+ public void canHaveEntriesWithDefaultTextAndSomeModificationToAnExistingFile2() throws Exception {
// set date/author line
String authorName = "Test Author";
String email = "test@example.com";
@@ -456,20 +457,13 @@ public class GNUFormatTest {
String changelogPath = "/" + project.getTestProject().getName() + "/test/example";
final String changelogFilePath = changelogPath + "/ChangeLog";
- // pre-existing content to merge into
- String content = "2010-10-05 William Shakespeare <will@pear.com>\n\n\t" +
- "* path/to/file.c: New File.\n\n";
-
- // add a ChangeLog file to our test project
- InputStream newFileInputStream = new ByteArrayInputStream(
- content.getBytes());
+ // add a new empty ChangeLog file to our test project
+ InputStream newFileInputStream = new ByteArrayInputStream(new byte[0]);
IFile changelogFile = project.addFileToProject( "/test/example", "ChangeLog",
newFileInputStream);
// Open a document and get the IEditorPart
changelogEditorPart = openEditor(changelogFile);
- assertEquals(content, getContent(changelogEditorPart));
-
// entry file path (need overlap with changelogPath)
final String firstFileEntryRelPath = "eclipse/example/test/NewCoffeeMaker.java";
String entryFilePath = changelogPath + "/" + firstFileEntryRelPath;
@@ -509,8 +503,7 @@ public class GNUFormatTest {
secondFileEntryRelPath+ FILE_ENTRY_END_MARKER +
secondDefaultContent + NEW_LINE + TAB + FILE_ENTRY_START_MARKER +
firstFileEntryRelPath + FILE_ENTRY_END_MARKER +
- firstDefaultContent + NEW_LINE + NEW_LINE +
- content /* orig. content */;
+ firstDefaultContent;
assertEquals(expectedResult, actualMergeResult);
}

Back to the top