Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2013-09-07 13:14:16 +0000
committerChristian W. Damus2013-09-07 13:56:37 +0000
commit8842394d5f70ff7c5682e5087d78bc20d4351b52 (patch)
treec0b73d7c757d787bf05c896c45ab8968a3a5d396 /extraplugins
parentd12ae709cb693b13870c198b78232a38ab207825 (diff)
downloadorg.eclipse.papyrus-8842394d5f70ff7c5682e5087d78bc20d4351b52.tar.gz
org.eclipse.papyrus-8842394d5f70ff7c5682e5087d78bc20d4351b52.tar.xz
org.eclipse.papyrus-8842394d5f70ff7c5682e5087d78bc20d4351b52.zip
415371: Regression tests for CDO model search
https://bugs.eclipse.org/bugs/show_bug.cgi?id=415371
Diffstat (limited to 'extraplugins')
-rw-r--r--extraplugins/cdo/org.eclipse.papyrus.cdo.core/META-INF/MANIFEST.MF3
-rw-r--r--extraplugins/cdo/org.eclipse.papyrus.cdo.uml.search.ui/META-INF/MANIFEST.MF6
-rw-r--r--extraplugins/cdo/org.eclipse.papyrus.cdo.uml.search.ui/about.html28
-rw-r--r--extraplugins/cdo/org.eclipse.papyrus.cdo.uml.search.ui/build.properties3
-rw-r--r--extraplugins/cdo/org.eclipse.papyrus.cdo.uml.search.ui/src/org/eclipse/papyrus/cdo/uml/search/internal/ui/query/CDOSearchQueryProvider.java2
-rw-r--r--extraplugins/cdo/org.eclipse.papyrus.cdo.uml.search.ui/src/org/eclipse/papyrus/cdo/uml/search/internal/ui/query/PatternUtil.java14
6 files changed, 47 insertions, 9 deletions
diff --git a/extraplugins/cdo/org.eclipse.papyrus.cdo.core/META-INF/MANIFEST.MF b/extraplugins/cdo/org.eclipse.papyrus.cdo.core/META-INF/MANIFEST.MF
index 041bf4e47fc..f6abd548710 100644
--- a/extraplugins/cdo/org.eclipse.papyrus.cdo.core/META-INF/MANIFEST.MF
+++ b/extraplugins/cdo/org.eclipse.papyrus.cdo.core/META-INF/MANIFEST.MF
@@ -12,7 +12,8 @@ Export-Package: org.eclipse.papyrus.cdo.core,
org.eclipse.papyrus.cdo.uml.ui,
org.eclipse.papyrus.cdo.ui.customization.properties,
org.eclipse.papyrus.cdo.uml.ui.tests,
- org.eclipse.papyrus.cdo.uml.search.ui",
+ org.eclipse.papyrus.cdo.uml.search.ui,
+ org.eclipse.papyrus.cdo.uml.search.ui.tests",
org.eclipse.papyrus.cdo.internal.core.exporter;x-friends:="org.eclipse.papyrus.cdo.core.tests,org.eclipse.papyrus.cdo.ui",
org.eclipse.papyrus.cdo.internal.core.expressions;x-friends:="org.eclipse.papyrus.cdo.core.tests,org.eclipse.papyrus.cdo.ui",
org.eclipse.papyrus.cdo.internal.core.importer;x-friends:="org.eclipse.papyrus.cdo.core.tests,org.eclipse.papyrus.cdo.ui",
diff --git a/extraplugins/cdo/org.eclipse.papyrus.cdo.uml.search.ui/META-INF/MANIFEST.MF b/extraplugins/cdo/org.eclipse.papyrus.cdo.uml.search.ui/META-INF/MANIFEST.MF
index aa5584e65a7..474122ed569 100644
--- a/extraplugins/cdo/org.eclipse.papyrus.cdo.uml.search.ui/META-INF/MANIFEST.MF
+++ b/extraplugins/cdo/org.eclipse.papyrus.cdo.uml.search.ui/META-INF/MANIFEST.MF
@@ -22,8 +22,8 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.9.0",
org.eclipse.papyrus.infra.services.openelement;bundle-version="0.10.1",
org.eclipse.papyrus.cdo.ui;bundle-version="0.10.1"
Export-Package: org.eclipse.papyrus.cdo.uml.search.internal.ui;x-internal:=true,
- org.eclipse.papyrus.cdo.uml.search.internal.ui.open;x-internal:=true,
- org.eclipse.papyrus.cdo.uml.search.internal.ui.query;x-internal:=true,
- org.eclipse.papyrus.cdo.uml.search.internal.ui.scope;x-internal:=true
+ org.eclipse.papyrus.cdo.uml.search.internal.ui.open;x-friends:="org.eclipse.papyrus.cdo.uml.search.ui.tests",
+ org.eclipse.papyrus.cdo.uml.search.internal.ui.query;x-friends:="org.eclipse.papyrus.cdo.uml.search.ui.tests",
+ org.eclipse.papyrus.cdo.uml.search.internal.ui.scope;x-friends:="org.eclipse.papyrus.cdo.uml.search.ui.tests"
Import-Package: com.google.common.base;version="10.0.0",
com.google.common.collect;version="10.0.0"
diff --git a/extraplugins/cdo/org.eclipse.papyrus.cdo.uml.search.ui/about.html b/extraplugins/cdo/org.eclipse.papyrus.cdo.uml.search.ui/about.html
new file mode 100644
index 00000000000..dd3c089a94c
--- /dev/null
+++ b/extraplugins/cdo/org.eclipse.papyrus.cdo.uml.search.ui/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>November 14, 2008</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/extraplugins/cdo/org.eclipse.papyrus.cdo.uml.search.ui/build.properties b/extraplugins/cdo/org.eclipse.papyrus.cdo.uml.search.ui/build.properties
index 30b2fc40bd8..f7540fbc534 100644
--- a/extraplugins/cdo/org.eclipse.papyrus.cdo.uml.search.ui/build.properties
+++ b/extraplugins/cdo/org.eclipse.papyrus.cdo.uml.search.ui/build.properties
@@ -3,4 +3,5 @@ output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.properties,\
- plugin.xml
+ plugin.xml,\
+ about.html
diff --git a/extraplugins/cdo/org.eclipse.papyrus.cdo.uml.search.ui/src/org/eclipse/papyrus/cdo/uml/search/internal/ui/query/CDOSearchQueryProvider.java b/extraplugins/cdo/org.eclipse.papyrus.cdo.uml.search.ui/src/org/eclipse/papyrus/cdo/uml/search/internal/ui/query/CDOSearchQueryProvider.java
index 939be7a04a8..95f421f890a 100644
--- a/extraplugins/cdo/org.eclipse.papyrus.cdo.uml.search.ui/src/org/eclipse/papyrus/cdo/uml/search/internal/ui/query/CDOSearchQueryProvider.java
+++ b/extraplugins/cdo/org.eclipse.papyrus.cdo.uml.search.ui/src/org/eclipse/papyrus/cdo/uml/search/internal/ui/query/CDOSearchQueryProvider.java
@@ -147,7 +147,7 @@ public class CDOSearchQueryProvider implements IPapyrusQueryProvider {
}
protected Pair<String, Boolean> getSearchPattern(QueryInfo queryInfo) {
- String searchPattern = PatternUtil.wrap(queryInfo.getQueryText(), queryInfo.isCaseSensitive(), queryInfo.isRegularExpression());
+ String searchPattern = PatternUtil.wrap(queryInfo.getQueryText(), queryInfo.isCaseSensitive(), queryInfo.isRegularExpression(), queryInfo.isSearchAllStringAttributes());
boolean isRegexMatch = searchPattern != null;
if(!isRegexMatch) {
searchPattern = queryInfo.getQueryText();
diff --git a/extraplugins/cdo/org.eclipse.papyrus.cdo.uml.search.ui/src/org/eclipse/papyrus/cdo/uml/search/internal/ui/query/PatternUtil.java b/extraplugins/cdo/org.eclipse.papyrus.cdo.uml.search.ui/src/org/eclipse/papyrus/cdo/uml/search/internal/ui/query/PatternUtil.java
index 5a7514bf70b..b4c67f63a02 100644
--- a/extraplugins/cdo/org.eclipse.papyrus.cdo.uml.search.ui/src/org/eclipse/papyrus/cdo/uml/search/internal/ui/query/PatternUtil.java
+++ b/extraplugins/cdo/org.eclipse.papyrus.cdo.uml.search.ui/src/org/eclipse/papyrus/cdo/uml/search/internal/ui/query/PatternUtil.java
@@ -37,17 +37,25 @@ public class PatternUtil {
* @param caseSensitive
* whether the search is case-sensitive
* @param regularExpression
- * whether the search tex is to be interpreted as a regular expression
+ * whether the search text is to be interpreted as a regular expression
+ * @param allStringAttributes
+ * whether the search text is sought in all string attributes of an object
*
* @return the appropriately modified string specifying the regular expression search term, or {@code null} if the search text
* is actually a literal exact sub-string match
*/
- public static String wrap(String searchText, boolean caseSensitive, boolean regularExpression) {
+ public static String wrap(String searchText, boolean caseSensitive, boolean regularExpression, boolean allStringAttributes) {
String result;
if(caseSensitive) {
if(!regularExpression) {
- result = null; // simple sub-string search
+ if(allStringAttributes) {
+ // the cdoMatches() operation needs a regex
+ result = String.format("%s%s%s", WILDCARD, quote(searchText), WILDCARD);
+ } else {
+ // we use "indexOf(searchPattern) > 0" to do a simple sub-string search
+ result = null;
+ }
} else {
result = ensureRegexSubstring(searchText);
}

Back to the top