diff options
author | Alexander Kurtakov | 2020-02-10 09:33:59 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2020-02-10 20:46:18 +0000 |
commit | 83e3ecbc3b9842bb8cc66a1b15852475d66ea474 (patch) | |
tree | a98552bd2b1c60e6b80eb908e0299ccfe8578e5c | |
parent | 8c462cbe1b0bb1b55e3736ec58f92919d4d784a1 (diff) | |
download | eclipse.platform.text-83e3ecbc3b9842bb8cc66a1b15852475d66ea474.tar.gz eclipse.platform.text-83e3ecbc3b9842bb8cc66a1b15852475d66ea474.tar.xz eclipse.platform.text-83e3ecbc3b9842bb8cc66a1b15852475d66ea474.zip |
Convert quicksearch.tests to JUnit 4.xI20200210-1800
Change-Id: Ie68384f883c0dcd94994e3df6f2883ac2b8397dc
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
3 files changed, 15 insertions, 12 deletions
diff --git a/org.eclipse.text.quicksearch.tests/META-INF/MANIFEST.MF b/org.eclipse.text.quicksearch.tests/META-INF/MANIFEST.MF index 843c96cbdf9..78e20dec047 100644 --- a/org.eclipse.text.quicksearch.tests/META-INF/MANIFEST.MF +++ b/org.eclipse.text.quicksearch.tests/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.text.quicksearch.tests -Bundle-Version: 1.0.100.qualifier +Bundle-Version: 1.0.200.qualifier Require-Bundle: org.eclipse.core.runtime, org.eclipse.text.quicksearch, org.eclipse.core.resources, diff --git a/org.eclipse.text.quicksearch.tests/pom.xml b/org.eclipse.text.quicksearch.tests/pom.xml index fe8c851c4d8..196a7adb225 100644 --- a/org.eclipse.text.quicksearch.tests/pom.xml +++ b/org.eclipse.text.quicksearch.tests/pom.xml @@ -24,7 +24,7 @@ </parent> <groupId>org.eclipse.text</groupId> <artifactId>org.eclipse.text.quicksearch.tests</artifactId> - <version>1.0.100-SNAPSHOT</version> + <version>1.0.200-SNAPSHOT</version> <packaging>eclipse-test-plugin</packaging> <properties> <testSuite>${project.artifactId}</testSuite> diff --git a/org.eclipse.text.quicksearch.tests/src/org/eclipse/text/quicksearch/tests/PrioriTreeTest.java b/org.eclipse.text.quicksearch.tests/src/org/eclipse/text/quicksearch/tests/PrioriTreeTest.java index ac972c420af..89318075aad 100644 --- a/org.eclipse.text.quicksearch.tests/src/org/eclipse/text/quicksearch/tests/PrioriTreeTest.java +++ b/org.eclipse.text.quicksearch.tests/src/org/eclipse/text/quicksearch/tests/PrioriTreeTest.java @@ -12,23 +12,23 @@ package org.eclipse.text.quicksearch.tests; import static org.eclipse.text.quicksearch.internal.core.priority.PriorityFunction.PRIORITY_DEFAULT; import static org.eclipse.text.quicksearch.internal.core.priority.PriorityFunction.PRIORITY_IGNORE; +import static org.junit.Assert.assertEquals; import org.eclipse.core.runtime.Path; import org.eclipse.text.quicksearch.internal.core.priority.PrioriTree; +import org.junit.Before; +import org.junit.Test; -import junit.framework.TestCase; - -@SuppressWarnings("restriction") -public class PrioriTreeTest extends TestCase { +public class PrioriTreeTest { PrioriTree tree; - @Override - protected void setUp() throws Exception { - super.setUp(); + @Before + public void setUp() throws Exception { tree = PrioriTree.create(); } + @Test public void testWithEmptyTree() { //In the empty tree most paths are assigned 'DEFAULT' priority. checkPriority(PRIORITY_DEFAULT, "/"); @@ -47,7 +47,7 @@ public class PrioriTreeTest extends TestCase { checkPriority(PRIORITY_IGNORE, "/project/build"); } - + @Test public void testSinglePathSet() { setPriority("/foo/bar/zor", 100.0); @@ -70,7 +70,7 @@ public class PrioriTreeTest extends TestCase { checkPriority(PRIORITY_IGNORE, "/foo/bar/zor/nested/big.zip"); } - + @Test public void testSetOverlappingPaths() { setPriority("/shared/foo", 50.0); setPriority("/shared/bar", 100.0); @@ -93,6 +93,7 @@ public class PrioriTreeTest extends TestCase { * priority set operations is reversed. The result should * be the same. */ + @Test public void testSetOverlappingPaths2() { setPriority("/shared/bar", 100.0); setPriority("/shared/foo", 50.0); @@ -111,6 +112,7 @@ public class PrioriTreeTest extends TestCase { /** * Need support for setting priority of an entire subtree. */ + @Test public void testSetTreePriority() { setPriority("/promoted", 100.0); @@ -130,6 +132,7 @@ public class PrioriTreeTest extends TestCase { * Check that setting priotity of a tree raises children priority also if those * children already had a priority assigned before. */ + @Test public void testSetTreePriority2() { setPriority("/promoted/sub/sub", 50.0); checkPriority(50.0, "/promoted"); @@ -159,7 +162,7 @@ public class PrioriTreeTest extends TestCase { private void checkPriority(double expected, String pathStr) { assertEquals(pathStr, - expected, tree.priority(new MockResource(pathStr))); + expected, tree.priority(new MockResource(pathStr)), 0); } } |