diff options
author | Dani Megert | 2008-11-19 10:23:13 +0000 |
---|---|---|
committer | Dani Megert | 2008-11-19 10:23:13 +0000 |
commit | c78657c6c12d2aee3e52578b361b21de7beb737e (patch) | |
tree | 5d79a6ff4a074f4a6ff3c482ef2f8cc93b1844d8 /org.eclipse.jface.text.tests | |
parent | 9e84302cc073a51e8f6cbe9573376b0e9d5949b6 (diff) | |
download | eclipse.platform.text-c78657c6c12d2aee3e52578b361b21de7beb737e.tar.gz eclipse.platform.text-c78657c6c12d2aee3e52578b361b21de7beb737e.tar.xz eclipse.platform.text-c78657c6c12d2aee3e52578b361b21de7beb737e.zip |
Added missing Javadoc.
Diffstat (limited to 'org.eclipse.jface.text.tests')
5 files changed, 76 insertions, 41 deletions
diff --git a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/AbstractPairMatcherTest.java b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/AbstractPairMatcherTest.java index dcb9be2a86b..1d6e3947ce0 100644 --- a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/AbstractPairMatcherTest.java +++ b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/AbstractPairMatcherTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006 IBM Corporation and others. + * Copyright (c) 2006, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -35,10 +35,19 @@ import org.eclipse.jface.text.source.ICharacterPairMatcher; */ public abstract class AbstractPairMatcherTest extends TestCase { - /** Constructs a new character pair matcher */ + /** + * Constructs a new character pair matcher. + * + * @param chars the characters to match + * @return the character pair matcher + */ protected abstract ICharacterPairMatcher createMatcher(final String chars); - /** Returns the partitioning treated by the matcher */ + /** + * Returns the partitioning treated by the matcher. + * + * @return the partition + */ protected abstract String getDocumentPartitioning(); public AbstractPairMatcherTest(String name) { @@ -59,7 +68,11 @@ public abstract class AbstractPairMatcherTest extends TestCase { performReaderTest("#%", 0, 0, ""); } - /** Very simple checks */ + /** + * Very simple checks. + * + * @throws BadLocationException + */ public void testSimpleMatchSameMatcher() throws BadLocationException { final ICharacterPairMatcher matcher= createMatcher("()[]{}"); performMatch(matcher, "#( )%"); @@ -71,7 +84,11 @@ public abstract class AbstractPairMatcherTest extends TestCase { matcher.dispose(); } - /** Very simple checks */ + /** + * Very simple checks. + * + * @throws BadLocationException + */ public void testSimpleMatchDifferentMatchers() throws BadLocationException { performMatch("()[]{}", "#( )%"); performMatch("()[]{}", "#[ ]%"); @@ -81,7 +98,11 @@ public abstract class AbstractPairMatcherTest extends TestCase { performMatch("()[]{}", "{% }#"); } - /** Close matches */ + /** + * Close matches. + * + * @throws BadLocationException + */ public void testCloseMatches() throws BadLocationException { final ICharacterPairMatcher matcher= createMatcher("()[]{}"); performMatch(matcher, "#()%"); @@ -94,7 +115,11 @@ public abstract class AbstractPairMatcherTest extends TestCase { } - /** Checks of simple situations where no matches should be found */ + /** + * Checks of simple situations where no matches should be found. + * + * @throws BadLocationException + */ public void testIncompleteMatch() throws BadLocationException { final ICharacterPairMatcher matcher= createMatcher("()[]{}"); performMatch(matcher, "(% "); @@ -105,7 +130,11 @@ public abstract class AbstractPairMatcherTest extends TestCase { matcher.dispose(); } - /** Test that it doesn't match across different partitions */ + /** + * Test that it doesn't match across different partitions. + * + * @throws BadLocationException + */ public void testPartitioned() throws BadLocationException { final ICharacterPairMatcher matcher= createMatcher("()[]{}"); performMatch(matcher, "(% |a a| )#"); @@ -121,7 +150,11 @@ public abstract class AbstractPairMatcherTest extends TestCase { matcher.dispose(); } - /** Test that it works properly next to partition boundaries */ + /** + * Test that it works properly next to partition boundaries. + * + * @throws BadLocationException + */ public void testTightPartitioned() throws BadLocationException { final ICharacterPairMatcher matcher= createMatcher("()[]{}"); performMatch(matcher, "(|b)%b|"); @@ -152,7 +185,11 @@ public abstract class AbstractPairMatcherTest extends TestCase { matcher.dispose(); } - /** Test a few boundary conditions */ + /** + * Test a few boundary conditions. + * + * * @throws BadLocationException + */ public void testBoundaries() throws BadLocationException { final ICharacterPairMatcher matcher= createMatcher("()[]{}"); final StringDocument doc= new StringDocument("abcdefghijkl"); @@ -174,11 +211,14 @@ public abstract class AbstractPairMatcherTest extends TestCase { /* --- U t i l i t i e s --- */ /** - * Checks that the test case reader reads the test case as - * specified + * Checks that the test case reader reads the test case as specified. + * + * @param testString the string to test + * @param expectedPos the expected position + * @param expectedMatch the expected match + * @param expectedString the expected string */ - private void performReaderTest(String testString, int expectedPos, - int expectedMatch, String expectedString) { + private void performReaderTest(String testString, int expectedPos, int expectedMatch, String expectedString) { TestCase t0= createTestCase(testString); assertEquals(expectedPos, t0.fPos); assertEquals(expectedMatch, t0.fMatch); @@ -187,6 +227,9 @@ public abstract class AbstractPairMatcherTest extends TestCase { /** * Checks that the given matcher matches the input as specified. + * + * @param matcher the matcher + * @param testCase the test string */ protected void performMatch(final ICharacterPairMatcher matcher, final String testCase) { final TestCase test= createTestCase(testCase); @@ -218,9 +261,11 @@ public abstract class AbstractPairMatcherTest extends TestCase { } /** - * Creates a text case from a string. In the given string a '%' - * represents the position of the cursor and a '#' represents the - * position of the expected matching character. + * Creates a text case from a string. In the given string a '%' represents the position of the + * cursor and a '#' represents the position of the expected matching character. + * + * @param str the string for which to create the test case + * @return the created test case */ public TestCase createTestCase(String str) { int pos= str.indexOf("%"); diff --git a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/AbstractUndoManagerTest.java b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/AbstractUndoManagerTest.java index 60aa52d3f82..98b49052164 100644 --- a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/AbstractUndoManagerTest.java +++ b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/AbstractUndoManagerTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -142,7 +142,7 @@ public abstract class AbstractUndoManagerTest extends TestCase { String [] strings= new String[count]; for (int i= 0; i < count; i++) { final Position position= createRandomPositionPoisson(document.getLength()); - final String string= createRandomStringPoisson(4); + final String string= createRandomStringPoisson(); document.replace(position.getOffset(), position.getLength(), string); positions[i]= position; strings[i]= string; @@ -442,7 +442,7 @@ public abstract class AbstractUndoManagerTest extends TestCase { return (char) (32 + 95 * Math.random()); } - private static String createRandomStringPoisson(int mean) { + private static String createRandomStringPoisson() { final int length= getRandomPoissonValue(2); return createRandomString(length); } diff --git a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/TestTextViewer.java b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/TestTextViewer.java index 10575a78970..41859b308a8 100644 --- a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/TestTextViewer.java +++ b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/TestTextViewer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -172,12 +172,6 @@ public class TestTextViewer implements ISourceViewer, IDocumentListener { } /** - * @see ITextViewer#adjustVisibleRegion(int, int) - */ - public void adjustVisibleRegion(int p0, int p1) { - } - - /** * @see ITextViewer#overlapsWithVisibleRegion(int, int) */ public boolean overlapsWithVisibleRegion(int p0, int p1) { @@ -210,7 +204,7 @@ public class TestTextViewer implements ISourceViewer, IDocumentListener { } /** - * @see ITextViewer#setDefaultPrefixes(String, String) + * @see ITextViewer#setDefaultPrefixes(String[], String) */ public void setDefaultPrefixes(String[] p0, String p1) { } diff --git a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/TextPresentationTest.java b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/TextPresentationTest.java index eabccf64169..689e8dc81e3 100644 --- a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/TextPresentationTest.java +++ b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/TextPresentationTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -68,23 +68,14 @@ public class TextPresentationTest extends TestCase { fTextPresentation.addStyleRange(fAllRanges[i]); } - /** - * @param end is exclusive - */ private StyleRange createStyleRange(int start, int end, int style) { return createStyleRange(start, end, null, null, style); } - /** - * @param end is exclusive - */ private StyleRange createStyleRange(int start, int end, Color foreground, Color background, int style) { return new StyleRange(start, end - start, foreground, background, style); } - /** - * @param end is exclusive - */ private StyleRange createStyleRange(int start, int end, int foreground, int background, int style) { return createStyleRange(start, end, createColor(foreground, foreground, foreground), createColor(background, background, background), style); } @@ -92,6 +83,11 @@ public class TextPresentationTest extends TestCase { private Display fDisplay= Display.getDefault(); /** + * Creates a new color. + * + * @param red the amount of red in the color + * @param green the amount of green in the color + * @param blue the amount of blue in the color * @return <code>null</code> if any of the parameters is smaller than 0 or greater than 255 */ private Color createColor(int red, int green, int blue) { diff --git a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/reconciler/AbstractReconcilerTest.java b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/reconciler/AbstractReconcilerTest.java index 251306c86f7..a20fbaff584 100644 --- a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/reconciler/AbstractReconcilerTest.java +++ b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/reconciler/AbstractReconcilerTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -171,7 +171,7 @@ public class AbstractReconcilerTest extends TestCase { fReconciler.uninstall(); } - public void testInitialReconcile() throws InterruptedException, BadLocationException { + public void testInitialReconcile() throws InterruptedException { // initially the reconciler is neither active nor dirty // XXX shouldn't it be dirty? assertFalse(isActive()); @@ -277,7 +277,7 @@ public class AbstractReconcilerTest extends TestCase { // assertFalse(isDirty()); } - public void testReplacingDocumentWhenClean() throws InterruptedException, BadLocationException { + public void testReplacingDocumentWhenClean() throws InterruptedException { installDocument(); // replace |