fixed case on RackSpace should be Rackspace

git-svn-id: http://jclouds.googlecode.com/svn/trunk@1629 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
adrian.f.cole 2009-07-16 19:46:20 +00:00
parent bdd0cf3b22
commit 78573da3d0
10 changed files with 44 additions and 44 deletions

View File

@ -24,14 +24,14 @@
package org.jclouds.rackspace.cloudfiles.reference;
import org.jclouds.objectstore.reference.ObjectStoreConstants;
import org.jclouds.rackspace.reference.RackSpaceConstants;
import org.jclouds.rackspace.reference.RackspaceConstants;
/**
* Configuration properties and constants used in Cloud Files connections.
*
* @author Adrian Cole
*/
public interface CloudFilesConstants extends ObjectStoreConstants, RackSpaceConstants {
public interface CloudFilesConstants extends ObjectStoreConstants, RackspaceConstants {

View File

@ -31,7 +31,7 @@ import org.jclouds.http.HttpException;
import org.jclouds.http.HttpRequest;
import org.jclouds.http.HttpRequestFilter;
import org.jclouds.rackspace.Authentication;
import org.jclouds.rackspace.reference.RackSpaceHeaders;
import org.jclouds.rackspace.reference.RackspaceHeaders;
import com.google.inject.Inject;
import com.google.inject.Provider;
@ -89,7 +89,7 @@ public class AuthenticateRequest implements HttpRequestFilter {
}
public void filter(HttpRequest request) throws HttpException {
request.getHeaders().replaceValues(RackSpaceHeaders.AUTH_TOKEN,
request.getHeaders().replaceValues(RackspaceHeaders.AUTH_TOKEN,
Collections.singletonList(getAuthToken()));
}

View File

@ -30,7 +30,7 @@ import javax.ws.rs.HeaderParam;
import javax.ws.rs.Path;
import org.jclouds.rackspace.functions.ParseAuthenticationResponseFromHeaders;
import org.jclouds.rackspace.reference.RackSpaceHeaders;
import org.jclouds.rackspace.reference.RackspaceHeaders;
import org.jclouds.rest.ResponseParser;
/**
@ -42,7 +42,7 @@ import org.jclouds.rest.ResponseParser;
* @author Adrian Cole
*/
public interface RackSpaceAuthentication {
public interface RackspaceAuthentication {
public interface AuthenticationResponse {
@Storage
@ -61,6 +61,6 @@ public interface RackSpaceAuthentication {
@GET
@ResponseParser(ParseAuthenticationResponseFromHeaders.class)
@Path("/auth")
AuthenticationResponse authenticate(@HeaderParam(RackSpaceHeaders.AUTH_USER) String user,
@HeaderParam(RackSpaceHeaders.AUTH_KEY) String key);
AuthenticationResponse authenticate(@HeaderParam(RackspaceHeaders.AUTH_USER) String user,
@HeaderParam(RackspaceHeaders.AUTH_KEY) String key);
}

View File

@ -34,8 +34,8 @@ import static org.jclouds.http.pool.PoolConstants.PROPERTY_POOL_MAX_CONNECTIONS;
import static org.jclouds.http.pool.PoolConstants.PROPERTY_POOL_MAX_CONNECTION_REUSE;
import static org.jclouds.http.pool.PoolConstants.PROPERTY_POOL_MAX_SESSION_FAILURES;
import static org.jclouds.http.pool.PoolConstants.PROPERTY_POOL_REQUEST_INVOKER_THREADS;
import static org.jclouds.rackspace.reference.RackSpaceConstants.PROPERTY_RACKSPACE_KEY;
import static org.jclouds.rackspace.reference.RackSpaceConstants.PROPERTY_RACKSPACE_USER;
import static org.jclouds.rackspace.reference.RackspaceConstants.PROPERTY_RACKSPACE_KEY;
import static org.jclouds.rackspace.reference.RackspaceConstants.PROPERTY_RACKSPACE_USER;
import java.util.List;
import java.util.Properties;

View File

@ -1,7 +1,7 @@
package org.jclouds.rackspace.config;
import static org.jclouds.rackspace.reference.RackSpaceConstants.PROPERTY_RACKSPACE_KEY;
import static org.jclouds.rackspace.reference.RackSpaceConstants.PROPERTY_RACKSPACE_USER;
import static org.jclouds.rackspace.reference.RackspaceConstants.PROPERTY_RACKSPACE_KEY;
import static org.jclouds.rackspace.reference.RackspaceConstants.PROPERTY_RACKSPACE_USER;
import java.net.MalformedURLException;
import java.net.URI;
@ -10,10 +10,10 @@ import org.jclouds.http.HttpConstants;
import org.jclouds.http.RequiresHttp;
import org.jclouds.rackspace.Authentication;
import org.jclouds.rackspace.CDN;
import org.jclouds.rackspace.RackSpaceAuthentication;
import org.jclouds.rackspace.RackspaceAuthentication;
import org.jclouds.rackspace.Server;
import org.jclouds.rackspace.Storage;
import org.jclouds.rackspace.RackSpaceAuthentication.AuthenticationResponse;
import org.jclouds.rackspace.RackspaceAuthentication.AuthenticationResponse;
import org.jclouds.rest.RestClientFactory;
import org.jclouds.rest.config.JaxrsModule;
@ -43,7 +43,7 @@ public class RackspaceAuthenticationModule extends AbstractModule {
@Authentication URI authenticationUri, RestClientFactory factory,
@Named(PROPERTY_RACKSPACE_USER) String user,
@Named(PROPERTY_RACKSPACE_KEY) String key) {
return factory.create(authenticationUri, RackSpaceAuthentication.class).authenticate(user,
return factory.create(authenticationUri, RackspaceAuthentication.class).authenticate(user,
key);
}
@ -53,7 +53,7 @@ public class RackspaceAuthenticationModule extends AbstractModule {
RestClientFactory factory,
@Named(PROPERTY_RACKSPACE_USER) String user,
@Named(PROPERTY_RACKSPACE_KEY) String key) {
return factory.create(authenticationUri, RackSpaceAuthentication.class).authenticate(user,
return factory.create(authenticationUri, RackspaceAuthentication.class).authenticate(user,
key).getAuthToken();
}

View File

@ -24,15 +24,15 @@
package org.jclouds.rackspace.functions;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.jclouds.rackspace.reference.RackSpaceHeaders.AUTH_TOKEN;
import static org.jclouds.rackspace.reference.RackSpaceHeaders.CDN_MANAGEMENT_URL;
import static org.jclouds.rackspace.reference.RackSpaceHeaders.SERVER_MANAGEMENT_URL;
import static org.jclouds.rackspace.reference.RackSpaceHeaders.STORAGE_URL;
import static org.jclouds.rackspace.reference.RackspaceHeaders.AUTH_TOKEN;
import static org.jclouds.rackspace.reference.RackspaceHeaders.CDN_MANAGEMENT_URL;
import static org.jclouds.rackspace.reference.RackspaceHeaders.SERVER_MANAGEMENT_URL;
import static org.jclouds.rackspace.reference.RackspaceHeaders.STORAGE_URL;
import java.net.URI;
import org.jclouds.http.HttpResponse;
import org.jclouds.rackspace.RackSpaceAuthentication.AuthenticationResponse;
import org.jclouds.rackspace.RackspaceAuthentication.AuthenticationResponse;
import com.google.common.base.Function;

View File

@ -24,11 +24,11 @@
package org.jclouds.rackspace.reference;
/**
* Configuration properties and constants used in RackSpace connections.
* Configuration properties and constants used in Rackspace connections.
*
* @author Adrian Cole
*/
public interface RackSpaceConstants {
public interface RackspaceConstants {
public static final String PROPERTY_RACKSPACE_USER = "jclouds.rackspace.user";
public static final String PROPERTY_RACKSPACE_KEY = "jclouds.rackspace.key";
}

View File

@ -7,7 +7,7 @@ package org.jclouds.rackspace.reference;
* @author Adrian Cole
*
*/
public interface RackSpaceHeaders {
public interface RackspaceHeaders {
public static final String AUTH_USER = "X-Auth-User";
public static final String AUTH_KEY = "X-Auth-Key";

View File

@ -23,8 +23,8 @@
*/
package org.jclouds.rackspace;
import static org.jclouds.rackspace.reference.RackSpaceConstants.PROPERTY_RACKSPACE_KEY;
import static org.jclouds.rackspace.reference.RackSpaceConstants.PROPERTY_RACKSPACE_USER;
import static org.jclouds.rackspace.reference.RackspaceConstants.PROPERTY_RACKSPACE_KEY;
import static org.jclouds.rackspace.reference.RackspaceConstants.PROPERTY_RACKSPACE_USER;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.fail;
@ -36,8 +36,8 @@ import org.jclouds.concurrent.WithinThreadExecutorService;
import org.jclouds.concurrent.config.ExecutorServiceModule;
import org.jclouds.http.HttpResponseException;
import org.jclouds.http.config.JavaUrlHttpCommandExecutorServiceModule;
import org.jclouds.rackspace.RackSpaceAuthentication;
import org.jclouds.rackspace.RackSpaceAuthentication.AuthenticationResponse;
import org.jclouds.rackspace.RackspaceAuthentication;
import org.jclouds.rackspace.RackspaceAuthentication.AuthenticationResponse;
import org.jclouds.rest.RestClientFactory;
import org.jclouds.rest.config.JaxrsModule;
import org.testng.annotations.BeforeClass;
@ -54,8 +54,8 @@ import com.google.inject.Singleton;
*
* @author Adrian Cole
*/
@Test(groups = "live", testName = "rackspace.RackSpaceAuthenticationLiveTest")
public class RackSpaceAuthenticationLiveTest {
@Test(groups = "live", testName = "rackspace.RackspaceAuthenticationLiveTest")
public class RackspaceAuthenticationLiveTest {
protected static final String sysRackspaceUser = System.getProperty(PROPERTY_RACKSPACE_USER);
protected static final String sysRackspaceKey = System.getProperty(PROPERTY_RACKSPACE_KEY);
@ -63,8 +63,8 @@ public class RackSpaceAuthenticationLiveTest {
@Test
public void testAuthentication() throws Exception {
RackSpaceAuthentication authentication = injector
.getInstance(RackSpaceAuthentication.class);
RackspaceAuthentication authentication = injector
.getInstance(RackspaceAuthentication.class);
AuthenticationResponse response = authentication.authenticate(sysRackspaceUser,
sysRackspaceKey);
assertNotNull(response);
@ -76,8 +76,8 @@ public class RackSpaceAuthenticationLiveTest {
@Test(expectedExceptions = HttpResponseException.class)
public void testBadAuthentication() throws Exception {
RackSpaceAuthentication authentication = injector
.getInstance(RackSpaceAuthentication.class);
RackspaceAuthentication authentication = injector
.getInstance(RackspaceAuthentication.class);
try {
authentication.authenticate("foo", "bar");
} catch (UndeclaredThrowableException e) {
@ -98,10 +98,10 @@ public class RackSpaceAuthenticationLiveTest {
@SuppressWarnings("unused")
@Provides
@Singleton
protected RackSpaceAuthentication provideCloudFilesAuthentication(
protected RackspaceAuthentication provideCloudFilesAuthentication(
RestClientFactory factory) {
return factory.create(URI.create("https://api.mosso.com"),
RackSpaceAuthentication.class);
RackspaceAuthentication.class);
}
}, new JaxrsModule(), new ExecutorServiceModule(new WithinThreadExecutorService()),
new JavaUrlHttpCommandExecutorServiceModule());

View File

@ -35,7 +35,7 @@ import org.jclouds.http.HttpMethod;
import org.jclouds.http.HttpRequest;
import org.jclouds.http.config.JavaUrlHttpCommandExecutorServiceModule;
import org.jclouds.rackspace.functions.ParseAuthenticationResponseFromHeaders;
import org.jclouds.rackspace.reference.RackSpaceHeaders;
import org.jclouds.rackspace.reference.RackspaceHeaders;
import org.jclouds.rest.JaxrsAnnotationProcessor;
import org.jclouds.rest.config.JaxrsModule;
import org.testng.annotations.BeforeClass;
@ -49,26 +49,26 @@ import com.google.inject.Guice;
*
* @author Adrian Cole
*/
@Test(groups = "unit", testName = "rackspace.RackSpaceAuthentication")
public class RackSpaceAuthenticationTest {
@Test(groups = "unit", testName = "rackspace.RackspaceAuthentication")
public class RackspaceAuthenticationTest {
JaxrsAnnotationProcessor.Factory factory;
public void testAuthenticate() throws SecurityException, NoSuchMethodException {
Method method = RackSpaceAuthentication.class.getMethod("authenticate", String.class,
Method method = RackspaceAuthentication.class.getMethod("authenticate", String.class,
String.class);
URI endpoint = URI.create("http://localhost");
HttpRequest httpMethod = factory.create(RackSpaceAuthentication.class).createRequest(
HttpRequest httpMethod = factory.create(RackspaceAuthentication.class).createRequest(
endpoint, method, new Object[] { "foo", "bar" });
assertEquals(httpMethod.getEndpoint().getHost(), "localhost");
assertEquals(httpMethod.getEndpoint().getPath(), "/auth");
assertEquals(httpMethod.getMethod(), HttpMethod.GET);
assertEquals(httpMethod.getHeaders().size(), 2);
assertEquals(httpMethod.getHeaders().get(RackSpaceHeaders.AUTH_USER), Collections
assertEquals(httpMethod.getHeaders().get(RackspaceHeaders.AUTH_USER), Collections
.singletonList("foo"));
assertEquals(httpMethod.getHeaders().get(RackSpaceHeaders.AUTH_KEY), Collections
assertEquals(httpMethod.getHeaders().get(RackspaceHeaders.AUTH_KEY), Collections
.singletonList("bar"));
factory.create(RackSpaceAuthentication.class);
factory.create(RackspaceAuthentication.class);
assertEquals(JaxrsAnnotationProcessor.getParserOrThrowException(method),
ParseAuthenticationResponseFromHeaders.class);