Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'release/22.0.6-BETA'

  • Loading branch information...
commit 2ccf9d30e68f92e48e53ade1fdf77a425e4ca7e9 2 parents 3ff62c6 + c28edb5
Nawab Iqbal authored

Showing 72 changed files with 652 additions and 297 deletions. Show diff stats Hide diff stats

  1. +1 1  build-tools/pom.xml
  2. +1 1  codegen/pom.xml
  3. +7 8 connector/doc/connection-url.md
  4. +0 25 connector/doc/native-api.md
  5. +2 2 connector/pom.xml
  6. +1 1  connector/src/main/java/com/force/sdk/connector/ForceConnectorConfig.java
  7. +68 15 connector/src/main/java/com/force/sdk/connector/ForceConnectorUtils.java
  8. +22 25 connector/src/test/java/com/force/sdk/connector/ForceConnectorConfigTest.java
  9. +2 2 connector/src/test/resources/cliforce.properties
  10. +1 1  connector/src/test/resources/unitconnurl.properties
  11. +13 5 doc/force-sdk-overview.md
  12. +3 7 doc/quick-start.md
  13. +5 5 doc/sts.md
  14. +1 1  javasdk-test/codegen-test/pom.xml
  15. +2 2 javasdk-test/connector-test/pom.xml
  16. +2 2 javasdk-test/connector-test/src/test/java/com/force/sdk/connector/BaseForceServiceConnectorTest.java
  17. +2 2 javasdk-test/connector-test/src/test/java/com/force/sdk/connector/ForceServiceConnectorCacheTest.java
  18. +1 1  javasdk-test/connector-test/src/test/java/com/force/sdk/connector/NegativeForceServiceConnectorTest.java
  19. +1 1  javasdk-test/connector-test/src/test/resources/funcconnurl.properties
  20. +1 1  javasdk-test/jpa-test-beanvalidation/pom.xml
  21. +2 2 javasdk-test/jpa-test-connection/pom.xml
  22. +2 2 javasdk-test/jpa-test-connection/src/test/java/com/force/sdk/jpa/connection/BaseJPAConnectionTest.java
  23. +26 6 javasdk-test/jpa-test-connection/src/test/java/com/force/sdk/jpa/connection/BasicJPAConnectionTest.java
  24. +22 5 javasdk-test/jpa-test-connection/src/test/resources/META-INF/persistence.xml
  25. +1 1  javasdk-test/jpa-test-connection/src/test/resources/connUrlPropFile.properties
  26. +1 1  javasdk-test/jpa-test-connection/src/test/resources/connUrlWithOptionsPropFile.properties
  27. +1 1  javasdk-test/jpa-test-query/pom.xml
  28. +1 1  javasdk-test/jpa-test-schema/pom.xml
  29. +12 2 javasdk-test/jpa-test/pom.xml
  30. +1 1  javasdk-test/jpa-test/src/test/resources/META-INF/persistence.xml
  31. +2 2 javasdk-test/mock-oauth-server/pom.xml
  32. +2 2 javasdk-test/oauth-app/pom.xml
  33. +6 6 javasdk-test/oauth-app/src/main/webapp/WEB-INF/web.xml
  34. +2 2 javasdk-test/oauth-integration-test/pom.xml
  35. +1 1  javasdk-test/oauth-integration-test/testng-endtoend.xml
  36. +7 4 javasdk-test/oauth-test/pom.xml
  37. +2 2 javasdk-test/oauth-test/src/test/java/com/force/sdk/oauth/BaseOAuthTest.java
  38. +41 1 javasdk-test/oauth-test/src/test/java/com/force/sdk/oauth/BasicAuthFilterTest.java
  39. +1 1  javasdk-test/oauth-test/src/test/java/com/force/sdk/oauth/connector/BasicForceOAuthConnectorTest.java
  40. +20 23 javasdk-test/oauth-test/src/test/java/com/force/sdk/oauth/connector/ForceOAuthConnectionInfoTest.java
  41. +1 1  javasdk-test/oauth-test/src/test/resources/funcconnurl.properties
  42. +1 1  javasdk-test/oauth-test/src/test/resources/unitconnurl.properties
  43. +1 1  javasdk-test/pom.xml
  44. +1 1  javasdk-test/qa-utils/pom.xml
  45. +3 3 javasdk-test/qa-utils/src/main/java/com/force/sdk/qa/util/integration/BaseSecurityIntegrationTest.java
  46. +24 0 javasdk-test/qa-utils/src/main/java/com/force/sdk/qa/util/jpa/BaseJPAFTest.java
  47. +1 1  javasdk-test/qa-utils/src/main/resources/force-sdk-test.properties
  48. +2 2 javasdk-test/springsecurity-app/pom.xml
  49. +3 2 javasdk-test/springsecurity-app/src/main/webapp/WEB-INF/security-config-ns.xml
  50. +2 2 javasdk-test/springsecurity-integration-test/pom.xml
  51. +22 1 javasdk-test/springsecurity-test/pom.xml
  52. +41 23 ...st/springsecurity-test/src/test/java/com/force/sdk/springsecurity/config/OAuthBeanDefinitionParserTest.java
  53. +58 0 javasdk-test/springsecurity-test/src/test/resources/security-config-ns-connUrl-env.xml
  54. +58 0 javasdk-test/springsecurity-test/src/test/resources/security-config-ns-connUrl-javaprop.xml
  55. +1 1  javasdk-test/springsecurity-test/src/test/resources/security-config-ns-connUrl.xml
  56. +25 25 jpa/doc/database-com-datatypes.md
  57. +8 8 jpa/doc/java-db-com-datatypes-map.md
  58. +3 3 jpa/doc/jpa-annotations-custom.md
  59. +4 4 jpa/doc/jpa-config-persistence.md
  60. +3 3 jpa/doc/jpa-cud.md
  61. +1 1  jpa/doc/jpa-provider.md
  62. +1 1  jpa/doc/jpa-queries-soql.md
  63. +1 1  jpa/doc/jpa-queries.md
  64. +1 1  jpa/pom.xml
  65. +32 11 jpa/src/main/java/com/force/sdk/jpa/ForceStoreManager.java
  66. +4 4 oauth/doc/oauth-auth.md
  67. +1 1  oauth/pom.xml
  68. +12 1 oauth/src/main/java/com/force/sdk/oauth/AuthFilter.java
  69. +1 1  oauth/src/main/java/com/force/sdk/oauth/connector/ForceOAuthConnectionInfo.java
  70. +2 2 pom.xml
  71. +44 16 springsecurity/doc/spring-security.md
  72. +1 1  springsecurity/pom.xml
2  build-tools/pom.xml
@@ -4,7 +4,7 @@
4 4 <parent>
5 5 <groupId>com.force.sdk</groupId>
6 6 <artifactId>force-sdk</artifactId>
7   - <version>22.0.5-BETA</version>
  7 + <version>22.0.6-BETA</version>
8 8 </parent>
9 9
10 10 <modelVersion>4.0.0</modelVersion>
2  codegen/pom.xml
@@ -4,7 +4,7 @@
4 4 <parent>
5 5 <groupId>com.force.sdk</groupId>
6 6 <artifactId>force-sdk</artifactId>
7   - <version>22.0.5-BETA</version>
  7 + <version>22.0.6-BETA</version>
