Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2018-08-13 07:58:21 -0400
committerAlexander Kurtakov2018-08-13 10:21:20 -0400
commit3a55028d1ca80ea58780dd5b88c40e572db1b773 (patch)
tree7b0aa25d625c574f2a4a9ddf03e679b7866deb62 /bundles/org.eclipse.equinox.p2.tests.ui
parentc26c1d7d18a07fc62dc445b4e03ed1d588464ef2 (diff)
downloadrt.equinox.p2-3a55028d1ca80ea58780dd5b88c40e572db1b773.tar.gz
rt.equinox.p2-3a55028d1ca80ea58780dd5b88c40e572db1b773.tar.xz
rt.equinox.p2-3a55028d1ca80ea58780dd5b88c40e572db1b773.zip
Change-Id: I4c88d405c42ced96054e70f18eac25a093c8f41d Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests.ui')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/importexport/AllTests.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryDescriptorTest.java25
2 files changed, 20 insertions, 10 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/importexport/AllTests.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/importexport/AllTests.java
index 9457b7134..578e8c582 100644
--- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/importexport/AllTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/importexport/AllTests.java
@@ -1,6 +1,5 @@
package org.eclipse.equinox.p2.tests.importexport;
-import junit.framework.TestCase;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
@@ -8,7 +7,7 @@ import org.junit.runners.Suite;
* Performs all automated importexport tests.
*/
@RunWith(Suite.class)
-@Suite.SuiteClasses({ImportExportTests.class, ImportExportRemoteTests.class})
-public class AllTests extends TestCase {
+@Suite.SuiteClasses({ ImportExportTests.class, ImportExportRemoteTests.class })
+public class AllTests {
// test suite
}
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryDescriptorTest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryDescriptorTest.java
index e20c3097e..9e5251645 100644
--- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryDescriptorTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryDescriptorTest.java
@@ -9,20 +9,23 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.ui.query;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
import java.util.*;
-import junit.framework.TestCase;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.equinox.internal.p2.ui.ElementQueryDescriptor;
import org.eclipse.equinox.internal.p2.ui.ElementWrapper;
import org.eclipse.equinox.p2.query.*;
+import org.junit.Test;
/**
* Tests the Query Descriptor
*/
-public class QueryDescriptorTest extends TestCase {
+public class QueryDescriptorTest {
class SimpleQueryable implements IQueryable<String> {
- List<String> elements = Arrays.asList(new String[] {"a", "b", "c", "d", "e"});
+ List<String> elements = Arrays.asList(new String[] { "a", "b", "c", "d", "e" });
@Override
public IQueryResult<String> query(IQuery<String> query, IProgressMonitor monitor) {
@@ -83,33 +86,41 @@ public class QueryDescriptorTest extends TestCase {
}
}
+ @Test
public void testSimpleDescriptorWithWrapper() {
- ElementQueryDescriptor eqDescriptor = new ElementQueryDescriptor(new SimpleQueryable(), new SimpleMatchQuery(), new Collector<>(), new StringWrapper());
+ ElementQueryDescriptor eqDescriptor = new ElementQueryDescriptor(new SimpleQueryable(), new SimpleMatchQuery(),
+ new Collector<>(), new StringWrapper());
Collection<?> collection = eqDescriptor.performQuery(null);
assertEquals("1.0", 2, collection.size());
assertTrue("1.1", collection.contains(new WrappedString("a")));
assertTrue("1.1", collection.contains(new WrappedString("b")));
}
+ @Test
public void testSimpleDescriptorWithoutWrapper() {
- ElementQueryDescriptor eqDescriptor = new ElementQueryDescriptor(new SimpleQueryable(), new SimpleMatchQuery(), new Collector<>());
+ ElementQueryDescriptor eqDescriptor = new ElementQueryDescriptor(new SimpleQueryable(), new SimpleMatchQuery(),
+ new Collector<>());
Collection<?> collection = eqDescriptor.performQuery(null);
assertEquals("1.0", 2, collection.size());
assertTrue("1.1", collection.contains("a"));
assertTrue("1.1", collection.contains("b"));
}
+ @Test
public void testCompoundDescriptorAND() {
IQuery<Object> query = QueryUtil.createCompoundQuery(new SimpleMatchQuery(), new SimpleMatchQuery2(), true);
- ElementQueryDescriptor eqDescriptor = new ElementQueryDescriptor(new SimpleQueryable(), query, new Collector<>(), new StringWrapper());
+ ElementQueryDescriptor eqDescriptor = new ElementQueryDescriptor(new SimpleQueryable(), query,
+ new Collector<>(), new StringWrapper());
Collection<?> collection = eqDescriptor.performQuery(null);
assertEquals("1.0", 1, collection.size());
assertTrue("1.1", collection.contains(new WrappedString("b")));
}
+ @Test
public void testCompoundDescriptorOR() {
IQuery<Object> query = QueryUtil.createCompoundQuery(new SimpleMatchQuery(), new SimpleMatchQuery2(), false);
- ElementQueryDescriptor eqDescriptor = new ElementQueryDescriptor(new SimpleQueryable(), query, new Collector<>(), new StringWrapper());
+ ElementQueryDescriptor eqDescriptor = new ElementQueryDescriptor(new SimpleQueryable(), query,
+ new Collector<>(), new StringWrapper());
Collection<?> collection = eqDescriptor.performQuery(null);
assertEquals("1.0", 3, collection.size());
assertTrue("1.1", collection.contains(new WrappedString("a")));

Back to the top