diff options
author | Lars Vogel | 2019-06-03 07:36:04 +0000 |
---|---|---|
committer | Lars Vogel | 2019-06-11 20:20:10 +0000 |
commit | a92933dc938dd8b40a7a978bae916d2b56f82827 (patch) | |
tree | 1c33ef293d3809128f8de9e8c85000ec8c3c2e88 /org.eclipse.text.tests | |
parent | 60e43ccd2584c9464a593b3730b405dd75ca6490 (diff) | |
download | eclipse.platform.text-a92933dc938dd8b40a7a978bae916d2b56f82827.tar.gz eclipse.platform.text-a92933dc938dd8b40a7a978bae916d2b56f82827.tar.xz eclipse.platform.text-a92933dc938dd8b40a7a978bae916d2b56f82827.zip |
Removes trailing whitespace from org.eclipse.text.testsI20190612-0115
Change-Id: Ieb237a6c49182be02a6d722189deddafe93e069f
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
Diffstat (limited to 'org.eclipse.text.tests')
22 files changed, 311 insertions, 311 deletions
diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/AdaptiveGapTextTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/AdaptiveGapTextTest.java index 7c850eaaed0..db02fdf7e6b 100644 --- a/org.eclipse.text.tests/src/org/eclipse/text/tests/AdaptiveGapTextTest.java +++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/AdaptiveGapTextTest.java @@ -18,7 +18,7 @@ import org.junit.Before; import org.junit.Test; public class AdaptiveGapTextTest extends AbstractGapTextTest { - + @Before public void setUp() { fText= new GapText(2, 10, 0.5f); @@ -92,7 +92,7 @@ public class AdaptiveGapTextTest extends AbstractGapTextTest { fText.replace(1, 2, null); assertGap(1, 3); } - + @Test public void testRemoveGapOverlapping2() { fText.replace(0, 0, "aaaaazzzzzyyyyy"); @@ -104,7 +104,7 @@ public class AdaptiveGapTextTest extends AbstractGapTextTest { assertGap(5, 7); assertContents("aaaaaxxx"); } - + @Test public void testRemoveRemoteFromGap() { fText.replace(0, 0, "aaaaazzzzzyyyyy"); @@ -132,7 +132,7 @@ public class AdaptiveGapTextTest extends AbstractGapTextTest { fText.replace(6, 1, null); assertGap(6, 8); } - + @Test public void testRemoveAtRightGapEdge() { fText.replace(4, 0, "xxx"); @@ -142,7 +142,7 @@ public class AdaptiveGapTextTest extends AbstractGapTextTest { fText.replace(7, 1, null); assertGap(7, 9); } - + @Test public void testReplace() { fText.replace(2, 2, "yy"); @@ -154,7 +154,7 @@ public class AdaptiveGapTextTest extends AbstractGapTextTest { fText.replace(14, 0, "yyy"); assertGap(17, 19); } - + @Test public void testRemoveReallocateBeforeGap() throws Exception { fText.replace(0, 0, "yyyyyzzzzz"); diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/AnnotationModelExtension2Test.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/AnnotationModelExtension2Test.java index 1788309b44b..02fdf396b6c 100644 --- a/org.eclipse.text.tests/src/org/eclipse/text/tests/AnnotationModelExtension2Test.java +++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/AnnotationModelExtension2Test.java @@ -252,25 +252,25 @@ public class AnnotationModelExtension2Test { } return null; } - + @Test public void testInside() throws Exception { Annotation[] expected= new Annotation[] { fInside, fInsideIn }; assertPermutations(false, false, expected); } - + @Test public void testAhead() throws Exception { Annotation[] expected= new Annotation[] { fInside, fInsideIn, fBefore, fBeforeIn }; assertPermutations(true, false, expected); } - + @Test public void testBehind() throws Exception { Annotation[] expected= new Annotation[] { fInside, fInsideIn, fAfter, fAfterIn }; assertPermutations(false, true, expected); } - + @Test public void testAheadBehind() throws Exception { Annotation[] expected= new Annotation[] { fInside, fInsideIn, fInsideOut, fAfter, fAfterIn, fBefore, fBeforeIn }; diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/AnnotationModelStressTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/AnnotationModelStressTest.java index 734389a5409..7682e0e7d8b 100644 --- a/org.eclipse.text.tests/src/org/eclipse/text/tests/AnnotationModelStressTest.java +++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/AnnotationModelStressTest.java @@ -1234,7 +1234,7 @@ public class AnnotationModelStressTest { @After public void tearDown() throws Exception { fAnnotationModel.disconnect(fDocument); - + fDocument= null; fAnnotationModel= null; fInnerModel1= null; @@ -1348,7 +1348,7 @@ public class AnnotationModelStressTest { return result; } - + @Test public void testStressTestPlainOld() throws Exception { ArrayList<AnnotationData> added= new ArrayList<>(); @@ -1379,7 +1379,7 @@ public class AnnotationModelStressTest { assertExist(added); } } - + @Test public void testStressTestPlainNew() throws Exception { ArrayList<AnnotationData> added= new ArrayList<>(); @@ -1410,7 +1410,7 @@ public class AnnotationModelStressTest { assertExistNew(added); } } - + @Test public void testStressTestMoveOld() throws Exception { ArrayList<AnnotationData> added= new ArrayList<>(); @@ -1445,7 +1445,7 @@ public class AnnotationModelStressTest { assertExist(added); } } - + @Test public void testStressTestMoveNew() throws Exception { ArrayList<AnnotationData> added= new ArrayList<>(); diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/ChildDocumentTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/ChildDocumentTest.java index 910d5fb6936..1d0c8d76b61 100644 --- a/org.eclipse.text.tests/src/org/eclipse/text/tests/ChildDocumentTest.java +++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/ChildDocumentTest.java @@ -141,7 +141,7 @@ public class ChildDocumentTest { public void tearDown () { fDocument= null; } - + @Test public void testDelete1() { @@ -165,7 +165,7 @@ public class ChildDocumentTest { checkPositions(positions); } - + @Test public void testEditScript1() { @@ -202,7 +202,7 @@ public class ChildDocumentTest { checkPositions(positions); } - + @Test public void testFindPositions() { @@ -243,7 +243,7 @@ public class ChildDocumentTest { checkPositions(positions); } - + @Test public void testInsert1() { @@ -267,7 +267,7 @@ public class ChildDocumentTest { checkPositions(positions); } - + @Test public void testInsert2() { @@ -291,7 +291,7 @@ public class ChildDocumentTest { checkPositions(positions); } - + @Test public void testInsert3() { @@ -315,7 +315,7 @@ public class ChildDocumentTest { checkPositions(positions); } - + @Test public void testInsert4() { @@ -341,7 +341,7 @@ public class ChildDocumentTest { checkPositions(positions); } - + @Test public void testReplace1() { @@ -365,7 +365,7 @@ public class ChildDocumentTest { checkPositions(positions); } - + @Test public void testReplace2() { @@ -389,7 +389,7 @@ public class ChildDocumentTest { checkPositions(positions); } - + @Test public void testReplace3() { @@ -418,7 +418,7 @@ public class ChildDocumentTest { * * [formatting] IllegalArgumentException when formatting comment code snippet in segmented mode * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51594 - */ + */ @Test public void testReplace4() { try { @@ -432,7 +432,7 @@ public class ChildDocumentTest { assertTrue("BadLocationException thrown", false); } } - + @Test public void testAppend() { @@ -482,7 +482,7 @@ public class ChildDocumentTest { checkPositions(positions); } - + @Test public void testShiftRight() { diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/CopyOnWriteTextStoreTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/CopyOnWriteTextStoreTest.java index 8ff6bd9cbda..cc8fc3d5d65 100644 --- a/org.eclipse.text.tests/src/org/eclipse/text/tests/CopyOnWriteTextStoreTest.java +++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/CopyOnWriteTextStoreTest.java @@ -58,7 +58,7 @@ public class CopyOnWriteTextStoreTest { public void tearDown () { fText= null; } - + @Test public void testInitialContent() { @@ -73,7 +73,7 @@ public class CopyOnWriteTextStoreTest { assertTrue(failed); } - + @Test public void testFirstModification() { @@ -81,7 +81,7 @@ public class CopyOnWriteTextStoreTest { assertEquals(GapTextStore.class, fText.getStore().getClass()); } - + @Test public void testSet() { @@ -97,7 +97,7 @@ public class CopyOnWriteTextStoreTest { } assertTrue(failed); } - + @Test public void testInsert1() { @@ -106,7 +106,7 @@ public class CopyOnWriteTextStoreTest { } } - + @Test public void testInsert2() { @@ -115,7 +115,7 @@ public class CopyOnWriteTextStoreTest { } } - + @Test public void testDelete1() { @@ -124,7 +124,7 @@ public class CopyOnWriteTextStoreTest { } } - + @Test public void testDelete2() { @@ -133,7 +133,7 @@ public class CopyOnWriteTextStoreTest { } } - + @Test public void testAppend() { diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/DocumentExtensionTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/DocumentExtensionTest.java index 5cfe7654128..b05ea551e35 100644 --- a/org.eclipse.text.tests/src/org/eclipse/text/tests/DocumentExtensionTest.java +++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/DocumentExtensionTest.java @@ -182,7 +182,7 @@ public class DocumentExtensionTest { assertTrue("axbxcx".equals(document.get())); } - + @Test public void testRemove() { Listener listener= new Listener() { @@ -213,7 +213,7 @@ public class DocumentExtensionTest { assertTrue("yyy".equals(document.get())); } - + @Test public void testRepeatedAppend() { Listener listener= new Listener() { @@ -319,12 +319,12 @@ public class DocumentExtensionTest { assertTrue(false); } } - + @Test public void testChildDocumentPP() { internalTestChildDocument(true, true, 1); } - + @Test public void testChildDocumentCC() { try { @@ -333,12 +333,12 @@ public class DocumentExtensionTest { } } - + @Test public void testChildDocumentRepeatedPP() { internalTestChildDocument(true, true, 5); } - + @Test public void testChildDocumentRepeatedCC() { try { @@ -358,7 +358,7 @@ public class DocumentExtensionTest { } catch (UnsupportedOperationException x) { } } - + @Test public void testChildDocumentCP() { internalTestChildDocument(false, true, 1); @@ -366,7 +366,7 @@ public class DocumentExtensionTest { /** * Tests that this is not supported. - */ + */ @Test public void testChildDocumentRepeatedPC() { try { @@ -375,7 +375,7 @@ public class DocumentExtensionTest { } catch (UnsupportedOperationException x) { } } - + @Test public void testChildDocumentRepeatedCP() { internalTestChildDocument(false, true, 5); diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/DocumentTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/DocumentTest.java index c1df38d3866..b83634fcfe1 100644 --- a/org.eclipse.text.tests/src/org/eclipse/text/tests/DocumentTest.java +++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/DocumentTest.java @@ -64,7 +64,7 @@ public class DocumentTest { "/*\n" + // 24 "* comment\n" + // 34 "*/\n" + // 37 - " public class Class {\n" + // 59 + " public class Class {\n" + // 59 " // comment1\n" + // 73 " public void method1() {\n" + // 99 " }\n" + //103 @@ -94,14 +94,14 @@ public class DocumentTest { public void tearDown () { fDocument= null; } - + @Test public void testEmptyDocument() { IDocument document= new Document(); int lines= document.getNumberOfLines(); assertEquals(1, lines); } - + @Test public void testDelete1() { @@ -251,7 +251,7 @@ public class DocumentTest { checkPositions(positions); } - + @Test public void testInsert3() { @@ -275,7 +275,7 @@ public class DocumentTest { checkPositions(positions); } - + @Test public void testInsert4() { @@ -301,7 +301,7 @@ public class DocumentTest { checkPositions(positions); } - + @Test public void testReplace1() { @@ -325,7 +325,7 @@ public class DocumentTest { checkPositions(positions); } - + @Test public void testReplace2() { @@ -349,7 +349,7 @@ public class DocumentTest { checkPositions(positions); } - + @Test public void testReplace3() { @@ -372,7 +372,7 @@ public class DocumentTest { checkPositions(expected, actual); } - + @Test public void testReplace4() { @@ -396,7 +396,7 @@ public class DocumentTest { checkPositions(positions); } - + @Test public void testAppend() { @@ -446,7 +446,7 @@ public class DocumentTest { checkPositions(positions); } - + @Test public void testShiftRight() { diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/DocumentUndoManagerTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/DocumentUndoManagerTest.java index 51819023d4a..f621e5348da 100644 --- a/org.eclipse.text.tests/src/org/eclipse/text/tests/DocumentUndoManagerTest.java +++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/DocumentUndoManagerTest.java @@ -31,7 +31,7 @@ import org.eclipse.jface.text.Position; /** * Tests for DefaultUndoManager. - * + * * @since 3.5 */ public class DocumentUndoManagerTest extends TestCase { @@ -76,7 +76,7 @@ public class DocumentUndoManagerTest extends TestCase { /** * Test for line delimiter conversion. - * + * * @throws ExecutionException if undo fails */ public void testConvertLineDelimiters() throws ExecutionException { @@ -110,7 +110,7 @@ public class DocumentUndoManagerTest extends TestCase { /** * Randomly applies document changes. - * + * * @throws ExecutionException if undo fails */ public void testRandomAccess() throws ExecutionException { @@ -252,7 +252,7 @@ public class DocumentUndoManagerTest extends TestCase { /** * Test case for https://bugs.eclipse.org/bugs/show_bug.cgi?id=88172 - * + * * @throws ExecutionException if undo fails */ public void testRandomAccessAsUnclosedCompound() throws ExecutionException { @@ -458,7 +458,7 @@ public class DocumentUndoManagerTest extends TestCase { /** * Returns the faculty of k. - * + * * @param k the <code>int</code> for which to get the faculty * @return the faculty */ diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/ExclusivePositionUpdaterTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/ExclusivePositionUpdaterTest.java index 5d34752291e..ad629798942 100644 --- a/org.eclipse.text.tests/src/org/eclipse/text/tests/ExclusivePositionUpdaterTest.java +++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/ExclusivePositionUpdaterTest.java @@ -35,7 +35,7 @@ public class ExclusivePositionUpdaterTest { private static final String CATEGORY= "testcategory"; private Position fPos; private IDocument fDoc; - + @Before public void setUp() throws Exception { fUpdater= new DefaultPositionUpdater(CATEGORY); @@ -52,9 +52,9 @@ public class ExclusivePositionUpdaterTest { fDoc.removePositionUpdater(fUpdater); fDoc.removePositionCategory(CATEGORY); } - + // Delete, ascending by offset, length: - + @Test public void testDeleteBefore() throws BadLocationException { fDoc.replace(2, 2, ""); @@ -62,7 +62,7 @@ public class ExclusivePositionUpdaterTest { Assert.assertEquals(5, fPos.length); Assert.assertFalse(fPos.isDeleted); } - + @Test public void testDeleteRightBefore() throws BadLocationException { fDoc.replace(3, 2, ""); @@ -70,7 +70,7 @@ public class ExclusivePositionUpdaterTest { Assert.assertEquals(5, fPos.length); Assert.assertFalse(fPos.isDeleted); } - + @Test public void testDeleteOverLeftBorder() throws BadLocationException { fDoc.replace(3, 6, ""); @@ -78,7 +78,7 @@ public class ExclusivePositionUpdaterTest { Assert.assertEquals(1, fPos.length); Assert.assertFalse(fPos.isDeleted); } - + @Test public void testDeleteOverLeftBorderTillRight() throws BadLocationException { fDoc.replace(4, 6, ""); @@ -86,13 +86,13 @@ public class ExclusivePositionUpdaterTest { Assert.assertEquals(0, fPos.length); Assert.assertFalse(fPos.isDeleted); } - + @Test public void testDeleted() throws BadLocationException { fDoc.replace(4, 7, ""); Assert.assertTrue(fPos.isDeleted); } - + @Test public void testDeleteAtOffset() throws BadLocationException { fDoc.replace(5, 1, ""); @@ -100,7 +100,7 @@ public class ExclusivePositionUpdaterTest { Assert.assertEquals(4, fPos.length); Assert.assertFalse(fPos.isDeleted); } - + @Test public void testDeleteAtOffset2() throws BadLocationException { fDoc.replace(5, 2, ""); @@ -108,7 +108,7 @@ public class ExclusivePositionUpdaterTest { Assert.assertEquals(3, fPos.length); Assert.assertFalse(fPos.isDeleted); } - + @Test public void testDeleteAtOffsetTillRight() throws BadLocationException { fDoc.replace(5, 5, ""); @@ -116,7 +116,7 @@ public class ExclusivePositionUpdaterTest { Assert.assertEquals(0, fPos.length); Assert.assertFalse(fPos.isDeleted); } - + @Test public void testDeleteAtOffsetOverRightBorder() throws BadLocationException { fDoc.replace(5, 6, ""); @@ -124,7 +124,7 @@ public class ExclusivePositionUpdaterTest { Assert.assertEquals(0, fPos.length); Assert.assertFalse(fPos.isDeleted); } - + @Test public void testDeleteWithin() throws BadLocationException { fDoc.replace(6, 2, ""); @@ -132,7 +132,7 @@ public class ExclusivePositionUpdaterTest { Assert.assertEquals(3, fPos.length); Assert.assertFalse(fPos.isDeleted); } - + @Test public void testDeleteAtRight() throws BadLocationException { fDoc.replace(8, 2, ""); @@ -140,7 +140,7 @@ public class ExclusivePositionUpdaterTest { Assert.assertEquals(3, fPos.length); Assert.assertFalse(fPos.isDeleted); } - + @Test public void testDeleteOverRightBorder() throws BadLocationException { fDoc.replace(9, 2, ""); @@ -148,7 +148,7 @@ public class ExclusivePositionUpdaterTest { Assert.assertEquals(4, fPos.length); Assert.assertFalse(fPos.isDeleted); } - + @Test public void testDeleteRightAfter() throws BadLocationException { fDoc.replace(10, 2, ""); @@ -156,7 +156,7 @@ public class ExclusivePositionUpdaterTest { Assert.assertEquals(5, fPos.length); Assert.assertFalse(fPos.isDeleted); } - + @Test public void testDeleteAfter() throws BadLocationException { fDoc.replace(20, 2, ""); @@ -166,42 +166,42 @@ public class ExclusivePositionUpdaterTest { } // Add, ascending by offset: - + @Test public void testAddBefore() throws BadLocationException { fDoc.replace(2, 0, "yy"); Assert.assertEquals(7, fPos.offset); Assert.assertEquals(5, fPos.length); } - + @Test public void testAddRightBefore() throws BadLocationException { fDoc.replace(5, 0, "yy"); Assert.assertEquals(7, fPos.offset); Assert.assertEquals(5, fPos.length); } - + @Test public void testAddWithin() throws BadLocationException { fDoc.replace(6, 0, "yy"); Assert.assertEquals(5, fPos.offset); Assert.assertEquals(7, fPos.length); } - + @Test public void testAddWithin2() throws BadLocationException { fDoc.replace(9, 0, "yy"); Assert.assertEquals(5, fPos.offset); Assert.assertEquals(7, fPos.length); } - + @Test public void testAddRightAfter() throws BadLocationException { fDoc.replace(10, 0, "yy"); Assert.assertEquals(5, fPos.offset); Assert.assertEquals(5, fPos.length); } - + @Test public void testAddAfter() throws BadLocationException { fDoc.replace(20, 0, "yy"); @@ -210,41 +210,41 @@ public class ExclusivePositionUpdaterTest { } // Replace, ascending by offset, length: - + @Test public void testReplaceBefore() throws BadLocationException { fDoc.replace(2, 2, "y"); Assert.assertEquals(4, fPos.offset); Assert.assertEquals(5, fPos.length); } - + @Test public void testReplaceRightBefore() throws BadLocationException { fDoc.replace(2, 3, "y"); Assert.assertEquals(3, fPos.offset); Assert.assertEquals(5, fPos.length); } - + @Test public void testReplaceLeftBorder() throws BadLocationException { fDoc.replace(4, 2, "yy"); Assert.assertEquals(6, fPos.offset); Assert.assertEquals(4, fPos.length); } - + @Test public void testReplaceLeftBorderTillRight() throws BadLocationException { fDoc.replace(4, 6, "yy"); Assert.assertEquals(6, fPos.offset); Assert.assertEquals(0, fPos.length); } - + @Test public void testReplaced() throws BadLocationException { fDoc.replace(4, 7, "yyyyyyy"); Assert.assertTrue(fPos.isDeleted); } - + @Test public void testReplaceAtOffset1() throws BadLocationException { fDoc.replace(5, 1, "yy"); @@ -252,7 +252,7 @@ public class ExclusivePositionUpdaterTest { Assert.assertEquals(5, fPos.offset); Assert.assertEquals(6, fPos.length); } - + @Test public void testReplaceAtOffset2() throws BadLocationException { fDoc.replace(5, 4, "yy"); @@ -260,7 +260,7 @@ public class ExclusivePositionUpdaterTest { Assert.assertEquals(5, fPos.offset); Assert.assertEquals(3, fPos.length); } - + @Test public void testReplaceAtOffsetTillRight() throws BadLocationException { fDoc.replace(5, 5, "yy"); @@ -269,28 +269,28 @@ public class ExclusivePositionUpdaterTest { Assert.assertEquals(2, fPos.length); Assert.assertFalse(fPos.isDeleted); } - + @Test public void testReplaceAtRight() throws BadLocationException { fDoc.replace(6, 4, "yy"); Assert.assertEquals(5, fPos.offset); Assert.assertEquals(3, fPos.length); } - + @Test public void testReplaceRightBorder() throws BadLocationException { fDoc.replace(9, 2, "yy"); Assert.assertEquals(5, fPos.offset); Assert.assertEquals(4, fPos.length); } - + @Test public void testReplaceRightAfter() throws BadLocationException { fDoc.replace(10, 2, "y"); Assert.assertEquals(5, fPos.offset); Assert.assertEquals(5, fPos.length); } - + @Test public void testReplaceAfter() throws BadLocationException { fDoc.replace(20, 2, "y"); diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/FindReplaceDocumentAdapterTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/FindReplaceDocumentAdapterTest.java index b4057696f72..d0a6b3fccf8 100644 --- a/org.eclipse.text.tests/src/org/eclipse/text/tests/FindReplaceDocumentAdapterTest.java +++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/FindReplaceDocumentAdapterTest.java @@ -41,7 +41,7 @@ import org.eclipse.jface.text.Region; public class FindReplaceDocumentAdapterTest { private static final boolean BUG_392594= true; - + private Document fDocument; @Before @@ -71,7 +71,7 @@ public class FindReplaceDocumentAdapterTest { public void tearDown () { fDocument= null; } - + @org.junit.Test public void testFind() { FindReplaceDocumentAdapter findReplaceDocumentAdapter= new FindReplaceDocumentAdapter(fDocument); @@ -94,7 +94,7 @@ public class FindReplaceDocumentAdapterTest { Assert.assertTrue(false); } } - + @Test public void testFindCaretInMiddleOfWord() { FindReplaceDocumentAdapter findReplaceDocumentAdapter= new FindReplaceDocumentAdapter(fDocument); @@ -112,7 +112,7 @@ public class FindReplaceDocumentAdapterTest { Assert.assertTrue(false); } } - + @Test public void testFindCaretAtWordStart() { FindReplaceDocumentAdapter findReplaceDocumentAdapter= new FindReplaceDocumentAdapter(fDocument); @@ -126,7 +126,7 @@ public class FindReplaceDocumentAdapterTest { Assert.assertTrue(false); } } - + @Test public void testFindCaretAtEndStart() { FindReplaceDocumentAdapter findReplaceDocumentAdapter= new FindReplaceDocumentAdapter(fDocument); @@ -143,7 +143,7 @@ public class FindReplaceDocumentAdapterTest { /** * Test case for: https://bugs.eclipse.org/bugs/show_bug.cgi?id=74993 - */ + */ @Test public void testBug74993() { FindReplaceDocumentAdapter findReplaceDocumentAdapter= new FindReplaceDocumentAdapter(fDocument); @@ -158,7 +158,7 @@ public class FindReplaceDocumentAdapterTest { /** * Test case for: https://bugs.eclipse.org/386751 - */ + */ @Test public void testBug386751() { FindReplaceDocumentAdapter adapter= new FindReplaceDocumentAdapter(fDocument); @@ -169,7 +169,7 @@ public class FindReplaceDocumentAdapterTest { Assert.assertTrue(false); } } - + @Test public void testUTF8Pattern() { FindReplaceDocumentAdapter findReplaceDocumentAdapter= new FindReplaceDocumentAdapter(fDocument); @@ -192,7 +192,7 @@ public class FindReplaceDocumentAdapterTest { Assert.assertTrue(false); } } - + @Test public void testReplace() { FindReplaceDocumentAdapter findReplaceDocumentAdapter= new FindReplaceDocumentAdapter(fDocument); @@ -237,7 +237,7 @@ public class FindReplaceDocumentAdapterTest { Assert.assertTrue(false); } } - + @Test @Ignore public void _testRegexReplace() throws Exception { @@ -255,7 +255,7 @@ public class FindReplaceDocumentAdapterTest { String text= "Unix\nWindows\r\nMac\rInferred\n\n\\, \u00F6, \u00F6, \t, \n, \r, \f, \u0007, \u001B, \u0006"; assertEquals(text, fDocument.get()); } - + @Test public void testRegexReplace2() throws Exception { FindReplaceDocumentAdapter findReplaceDocumentAdapter= new FindReplaceDocumentAdapter(fDocument); @@ -276,7 +276,7 @@ public class FindReplaceDocumentAdapterTest { regexReplace("foo", "$010", findReplaceDocumentAdapter); assertEquals("foo10", fDocument.get()); } - + @Test public void testRegexReplace3() throws Exception { FindReplaceDocumentAdapter findReplaceDocumentAdapter= new FindReplaceDocumentAdapter(fDocument); @@ -292,7 +292,7 @@ public class FindReplaceDocumentAdapterTest { /* * @since 3.4 - */ + */ @Test public void testRegexRetainCase() throws Exception { FindReplaceDocumentAdapter findReplaceDocumentAdapter= new FindReplaceDocumentAdapter(fDocument); @@ -348,7 +348,7 @@ public class FindReplaceDocumentAdapterTest { IRegion r= findReplaceDocumentAdapter.replace(replace, true); assertNotNull(r); } - + @Test public void testRegexFindLinebreak() throws Exception { FindReplaceDocumentAdapter adapter= new FindReplaceDocumentAdapter(fDocument); @@ -371,7 +371,7 @@ public class FindReplaceDocumentAdapterTest { region= adapter.find(r + 1, "\\R", true, false, false, true); assertNull(region); } - + @Test public void testRegexFindLinebreak2_fail() throws Exception { FindReplaceDocumentAdapter adapter= new FindReplaceDocumentAdapter(fDocument); @@ -393,7 +393,7 @@ public class FindReplaceDocumentAdapterTest { } fail(); } - + @Test @Ignore public void _testRegexFindLinebreak2() throws Exception { @@ -412,7 +412,7 @@ public class FindReplaceDocumentAdapterTest { adapter.replace("Win\\1$1", true); assertEquals("+Win\r\n\r\n", fDocument.get()); } - + @Test public void testRegexFindLinebreak3() throws Exception { FindReplaceDocumentAdapter adapter= new FindReplaceDocumentAdapter(fDocument); @@ -430,7 +430,7 @@ public class FindReplaceDocumentAdapterTest { region= adapter.find(0, "[a-zA-Z]+\\R{2}", true, false, false, true); assertEquals(new Region(two, end - two), region); } - + @Test public void testRegexFindLinebreakIllegal() throws Exception { FindReplaceDocumentAdapter adapter= new FindReplaceDocumentAdapter(fDocument); @@ -458,7 +458,7 @@ public class FindReplaceDocumentAdapterTest { } assertNull(region); } - + @Test public void testIllegalState() { FindReplaceDocumentAdapter findReplaceDocumentAdapter= new FindReplaceDocumentAdapter(fDocument); @@ -479,14 +479,14 @@ public class FindReplaceDocumentAdapterTest { Assert.assertTrue(false); } } - + @Test public void testRegexFindStackOverflow_fail() throws Exception { // test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=102699 - + if (BUG_392594 && System.getProperty("os.name").contains("Mac")) return; // VM crash on the Mac, see https://bugs.eclipse.org/392594 - + FindReplaceDocumentAdapter adapter= new FindReplaceDocumentAdapter(fDocument); int len= 100000; diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/GapTextTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/GapTextTest.java index b5452db1d48..24ef93a32f8 100644 --- a/org.eclipse.text.tests/src/org/eclipse/text/tests/GapTextTest.java +++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/GapTextTest.java @@ -32,12 +32,12 @@ public class GapTextTest extends AbstractGapTextTest { public void tearDown () { fText= null; } - + @Test public void testSet() { assertGap(5, 10); } - + @Test public void testGetText1() { String[] expected= { @@ -54,7 +54,7 @@ public class GapTextTest extends AbstractGapTextTest { } } - + @Test public void testGetText2() { String[] expected= { @@ -71,7 +71,7 @@ public class GapTextTest extends AbstractGapTextTest { } } - + @Test public void testInsert() { fText.replace(2, 0, "y"); @@ -86,7 +86,7 @@ public class GapTextTest extends AbstractGapTextTest { fText.replace(7, 0, "y"); assertGap(8, 13); } - + @Test public void testRemoveGapOverlapping() { fText.replace(2, 2, null); @@ -95,7 +95,7 @@ public class GapTextTest extends AbstractGapTextTest { fText.replace(1, 2, null); assertGap(1, 10); } - + @Test public void testRemoveGapOverlapping2() { fText.replace(0, 0, "aaaaazzzzzyyyyy"); @@ -107,7 +107,7 @@ public class GapTextTest extends AbstractGapTextTest { assertGap(5, 10); assertContents("aaaaaxxx"); } - + @Test public void testRemoveRemoteFromGap() { fText.replace(0, 0, "aaaaazzzzzyyyyy"); @@ -125,7 +125,7 @@ public class GapTextTest extends AbstractGapTextTest { assertContents("aaaaazzx"); } - + @Test public void testRemoveAtLeftGapEdge() { fText.replace(4, 0, "xxx"); @@ -135,7 +135,7 @@ public class GapTextTest extends AbstractGapTextTest { fText.replace(6, 1, null); assertGap(6, 8); } - + @Test public void testRemoveAtRightGapEdge() { fText.replace(4, 0, "xxx"); @@ -145,7 +145,7 @@ public class GapTextTest extends AbstractGapTextTest { fText.replace(7, 1, null); assertGap(7, 9); } - + @Test public void testReplace() { fText.replace(2, 2, "yy"); @@ -157,7 +157,7 @@ public class GapTextTest extends AbstractGapTextTest { fText.replace(14, 0, "yyy"); assertGap(17, 19); } - + @Test public void testRemoveReallocateBeforeGap() throws Exception { fText.replace(0, 0, "yyyyyzzzzz"); diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/LineTrackerTest3.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/LineTrackerTest3.java index 610245c7e07..b574f5d8ceb 100644 --- a/org.eclipse.text.tests/src/org/eclipse/text/tests/LineTrackerTest3.java +++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/LineTrackerTest3.java @@ -47,7 +47,7 @@ public class LineTrackerTest3 extends AbstractLineTrackerTest { offset += (lines[i] + 1); return offset; } - + @Test public void testEditScript1() throws Exception { checkLines(new int[] { 1, 1, 1, 1, 1, 0 }); @@ -67,7 +67,7 @@ public class LineTrackerTest3 extends AbstractLineTrackerTest { replace(4, 0, "x"); checkLines(new int[] { 3, 1 }); } - + @Test public void testEmptyLines() throws Exception { checkLines(new int[] { 1, 1, 1, 1, 1, 0 }); @@ -83,7 +83,7 @@ public class LineTrackerTest3 extends AbstractLineTrackerTest { assertTrue("invalid line number " + no + " reported instead of " + i, no == i); } } - + @Test public void testInsert1() throws Exception { checkLines(new int[] { 1, 1, 1, 1, 1, 0 }); @@ -100,7 +100,7 @@ public class LineTrackerTest3 extends AbstractLineTrackerTest { replace(13, 0, "y"); checkLines(new int[] { 1, 5, 2, 1, 1, 1, 1, 0 }); } - + @Test public void testInsert2() throws Exception { checkLines(new int[] { 1, 1, 1, 1, 1, 0 }); @@ -111,7 +111,7 @@ public class LineTrackerTest3 extends AbstractLineTrackerTest { replace(9, 0, "y\ny\ny"); checkLines(new int[] { 1, 5, 2, 1, 1, 1, 1, 0 }); } - + @Test public void testLinesNumbers() throws Exception { checkLines(new int[] { 1, 1, 1, 1, 1, 0 }); @@ -128,7 +128,7 @@ public class LineTrackerTest3 extends AbstractLineTrackerTest { offset+= (i + 1); } } - + @Test public void testOffsets() throws Exception { checkLines(new int[] { 1, 1, 1, 1, 1, 0 }); @@ -152,7 +152,7 @@ public class LineTrackerTest3 extends AbstractLineTrackerTest { assertTrue("invalid line number " + line + " for position " + i + " should be " + l, l == line); } } - + @Test public void testRemove() throws Exception { checkLines(new int[] { 1, 1, 1, 1, 1, 0 }); @@ -169,7 +169,7 @@ public class LineTrackerTest3 extends AbstractLineTrackerTest { replace(0, 3, null); checkLines(new int[] { 0 }); } - + @Test public void testReplace() throws Exception { checkLines(new int[] { 1, 1, 1, 1, 1, 0 }); @@ -178,7 +178,7 @@ public class LineTrackerTest3 extends AbstractLineTrackerTest { checkLines(new int[] { 2, 2, 2, 2, 2, 0 }); } - + @Test public void testReplace2() throws Exception { checkLines(new int[] { 1, 1, 1, 1, 1, 0 }); @@ -191,7 +191,7 @@ public class LineTrackerTest3 extends AbstractLineTrackerTest { checkLines(new int[] { 1, 1, 1, 0 }); } - + @Test public void testReplace3() throws Exception { checkLines(new int[] { 1, 1, 1, 1, 1, 0 }); @@ -200,7 +200,7 @@ public class LineTrackerTest3 extends AbstractLineTrackerTest { checkLines(new int[] { 1, 1, 1, 1, 1, 0 }); } - + @Test public void testReplace4() throws Exception { checkLines(new int[] { 1, 1, 1, 1, 1, 0 }); @@ -215,7 +215,7 @@ public class LineTrackerTest3 extends AbstractLineTrackerTest { previous= fTracker.getLineInformation(i); } } - + @Test public void testShiftLeft() throws Exception { checkLines(new int[] { 1, 1, 1, 1, 1, 0 }); @@ -231,7 +231,7 @@ public class LineTrackerTest3 extends AbstractLineTrackerTest { String txt= fText.get(0, fText.getLength()); assertEquals("invalid text", "x\nx\nx\nx\nx\n", txt); } - + @Test public void testShiftRight() throws Exception { checkLines(new int[] { 1, 1, 1, 1, 1, 0 }); @@ -246,7 +246,7 @@ public class LineTrackerTest3 extends AbstractLineTrackerTest { String txt= fText.get(0, fText.getLength()); assertEquals("invalid text", "\tx\n\tx\n\tx\n\tx\n\tx\n", txt); } - + @Test public void testMultipleNewlines() throws Exception { fText= new GapTextStore(); @@ -268,7 +268,7 @@ public class LineTrackerTest3 extends AbstractLineTrackerTest { fTracker.replace(fTracker.getLineOffset(line), fTracker.getLineLength(line), null); } - + @Test public void testDeleteLinesFromEnd() throws Exception { set("x\nx\n\nx\n\n"); @@ -279,7 +279,7 @@ public class LineTrackerTest3 extends AbstractLineTrackerTest { fTracker.replace(fTracker.getLineOffset(line), fTracker.getLineLength(line), null); } - + @Test public void testDeleteLines() throws Exception { String content= ""; @@ -299,7 +299,7 @@ public class LineTrackerTest3 extends AbstractLineTrackerTest { fTracker.replace(fTracker.getLineOffset(line), fTracker.getLineLength(line), null); } } - + @Test public void testSet() throws Exception { String content= ""; @@ -316,7 +316,7 @@ public class LineTrackerTest3 extends AbstractLineTrackerTest { content += "\n"; } } - + @Test public void testFunnyLastLineCompatibility() throws Exception { /* empty last line */ @@ -379,7 +379,7 @@ public class LineTrackerTest3 extends AbstractLineTrackerTest { } } - + @Test public void testNoDelimiterLine() throws Exception { set("abcef"); @@ -388,7 +388,7 @@ public class LineTrackerTest3 extends AbstractLineTrackerTest { replace(0, 0, ""); // switch to TreeLineTracker checkLines(new int[] { 5 }); } - + @Test public void testFunnyLastLineCompatibility2() throws Exception { /* empty last line */ @@ -453,7 +453,7 @@ public class LineTrackerTest3 extends AbstractLineTrackerTest { } } - + @Test public void testNegativeOffset() throws Exception { try { @@ -548,7 +548,7 @@ public class LineTrackerTest3 extends AbstractLineTrackerTest { /** * Test for Bug 545565. Some ListLineTracker methods yield wrong results after tracker content * was set to <code>null</code>. - * + * * @throws BadLocationException if test failed */ @Test @@ -592,7 +592,7 @@ public class LineTrackerTest3 extends AbstractLineTrackerTest { /** * Check if ListLineTracker and TreeLineTracker return same result for same input in context of * Bug 545565. - * + * * @throws BadLocationException if test fails */ @Test diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/LineTrackerTest4.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/LineTrackerTest4.java index 395d14275ca..18339653c9d 100644 --- a/org.eclipse.text.tests/src/org/eclipse/text/tests/LineTrackerTest4.java +++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/LineTrackerTest4.java @@ -66,7 +66,7 @@ public class LineTrackerTest4 extends AbstractLineTrackerTest { replace(5, 0, "x"); checkLines(new int[] { 3, 1 }); } - + @Test public void testEmptyLines() throws Exception { checkLines(new int[] { 1, 1, 1, 1, 1, 0 }); @@ -83,7 +83,7 @@ public class LineTrackerTest4 extends AbstractLineTrackerTest { assertTrue("invalid line number " + no + " for position " + i + " should be " + l, l == no); } } - + @Test public void testInsert1() throws Exception { checkLines(new int[] { 1, 1, 1, 1, 1, 0 }); @@ -100,7 +100,7 @@ public class LineTrackerTest4 extends AbstractLineTrackerTest { replace(17, 0, "y"); checkLines(new int[] { 1, 5, 2, 1, 1, 1, 1, 0 }); } - + @Test public void testInsert2() throws Exception { checkLines(new int[] { 1, 1, 1, 1, 1, 0 }); @@ -111,7 +111,7 @@ public class LineTrackerTest4 extends AbstractLineTrackerTest { replace(11, 0, "y\r\ny\r\ny"); checkLines(new int[] { 1, 5, 2, 1, 1, 1, 1, 0 }); } - + @Test public void testLinesNumbers() throws Exception { checkLines(new int[] { 1, 1, 1, 1, 1, 0 }); @@ -128,7 +128,7 @@ public class LineTrackerTest4 extends AbstractLineTrackerTest { offset+= (i + 2); } } - + @Test public void testOffsets() throws Exception { checkLines(new int[] { 1, 1, 1, 1, 1, 0 }); @@ -161,7 +161,7 @@ public class LineTrackerTest4 extends AbstractLineTrackerTest { int length= fTracker.getLineLength(lastLine); assertTrue("invalid last line end offset " + (offset + length - 1), 0 == length); } - + @Test public void testRemove() throws Exception { checkLines(new int[] { 1, 1, 1, 1, 1, 0 }); @@ -178,7 +178,7 @@ public class LineTrackerTest4 extends AbstractLineTrackerTest { replace(0, 4, null); checkLines(new int[] { 0 }); } - + @Test public void testReplace() throws Exception { checkLines(new int[] { 1, 1, 1, 1, 1, 0 }); @@ -186,7 +186,7 @@ public class LineTrackerTest4 extends AbstractLineTrackerTest { replace(0, fText.getLength(), "\tx\r\n\tx\r\n\tx\r\n\tx\r\n\tx\r\n"); checkLines(new int[] { 2, 2, 2, 2, 2, 0 }); } - + @Test public void testShiftLeft() throws Exception { checkLines(new int[] { 1, 1, 1, 1, 1, 0 }); @@ -202,7 +202,7 @@ public class LineTrackerTest4 extends AbstractLineTrackerTest { String txt= fText.get(0, fText.getLength()); assertEquals("invalid text", "x\r\nx\r\nx\r\nx\r\nx\r\n", txt); } - + @Test public void testShiftRight() throws Exception { checkLines(new int[] { 1, 1, 1, 1, 1, 0 }); diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/PositionUpdatingCornerCasesTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/PositionUpdatingCornerCasesTest.java index 9b68d1c4388..6c347a1c93c 100644 --- a/org.eclipse.text.tests/src/org/eclipse/text/tests/PositionUpdatingCornerCasesTest.java +++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/PositionUpdatingCornerCasesTest.java @@ -54,7 +54,7 @@ public class PositionUpdatingCornerCasesTest { fDocument.addPosition(new Position(0, 1)); fDocument.addPosition(new Position(5, 0)); fDocument.addPosition(new Position(5, 3)); - + fDocument.replace(0, 0, "yy"); Position[] positions= new Position[] { @@ -66,7 +66,7 @@ public class PositionUpdatingCornerCasesTest { checkPositions(positions); } - + @Test public void testInsert2() throws Exception { fDocument= new Document("x-x-x-x-x-x-x-x-x-x-x"); @@ -77,9 +77,9 @@ public class PositionUpdatingCornerCasesTest { fDocument.addPosition(new Position(5, 3)); fDocument.addPosition(new Position(10, 0)); fDocument.addPosition(new Position(10, 2)); - + fDocument.replace(5, 0, "yy"); - + Position[] positions= new Position[] { new Position(0, 1), new Position(0, 0), @@ -89,8 +89,8 @@ public class PositionUpdatingCornerCasesTest { new Position(12, 2), new Position(12, 0), }; - + checkPositions(positions); - + } } diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/TextEditTests.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/TextEditTests.java index 3c214bfe5b8..c34eb9e8e23 100644 --- a/org.eclipse.text.tests/src/org/eclipse/text/tests/TextEditTests.java +++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/TextEditTests.java @@ -61,21 +61,21 @@ public class TextEditTests { fRoot= null; fRoot= null; } - + @Test public void testCovers1() throws Exception { InsertEdit insert= new InsertEdit(1, ""); DeleteEdit delete= new DeleteEdit(2, 2); Assert.assertFalse(insert.covers(delete)); } - + @Test public void testCovers2() throws Exception { MultiTextEdit multi= new MultiTextEdit(0,0); MultiTextEdit child= new MultiTextEdit(0,0); Assert.assertTrue(multi.covers(child)); } - + @Test public void testOverlap1() throws Exception { // [ [ ] ] @@ -88,7 +88,7 @@ public class TextEditTests { } assertTrue(exception); } - + @Test public void testOverlap2() throws Exception { // [[ ] ] @@ -101,7 +101,7 @@ public class TextEditTests { } assertTrue(exception); } - + @Test public void testOverlap3() throws Exception { // [ [ ]] @@ -114,7 +114,7 @@ public class TextEditTests { } assertTrue(exception); } - + @Test public void testOverlap4() throws Exception { // [ [ ] ] @@ -127,7 +127,7 @@ public class TextEditTests { } assertTrue(exception); } - + @Test public void testOverlap5() throws Exception { // [ [] ] @@ -140,7 +140,7 @@ public class TextEditTests { } assertTrue(exception); } - + @Test public void testOverlap6() throws Exception { // [ [] ] @@ -153,7 +153,7 @@ public class TextEditTests { } assertTrue(exception); } - + @Test public void testOverlap7() throws Exception { MoveSourceEdit source= new MoveSourceEdit(2, 5); @@ -167,7 +167,7 @@ public class TextEditTests { } assertTrue(exception); } - + @Test public void testOverlap8() throws Exception { MoveSourceEdit source= new MoveSourceEdit(2, 5); @@ -181,7 +181,7 @@ public class TextEditTests { } assertTrue(exception); } - + @Test public void testOverlap9() throws Exception { MoveSourceEdit s1= new MoveSourceEdit(3, 1); @@ -199,7 +199,7 @@ public class TextEditTests { } assertTrue(exception); } - + @Test public void testUndefinedMultiEdit1() throws Exception { MultiTextEdit m1= new MultiTextEdit(); @@ -210,7 +210,7 @@ public class TextEditTests { m2.addChild(new InsertEdit(2, "")); fRoot.addChild(m2); } - + @Test public void testUndefinedMultiEdit2() throws Exception { MultiTextEdit m1= new MultiTextEdit(); @@ -218,7 +218,7 @@ public class TextEditTests { assertTrue(m1.covers(m2)); assertTrue(m2.covers(m1)); } - + @Test public void testUndefinedMultiEdit3() throws Exception { MultiTextEdit m2= new MultiTextEdit(); @@ -228,7 +228,7 @@ public class TextEditTests { Assert.assertEquals(1, m2.getOffset()); Assert.assertEquals(3, m2.getLength()); } - + @Test public void testUndefinedMultiEdit4() throws Exception { MultiTextEdit m2= new MultiTextEdit(); @@ -237,7 +237,7 @@ public class TextEditTests { Assert.assertEquals(1, m2.getOffset()); Assert.assertEquals(5, m2.getLength()); } - + @Test public void testUndefinedMultiEdit5() throws Exception { MultiTextEdit m2= new MultiTextEdit(); @@ -246,14 +246,14 @@ public class TextEditTests { Assert.assertEquals(1, m2.getOffset()); Assert.assertEquals(5, m2.getLength()); } - + @Test public void testUndefinedMultiEdit6() throws Exception { DeleteEdit d1= new DeleteEdit(1,3); MultiTextEdit m2= new MultiTextEdit(); assertTrue(d1.covers(m2)); } - + @Test public void testUnconnected1() throws Exception { MoveSourceEdit s1= new MoveSourceEdit(3, 1); @@ -266,7 +266,7 @@ public class TextEditTests { } assertTrue(exception); } - + @Test public void testBufferLength() throws Exception { MultiTextEdit edit= new MultiTextEdit(0, fDocument.getLength() + 1); @@ -279,7 +279,7 @@ public class TextEditTests { assertTrue(exception); } } - + @Test public void testCopy1() throws Exception { MultiTextEdit root= new MultiTextEdit(); @@ -292,7 +292,7 @@ public class TextEditTests { List<TextEdit> copy= flatten(copier.perform()); compare(org, copy); } - + @Test public void testCopy2() throws Exception { MultiTextEdit root= new MultiTextEdit(); @@ -348,7 +348,7 @@ public class TextEditTests { } } } - + @Test public void testInsert1() throws Exception { // [][ ] @@ -363,7 +363,7 @@ public class TextEditTests { Assert.assertEquals("Buffer content", "01yy345656789", fDocument.get()); doUndoRedo(undo, "01yy345656789"); } - + @Test public void testInsert2() throws Exception { // [][] @@ -378,7 +378,7 @@ public class TextEditTests { Assert.assertEquals("Buffer content", "01yyxx23456789", fDocument.get()); doUndoRedo(undo, "01yyxx23456789"); } - + @Test public void testInsert3() throws Exception { // [ ][][ ] @@ -396,7 +396,7 @@ public class TextEditTests { Assert.assertEquals("Buffer content", "011xx2456789", fDocument.get()); doUndoRedo(undo, "011xx2456789"); } - + @Test public void testInsert4() throws Exception { TextEdit e1= new InsertEdit(0, "xx"); @@ -408,7 +408,7 @@ public class TextEditTests { Assert.assertEquals("Buffer content", "xx0123456789", fDocument.get()); doUndoRedo(undo, "xx0123456789"); } - + @Test public void testInsert5() throws Exception { TextEdit e1= new InsertEdit(10, "xx"); @@ -420,7 +420,7 @@ public class TextEditTests { Assert.assertEquals("Buffer content", "0123456789xx", fDocument.get()); doUndoRedo(undo, "0123456789xx"); } - + @Test public void testInsertReplace1() throws Exception { TextEdit e1= new ReplaceEdit(2, 1, "y"); @@ -434,7 +434,7 @@ public class TextEditTests { Assert.assertEquals("Buffer content", "01xxy3456789", fDocument.get()); doUndoRedo(undo, "01xxy3456789"); } - + @Test public void testDelete1() throws Exception { TextEdit e1= new DeleteEdit(3, 1); @@ -445,7 +445,7 @@ public class TextEditTests { Assert.assertEquals("Buffer content", "012456789", fDocument.get()); doUndoRedo(undo, "012456789"); } - + @Test public void testDelete2() throws Exception { TextEdit e1= new DeleteEdit(4, 1); @@ -462,7 +462,7 @@ public class TextEditTests { Assert.assertEquals("Buffer content", "0126789", fDocument.get()); doUndoRedo(undo, "0126789"); } - + @Test public void testDelete3() throws Exception { TextEdit e1= new InsertEdit(3, "x"); @@ -476,7 +476,7 @@ public class TextEditTests { Assert.assertEquals("Buffer content", "012x456789", fDocument.get()); doUndoRedo(undo, "012x456789"); } - + @Test public void testDeleteWithChildren() throws Exception { TextEdit e1= new DeleteEdit(2, 6); @@ -496,7 +496,7 @@ public class TextEditTests { assertTrue(e4.isDeleted()); doUndoRedo(undo, "0189"); } - + @Test public void testTreeUpdate1() throws Exception { MultiTextEdit m1= new MultiTextEdit(); @@ -524,7 +524,7 @@ public class TextEditTests { assertEquals(fRoot, 2, 14); doUndoRedo(undo, "01aa23bb45cc67dd89"); } - + @Test public void testMove1() throws Exception { MoveSourceEdit s1= new MoveSourceEdit(2, 2); @@ -537,7 +537,7 @@ public class TextEditTests { assertEquals(t1, 3, 2); doUndoRedo(undo, "0142356789"); } - + @Test public void testMove2() throws Exception { MoveSourceEdit s1= new MoveSourceEdit(5, 2); @@ -550,7 +550,7 @@ public class TextEditTests { assertEquals(t1, 2, 2); doUndoRedo(undo, "0156234789"); } - + @Test public void testMove3() throws Exception { MoveSourceEdit s1= new MoveSourceEdit(2, 2); @@ -566,7 +566,7 @@ public class TextEditTests { assertEquals(e2, 2, 1); doUndoRedo(undo, "01x5623789"); } - + @Test public void testMove4() throws Exception { MoveSourceEdit s1= new MoveSourceEdit(7, 2); @@ -582,7 +582,7 @@ public class TextEditTests { assertEquals(e2, 7, 1); doUndoRedo(undo, "0178234x69"); } - + @Test public void testMove5() throws Exception { // Move onto itself @@ -599,7 +599,7 @@ public class TextEditTests { Assert.assertEquals("Buffer content", "01x3456789", fDocument.get()); doUndoRedo(undo, "01x3456789"); } - + @Test public void testMove6() throws Exception { // Move onto itself @@ -616,7 +616,7 @@ public class TextEditTests { Assert.assertEquals("Buffer content", "01x3456789", fDocument.get()); doUndoRedo(undo,"01x3456789"); } - + @Test public void testMove7() throws Exception { MoveSourceEdit s1= new MoveSourceEdit(2, 3); @@ -632,7 +632,7 @@ public class TextEditTests { assertEquals(e2, 5, 1); doUndoRedo(undo, "01562x4789"); } - + @Test public void testMove8() throws Exception { MoveSourceEdit s1= new MoveSourceEdit(5, 3); @@ -648,7 +648,7 @@ public class TextEditTests { assertEquals(e2, 2, 1); doUndoRedo(undo, "05x7123489"); } - + @Test public void testMove9() throws Exception { MoveSourceEdit s1= new MoveSourceEdit(1, 3); @@ -670,7 +670,7 @@ public class TextEditTests { Assert.assertEquals("Buffer content", "0421356789", fDocument.get()); doUndoRedo(undo, "0421356789"); } - + @Test public void testMove10() throws Exception { MoveSourceEdit s1= new MoveSourceEdit(2, 2); @@ -691,7 +691,7 @@ public class TextEditTests { Assert.assertEquals("Buffer content", "0561472389", fDocument.get()); doUndoRedo(undo, "0561472389"); } - + @Test public void testMoveWithRangeMarker() throws Exception { MoveSourceEdit s1= new MoveSourceEdit(2, 2); @@ -710,7 +710,7 @@ public class TextEditTests { assertEquals(marker, 3, 2); doUndoRedo(undo, "0142356789"); } - + @Test public void testMoveWithTargetDelete() throws Exception { MoveSourceEdit s1= new MoveSourceEdit(2, 3); @@ -726,7 +726,7 @@ public class TextEditTests { assertEquals(e2, 3, 0); doUndoRedo(undo, "01589"); } - + @Test public void testMoveUpWithSourceDelete() throws Exception { MoveSourceEdit s1= new MoveSourceEdit(5, 2); @@ -749,7 +749,7 @@ public class TextEditTests { assertEquals(d1, 7, 0); doUndoRedo(undo, "0156234789"); } - + @Test public void testMoveDown() throws Exception { MoveSourceEdit s1= new MoveSourceEdit(2, 2); @@ -774,7 +774,7 @@ public class TextEditTests { assertEquals(d1, 10, 0); doUndoRedo(undo, "014x562378"); } - + @Test public void testMoveUp() throws Exception { MoveSourceEdit s1= new MoveSourceEdit(7, 2); @@ -799,7 +799,7 @@ public class TextEditTests { assertEquals(d1, 10, 0); doUndoRedo(undo, "0178234x56"); } - + @Test public void testMoveDownWithSourceDelete() throws Exception { MoveSourceEdit s1= new MoveSourceEdit(2, 2); @@ -822,7 +822,7 @@ public class TextEditTests { assertEquals(m1, 5, 2); doUndoRedo(undo, "0145623789"); } - + @Test public void testMoveUpWithInnerMark() throws Exception { MoveSourceEdit s1= new MoveSourceEdit(7, 2); @@ -838,7 +838,7 @@ public class TextEditTests { assertEquals(m, 6, 2); doUndoRedo(undo, "017823yy569"); } - + @Test public void testMoveDownWithInnerMark() throws Exception { MoveSourceEdit s1= new MoveSourceEdit(2, 2); @@ -854,7 +854,7 @@ public class TextEditTests { assertEquals(m, 2, 2); doUndoRedo(undo, "01yy5623789"); } - + @Test public void testMoveUpWithParentMark() throws Exception { RangeMarker m= new RangeMarker(2, 6); @@ -870,7 +870,7 @@ public class TextEditTests { assertEquals(s1, 6, 0); doUndoRedo(undo, "0124536789"); } - + @Test public void testMoveDownWithParentMark() throws Exception { RangeMarker m= new RangeMarker(2, 6); @@ -886,7 +886,7 @@ public class TextEditTests { assertEquals(s1, 2, 0); doUndoRedo(undo, "0142356789"); } - + @Test public void testNestedMoveSource() throws Exception { MoveSourceEdit s1= new MoveSourceEdit(1, 5); @@ -912,7 +912,7 @@ public class TextEditTests { Assert.assertEquals("Buffer content", result, fDocument.get()); doUndoRedo(undo, result); } - + @Test public void testNestedMoveSourceWithInsert() throws Exception { MoveSourceEdit s1= new MoveSourceEdit(1, 5); @@ -941,7 +941,7 @@ public class TextEditTests { Assert.assertEquals("Buffer content", result, fDocument.get()); doUndoRedo(undo, result); } - + @Test public void testNestedMoveTarget() throws Exception { MoveSourceEdit s1= new MoveSourceEdit(1, 2); @@ -961,7 +961,7 @@ public class TextEditTests { Assert.assertEquals("Buffer content", result, fDocument.get()); doUndoRedo(undo, result); } - + @Test public void testCopyDown() throws Exception { CopySourceEdit s1= new CopySourceEdit(2, 3); @@ -976,7 +976,7 @@ public class TextEditTests { Assert.assertEquals("Buffer content", result, fDocument.get()); doUndoRedo(undo, result); } - + @Test public void testCopyUp() throws Exception { CopySourceEdit s1= new CopySourceEdit(7, 2); @@ -991,7 +991,7 @@ public class TextEditTests { Assert.assertEquals("Buffer content", result, fDocument.get()); doUndoRedo(undo, result); } - + @Test public void testDoubleCopy() throws Exception { CopySourceEdit s1= new CopySourceEdit(5, 2); @@ -1012,7 +1012,7 @@ public class TextEditTests { Assert.assertEquals("Buffer content", result, fDocument.get()); doUndoRedo(undo, result); } - + @Test public void testNestedCopySource() throws Exception { CopySourceEdit s1= new CopySourceEdit(1, 5); @@ -1038,7 +1038,7 @@ public class TextEditTests { Assert.assertEquals("Buffer content", result, fDocument.get()); doUndoRedo(undo, result); } - + @Test public void testNestedCopySourceWithInsert() throws Exception { CopySourceEdit s1= new CopySourceEdit(1, 5); @@ -1067,7 +1067,7 @@ public class TextEditTests { Assert.assertEquals("Buffer content", result, fDocument.get()); doUndoRedo(undo, result); } - + @Test public void testNestedCopyTarget() throws Exception { CopySourceEdit s1= new CopySourceEdit(1, 2); @@ -1087,7 +1087,7 @@ public class TextEditTests { Assert.assertEquals("Buffer content", result, fDocument.get()); doUndoRedo(undo, result); } - + @Test public void testSwap1() throws Exception { IDocument document= new Document("foo(1, 2), 3"); @@ -1116,7 +1116,7 @@ public class TextEditTests { String result= "3, foo(1, 2)"; Assert.assertEquals("Buffer content", result, document.get()); } - + @Test public void testSwap2() throws Exception { IDocument document= new Document("foo(1, 2), 3"); @@ -1144,7 +1144,7 @@ public class TextEditTests { String result= "foo(2, 1), 3"; Assert.assertEquals("Buffer content", result, document.get()); } - + @Test public void testSwap2InSwap1() throws Exception { IDocument document= new Document("foo(1, 2), 3"); @@ -1188,7 +1188,7 @@ public class TextEditTests { String result= "3, foo(2, 1)"; Assert.assertEquals("Buffer content", result, document.get()); } - + @Test public void testMoveTree1() { TextEdit root= new MultiTextEdit(); @@ -1204,7 +1204,7 @@ public class TextEditTests { Assert.assertEquals(5, e2.getOffset()); Assert.assertEquals(2, e2.getLength()); } - + @Test public void testMoveTree2() { TextEdit root= new MultiTextEdit(); @@ -1220,7 +1220,7 @@ public class TextEditTests { Assert.assertEquals(2, e2.getOffset()); Assert.assertEquals(2, e2.getLength()); } - + @Test public void testMoveTree3() { boolean exception= false; @@ -1232,7 +1232,7 @@ public class TextEditTests { } assertTrue(exception); } - + @Test public void testMoveTree4() { boolean exception= false; @@ -1246,7 +1246,7 @@ public class TextEditTests { } assertTrue(exception); } - + @Test public void testComparator() throws Exception { DeleteEdit d1= new DeleteEdit(1,3); @@ -1265,7 +1265,7 @@ public class TextEditTests { assertTrue(comparator.compare(edit1, edit3) == -comparator.compare(edit3, edit1)); } - + @Test public void testSourceTransformationIncludes() throws Exception { MoveSourceEdit ms= new MoveSourceEdit(2, 4); @@ -1290,7 +1290,7 @@ public class TextEditTests { assertEquals(r1, 6, 3); } - // Regression test for 108672 [quick fix] Exception when applying Convert to enhanced for loop + // Regression test for 108672 [quick fix] Exception when applying Convert to enhanced for loop @Test public void testSourceTranformationMultipleCovers() throws Exception { MoveSourceEdit ms= new MoveSourceEdit(2, 4); @@ -1320,7 +1320,7 @@ public class TextEditTests { assertTrue(r2.isDeleted()); assertEquals(r3, 7, 2); } - + @Test public void testSourceTranformationSplit1() throws Exception { MoveSourceEdit ms= new MoveSourceEdit(2, 4); @@ -1344,7 +1344,7 @@ public class TextEditTests { Assert.assertEquals("Buffer content", result, fDocument.get()); assertEquals(r1, 7, 1); } - + @Test public void testSourceTranformationSplit2() throws Exception { MoveSourceEdit ms= new MoveSourceEdit(2, 4); @@ -1368,7 +1368,7 @@ public class TextEditTests { Assert.assertEquals("Buffer content", result, fDocument.get()); assertEquals(r1, 6, 3); } - + @Test public void testIntersect() throws Exception { IRegion result= MoveSourceEdit.intersect(new RangeMarker(0,1), new RangeMarker(2,1)); diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/TextUtilitiesTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/TextUtilitiesTest.java index e547335c391..7504167e805 100644 --- a/org.eclipse.text.tests/src/org/eclipse/text/tests/TextUtilitiesTest.java +++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/TextUtilitiesTest.java @@ -139,7 +139,7 @@ public class TextUtilitiesTest { /** * Constructor for UtilitiesTest. - * + * * @param name the name */ private static DocumentEvent createRandomEvent(IDocument document, int maxLength, char character) { @@ -157,7 +157,7 @@ public class TextUtilitiesTest { return new DocumentEvent(document, offset, length, buffer.toString()); } - + @Test public void testMergeEvents1() { IDocument reference= new Document(); @@ -175,7 +175,7 @@ public class TextUtilitiesTest { Assert.fail("bad location exception"); } } - + @Test public void testMergeEvents() { IDocument reference= new Document(); @@ -228,7 +228,7 @@ public class TextUtilitiesTest { Assert.fail("bad location exception"); } } - + @Test public void testMergeEvents2() { IDocument reference= new Document(); @@ -278,7 +278,7 @@ public class TextUtilitiesTest { private static void check(IDocument reference, IDocument testee) { Assert.assertEquals(reference.get(), testee.get()); } - + @Test public void testIndexOf() { int[] result; diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/link/InclusivePositionUpdaterTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/link/InclusivePositionUpdaterTest.java index b671203ee3f..742a7407c2a 100644 --- a/org.eclipse.text.tests/src/org/eclipse/text/tests/link/InclusivePositionUpdaterTest.java +++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/link/InclusivePositionUpdaterTest.java @@ -31,7 +31,7 @@ public class InclusivePositionUpdaterTest { private static final String CATEGORY= "testcategory"; private Position fPos; private IDocument fDoc; - + @Before public void setUp() throws Exception { fUpdater= new InclusivePositionUpdater(CATEGORY); @@ -47,111 +47,111 @@ public class InclusivePositionUpdaterTest { fDoc.removePositionUpdater(fUpdater); fDoc.removePositionCategory(CATEGORY); } - + @Test public void testDeleteAfter() throws BadLocationException { fDoc.replace(20, 2, ""); Assert.assertEquals(5, fPos.offset); Assert.assertEquals(5, fPos.length); } - + @Test public void testAddAfter() throws BadLocationException { fDoc.replace(20, 0, "yy"); Assert.assertEquals(5, fPos.offset); Assert.assertEquals(5, fPos.length); } - + @Test public void testDeleteBefore() throws BadLocationException { fDoc.replace(2, 2, ""); Assert.assertEquals(3, fPos.offset); Assert.assertEquals(5, fPos.length); } - + @Test public void testAddBefore() throws BadLocationException { fDoc.replace(2, 0, "yy"); Assert.assertEquals(7, fPos.offset); Assert.assertEquals(5, fPos.length); } - + @Test public void testAddRightBefore() throws BadLocationException { fDoc.replace(5, 0, "yy"); Assert.assertEquals(5, fPos.offset); Assert.assertEquals(7, fPos.length); } - + @Test public void testDeleteAtOffset() throws BadLocationException { fDoc.replace(5, 2, ""); Assert.assertEquals(5, fPos.offset); Assert.assertEquals(3, fPos.length); } - + @Test public void testDeleteRightBefore() throws BadLocationException { fDoc.replace(3, 2, ""); Assert.assertEquals(3, fPos.offset); Assert.assertEquals(5, fPos.length); } - + @Test public void testAddRightAfter() throws BadLocationException { fDoc.replace(10, 0, "yy"); Assert.assertEquals(5, fPos.offset); Assert.assertEquals(7, fPos.length); } - + @Test public void testDeleteRightAfter() throws BadLocationException { fDoc.replace(10, 2, ""); Assert.assertEquals(5, fPos.offset); Assert.assertEquals(5, fPos.length); } - + @Test public void testAddWithin() throws BadLocationException { fDoc.replace(6, 0, "yy"); Assert.assertEquals(5, fPos.offset); Assert.assertEquals(7, fPos.length); } - + @Test public void testDeleteWithin() throws BadLocationException { fDoc.replace(6, 2, ""); Assert.assertEquals(5, fPos.offset); Assert.assertEquals(3, fPos.length); } - + @Test public void testReplaceLeftBorder() throws BadLocationException { fDoc.replace(4, 2, "yy"); Assert.assertEquals(4, fPos.offset); Assert.assertEquals(6, fPos.length); } - + @Test public void testReplaceRightBorder() throws BadLocationException { fDoc.replace(9, 2, "yy"); Assert.assertEquals(5, fPos.offset); Assert.assertEquals(6, fPos.length); } - + @Test public void testDeleteOverRightBorder() throws BadLocationException { fDoc.replace(9, 2, ""); Assert.assertEquals(5, fPos.offset); Assert.assertEquals(4, fPos.length); } - + @Test public void testDeleted() throws BadLocationException { fDoc.replace(4, 7, ""); Assert.assertTrue(fPos.isDeleted); } - + @Test public void testReplaced() throws BadLocationException { fDoc.replace(4, 7, "yyyyyyy"); diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/link/LinkedModeModelTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/link/LinkedModeModelTest.java index 3bc2332f92a..462ac90eed5 100644 --- a/org.eclipse.text.tests/src/org/eclipse/text/tests/link/LinkedModeModelTest.java +++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/link/LinkedModeModelTest.java @@ -41,7 +41,7 @@ public class LinkedModeModelTest { private List<LinkedPosition> fPositions= new LinkedList<>(); private List<IDocument[]> fDocumentMap= new ArrayList<>(); - + @Test public void testUpdate() throws BadLocationException { IDocument doc1= new Document(GARTEN1); @@ -59,11 +59,11 @@ public class LinkedModeModelTest { assertEquals(group1, "GRETCHEN"); assertUnchanged(group1); } - + @Test public void testUpdateUnequalContent() throws BadLocationException { IDocument doc1= new Document(GARTEN1); - + // set up linked mode LinkedPositionGroup group1= new LinkedPositionGroup(); createLinkedPositions(group1, doc1, "Allumfasser"); @@ -71,14 +71,14 @@ public class LinkedModeModelTest { LinkedModeModel env= new LinkedModeModel(); env.addGroup(group1); env.forceInstall(); - + // edit the document doc1.replace(GARTEN1.indexOf("Gott"), 4, "SUPERMAN"); - + assertEquals(group1, "SUPERMAN"); assertUnchanged(group1); } - + @Test public void testUpdateTwoGroups() throws BadLocationException { IDocument doc1= new Document(GARTEN1); @@ -104,7 +104,7 @@ public class LinkedModeModelTest { assertEquals(group2, "FAUST"); assertUnchanged(group1, group2); } - + @Test public void testUpdateMultipleGroups() throws BadLocationException { IDocument doc1= new Document(GARTEN1); @@ -132,7 +132,7 @@ public class LinkedModeModelTest { assertEquals(group2, "AUGE"); assertUnchanged(group1, group2); } - + @Test public void testUpdateMultiDocument() throws BadLocationException { IDocument doc1= new Document(GARTEN1); @@ -164,7 +164,7 @@ public class LinkedModeModelTest { assertUnchanged(group1, group2); } - + @Test public void testAddCompatibleGroups() throws BadLocationException { IDocument doc1= new Document(GARTEN1); @@ -186,7 +186,7 @@ public class LinkedModeModelTest { assertUnchanged(group1, group2); } - + @Test public void testAddIncompatibleGroups() throws BadLocationException { IDocument doc1= new Document(GARTEN1); @@ -207,7 +207,7 @@ public class LinkedModeModelTest { } assertFalse(true); } - + @Test public void testAddNullGroup() throws BadLocationException { LinkedModeModel env= new LinkedModeModel(); @@ -219,7 +219,7 @@ public class LinkedModeModelTest { assertFalse(true); } - + @Test public void testAddGroupWhenSealed() throws BadLocationException { IDocument doc1= new Document(GARTEN1); @@ -241,7 +241,7 @@ public class LinkedModeModelTest { assertFalse(true); } - + @Test public void testDoubleInstall() throws BadLocationException { IDocument doc1= new Document(GARTEN1); @@ -262,7 +262,7 @@ public class LinkedModeModelTest { assertFalse(true); } - + @Test public void testEmptyInstall() throws BadLocationException { LinkedModeModel env= new LinkedModeModel(); @@ -275,7 +275,7 @@ public class LinkedModeModelTest { assertFalse(true); } - + @Test public void testNestedUpdate() throws BadLocationException { IDocument doc1= new Document(GARTEN1); @@ -315,7 +315,7 @@ public class LinkedModeModelTest { assertEquals(group2, "FAUST"); assertUnchanged(group1, group2); } - + @Test public void testNestedForceInstall() throws BadLocationException { IDocument doc1= new Document(GARTEN1); @@ -361,7 +361,7 @@ public class LinkedModeModelTest { assertEquals(group1_2, "INE"); } - + @Test public void testNestedTryInstall() throws BadLocationException { IDocument doc1= new Document(GARTEN1); @@ -405,7 +405,7 @@ public class LinkedModeModelTest { assertEquals(group1, "MARGARINE"); assertUnchanged(group1, group2); } - + @Test public void testOutsideUpdate() throws BadLocationException { IDocument doc1= new Document(GARTEN1); @@ -433,7 +433,7 @@ public class LinkedModeModelTest { " Verbrich mir, Heinrich!", doc1.get(0, 36)); // assertUnchanged(group1); // would fail, since it was changed outside } - + @Test public void testOverlappingUpdate() throws BadLocationException { // a change partially touches a linked position, but also "in-between" text @@ -462,7 +462,7 @@ public class LinkedModeModelTest { "Versprich mir, Heinrich!", doc1.get(0, 41)); // assertUnchanged(group1); // would fail, since it was changed outside } - + @Test public void testOverlappingDelete() throws BadLocationException { // a change partially touches a linked position, but also "in-between" text @@ -491,7 +491,7 @@ public class LinkedModeModelTest { "Versprich mir, Heinrich!", doc1.get(0, 31)); // assertUnchanged(group1); // would fail, since it was changed outside } - + @Test public void testIllegalChange1() throws BadLocationException { // linked mode does not exit if the documents change outside the linked @@ -520,7 +520,7 @@ public class LinkedModeModelTest { assertTrue(isExit[0]); } - + @Test public void testIllegalChange2() throws BadLocationException { // linked mode does not exit if the documents change outside the linked diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/link/LinkedPositionGroupTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/link/LinkedPositionGroupTest.java index f9dc8d32c78..cacec99346d 100644 --- a/org.eclipse.text.tests/src/org/eclipse/text/tests/link/LinkedPositionGroupTest.java +++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/link/LinkedPositionGroupTest.java @@ -29,20 +29,20 @@ import org.eclipse.jface.text.link.LinkedPositionGroup; public class LinkedPositionGroupTest { - + @Test public void testIsEmpty() { LinkedPositionGroup group= new LinkedPositionGroup(); assertTrue(group.isEmpty()); } - + @Test public void testIsNotEmtpy() throws BadLocationException { LinkedPositionGroup group= new LinkedPositionGroup(); group.addPosition(new LinkedPosition(new Document(), 0, 0)); assertFalse(group.isEmpty()); } - + @Test public void testGetPositions() throws BadLocationException { LinkedPositionGroup group= new LinkedPositionGroup(); @@ -50,7 +50,7 @@ public class LinkedPositionGroupTest { group.addPosition(new LinkedPosition(new Document(), 0, 0)); assertEquals(2, group.getPositions().length); } - + @Test public void testAddPosition() throws BadLocationException { LinkedPositionGroup group= new LinkedPositionGroup(); @@ -58,7 +58,7 @@ public class LinkedPositionGroupTest { group.addPosition(p); assertSame(p, group.getPositions()[0]); } - + @Test public void testAddIllegalState() throws BadLocationException { LinkedPositionGroup group= new LinkedPositionGroup(); @@ -74,7 +74,7 @@ public class LinkedPositionGroupTest { assertFalse(true); } - + @Test public void testAddBadLocation() throws BadLocationException { LinkedPositionGroup group= new LinkedPositionGroup(); @@ -88,7 +88,7 @@ public class LinkedPositionGroupTest { assertFalse(true); } - + @Test public void testAddEqualContent() { LinkedPositionGroup group= new LinkedPositionGroup(); @@ -100,7 +100,7 @@ public class LinkedPositionGroupTest { assertFalse(true); } } - + @Test public void testAddNotEqualContent() { LinkedPositionGroup group= new LinkedPositionGroup(); diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/link/LinkedPositionTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/link/LinkedPositionTest.java index 444dd7f728a..3e69f6fa451 100644 --- a/org.eclipse.text.tests/src/org/eclipse/text/tests/link/LinkedPositionTest.java +++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/link/LinkedPositionTest.java @@ -36,13 +36,13 @@ public class LinkedPositionTest { fDoc= new Document(GARTEN1); fPos= new LinkedPosition(fDoc, 3, 10); } - + @Test public void testCreate() { new LinkedPosition(fDoc, 1, 9); new LinkedPosition(new Document(), 123, 234); } - + @Test(expected=Throwable.class) public void testNullCreate() { new LinkedPosition(null, 1, 9); @@ -50,7 +50,7 @@ public class LinkedPositionTest { /* * Class to test for boolean includes(int) - */ + */ @Test public void testIncludesint() { assertTrue(fPos.includes(3)); @@ -59,7 +59,7 @@ public class LinkedPositionTest { assertFalse(fPos.includes(2)); assertFalse(fPos.includes(15)); } - + @Test public void testGetDocument() { assertEquals(fDoc, fPos.getDocument()); @@ -67,7 +67,7 @@ public class LinkedPositionTest { /* * Class to test for boolean overlapsWith(LinkedPosition) - */ + */ @Test public void testOverlapsWithLinkedPosition() { LinkedPosition pos= new LinkedPosition(fDoc, 0, 2); @@ -100,7 +100,7 @@ public class LinkedPositionTest { /* * Class to test for boolean includes(DocumentEvent) - */ + */ @Test public void testIncludesDocumentEvent() { DocumentEvent de= new DocumentEvent(fDoc, 0, 2, "ignore"); @@ -133,7 +133,7 @@ public class LinkedPositionTest { /* * Class to test for boolean includes(LinkedPosition) - */ + */ @Test public void testIncludesLinkedPosition() { LinkedPosition pos= new LinkedPosition(fDoc, 0, 2); @@ -163,7 +163,7 @@ public class LinkedPositionTest { pos= new LinkedPosition(fDoc, 14, 4); assertFalse(fPos.includes(pos)); } - + @Test public void testGetContent() throws BadLocationException { LinkedPosition p= new LinkedPosition(fDoc, 1, 9); @@ -178,7 +178,7 @@ public class LinkedPositionTest { fDoc.set(GARTEN1); assertEquals("FAUST", p.getContent()); } - + @Test(expected= BadLocationException.class) public void testBadLocationContentNull() throws BadLocationException { LinkedPosition p= new LinkedPosition(new Document(), 23, 3); @@ -191,7 +191,7 @@ public class LinkedPositionTest { fDoc.set(""); p.getContent(); } - + @Test public void testGetSequenceNumber() { LinkedPosition p= new LinkedPosition(fDoc, 1, 9); @@ -200,13 +200,13 @@ public class LinkedPositionTest { p= new LinkedPosition(fDoc, 1, 9, 18); assertEquals(18, p.getSequenceNumber()); } - + @Test public void testSetSequenceNumber() { fPos.setSequenceNumber(28); assertEquals(28, fPos.getSequenceNumber()); } - + @Test public void testEquals() { LinkedPosition p1= new LinkedPosition(fDoc, 1, 9); @@ -214,7 +214,7 @@ public class LinkedPositionTest { assertEquals(p1, p2); } - + @Test public void testNotEquals() { LinkedPosition p1= new LinkedPosition(fDoc, 1, 9); @@ -222,7 +222,7 @@ public class LinkedPositionTest { assertFalse(p1.equals(p2)); } - + @Test public void testNotEqualsPosition() { LinkedPosition p1= new LinkedPosition(fDoc, 1, 9); @@ -230,7 +230,7 @@ public class LinkedPositionTest { assertFalse(p1.equals(p2)); } - + @Test public void testNotEqualsDifferentDoc() { LinkedPosition p1= new LinkedPosition(fDoc, 1, 9); diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/templates/GlobalTemplateVariablesDateTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/templates/GlobalTemplateVariablesDateTest.java index f9abc9e82bc..f84cf4ce7af 100644 --- a/org.eclipse.text.tests/src/org/eclipse/text/tests/templates/GlobalTemplateVariablesDateTest.java +++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/templates/GlobalTemplateVariablesDateTest.java @@ -49,7 +49,7 @@ public class GlobalTemplateVariablesDateTest { fContext= new DocumentTemplateContext(fType, new Document(), 0, 0); } - + @Test public void testWithoutParameter() throws Exception { TemplateBuffer buffer= fTranslator.translate("Today is ${date}!"); @@ -61,7 +61,7 @@ public class GlobalTemplateVariablesDateTest { expected.append("!"); assertBufferStringAndVariables(expected.toString(), buffer); } - + @Test public void testOneParameter() throws Exception { TemplateBuffer buffer= fTranslator.translate("This format ${d:date('dd MMM YYYY')} and not ${p:date('YYYY-MM-dd')}"); @@ -128,7 +128,7 @@ public class GlobalTemplateVariablesDateTest { /** * Ensures that {@link TemplateBuffer#getString()} equals the expected String and that all * {@link TemplateBuffer#getVariables()} are resolved and unambiguous. - * + * * @param expected expected result * @param buffer the template buffer */ diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/templates/TemplateTranslatorTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/templates/TemplateTranslatorTest.java index af749bcbbe8..a6a27cc60bc 100644 --- a/org.eclipse.text.tests/src/org/eclipse/text/tests/templates/TemplateTranslatorTest.java +++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/templates/TemplateTranslatorTest.java @@ -275,7 +275,7 @@ public class TemplateTranslatorTest { public void testIllegallyParameterizedTypeTemplate1() throws Exception { fTranslator.translate("foo ${var:type(param)} bar ${var:type(other)} end"); } - + @Test(expected=TemplateException.class) public void testIllegallyParameterizedTypeTemplate2() throws Exception { fTranslator.translate("foo ${var:type(param)} bar ${var:type} end"); |