8 8 </parent>
9 9
10 10 <modelVersion>4.0.0</modelVersion>
15 connector/doc/connection-url.md
Source Rendered
@@ -45,7 +45,7 @@ You can encode the JPA connection information for the default integration user a
45 45 The format of a connection URL that includes JPA connection information for the default integration user and OAuth credentials is:
46 46
47 47 <pre>
48   - <code>force://login.salesforce.com;user=<em>user@salesforcedoc.org</em>;password=<em>samplePassword</em>;oauth_key=<em>xyz</em>;oauth_secret=<em>abc</em></code>
  48 + <code>force://login.salesforce.com?user=<em>user@salesforcedoc.org</em>&password=<em>samplePassword</em>&oauth_key=<em>xyz</em>&oauth_secret=<em>abc</em></code>
49 49 </pre>
50 50
51 51 Substitute values in the *user* and *password* fields with the username and password for the default integration user.
@@ -56,11 +56,10 @@ There is also an optional *timeout* parameter, which is the number of millisecon
56 56 timing out. This parameter is equivalent to the **datanucleus.datastoreReadTimeout** property in `persistence.xml`. This connection URL shows sample usage:
57 57
58 58 <pre>
59   - <code>force://login.salesforce.com;user=<em>user@salesforcedoc.org</em>;password=<em>samplePassword</em>;timeout=<em>10000</em></code>
  59 + <code>force://login.salesforce.com?user=<em>user@salesforcedoc.org</em>&password=<em>samplePassword</em>&timeout=<em>10000</em></code>
60 60 </pre>
61 61
62   -Each version of the Database.com Java SDK is automatically linked with an API version. For example, version 22.0.0 of the SDK
63   -uses API version 22.0. For JPA functionality, the major version of the SDK must always match the API version. To use a native API connection class to override the default API version for the SDK, see <a href="native-api#setAPIversion">Setting an API Version</a>.
  62 +Each version of the Database.com Java SDK is automatically linked with an API version. The major version of the SDK matches the major version of the API. For example, version 22.0.0 of the SDK uses API version 22.0.
64 63
65 64 <a name ="configConnectionURL"> </a>
66 65 ## Configuring Connection URLs
@@ -106,14 +105,14 @@ information for this persistence unit in a Java system property named force.*per
106 105 The following code shows you how to set the authentication information in a Java system property:
107 106
108 107 System.setProperty("force.persistenceUnitName.url",
109   - "force://login.salesforce.com;user=user@salesforcedoc.org;password=samplePassword");
  108 + "force://login.salesforce.com?user=user@salesforcedoc.org&password=samplePassword");
110 109
111 110 If you use a Java system property to set the authentication information, you must include <code>\<property
112 111 name="datanucleus.storeManagerType" value="force"/></code> in the <code>persistence-unit</code> element in your application's
113 112 `persistence.xml` file.
114 113
115 114 <a name="propFile"> </a>
116   -### Connection Properties File
  115 +### Connection URL in Properties file in the Classpath
117 116
118 117 You can set the connection URL in a properties file in the classpath. If you add the properties file to the `src/main/resources` directory of your
119 118 application, Maven automatically copies it to your classpath.
@@ -129,13 +128,13 @@ information for this persistence unit in a *persistenceUnitName*.properties file
129 128
130 129 A file containing this line is an example of a properties file containing a url property.
131 130
132   - url=force://login.salesforce.com;user=user@salesforcedoc.org;password=samplePassword
  131 + url=force://login.salesforce.com?user=user@salesforcedoc.org&password=samplePassword
133 132
134 133 <!-- Comment out until release cliforce. Uncomment this section and add a link to the bullet list earlier in the file when ready.
135 134 <a name="UrlConnectionsPropFile"> </a>
136 135
137 136 You can set the connection URL in the $HOME/.force/cliforce_urls file, where $HOME refers to your home directory. The format is:
138 137
139   - persistenceUnitName=force://login.salesforce.com;user=user@salesforcedoc.org;password=samplePassword
  138 + persistenceUnitName=force://login.salesforce.com?user=user@salesforcedoc.org&password=samplePassword
