summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Padgett2011-11-08 14:53:40 (EST)
committer Michael Fiedler2011-11-08 16:43:40 (EST)
commit574caf72a920ab26e9d4bdcaafc1bd57ad429ae0 (patch)
tree0dba10d845dbe6375bdd29c765819bd7a9d985c7
parent4a2db1cc6090cc0291685ebaafcd9da2075579b4 (diff)
downloadorg.eclipse.lyo.testsuite-574caf72a920ab26e9d4bdcaafc1bd57ad429ae0.zip
org.eclipse.lyo.testsuite-574caf72a920ab26e9d4bdcaafc1bd57ad429ae0.tar.gz
org.eclipse.lyo.testsuite-574caf72a920ab26e9d4bdcaafc1bd57ad429ae0.tar.bz2
Bug 363219 -- Property encode URL parameters in SimplifiedQueryBaseTests
-rw-r--r--org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/SimplifiedQueryBaseTests.java29
1 files changed, 12 insertions, 17 deletions
diff --git a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/SimplifiedQueryBaseTests.java b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/SimplifiedQueryBaseTests.java
index 3e3f991..c7b485a 100644
--- a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/SimplifiedQueryBaseTests.java
+++ b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/SimplifiedQueryBaseTests.java
@@ -69,9 +69,9 @@ public class SimplifiedQueryBaseTests extends TestsBase {
protected String getQueryUrlForalidEqualsQueryContainsExpectedResources()
throws UnsupportedEncodingException {
- String query = getQueryBase() + "oslc.where=" + queryProperty
- + URLEncoder.encode("=\"" + queryPropertyValue + "\"", "UTF-8")
- + "&oslc.select=" + queryProperty;
+ String query = getQueryBase() + "oslc.where="
+ + URLEncoder.encode(queryProperty + "=\"" + queryPropertyValue + "\"", "UTF-8")
+ + "&oslc.select=" + URLEncoder.encode(queryProperty, "UTF-8");
return query;
}
@@ -79,40 +79,36 @@ public class SimplifiedQueryBaseTests extends TestsBase {
throws UnsupportedEncodingException {
return getQueryBase()
+ "oslc.where="
- + queryProperty
+ URLEncoder
- .encode("!=\"" + queryPropertyValue + "\"", "UTF-8")
- + "&oslc.select=" + queryProperty;
+ .encode(queryProperty + "!=\"" + queryPropertyValue + "\"", "UTF-8")
+ + "&oslc.select=" + URLEncoder.encode(queryProperty, "UTF-8");
}
protected String getQueryUrlForValidLessThanQueryContainsExpectedResources()
throws UnsupportedEncodingException {
return getQueryBase()
+ "oslc.where="
- + queryComparisonProperty
- + URLEncoder.encode("<\"" + queryComparisonValue + "\"",
- "UTF-8") + "&oslc.select=" + queryComparisonProperty;
+ + URLEncoder.encode(queryComparisonProperty + "<\"" + queryComparisonValue + "\"",
+ "UTF-8") + "&oslc.select=" + URLEncoder.encode(queryComparisonProperty, "UTF-8");
}
protected String getQueryUrlForValidGreaterThanQueryContainsExpectedResources()
throws UnsupportedEncodingException {
return getQueryBase()
+ "oslc.where="
- + queryComparisonProperty
- + URLEncoder.encode(">=\"" + queryComparisonValue + "\"",
- "UTF-8") + "&oslc.select=" + queryComparisonProperty;
+ + URLEncoder.encode(queryComparisonProperty + ">=\"" + queryComparisonValue + "\"",
+ "UTF-8") + "&oslc.select=" + URLEncoder.encode(queryComparisonProperty, "UTF-8");
}
protected String getQueryUrlForValidCompoundQueryContainsExpectedResources()
throws UnsupportedEncodingException {
return getQueryBase()
+ "oslc.where="
- + queryProperty
- + URLEncoder.encode("=\"" + queryPropertyValue + "\" and "
+ + URLEncoder.encode(queryProperty + "=\"" + queryPropertyValue + "\" and "
+ queryComparisonProperty + ">=\""
+ queryComparisonValue + "\"", "UTF-8")
- + "&oslc.select=" + queryProperty + ","
- + queryComparisonProperty;
+ + "&oslc.select=" + URLEncoder.encode(queryProperty + ","
+ + queryComparisonProperty, "UTF-8");
}
protected String getQueryUrlForFullTextSearchContainsExpectedResults()
@@ -120,5 +116,4 @@ public class SimplifiedQueryBaseTests extends TestsBase {
return getQueryBase() + "oslc.searchTerms="
+ URLEncoder.encode("\"" + fullTextSearchTerm + "\"", "UTF-8");
}
-
} \ No newline at end of file