Author: lixu
Date: Tue Mar 6 20:36:07 2012
New Revision: 1297695
URL: http://svn.apache.org/viewvc?rev=1297695&view=rev
Log:
SHINDIG-1722 | Improvement to OAuth2 message files
Modified:
shindig/trunk/java/gadgets/src/main/resources/org/apache/shindig/gadgets/oauth2/resource.properties
shindig/trunk/java/gadgets/src/main/resources/org/apache/shindig/gadgets/oauth2/resource_en_US.properties
shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/oauth2/OAuth2ErrorTest.java
shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/oauth2/OAuth2RequestExceptionTest.java
shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/oauth2/handler/OAuth2HandlerErrorTest.java
shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/oauth2/logger/FilteredLoggerTest.java
Modified:
shindig/trunk/java/gadgets/src/main/resources/org/apache/shindig/gadgets/oauth2/resource.properties
URL:
http://svn.apache.org/viewvc/shindig/trunk/java/gadgets/src/main/resources/org/apache/shindig/gadgets/oauth2/resource.properties?rev=1297695&r1=1297694&r2=1297695&view=diff
==============================================================================
---
shindig/trunk/java/gadgets/src/main/resources/org/apache/shindig/gadgets/oauth2/resource.properties
(original)
+++
shindig/trunk/java/gadgets/src/main/resources/org/apache/shindig/gadgets/oauth2/resource.properties
Tue Mar 6 20:36:07 2012
@@ -14,68 +14,68 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-message_header= {0} encountered a problem :
-authorization_code_problem=exchanging authorization_code for access_token : {0}
-authorization_code_problem.explanation=An error occured exchanging the
authorization code for access_token.
-authorize_problem=initiating authorization {0}
-authorize_problem.explanation=An error occured initiating authorization.
-callback_problem=processing the redirect_uri response : {0}
-callback_problem.explanation=Error processing the redirect response from the
service provider.
-client_credentials_problem=getting access_token from client_credentials : {0}
-client_credentials_problem.explanation=Error in the client_credentials flow.
-fetch_init_problem=initializing OAuth2Request : {0}
-fetch_init_problem.explanation=A low-level error occured intializing the
OAuth2 request fetch.
+message_header= {0} encountered an error :
+authorization_code_problem=The authorization code is being exchanged for the
access token : {0}
+authorization_code_problem.explanation=An error occurred when exchanging the
authorization code for the access_token.
+authorize_problem=The authorization process for {0} is initiating.
+authorize_problem.explanation=An error occurred when initiating authorization
process.
+callback_problem=The redirect response is being processed : {0}
+callback_problem.explanation=An error occurred when processing the redirect
response from the service provider.
+client_credentials_problem=The access_token is being retrieved for the client
with the following client credential : {0}
+client_credentials_problem.explanation=An error occurred when retrieving
access token in the client_credentials flow.
+fetch_init_problem=The OAuth2Request is initializing: {0}
+fetch_init_problem.explanation=A low-level error occurred when initializing
the OAuth2Request fetch.
fetch_problem=executing OAuth2Request.fetch() : {0}
-fetch_problem.explanation=An error occurred issuing the OAuth2 request.
-gadget_spec_problem=processing the gadget spec : {0}
-gadget_spec_problem.explanation=A gadget spec was not found. Most like your
administrator has not configured your gadget to work with OAuth2.
+fetch_problem.explanation=An error occurred when issuing the OAuth2Request
fetch.
+gadget_spec_problem=The following gadget specification is processing : {0}
+gadget_spec_problem.explanation=A gadget specification was not found. Ask
your administrator to configure your gadget to work with OAuth2.0.
get_oauth2_accessor_problem=getting an OAuth2Accessor for the OAuth2Request :
{0}
-get_oauth2_accessor_problem.explanation=The most common cause of this error is
that your administrator has not created an OAuth2Client binding for this gadget
and service.
-lookup_spec_problem=looking up the gadget spec : {0}
-lookup_spec_problem.explanation=A gadget spec was not found. Most like your
administrator has not configured your gadget to work with OAuth2.
-missing_fetch_params=there are missing required fetch params : {0}
-missing_fetch_params.explanation=fetch() method was called with bad parameters.
-missing_server_response=problem with the OAuth2 service provider resonse : {0}
-missing_server_response.explanation=The server was able to create what it
thought was a valid OAuth 2 request but was unable to issue the request or get
a valid response from the service provider.
-no_response_handler=no response handler processed the response : {0}
-no_response_handler.explanation=There is no
AuthorizationEndpointResponseHandler or TokenEndpointResponseHandler registered
for what you are trying to do.
-no_gadget_spec=cannot find a gadget spec for {0}
-no_gadget_spec.explanation=A gadget spec was not found. Most like your
administrator has not configured your gadget to work with OAuth2.
-refresh_token_problem=exchanging the refresh_token for a new access_token : {0}
-refresh_token_problem.explanation=The system tried to exchaning a seemingly
valid refresh_token for an access_token and encountered an error.
-secret_encryption_problem=encrytping token secret for persistence : {0}
-secret_encryption_problem.explanation=Error storing OAuth2 secrets with the
provided encryption module.
-access_denied=access denied
-access_denied.explanation=User denied or canceled the authorization with the
service provider.
-invalid_client=invalid client : {0}
-invalid_client.explanation= Client authentication failed (e.g. unknown client,
no client authentication included, or unsupported authentication method).
-invalid_grant=invalid grant : {0}
-invalid_grant.explanation=The provided authorization grant (e.g. authorization
code, resource owner credentials, client credentials) is invalid, expired,
revoked, does not match the redirection URI used in the authorization request,
or was issued to another client.
-invalid_request=invalid request : {0}
-invalid_request.explanation=The request is missing a required parameter,
includes an unsupported parameter value, repeats a parameter, includes multiple
credentials, utilizes more than one mechanism for authenticating the client, or
is otherwise malformed.
-invalid_scope=invalid scope : {0}
-invalid_scope.explanation= The requested scope is invalid, unknown, malformed,
or exceeds the scope granted by the resource owner.
-server_error=server error : {0}
+get_oauth2_accessor_problem.explanation=An error occured. Ask your
administrator to create an OAuth2.0 Client binding for this gadget and service.
+lookup_spec_problem=The gadget specification is being retrieved : {0}
+lookup_spec_problem.explanation=A gadget specification was not found. Ask
your administrator to configure your gadget to work with OAuth2.0.
+missing_fetch_params=The following required fetch parameters are missing : {0}
+missing_fetch_params.explanation=The fetch() method was called with bad
parameters.
+missing_server_response=An error occurred during OAuth2.0 service provider
response : {0}
+missing_server_response.explanation=The server created a valid OAuth2Request
but was either unable to issue the request or get a valid response from the
service provider.
+no_response_handler=A response handler did not process the following response
: {0}
+no_response_handler.explanation=Response handler do not exists for processing
the authorization and token endpoints. AuthorizationEndpointResponseHandler or
TokenEndpointResponseHandler.
+no_gadget_spec=The gadget specification for {0} can not be found.
+no_gadget_spec.explanation=A gadget specification was not found. Ask your
administrator to configure your gadget to work with OAuth2.0.
+refresh_token_problem=The refresh token is being exchanged for the
access_token : {0}
+refresh_token_problem.explanation=An error occurred when exchanging the
refresh token for the access token.
+secret_encryption_problem=The token secret is bing encrypted for persistence :
{0}
+secret_encryption_problem.explanation=An error occurred when storing OAuth2.0
secrets with the provided encryption module.
+access_denied=Access was denied.
+access_denied.explanation=The user denied or canceled the authorization with
the service provider.
+invalid_client=The client is invalid : {0}
+invalid_client.explanation= The client cannot be authenticated,possibly
because hte client is not known., the client authentication was not included,
or the authentication method is not suppported.
+invalid_grant=The authorization grant is invalid : {0}
+invalid_grant.explanation=The authorization grant is invalid,expired,revoked,
does not match the redirection URI used in the authorization request, or was
issued to another client. The authorization grant can include the authorization
code, the credentials of the resource owner, or the credentials of the client.
+invalid_request=The request is invalid : {0}
+invalid_request.explanation=The request is invalid because it is missing a
required parameter, includes an unsupported parameter value, repeats a
parameter, includes multiple credentials, utilizes more than one mechanism for
authenticating the client, or is otherwise malformed.
+invalid_scope=The scope is invalid : {0}
+invalid_scope.explanation=The requested scope is invalid, unknown, malformed,
or exceeds the scope granted by the resource owner.
+server_error=A server error occurred: {0}
server_error.explanation=The authorization server encountered an unexpected
condition which prevented it from fulfilling the request.
-server_rejected_request=server rejected request : statuscode = {0}
-server_rejected_request.explanation=The server was able to create what it
thought was a valid OAuth 2 request but the OAuth 2 service provider rejected
it.
-temporarily_unavailable=temporarily unavailable : {0}
-temporarily_unavailable.explanation=The authorization server is currently
unable to handle the request due to a temporary overloading or maintenance of
the server.
-token_response_problem=processing response from token endpoint : {0}
+server_rejected_request=The server rejected the request : statuscode = {0}
+server_rejected_request.explanation=The server created an OAuth2Request, but
the service provider rejected it.
+temporarily_unavailable=The service is temporarily unavailable : {0}
+temporarily_unavailable.explanation=The authorization server is unable to
handle the request because it is temporarily overloaded or is in maintenance
mode.
+token_response_problem=The response from token endpoint is being processed :
{0}
token_response_problem.explanation=The token endpoint sent a response that the
server could not process.
-unauthorized_client=unauthorized client : {0}
+unauthorized_client=The client is not authorized : {0}
unauthorized_client.explanation=The client is not authorized to request an
access token using this method.
-unsupported_grant_type=unsupported grant type : {0}
+unsupported_grant_type=The grant type if not supported : {0}
unsupported_grant_type.explanation=The authorization server does not support
obtaining an access token using this method.
-unsupported_response_type=unsupported response type : {0}
+unsupported_response_type=The response type is unsupported: {0}
unsupported_response_type.explanation=The authorization server does not
support obtaining an authorization code using this method.
-mac_token_problem=mac token request : {0}
-mac_token_problem.explanation=Could not add a mac token on the request to the
resource server.
-bearer_token_problem=bearer token request : {0}
-bearer_token_problem.explanation=Could not add a bearer token on the request
to the resource server.
-authentication_problem=adding client authentication : {0}
-authentication_problem.explanation=Could not add authentication headers to the
request.
-unknown_problem=unknown problem : {0}
-unknown_problem.explanation=Please see your system administrator for help.
-code_grant_problem=getting access_token from authorization code : {0}
-code_grant_problem.explanation=Error in the authorization_code flow.
\ No newline at end of file
+mac_token_problem=The mac token is being requested : {0}
+mac_token_problem.explanation=The mac token on the request could not be added
to the resource server.
+bearer_token_problem=The bearer token is being requested : {0}
+bearer_token_problem.explanation=The bearer token on the request could not be
added to the resource server.
+authentication_problem=The client authentication is being added : {0}
+authentication_problem.explanation=The authentication headers could not be
added to the request.
+unknown_problem=An unknown error occurred : {0}
+unknown_problem.explanation=Ask your system administrator to investigate the
problem.
+code_grant_problem=The access token being obtained from the authorization code
: {0}
+code_grant_problem.explanation=An error occurred during the authorization code
flow.
\ No newline at end of file
Modified:
shindig/trunk/java/gadgets/src/main/resources/org/apache/shindig/gadgets/oauth2/resource_en_US.properties
URL:
http://svn.apache.org/viewvc/shindig/trunk/java/gadgets/src/main/resources/org/apache/shindig/gadgets/oauth2/resource_en_US.properties?rev=1297695&r1=1297694&r2=1297695&view=diff
==============================================================================
---
shindig/trunk/java/gadgets/src/main/resources/org/apache/shindig/gadgets/oauth2/resource_en_US.properties
(original)
+++
shindig/trunk/java/gadgets/src/main/resources/org/apache/shindig/gadgets/oauth2/resource_en_US.properties
Tue Mar 6 20:36:07 2012
@@ -14,68 +14,68 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-message_header= {0} encountered a problem :
-authorization_code_problem=exchanging authorization_code for access_token : {0}
-authorization_code_problem.explanation=An error occured exchanging the
authorization code for access_token.
-authorize_problem=initiating authorization {0}
-authorize_problem.explanation=An error occured initiating authorization.
-callback_problem=processing the redirect_uri response : {0}
-callback_problem.explanation=Error processing the redirect response from the
service provider.
-client_credentials_problem=getting access_token from client_credentials : {0}
-client_credentials_problem.explanation=Error in the client_credentials flow.
-fetch_init_problem=initializing OAuth2Request : {0}
-fetch_init_problem.explanation=A low-level error occured intializing the
OAuth2 request fetch.
+message_header= {0} encountered an error :
+authorization_code_problem=The authorization code is being exchanged for the
access token : {0}
+authorization_code_problem.explanation=An error occurred when exchanging the
authorization code for the access_token.
+authorize_problem=The authorization process for {0} is initiating.
+authorize_problem.explanation=An error occurred when initiating authorization
process.
+callback_problem=The redirect response is being processed : {0}
+callback_problem.explanation=An error occurred when processing the redirect
response from the service provider.
+client_credentials_problem=The access_token is being retrieved for the client
with the following client credential : {0}
+client_credentials_problem.explanation=An error occurred when retrieving
access token in the client_credentials flow.
+fetch_init_problem=The OAuth2Request is initializing: {0}
+fetch_init_problem.explanation=A low-level error occurred when initializing
the OAuth2Request fetch.
fetch_problem=executing OAuth2Request.fetch() : {0}
-fetch_problem.explanation=An error occurred issuing the OAuth2 request.
-gadget_spec_problem=processing the gadget spec : {0}
-gadget_spec_problem.explanation=A gadget spec was not found. Most like your
administrator has not configured your gadget to work with OAuth2.
+fetch_problem.explanation=An error occurred when issuing the OAuth2Request
fetch.
+gadget_spec_problem=The following gadget specification is processing : {0}
+gadget_spec_problem.explanation=A gadget specification was not found. Ask
your administrator to configure your gadget to work with OAuth2.0.
get_oauth2_accessor_problem=getting an OAuth2Accessor for the OAuth2Request :
{0}
-get_oauth2_accessor_problem.explanation=The most common cause of this error is
that your administrator has not created an OAuth2Client binding for this gadget
and service.
-lookup_spec_problem=looking up the gadget spec : {0}
-lookup_spec_problem.explanation=A gadget spec was not found. Most like your
administrator has not configured your gadget to work with OAuth2.
-missing_fetch_params=there are missing required fetch params : {0}
-missing_fetch_params.explanation=fetch() method was called with bad parameters.
-missing_server_response=problem with the OAuth2 service provider resonse : {0}
-missing_server_response.explanation=The server was able to create what it
thought was a valid OAuth 2 request but was unable to issue the request or get
a valid response from the service provider.
-no_response_handler=no response handler processed the response : {0}
-no_response_handler.explanation=There is no
AuthorizationEndpointResponseHandler or TokenEndpointResponseHandler registered
for what you are trying to do.
-no_gadget_spec=cannot find a gadget spec for {0}
-no_gadget_spec.explanation=A gadget spec was not found. Most like your
administrator has not configured your gadget to work with OAuth2.
-refresh_token_problem=exchanging the refresh_token for a new access_token : {0}
-refresh_token_problem.explanation=The system tried to exchaning a seemingly
valid refresh_token for an access_token and encountered an error.
-secret_encryption_problem=encrytping token secret for persistence : {0}
-secret_encryption_problem.explanation=Error storing OAuth2 secrets with the
provided encryption module.
-access_denied=access denied
-access_denied.explanation=User denied or canceled the authorization with the
service provider.
-invalid_client=invalid client : {0}
-invalid_client.explanation= Client authentication failed (e.g. unknown client,
no client authentication included, or unsupported authentication method).
-invalid_grant=invalid grant : {0}
-invalid_grant.explanation=The provided authorization grant (e.g. authorization
code, resource owner credentials, client credentials) is invalid, expired,
revoked, does not match the redirection URI used in the authorization request,
or was issued to another client.
-invalid_request=invalid request : {0}
-invalid_request.explanation=The request is missing a required parameter,
includes an unsupported parameter value, repeats a parameter, includes multiple
credentials, utilizes more than one mechanism for authenticating the client, or
is otherwise malformed.
-invalid_scope=invalid scope : {0}
-invalid_scope.explanation= The requested scope is invalid, unknown, malformed,
or exceeds the scope granted by the resource owner.
-server_error=server error : {0}
+get_oauth2_accessor_problem.explanation=An error occured. Ask your
administrator to create an OAuth2.0 Client binding for this gadget and service.
+lookup_spec_problem=The gadget specification is being retrieved : {0}
+lookup_spec_problem.explanation=A gadget specification was not found. Ask
your administrator to configure your gadget to work with OAuth2.0.
+missing_fetch_params=The following required fetch parameters are missing : {0}
+missing_fetch_params.explanation=The fetch() method was called with bad
parameters.
+missing_server_response=An error occurred during OAuth2.0 service provider
response : {0}
+missing_server_response.explanation=The server created a valid OAuth2Request
but was either unable to issue the request or get a valid response from the
service provider.
+no_response_handler=A response handler did not process the following response
: {0}
+no_response_handler.explanation=Response handler do not exists for processing
the authorization and token endpoints. AuthorizationEndpointResponseHandler or
TokenEndpointResponseHandler.
+no_gadget_spec=The gadget specification for {0} can not be found.
+no_gadget_spec.explanation=A gadget specification was not found. Ask your
administrator to configure your gadget to work with OAuth2.0.
+refresh_token_problem=The refresh token is being exchanged for the
access_token : {0}
+refresh_token_problem.explanation=An error occurred when exchanging the
refresh token for the access token.
+secret_encryption_problem=The token secret is bing encrypted for persistence :
{0}
+secret_encryption_problem.explanation=An error occurred when storing OAuth2.0
secrets with the provided encryption module.
+access_denied=Access was denied.
+access_denied.explanation=The user denied or canceled the authorization with
the service provider.
+invalid_client=The client is invalid : {0}
+invalid_client.explanation= The client cannot be authenticated,possibly
because hte client is not known., the client authentication was not included,
or the authentication method is not suppported.
+invalid_grant=The authorization grant is invalid : {0}
+invalid_grant.explanation=The authorization grant is invalid,expired,revoked,
does not match the redirection URI used in the authorization request, or was
issued to another client. The authorization grant can include the authorization
code, the credentials of the resource owner, or the credentials of the client.
+invalid_request=The request is invalid : {0}
+invalid_request.explanation=The request is invalid because it is missing a
required parameter, includes an unsupported parameter value, repeats a
parameter, includes multiple credentials, utilizes more than one mechanism for
authenticating the client, or is otherwise malformed.
+invalid_scope=The scope is invalid : {0}
+invalid_scope.explanation=The requested scope is invalid, unknown, malformed,
or exceeds the scope granted by the resource owner.
+server_error=A server error occurred: {0}
server_error.explanation=The authorization server encountered an unexpected
condition which prevented it from fulfilling the request.
-server_rejected_request=server rejected request : statuscode = {0}
-server_rejected_request.explanation=The server was able to create what it
thought was a valid OAuth 2 request but the OAuth 2 service provider rejected
it.
-temporarily_unavailable=temporarily unavailable : {0}
-temporarily_unavailable.explanation=The authorization server is currently
unable to handle the request due to a temporary overloading or maintenance of
the server.
-token_response_problem=processing response from token endpoint : {0}
+server_rejected_request=The server rejected the request : statuscode = {0}
+server_rejected_request.explanation=The server created an OAuth2Request, but
the service provider rejected it.
+temporarily_unavailable=The service is temporarily unavailable : {0}
+temporarily_unavailable.explanation=The authorization server is unable to
handle the request because it is temporarily overloaded or is in maintenance
mode.
+token_response_problem=The response from token endpoint is being processed :
{0}
token_response_problem.explanation=The token endpoint sent a response that the
server could not process.
-unauthorized_client=unauthorized client : {0}
+unauthorized_client=The client is not authorized : {0}
unauthorized_client.explanation=The client is not authorized to request an
access token using this method.
-unsupported_grant_type=unsupported grant type : {0}
+unsupported_grant_type=The grant type if not supported : {0}
unsupported_grant_type.explanation=The authorization server does not support
obtaining an access token using this method.
-unsupported_response_type=unsupported response type : {0}
+unsupported_response_type=The response type is unsupported: {0}
unsupported_response_type.explanation=The authorization server does not
support obtaining an authorization code using this method.
-mac_token_problem=mac token request : {0}
-mac_token_problem.explanation=Could not add a mac token on the request to the
resource server.
-bearer_token_problem=bearer token request : {0}
-bearer_token_problem.explanation=Could not add a bearer token on the request
to the resource server.
-authentication_problem=adding client authentication : {0}
-authentication_problem.explanation=Could not add authentication headers to the
request.
-unknown_problem=unknown problem : {0}
-unknown_problem.explanation=Please see your system administrator for help.
-code_grant_problem=getting access_token from authorization code : {0}
-code_grant_problem.explanation=Error in the authorization_code flow.
\ No newline at end of file
+mac_token_problem=The mac token is being requested : {0}
+mac_token_problem.explanation=The mac token on the request could not be added
to the resource server.
+bearer_token_problem=The bearer token is being requested : {0}
+bearer_token_problem.explanation=The bearer token on the request could not be
added to the resource server.
+authentication_problem=The client authentication is being added : {0}
+authentication_problem.explanation=The authentication headers could not be
added to the request.
+unknown_problem=An unknown error occurred : {0}
+unknown_problem.explanation=Ask your system administrator to investigate the
problem.
+code_grant_problem=The access token being obtained from the authorization code
: {0}
+code_grant_problem.explanation=An error occurred during the authorization code
flow.
\ No newline at end of file
Modified:
shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/oauth2/OAuth2ErrorTest.java
URL:
http://svn.apache.org/viewvc/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/oauth2/OAuth2ErrorTest.java?rev=1297695&r1=1297694&r2=1297695&view=diff
==============================================================================
---
shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/oauth2/OAuth2ErrorTest.java
(original)
+++
shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/oauth2/OAuth2ErrorTest.java
Tue Mar 6 20:36:07 2012
@@ -31,24 +31,5 @@ public class OAuth2ErrorTest {
Assert.assertEquals("authentication_problem", result);
}
- @Test
- public void testGetErrorDescription_1() throws Exception {
- final OAuth2Error fixture = OAuth2Error.AUTHENTICATION_PROBLEM;
- final String result = fixture.getErrorDescription();
-
- Assert
- .assertEquals(
- "org.apache.shindig.gadgets.oauth2.OAuth2Request encountered a
problem : adding client authentication : {0}",
- result);
- }
-
- @Test
- public void testGetErrorExplanation_1() throws Exception {
- final OAuth2Error fixture = OAuth2Error.AUTHENTICATION_PROBLEM;
-
- final String result = fixture.getErrorExplanation();
-
- Assert.assertEquals("Could not add authentication headers to the
request.", result);
- }
}
\ No newline at end of file
Modified:
shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/oauth2/OAuth2RequestExceptionTest.java
URL:
http://svn.apache.org/viewvc/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/oauth2/OAuth2RequestExceptionTest.java?rev=1297695&r1=1297694&r2=1297695&view=diff
==============================================================================
---
shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/oauth2/OAuth2RequestExceptionTest.java
(original)
+++
shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/oauth2/OAuth2RequestExceptionTest.java
Tue Mar 6 20:36:07 2012
@@ -31,22 +31,6 @@ public class OAuth2RequestExceptionTest
final OAuth2RequestException result = new OAuth2RequestException(error,
errorText, cause);
Assert.assertNotNull(result);
- Assert
- .assertEquals(
- "org.apache.shindig.gadgets.oauth2.OAuth2Request encountered a
problem : adding client authentication : ",
- result.getErrorText());
- Assert
- .assertEquals(
- "org.apache.shindig.gadgets.oauth2.OAuth2Request encountered a
problem : adding client authentication : ",
- result.getMessage());
- Assert
- .assertEquals(
-
"[AUTHENTICATION_PROBLEM,org.apache.shindig.gadgets.oauth2.OAuth2Request
encountered a problem : adding client authentication : ]",
- result.toString());
- Assert
- .assertEquals(
- "org.apache.shindig.gadgets.oauth2.OAuth2Request encountered a
problem : adding client authentication : ",
- result.getLocalizedMessage());
}
@Test
@@ -58,49 +42,9 @@ public class OAuth2RequestExceptionTest
Assert.assertNotNull(result);
Assert.assertEquals("authentication_problem", result.getErrorCode());
- Assert.assertEquals("Could not add authentication headers to the request.",
- result.getErrorExplanation());
Assert.assertEquals("AUTHENTICATION_PROBLEM", result.name());
Assert.assertEquals(2, result.ordinal());
Assert.assertEquals("AUTHENTICATION_PROBLEM", result.toString());
}
- @Test
- public void testGetErrorText_1() throws Exception {
- final OAuth2RequestException fixture = new OAuth2RequestException(
- OAuth2Error.AUTHENTICATION_PROBLEM, "", new Throwable());
-
- final String result = fixture.getErrorText();
-
- Assert
- .assertEquals(
- "org.apache.shindig.gadgets.oauth2.OAuth2Request encountered a
problem : adding client authentication : ",
- result);
- }
-
- @Test
- public void testGetMessage_1() throws Exception {
- final OAuth2RequestException fixture = new OAuth2RequestException(
- OAuth2Error.AUTHENTICATION_PROBLEM, "", new Throwable());
-
- final String result = fixture.getMessage();
-
- Assert
- .assertEquals(
- "org.apache.shindig.gadgets.oauth2.OAuth2Request encountered a
problem : adding client authentication : ",
- result);
- }
-
- @Test
- public void testToString_1() throws Exception {
- final OAuth2RequestException fixture = new OAuth2RequestException(
- OAuth2Error.AUTHENTICATION_PROBLEM, "", new Throwable());
-
- final String result = fixture.toString();
-
- Assert
- .assertEquals(
-
"[AUTHENTICATION_PROBLEM,org.apache.shindig.gadgets.oauth2.OAuth2Request
encountered a problem : adding client authentication : ]",
- result);
- }
}
\ No newline at end of file
Modified:
shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/oauth2/handler/OAuth2HandlerErrorTest.java
URL:
http://svn.apache.org/viewvc/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/oauth2/handler/OAuth2HandlerErrorTest.java?rev=1297695&r1=1297694&r2=1297695&view=diff
==============================================================================
---
shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/oauth2/handler/OAuth2HandlerErrorTest.java
(original)
+++
shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/oauth2/handler/OAuth2HandlerErrorTest.java
Tue Mar 6 20:36:07 2012
@@ -72,8 +72,6 @@ public class OAuth2HandlerErrorTest {
Assert.assertNotNull(result);
Assert.assertEquals("authentication_problem", result.getErrorCode());
- Assert.assertEquals("Could not add authentication headers to the request.",
- result.getErrorExplanation());
Assert.assertEquals("AUTHENTICATION_PROBLEM", result.name());
Assert.assertEquals(2, result.ordinal());
Assert.assertEquals("AUTHENTICATION_PROBLEM", result.toString());
Modified:
shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/oauth2/logger/FilteredLoggerTest.java
URL:
http://svn.apache.org/viewvc/shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/oauth2/logger/FilteredLoggerTest.java?rev=1297695&r1=1297694&r2=1297695&view=diff
==============================================================================
---
shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/oauth2/logger/FilteredLoggerTest.java
(original)
+++
shindig/trunk/java/gadgets/src/test/java/org/apache/shindig/gadgets/oauth2/logger/FilteredLoggerTest.java
Tue Mar 6 20:36:07 2012
@@ -146,13 +146,6 @@ public class FilteredLoggerTest {
final ResourceBundle result = fixture.getResourceBundle();
Assert.assertNotNull(result);
- final String description =
result.getString(OAuth2Error.FETCH_PROBLEM.getErrorCode());
- Assert.assertEquals("executing OAuth2Request.fetch() : {0}", description);
-
- Assert.assertNotNull(result);
- final String explanation =
result.getString(OAuth2Error.FETCH_PROBLEM.getErrorCode()
- + ".explanation");
- Assert.assertEquals("An error occurred issuing the OAuth2 request.",
explanation);
}
@Test