140 139
141 140 -->
25 connector/doc/native-api.md
Source Rendered
@@ -26,31 +26,6 @@ The BulkConnection class enables you to execute Bulk API requests. The Bulk API
26 26
27 27 [Read more about the Bulk API](http://www.salesforce.com/us/developer/docs/api_asynch/)
28 28
29   -<a name="setAPIversion"> </a>
30   -## Setting an API Version
31   -
32   -By default, a Database.com Service Connector is bound to the API whose major version matches its own. For example, a service connector from SDK version 22.0.0 is automatically bound to API version 22.0.
33   -
34   - // ForceConnectorConfig, ForceServiceConnector from SDK 22.0.0
35   - ForceConnectorConfig config = new ForceConnectorConfig();
36   - config.setConnectionUrl("force://login.salesforce.com;user=user@salesforcedoc.org;password=samplePassword");
37   -
38   - // Gets a connection to API version 22.0
39   - ForceServiceConnector connector = new ForceServiceConnector(config);
40   - PartnerConnection connection = connector.getConnection();
41   -
42   -However, for certain advanced use cases, you may wish to issue native API calls to a different version of the API. To do this, you can override the default API version bound to a service connector by specifying a fully qualified API endpoint. In the following example, we are getting an API version 23.0 connection using SDK version 22.0.0.
43   -
44   - // ForceConnectorConfig, ForceServiceConnector from SDK 22.0.0
45   - ForceConnectorConfig config = new ForceConnectorConfig();
46   - config.setConnectionUrl("force://login.salesforce.com/services/Soap/u/23.0;user=user@salesforcedoc.org;password=samplePassword");
47   -
48   - // Gets a connection to API version 23.0
49   - ForceServiceConnector connector = new ForceServiceConnector(config);
50   - PartnerConnection connection = connector.getConnection();
51   -
52   -For more information about connection endpoints, see [Connection Configuration](connection-url#configConnectionURL).
53   -
54 29 ## API Queries
55 30
56 31 An alternative to using JPQL or SOQL queries is to bypass JPA and execute a [query()](http://www.salesforce.com/us/developer/docs/api/index_Left.htm#StartTopic=Content/sforce_api_calls_query.htm) call using the Web services API. The advantage of using JPQL or SOQL rather than a <code>query()</code> call is that JPA entities are
4 connector/pom.xml
@@ -4,7 +4,7 @@
4 4 <parent>
5 5 <groupId>com.force.sdk</groupId>
6 6 <artifactId>force-sdk</artifactId>
7   - <version>22.0.5-BETA</version>
  7 + <version>22.0.6-BETA</version>
8 8 </parent>
9 9
10 10 <modelVersion>4.0.0</modelVersion>
@@ -21,7 +21,7 @@
21 21 <configuration>
22 22 <environmentVariables>
23 23 <FORCE_ENVVARCONN_URL>
24   - force://url;user=user;password=password
  24 + force://url?user=user&amp;password=password
25 25 </FORCE_ENVVARCONN_URL>
26 26 </environmentVariables>
27 27 </configuration>
2  connector/src/main/java/com/force/sdk/connector/ForceConnectorConfig.java
@@ -171,7 +171,7 @@ public void setConnectionUrl(String connectionUrl) {
171 171 Map<ForceConnectionProperty, String> propMap = ForceConnectorUtils.loadConnectorPropsFromUrl(connectionUrl);
172 172 if (propMap == null || propMap.size() < MIN_CONN_URL_PROPS) {
173 173 throw new IllegalArgumentException("The connection url (" + connectionUrl + ") must contain at least three parts. "
174   - + "It should be in the form force://<endPoint>;user=<user>;password=<password>");
  174 + + "It should be in the form force://<endPoint>?user=<user>&password=<password>");
175 175 }
176 176
177 177 setPropsFromMap(propMap, connectionUrl);
83 connector/src/main/java/com/force/sdk/connector/ForceConnectorUtils.java
@@ -34,6 +34,8 @@
34 34 import java.io.IOException;
35 35 import java.io.InputStream;
36 36 import java.net.MalformedURLException;
  37 +import java.net.URI;
  38 +import java.net.URISyntaxException;
37 39 import java.net.URL;
38 40 import java.util.HashMap;
39 41 import java.util.Map;
@@ -126,6 +128,47 @@ public static String buildForceApiEndpoint(String endpoint) {
126 128 }
127 129
128 130 /**
  131 + * Returns true if var has some value enclosed in ${ and }; which means that user intended the value to be injected from
  132 + * system variables or environment variables.
  133 + * @param var any string.
  134 + * @return true if var is enclosed by ${ and }
  135 + */
  136 + public static boolean isInjectable(String var) {
  137 + return var != null && var.startsWith("${") && var.endsWith("}");
  138 + }
  139 +
  140 + /**
  141 + * This method will fetch and return the value of 'var' from system variables and if not found in system variables
  142 + * then in environment variables.
  143 + * @param var name of var enclosed by ${ and }
  144 + * @return value of var
  145 + */
  146 + public static String extractValue(String var) {
  147 + if (var != null) {
  148 + if (!var.startsWith("${") || !var.endsWith("}")) {
  149 + return null;
  150 + }
  151 +
  152 + var = var.replace("${" , "");
  153 + var = var.substring(0, var.length() - 1);
  154 +
  155 + if (var != null) {
  156 + if (System.getProperty(var) != null) {
  157 + LOGGER.info("Connection : loading " + var + " from Java System Properties");
  158 + return System.getProperty(var);
  159 + }
  160 +
  161 + if (System.getenv(var) != null) {
  162 + LOGGER.info("Connection : loading " + var + " from Environment Variables");
  163 + return System.getenv(var);
  164 + }
  165 + }
  166 + }
  167 +
  168 + return null;
  169 + }
  170 +
  171 + /**
129 172 * Loads Force.com connection properties from a connection name.
130 173 * <p>
131 174 * A connection name can represent connection properties in several
@@ -272,31 +315,41 @@ public static String buildForceApiEndpoint(String endpoint) {
272 315 if (connectionUrl == null) throw new IllegalArgumentException("Connection url cannot be null.");
273 316
274 317 // Parse the connection url
275   - String[] parsedConnectionUrl = connectionUrl.split(";");
276   - for (int i = 0; i < parsedConnectionUrl.length; i++) {
277   - parsedConnectionUrl[i] = parsedConnectionUrl[i].trim();
  318 + URI connectionUri;
  319 + try {
  320 + connectionUri = new URI(connectionUrl);
  321 + } catch (URISyntaxException e) {
  322 + throw new IllegalArgumentException("Unable to parse connection url (" + connectionUrl + ")", e);
278 323 }
279 324
280 325 // Basic validation of connection url
281   - if (parsedConnectionUrl.length < 0) throw new IllegalArgumentException("Connection url cannot be empty.");
282   - if (!parsedConnectionUrl[0].startsWith("force://")) {
  326 + if (!"force".equals(connectionUri.getScheme())) {
283 327 throw new IllegalArgumentException("Illegal prefix for connection url (" + connectionUrl + "). "
284 328 + "It must start with force://");
285   - } else {
286   - // Strip out the "force://" prefix
287   - parsedConnectionUrl[0] = parsedConnectionUrl[0].split("://", 2)[1];
288 329 }
289   -
290   - Map<ForceConnectionProperty, String> connectorPropMap =
291   - new HashMap<ForceConnectionProperty, String>(parsedConnectionUrl.length);
  330 +
  331 + Map<ForceConnectionProperty, String> connectorPropMap = new HashMap<ForceConnectionProperty, String>(3);
292 332
293 333 // In a connection url, the endpoint won't be marked with a property key
294 334 // so add it here first
295   - ForceConnectionProperty.ENDPOINT.validateValue(parsedConnectionUrl[0], "Illegal connection url (" + connectionUrl + ").");
296   - connectorPropMap.put(ForceConnectionProperty.ENDPOINT, parsedConnectionUrl[0]);
  335 + String endpoint = connectionUri.getHost();
  336 + if (endpoint != null) {
  337 + StringBuffer sb = new StringBuffer(endpoint);
  338 + if (connectionUri.getPort() > -1) sb.append(":").append(connectionUri.getPort());
  339 + if (connectionUri.getPath() != null) sb.append(connectionUri.getPath());
  340 +
  341 + endpoint = sb.toString();
  342 + }
  343 +
  344 + ForceConnectionProperty.ENDPOINT.validateValue(endpoint, "Illegal connection url (" + connectionUrl + ").");
  345 + connectorPropMap.put(ForceConnectionProperty.ENDPOINT, endpoint);
297 346
298   - for (int i = 1; i < parsedConnectionUrl.length; i++) {
299   - String[] parsedUrlProperty = parsedConnectionUrl[i].split("=", 2);
  347 + String queryString = connectionUri.getQuery();
  348 + if (queryString == null) return connectorPropMap;
  349 +
  350 + String[] parsedQueryString = connectionUri.getQuery().split("&");
  351 + for (String queryParam : parsedQueryString) {
  352 + String[] parsedUrlProperty = queryParam.split("=", 2);
300 353
301 354 if (parsedUrlProperty.length == 2) {
302 355 ForceConnectionProperty connProp = ForceConnectionProperty.fromPropertyName(parsedUrlProperty[0]);
47 connector/src/test/java/com/force/sdk/connector/ForceConnectorConfigTest.java
@@ -104,7 +104,7 @@ public void testLoadFromEnvVariable(String connectionName) throws Exception {
104 104 @Test(dataProvider = "javaPropertyProvider")
105 105 public void testLoadFromJavaProperty(String propName, String connectionName) throws Exception {
106 106 try {
107   - System.setProperty(propName, "force://url;user=user@org.com;password=password");
  107 + System.setProperty(propName, "force://url?user=user@org.com&password=password");
108 108 ForceConnectorConfig config = ForceConnectorConfig.loadFromName(connectionName);
109 109 assertNotNull(config);
110 110
@@ -119,7 +119,7 @@ public void testLoadFromJavaProperty(String propName, String connectionName) thr
119 119 @Test
120 120 public void testLoadFromJavaPropertyIsCaseSensitive() throws Exception {
121 121 try {
122   - System.setProperty("force.xyz.url", "force://url;user=user@org.com;password=password");
  122 + System.setProperty("force.xyz.url", "force://url?user=user@org.com&password=password");
123 123 assertNull(ForceConnectorConfig.loadFromName("XYZ"));
124 124 } finally {
125 125 System.clearProperty("force.xyz.url");
@@ -131,7 +131,7 @@ public void testLoadFromJavaPropertyIsCaseSensitive() throws Exception {
131 131 public void testLoadEnvVariableBeforeJavaProperty() throws Exception {
132 132 try {
133 133 // Set a Java property that conflicts with the environment variable set in the pom
134   - System.setProperty("force.envvarconn.url", "force://url;user=user;password=password");
  134 + System.setProperty("force.envvarconn.url", "force://url?user=user&password=password");
135 135
136 136 // Try loading from the environment variable.
137 137 // The assertions in that test should still work.
@@ -145,7 +145,7 @@ public void testLoadEnvVariableBeforeJavaProperty() throws Exception {
145 145 public void testLoadJavaPropertyBeforePropertyFile() throws Exception {
146 146 try {
147 147 // Set a Java property that conficts with the unitconnurl properties file
148   - System.setProperty("force.unitconnurl.url", "force://javapropurl;user=javapropuser;password=javaproppassword");
  148 + System.setProperty("force.unitconnurl.url", "force://javapropurl?user=javapropuser&password=javaproppassword");
149 149
150 150 ForceConnectorConfig config = ForceConnectorConfig.loadFromName("unitconnurl");
151 151 assertNotNull(config);
@@ -171,10 +171,11 @@ public void testLoadWithNothingSet() throws Exception {
171 171 {null},
172 172 {""},
173 173 {"url"},
174   - {"url;user=user;password=password"},
  174 + {"url?user=user&password=password"},
175 175 {"force://"},
176 176 {"force://url"},
177   - {"force://url;user=user"},
  177 + {"force://url?user=user"},
  178 + {" force://url?user=user&password=password"}, // Leading space
178 179 };
179 180 }
180 181
@@ -197,11 +198,11 @@ public void testParseBadConnectionUrl(String connectionUrl) throws Exception {
197 198 @DataProvider
198 199 protected Object[][] connectionUrlWithBadPropertyProvider() {
199 200 return new Object[][] {
200   - {"force://;user=user;password=password", "endpoint", null},
201   - {"force://url;user=;password=password", "user", null},
202   - {"force://url;user=user;password=", "password", null},
203   - {"force://url/a;user=user;password=", "endpoint", "url/a"},
204   - {"force://url;user=user;password=password;timeout=abc", "timeout", "abc"},
  201 + {"force://?user=user&password=password", "endpoint", null},
  202 + {"force://url?user=&password=password", "user", null},
  203 + {"force://url?user=user&password=", "password", null},
  204 + {"force://url/a?user=user&password=", "endpoint", "url/a"},
  205 + {"force://url?user=user&password=password&timeout=abc", "timeout", "abc"},
205 206 };
206 207 }
207 208
@@ -224,17 +225,13 @@ public void testParseConnectionUrlWithBadProperty(String connectionUrl, String b
224 225 @DataProvider
225 226 protected Object[][] basicGoodConnectionUrlProvider() {
226 227 return new Object[][] {
227   - {"force://url;user=user;password=password"},
228   - {"force://url;password=password;user=user"},
229   - {"force://url/;user=user;password=password"},
230   - {"force://url;user=user;password=password;testProp"}, // Ignore unknown properties
231   - {"force://url;user=user;password=password;testProp="}, // Ignore unknown properties
232   - {"force://url;user=user;password=password;oauth_secret=abc"}, // Ignore unused properties
233   - {"force://url;user=user;password=password;"}, // Trailing ';'
234   - {" force://url;user=user;password=password"}, // Leading whitespace
235   - {"force://url; user=user;password=password"}, // Space between url and user
236   - {"force://url;user=user; password=password"}, // Space between user and password
237   - {"force://url;user=user;password=password "}, // Trailing whitespace
  228 + {"force://url?user=user&password=password"},
  229 + {"force://url?password=password&user=user"},
  230 + {"force://url/?user=user&password=password"},
  231 + {"force://url?user=user&password=password&testProp"}, // Ignore unknown properties
  232 + {"force://url?user=user&password=password&testProp="}, // Ignore unknown properties
  233 + {"force://url?user=user&password=password&oauth_secret=abc"}, // Ignore unused properties
  234 + {"force://url?user=user&password=password&"}, // Trailing '&'
238 235 };
239 236 }
240 237
@@ -255,11 +252,11 @@ public void testParseBasicGoodConnectionUrl(String connectionUrl) throws Excepti
255 252 @DataProvider
256 253 protected Object[][] goodConnectionUrlProvider() {
257 254 return new Object[][] {
258   - {"force://url;user=user;password=password;clientid=id;timeout=1;trace=true",
  255 + {"force://url?user=user&password=password&clientid=id&timeout=1&trace=true",
259 256 null /* skip validation */, "user", "password", "id", 1},
260   - {"force://url/services/Soap/u/0;user=user;password=password",
  257 + {"force://url/services/Soap/u/0?user=user&password=password",
261 258 "https://url/services/Soap/u/0", "user", "password", null, 0},
262   - {"force://url;user=user;password=password=",
  259 + {"force://url?user=user&password=password=",
263 260 null /* skip validation */, "user", "password=", null, 0}, // Trailing '='
264 261 };
265 262 }
4 connector/src/test/resources/cliforce.properties
@@ -24,5 +24,5 @@
24 24 # POSSIBILITY OF SUCH DAMAGE.
25 25 #
26 26
27   -connA=force://url.com;user=abc@abc.com;password=Pass1234
28   -connB=force://web.com;user=xyz@xyz.com;password=1234pasS
  27 +connA=force://url.com?user=abc@abc.com&password=Pass1234
  28 +connB=force://web.com?user=xyz@xyz.com&password=1234pasS
2  connector/src/test/resources/unitconnurl.properties
@@ -24,4 +24,4 @@
24 24 # POSSIBILITY OF SUCH DAMAGE.
25 25 #
26 26
27   -url=force://url;user=username;password=password;clientid=id;timeout=1;trace=true
  27 +url=force://url?user=username&password=password&clientid=id&timeout=1&trace=true
18 doc/force-sdk-overview.md
Source Rendered
@@ -6,7 +6,7 @@ title: Introduction
6 6 ---
7 7 # Introduction
8 8
9   -Force.com is a complete application development platform that provides tools for managing data, logic, and user interfaces of your cloud apps. Database.com is the underlying database that powers Force.com and all the applications built on the platform, including Sales Cloud, Service Cloud and Chatter.
  9 +Force.com is a complete application development platform that provides tools for managing data, logic, and user interfaces of your cloud apps. Database.com is the underlying database that powers Force.com and all the applications built on the platform, including Sales Cloud, Service Cloud, and Chatter.
10 10
11 11 If you are a Force.com developer, you are already using Database.com to manage the data for your application and to automatically expose your data in both a [REST API][1] and [SOAP API][2]. It also provides a [Metadata API][3] to handle changes to your data model.
12 12
@@ -21,7 +21,7 @@ If you are a Java developer and you want to build a Java application that access
21 21 * Leverage the Database.com user security model to manage data access for your application
22 22 * Extend existing Force.com applications with Java logic
23 23
24   -The SDK is not tied to any particular runtime. You can build applications that run on your own server, on Amazon's EC2 or other cloud runtimes as long as you can make HTTPS connections to Database.com.
  24 +The SDK is not tied to any particular runtime. You can build applications that run on your own server, on Amazon's EC2, or other cloud runtimes as long as you can make HTTPS connections to Database.com.
25 25
26 26 You can use the Database.com Java SDK with any organization that has Force.com API calls enabled. This includes Enterprise, Unlimited, Developer, and Database.com Editions.
27 27
@@ -39,18 +39,26 @@ The JPA provider enables you to use Database.com as a persistent data store for
39 39
40 40 [Read more](jpa-provider)
41 41
42   -## OAuth authentication and authorization
  42 +## OAuth Authentication and Authorization
43 43
44 44 If you're building an application for authenticated Database.com users, you can configure single sign-on and leverage the security model in Database.com using OAuth2.
45 45
46 46 [Read more](oauth-auth)
47 47
48   -## Spring security plugin
  48 +## Spring Security Plugin
49 49
50 50 This plugin enables you to use Spring Security for authentication and authorization in your applications. The Spring Security library uses the API Connector and the OAuth Connector to allow authentication via the Force.com APIs. There is also a custom Spring Security namespace that helps to simplify configuration.
51 51
52 52 [Read more](spring-security)
53 53
54   -## Spring MVC project template
  54 +## Spring MVC Project Template
55 55
56 56 The SDK includes a Spring MVC project template distributed as a Maven archetype. You can quickly and easily create new projects from this template. The template sets up all the Maven dependencies needed for a new Spring MVC application using the JPA provider and Spring Security plugin.
  57 +
  58 +To see the Maven archetype in action, read the [quick start](quick-start).
  59 +
  60 +## Code Generation Plugin
  61 +
  62 +This plugin is not part of the Database.com Java SDK, but you can use it to generate Java classes based on the objects already present in your organization.
  63 +
  64 +[Read more](https://github.com/forcedotcom/maven-force-plugin)
10 doc/quick-start.md
Source Rendered
@@ -21,7 +21,7 @@ This quick start walks you through creating a new Spring MVC application from a
21 21
22 22 ### A word about Maven before you get started
23 23
24   -Many of the commands in this quick start trigger downloads of additional Maven dependencies. If you have never used Maven before or if you are going through this quick start on a new machine or with a new user account, this can be slow initially. However, once the modules are downloaded, they are cached in a local repository and subsequent commands execute quicker.
  24 +Many of the commands in this quick start trigger downloads of additional Maven dependencies. If you have never used Maven before or if you are going through this quick start on a new machine or with a new user account, this can be slow initially. However, once the modules are downloaded, they are cached in a local repository and subsequent commands execute more quickly.
25 25
26 26 ## 1. Create a new project from a template
27 27
@@ -66,7 +66,7 @@ Navigate to <http://localhost:8080/hellocloud> where you should see a welcome sc
66 66
67 67 ## 4. Next Steps
68 68
69   -The Database.com SDK is not tied to any particular runtime. You can now proceed to deploy the application on your own server, Cloud Foundry, EC2 or other cloud runtimes as long as you can make HTTPS connections to Database.com.
  69 +The Database.com SDK is not tied to any particular runtime. You can now proceed to deploy the application on your own server, Cloud Foundry, EC2, or other cloud runtimes as long as you can make HTTPS connections to Database.com.
70 70
71 71 If you want to take a look at an application that is built out a little bit more, you can look at the "Music Library" application here: <https://github.com/forcedotcom/javasample-musiclib>. You can clone this project by running:
72 72
@@ -78,8 +78,4 @@ Now, build and run the musiclib application.
78 78
79 79 mvn tomcat:run-war
80 80
81   -And see it at <http://localhost:8080/musiclib>. It will pick up the same connection parameters that you already set up and create entities in the same Force.com organization.
82   -
83   -Happy coding.
84   -
85   -
  81 +And see it at <http://localhost:8080/musiclib>. It will pick up the same connection parameters that you already set up and create entities in the same Force.com organization.
10 doc/sts.md
Source Rendered
@@ -27,18 +27,18 @@ The Database.com JPA provider uses the [DataNucleus Access Platform](http://www.
27 27 To install DataNucleus Eclipse plugin:
28 28
29 29 1. Click the SpringSource icon in the toolbar to open the Dashboard.
30   -- Click the Extensions tab at the bottom left of the Dashboard.
  30 +- Click the **Extensions** tab at the bottom left of the Dashboard.
31 31 - Search for DataNucleus and install the DataNucleus Eclipse Plugin.
32   -- Click Install at the bottom right of the Dashboard.
33   -- An Install popup window lists the items for installation. Click Next.
34   -- Review the installation details and click Next and Finish.
  32 +- Click **Install** at the bottom right of the Dashboard.
  33 +- An Install popup window lists the items for installation. Click **Next**.
  34 +- Review the installation details and click **Next** and **Finish**.
35 35 - Restart SpringSource Tool Suite for the changes to take effect.
36 36
37 37 ## 3. Import the Quick Start Sample Application
38 38
39 39 1. Once you have STS installed, launch it with a new workspace.
40 40 1. Click **File > Import**.
41   -1. In the import source list, click **Maven > Existing Maven Projects** and then click Next.
  41 +1. In the import source list, click **Maven > Existing Maven Projects** and then click **Next**.
42 42 1. Click **Browse** and navigate to the root folder of the `hellocloud` sample application you created in the [quick start](quick-start). The root folder contains pom.xml.
43 43 1. Click **OK** and you should see your pom.xml and project name in the Projects list.
44 44 1. Click **Finish**.
2  javasdk-test/codegen-test/pom.xml
@@ -8,7 +8,7 @@
8 8 <parent>
9 9 <groupId>com.force.sdk</groupId>
10 10 <artifactId>force-sdk-test</artifactId>
11   - <version>22.0.5-BETA</version>
  11 + <version>22.0.6-BETA</version>
12 12 </parent>
13 13
14 14 <build>
4 javasdk-test/connector-test/pom.xml
@@ -9,7 +9,7 @@
9 9 <parent>
10 10 <groupId>com.force.sdk</groupId>
11 11 <artifactId>force-sdk-test</artifactId>
12   - <version>22.0.5-BETA</version>
  12 + <version>22.0.6-BETA</version>
13 13 </parent>
14 14
15 15 <build>
@@ -37,7 +37,7 @@
37 37 <configuration>
38 38 <environmentVariables>
39 39 <FORCE_ENVVARCONN_URL>
40   - force://${endpoint}/services/Soap/u/${force.apiVersion};user=${user};password=${password}
  40 + force://${endpoint}/services/Soap/u/${force.apiVersion}?user=${user}&amp;password=${password}
41 41 </FORCE_ENVVARCONN_URL>
42 42 </environmentVariables>
43 43 </configuration>
4 javasdk-test/connector-test/src/test/java/com/force/sdk/connector/BaseForceServiceConnectorTest.java
@@ -103,8 +103,8 @@ protected String createConnectionUrl() {
103 103
104 104 StringBuffer sb = new StringBuffer();
105 105 sb.append("force://").append(parsedEndPoint[parsedEndPoint.length - 1])
106   - .append(";user=").append(userInfo.getUserName())
107   - .append(";password=").append(userInfo.getPassword());
  106 + .append("?user=").append(userInfo.getUserName())
  107 + .append("&password=").append(userInfo.getPassword());
108 108
109 109 return sb.toString();
110 110 }
4 javasdk-test/connector-test/src/test/java/com/force/sdk/connector/ForceServiceConnectorCacheTest.java
@@ -66,12 +66,12 @@ public void testCacheWithConfig() throws Exception {
66 66 public void testCacheWithConnectionName() throws Exception {
67 67 String connUrl = createConnectionUrl();
68 68 try {
69   - System.setProperty("force.testCacheWithConnectionName.url", connUrl + ";timeout=1234");
  69 + System.setProperty("force.testCacheWithConnectionName.url", connUrl + "&timeout=1234");
70 70
71 71 ForceServiceConnector connector = new ForceServiceConnector("testCacheWithConnectionName");
72 72 connector.getConnection();
73 73
74   - System.setProperty("force.testCacheWithConnectionName.url", connUrl + ";timeout=2345");
  74 + System.setProperty("force.testCacheWithConnectionName.url", connUrl + "&timeout=2345");
75 75 connector = new ForceServiceConnector("testCacheWithConnectionName");
76 76
77 77 // We should hit the cache here and retrieve the original read timeout
2  javasdk-test/connector-test/src/test/java/com/force/sdk/connector/NegativeForceServiceConnectorTest.java
@@ -62,7 +62,7 @@ public void testCannotResetConnectorAfterGetConnection() throws Exception {
62 62 @Test
63 63 public void testEqualsSignInConnectionUrl() throws Exception {
64 64 try {
65   - System.setProperty("force.testMissingStateInConnectionUrl.url", "force://url;useruser;password=password");
  65 + System.setProperty("force.testMissingStateInConnectionUrl.url", "force://url?useruser&password=password");
66 66
67 67 ForceServiceConnector connector = new ForceServiceConnector("testMissingStateInConnectionUrl");
68 68 connector.getConnection();
2  javasdk-test/connector-test/src/test/resources/funcconnurl.properties
@@ -24,4 +24,4 @@
24 24 # POSSIBILITY OF SUCH DAMAGE.
25 25 #
26 26
27   -url=force://${endpoint}/services/Soap/u/${force.apiVersion};user=${user};password=${password}
  27 +url=force://${endpoint}/services/Soap/u/${force.apiVersion}?user=${user}&password=${password}
2  javasdk-test/jpa-test-beanvalidation/pom.xml
@@ -9,7 +9,7 @@
9 9 <parent>
10 10 <groupId>com.force.sdk</groupId>
11 11 <artifactId>force-sdk-test</artifactId>
12   - <version>22.0.5-BETA</version>
  12 + <version>22.0.6-BETA</version>
13 13 </parent>
14 14
15 15 <build>
4 javasdk-test/jpa-test-connection/pom.xml
@@ -8,7 +8,7 @@
8 8 <parent>
9 9 <groupId>com.force.sdk</groupId>
10 10 <artifactId>force-sdk-test</artifactId>
11   - <version>22.0.5-BETA</version>
  11 + <version>22.0.6-BETA</version>
12 12 </parent>
13 13
14 14 <build>
@@ -41,7 +41,7 @@
41 41 </properties>
42 42 <environmentVariables>
43 43 <FORCE_CONNURLENVVAR_URL>
44   - force://${endpoint}/services/Soap/u/${force.apiVersion};user=${user};password=${password}
  44 + force://${endpoint}/services/Soap/u/${force.apiVersion}?user=${user}&amp;password=${password}
45 45 </FORCE_CONNURLENVVAR_URL>
46 46 </environmentVariables>
47 47 </configuration>
4 javasdk-test/jpa-test-connection/src/test/java/com/force/sdk/jpa/connection/BaseJPAConnectionTest.java
@@ -64,8 +64,8 @@ protected String createConnectionUrl() {
64 64
65 65 StringBuffer sb = new StringBuffer();
66 66 sb.append("force://").append(parsedEndPoint[parsedEndPoint.length - 1])
67   - .append(";user=").append(userInfo.getUserName())
68   - .append(";password=").append(userInfo.getPassword());
  67 + .append("?user=").append(userInfo.getUserName())
  68 + .append("&password=").append(userInfo.getPassword());
69 69
70 70 return sb.toString();
71 71 }
32 javasdk-test/jpa-test-connection/src/test/java/com/force/sdk/jpa/connection/BasicJPAConnectionTest.java
@@ -26,15 +26,13 @@
26 26
27 27 package com.force.sdk.jpa.connection;
28 28
29   -import java.util.Collections;
30   -import java.util.Map;
  29 +import com.force.sdk.connector.ForceConnectorTestUtils;
  30 +import org.testng.annotations.Test;
31 31
32 32 import javax.persistence.EntityManagerFactory;
33 33 import javax.persistence.Persistence;
34   -
35   -import org.testng.annotations.Test;
36   -
37   -import com.force.sdk.connector.ForceConnectorTestUtils;
  34 +import java.util.Collections;
  35 +import java.util.Map;
38 36
39 37 /**
40 38 * Basic tests for JPA connections.
@@ -53,6 +51,15 @@ public void testConnFromConnUrlEnvironmentVariable() throws Exception {
53 51 verifyEntityManager(emf.createEntityManager());
54 52 }
55 53
  54 + // NOTE: This test is not going to pass in STS. You have to execute from the command line.
  55 + @Test
  56 + public void testConnFromCustomEnvironmentVariable() throws Exception {
  57 + // FORCE_CONNURLENVVAR_URL is defined in pom.xml
  58 + // See connUrlEnvVar2 persistence-unit in persistence.xml. The config is read as : ${FORCE_CONNURLENVVAR_URL}
  59 + EntityManagerFactory emf = Persistence.createEntityManagerFactory("connUrlEnvVar2");
  60 + verifyEntityManager(emf.createEntityManager());
  61 + }
  62 +
56 63 @Test
57 64 public void testConnFromConnUrlJavaProperty() throws Exception {
58 65 // See connUrlJavaProp persistence-unit in persistence.xml
@@ -67,6 +74,19 @@ public void testConnFromConnUrlJavaProperty() throws Exception {
67 74 }
68 75
69 76 @Test
  77 + public void testConnFromCustomJavaProperty() throws Exception {
  78 + // See connUrlJavaProp persistence-unit in persistence.xml
  79 + try {
  80 + System.setProperty("custom.url", createConnectionUrl());
  81 +
  82 + EntityManagerFactory emf = Persistence.createEntityManagerFactory("connUrlJavaProp2");
  83 + verifyEntityManager(emf.createEntityManager());
  84 + } finally {
  85 + System.clearProperty("custom.url");
  86 + }
  87 + }
  88 +
  89 + @Test
70 90 public void testConnFromConnUrlPersistenceProperty() throws Exception {
71 91 // See connUrlPersistenceProp persistence-unit in persistence.xml
72 92 EntityManagerFactory emf = Persistence.createEntityManagerFactory("connUrlPersistenceProp");
27 javasdk-test/jpa-test-connection/src/test/resources/META-INF/persistence.xml
@@ -48,19 +48,37 @@
48 48 <property name="force.skipConfigCache" value="true"/>
49 49 </properties>
50 50 </persistence-unit>
51   -
52   - <persistence-unit name="connUrlJavaProp">
  51 +
  52 + <persistence-unit name="connUrlEnvVar2">
53 53 <provider>com.force.sdk.jpa.PersistenceProviderImpl</provider>
54 54 <properties>
55 55 <property name="datanucleus.storeManagerType" value="force"/>
  56 + <property name="datanucleus.ConnectionURL" value="${FORCE_CONNURLENVVAR_URL}" />
56 57 <property name="force.skipConfigCache" value="true"/>
57 58 </properties>
58 59 </persistence-unit>
  60 +
  61 + <persistence-unit name="connUrlJavaProp">
  62 + <provider>com.force.sdk.jpa.PersistenceProviderImpl</provider>
  63 + <properties>
  64 + <property name="datanucleus.storeManagerType" value="force"/>
  65 + <property name="force.skipConfigCache" value="true"/>
  66 + </properties>
  67 + </persistence-unit>
59 68
  69 + <persistence-unit name="connUrlJavaProp2">
  70 + <provider>com.force.sdk.jpa.PersistenceProviderImpl</provider>
  71 + <properties>
  72 + <property name="datanucleus.storeManagerType" value="force"/>
  73 + <property name="datanucleus.ConnectionURL" value="${custom.url}" />
  74 + <property name="force.skipConfigCache" value="true"/>
  75 + </properties>
  76 + </persistence-unit>
  77 +
60 78 <persistence-unit name="connUrlPersistenceProp">
61 79 <provider>com.force.sdk.jpa.PersistenceProviderImpl</provider>
62 80 <properties>
63   - <property name="datanucleus.ConnectionURL" value="force://${endpoint};user=${user};password=${password}" />
  81 + <property name="datanucleus.ConnectionURL" value="force://${endpoint}?user=${user}&amp;password=${password}" />
64 82 <property name="force.skipConfigCache" value="true"/>
65 83 </properties>
66 84 </persistence-unit>
@@ -99,7 +117,7 @@
99 117 <persistence-unit name="fullConnUrlPersistenceProp">
100 118 <provider>com.force.sdk.jpa.PersistenceProviderImpl</provider>
101 119 <properties>
102   - <property name="datanucleus.ConnectionURL" value="force://${endpoint}/services/Soap/u/${force.apiVersion};user=${user};password=${password}" />
  120 + <property name="datanucleus.ConnectionURL" value="force://${endpoint}/services/Soap/u/${force.apiVersion}?user=${user}&amp;password=${password}" />
103 121 <property name="force.skipConfigCache" value="true"/>
104 122 </properties>
105 123 </persistence-unit>
@@ -146,5 +164,4 @@
146 164 <property name="force.skipConfigCache" value="true"/>
147 165 </properties>
148 166 </persistence-unit>
149   -
150 167 </persistence>
2  javasdk-test/jpa-test-connection/src/test/resources/connUrlPropFile.properties
@@ -24,4 +24,4 @@
24 24 # POSSIBILITY OF SUCH DAMAGE.
25 25 #
26 26
27   -url=force://${endpoint}/services/Soap/u/${force.apiVersion};user=${user};password=${password}
  27 +url=force://${endpoint}/services/Soap/u/${force.apiVersion}?user=${user}&password=${password}
2  javasdk-test/jpa-test-connection/src/test/resources/connUrlWithOptionsPropFile.properties
@@ -24,4 +24,4 @@
24 24 # POSSIBILITY OF SUCH DAMAGE.
25 25 #
26 26
27   -url=force://${endpoint}/services/Soap/u/${force.apiVersion};user=${user};password=${password};clientId=testClientId;timeout=10000
  27 +url=force://${endpoint}/services/Soap/u/${force.apiVersion}?user=${user}&password=${password}&clientId=testClientId&timeout=10000
2  javasdk-test/jpa-test-query/pom.xml
@@ -8,7 +8,7 @@
8 8 <parent>
9 9 <groupId>com.force.sdk</groupId>
10 10 <artifactId>force-sdk-test</artifactId>
11   - <version>22.0.5-BETA</version>
  11 + <version>22.0.6-BETA</version>
12 12 </parent>
13 13
14 14 <build>
2  javasdk-test/jpa-test-schema/pom.xml
@@ -8,7 +8,7 @@
8 8 <parent>
9 9 <groupId>com.force.sdk</groupId>
10 10 <artifactId>force-sdk-test</artifactId>
11   - <version>22.0.5-BETA</version>
  11 + <version>22.0.6-BETA</version>
12 12 </parent>
13 13
14 14 <build>
14 javasdk-test/jpa-test/pom.xml
@@ -8,7 +8,7 @@
8 8 <parent>
9 9 <groupId>com.force.sdk</groupId>
10 10 <artifactId>force-sdk-test</artifactId>
11   - <version>22.0.5-BETA</version>
  11 + <version>22.0.6-BETA</version>
12 12 </parent>
13 13
14 14
@@ -69,6 +69,11 @@
69 69 </configuration>
70 70 </plugin>
71 71
  72 + <plugin>
  73 + <groupId>org.codehaus.mojo</groupId>
  74 + <artifactId>properties-maven-plugin</artifactId>
  75 + </plugin>
  76 +
72 77 <plugin>
73 78 <groupId>org.apache.maven.plugins</groupId>
74 79 <artifactId>maven-surefire-plugin</artifactId>
@@ -77,7 +82,12 @@
77 82 <suiteXmlFiles>
78 83 <suiteXmlFile>testng.xml</suiteXmlFile>
79 84 </suiteXmlFiles>
80   - </configuration>
  85 + <environmentVariables>
  86 + <CUSTOM_ENVURL>
  87 + force://${endpoint}/services/Soap/u/${force.apiVersion}?user=${user}&amp;password=${password}
  88 + </CUSTOM_ENVURL>
  89 + </environmentVariables>
  90 + </configuration>
81 91 </plugin>
82 92
83 93 <plugin>
2  javasdk-test/jpa-test/src/test/resources/META-INF/persistence.xml
@@ -44,7 +44,7 @@
44 44 <property name="datanucleus.datastoreTransactionDelayOperations" value="true"/>
45 45 <property name="datanucleus.jpa.addClassTransformer" value="false" />
46 46 <property name="datanucleus.cache.level2.type" value="none"/>
47   - <property name="force.ConnectionName" value="force-sdk-test"/>
  47 + <property name="datanucleus.ConnectionURL" value="${CUSTOM_ENVURL}" />
48 48 </properties>
49 49 </persistence-unit>
50 50 <!-- testDNJpaPersistence2 is used for optimistic transactions -->
4 javasdk-test/mock-oauth-server/pom.xml
@@ -7,9 +7,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
7 7 <artifactId>force-mock-oauth-server-app</artifactId>
8 8 <name>force-mock-oauth-server-app</name>
9 9 <packaging>war</packaging>
10   - <version>22.0.5-BETA</version>
  10 + <version>22.0.6-BETA</version>
11 11 <properties>
12   - <force.sdk.version>22.0.5-BETA</force.sdk.version>
  12 + <force.sdk.version>22.0.6-BETA</force.sdk.version>
13 13 <apache.cxf.version>2.3.0</apache.cxf.version>
14 14 <!-- Need to upgrade when http://jira.codehaus.org/browse/MCHECKSTYLE-147 is fixed -->
15 15 <checkstyle.plugin.version>2.4</checkstyle.plugin.version>
4 javasdk-test/oauth-app/pom.xml
@@ -5,13 +5,13 @@
5 5 <artifactId>force-oauth-app</artifactId>
6 6 <name>force-oauth-app</name>
7 7 <packaging>war</packaging>
8   - <version>22.0.5-BETA</version>
  8 + <version>22.0.6-BETA</version>
9 9
10 10 <properties>
11 11 <!-- Need to upgrade when http://jira.codehaus.org/browse/MCHECKSTYLE-147 is fixed -->
12 12 <checkstyle.plugin.version>2.4</checkstyle.plugin.version>
13 13 <force.api.version>22.0.0</force.api.version>
14   - <force.sdk.version>22.0.5-BETA</force.sdk.version>
  14 + <force.sdk.version>22.0.6-BETA</force.sdk.version>
15 15 <spring.version>3.0.3.RELEASE</spring.version>
16 16 <spring.security.version>3.0.3.RELEASE</spring.security.version>
17 17 <java.compile.version>1.6</java.compile.version>
12 javasdk-test/oauth-app/src/main/webapp/WEB-INF/web.xml
@@ -37,8 +37,8 @@
37 37 <filter-name>DefaultFilter</filter-name>
38 38 <filter-class>com.force.sdk.oauth.AuthFilter</filter-class>
39 39 <init-param>
40   - <param-name>connectionName</param-name>
41   - <param-value>integrationserver</param-value>
  40 + <param-name>url</param-name>
  41 + <param-value>${integrationserver.url}</param-value>
42 42 </init-param>
43 43 <init-param>
44 44 <param-name>secure-key-file</param-name>
@@ -59,8 +59,8 @@
59 59 <filter-name>FilterA</filter-name>
60 60 <filter-class>com.force.sdk.oauth.AuthFilter</filter-class>
61 61 <init-param>
62   - <param-name>connectionName</param-name>
63   - <param-value>integrationserver</param-value>
  62 + <param-name>url</param-name>
  63 + <param-value>${integrationserver.url}</param-value>
64 64 </init-param>
65 65 <init-param>
66 66 <param-name>secure-key-file</param-name>
@@ -91,8 +91,8 @@
91 91 <filter-name>FilterB</filter-name>
92 92 <filter-class>com.force.sdk.oauth.AuthFilter</filter-class>
93 93 <init-param>
94   - <param-name>connectionName</param-name>
95   - <param-value>integrationserver</param-value>
  94 + <param-name>url</param-name>
  95 + <param-value>${integrationserver.url}</param-value>
96 96 </init-param>
97 97 <init-param>
98 98 <param-name>secure-key-file</param-name>
4 javasdk-test/oauth-integration-test/pom.xml
@@ -6,12 +6,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
6 6 <groupId>com.force.sdk</groupId>
7 7 <artifactId>force-oauth-integration-test</artifactId>
8 8 <name>force-oauth-integration-test</name>
9   - <version>22.0.5-BETA</version>
  9 + <version>22.0.6-BETA</version>
10 10
11 11 <parent>
12 12 <groupId>com.force.sdk</groupId>
13 13 <artifactId>force-sdk-test</artifactId>
14   - <version>22.0.5-BETA</version>
  14 + <version>22.0.6-BETA</version>
15 15 </parent>
16 16
17 17 <properties>
2  javasdk-test/oauth-integration-test/testng-endtoend.xml
@@ -28,7 +28,7 @@
28 28
29 29 <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
30 30
31   -<suite name="springsecurity-endtoend-integration-tests" verbose="7">
  31 +<suite name="oauth-endtoend-integration-tests" verbose="7">
32 32 <parameter name="testType" value="ENDTOEND"/>
33 33
34 34 <listeners>
11 javasdk-test/oauth-test/pom.xml
@@ -8,7 +8,7 @@
8 8 <parent>
9 9 <groupId>com.force.sdk</groupId>
10 10 <artifactId>force-sdk-test</artifactId>
11   - <version>22.0.5-BETA</version>
  11 + <version>22.0.6-BETA</version>
12 12 </parent>
13 13
14 14 <build>
@@ -36,9 +36,12 @@
36 36 <version>${surefire.version}</version>
37 37 <configuration>
38 38 <environmentVariables>
39   - <FORCE_CONNURLENVVAR_URL>
40   - force://${endpoint};oauth_key=${force.test.oauth.key};oauth_secret=${force.test.oauth.secret}
41   - </FORCE_CONNURLENVVAR_URL>
  39 + <FORCE_CONNURLENVVAR_URL>
  40 + force://${endpoint}?oauth_key=${force.test.oauth.key}&amp;oauth_secret=${force.test.oauth.secret}
  41 + </FORCE_CONNURLENVVAR_URL>
  42 + <FORCE_URL_ORDER_TEST>
  43 + force://url?oauth_key=ABCDEF&amp;oauth_secret=123456
  44 + </FORCE_URL_ORDER_TEST>
42 45 </environmentVariables>
43 46 <systemPropertyVariables>
44 47 <loginConfigPath>${basedir}/src/test/resources</loginConfigPath>
4 javasdk-test/oauth-test/src/test/java/com/force/sdk/oauth/BaseOAuthTest.java
@@ -73,8 +73,8 @@ protected String createConnectionUrl() {
73 73 String host = this.endpoint.split("://", 2)[1];
74 74 StringBuffer connectionUrl = new StringBuffer("force://")
75 75 .append(host)
76   - .append(";oauth_key=").append(oauthKey)
77   - .append(";oauth_secret=").append(oauthSecret);
  76 + .append("?oauth_key=").append(oauthKey)
  77 + .append("&oauth_secret=").append(oauthSecret);
78 78
79 79 return connectionUrl.toString();
80 80 }
42 javasdk-test/oauth-test/src/test/java/com/force/sdk/oauth/BasicAuthFilterTest.java
@@ -124,6 +124,46 @@ public void testOAuthLoginRedirectWithEnvVariable() throws Exception {
124 124 }
125 125
126 126 @Test
  127 + public void testOAuthLoginRedirectWithCustomEnvVariable() throws Exception {
  128 + // Initialize the filter with an environment variable name
  129 + MockFilterConfig filterConfig = new MockFilterConfig();
  130 + filterConfig.addInitParameter("url", "${FORCE_CONNURLENVVAR_URL}"); // FORCE_CONNURLENVVAR_URL is set in pom file
  131 +
  132 + testOAuthLoginRedirectInternal(filterConfig);
  133 + }
  134 +
  135 + @Test
  136 + public void testOAuthLoginRedirectWithCustomJavaProperty() throws Exception {
  137 + // Initialize the filter with an environment variable name
  138 + try {
  139 + System.setProperty("custom.force.connection", createConnectionUrl());
  140 +
  141 + MockFilterConfig filterConfig = new MockFilterConfig();
  142 + filterConfig.addInitParameter("url", "${custom.force.connection}");
  143 +
  144 + testOAuthLoginRedirectInternal(filterConfig);
  145 + } finally {
  146 + System.clearProperty("custom.force.connection");
  147 + }
  148 + }
  149 +
  150 + @Test
  151 + public void testUrlConfigOrder() throws Exception {
  152 + // Initialize the filter with an environment variable name
  153 + try {
  154 + // pom file creates an env variable with same name but invalid url.
  155 + System.setProperty("FORCE_URL_ORDER_TEST", createConnectionUrl());
  156 +
  157 + MockFilterConfig filterConfig = new MockFilterConfig();
  158 + filterConfig.addInitParameter("url", "${FORCE_URL_ORDER_TEST}");
  159 +
  160 + testOAuthLoginRedirectInternal(filterConfig);
  161 + } finally {
  162 + System.clearProperty("FORCE_URL_ORDER_TEST");
  163 + }
  164 + }
  165 +
  166 + @Test
127 167 public void testOAuthLoginRedirectWithJavaProperty() throws Exception {
128 168 try {