From 8068e4e0e5a796a83f8f7f67fbe3e5340193854e Mon Sep 17 00:00:00 2001 From: "ivan@ivan.net.nz" Date: Mon, 21 Dec 2009 03:55:27 +0000 Subject: [PATCH] Refactored the contextbuilder args. git-svn-id: http://jclouds.googlecode.com/svn/trunk@2489 3d8758e0-26b5-11de-8745-db77d3ebf521 --- .../rimuhosting/miro/RimuHostingAsyncClient.java | 14 +++++++------- .../rimuhosting/miro/RimuHostingClient.java | 12 ++++++------ .../miro/RimuHostingContextBuilder.java | 3 +-- .../miro/RimuHostingContextFactory.java | 4 ++-- .../miro/RimuHostingPropertiesBuilder.java | 9 ++++----- .../miro/config/RimuHostingContextModule.java | 2 +- .../miro/config/RimuHostingRestClientModule.java | 2 +- .../miro/reference/RimuHostingConstants.java | 3 +-- .../miro/servers/RimuHostingComputeService.java | 12 +++++++----- .../servers/RimuHostingCreateServerResponse.java | 2 +- .../miro/servers/RimuHostingServer.java | 2 +- .../miro/RimuHostingClientLiveTest.java | 9 ++++----- .../rimuhosting/miro/RimuHostingComputeClient.java | 10 +++++----- .../miro/RimuHostingComputeClientLiveTest.java | 6 ++---- .../miro/RimuHostingContextBuilderTest.java | 9 +++------ .../miro/config/RimuHostingContextModuleTest.java | 7 ++----- .../servers/RimuHostingComputeServiceLiveTest.java | 5 ++--- .../java/org/jclouds/tools/ant/ComputeTask.java | 2 +- 18 files changed, 51 insertions(+), 62 deletions(-) diff --git a/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingAsyncClient.java b/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingAsyncClient.java index 9ac3655967..90da41e0fd 100644 --- a/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingAsyncClient.java +++ b/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingAsyncClient.java @@ -61,7 +61,7 @@ public interface RimuHostingAsyncClient { @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @ExceptionParser(ParseRimuHostingException.class) - Future> getInstanceList(); + Future> getServerList(); @GET @Path("/pricing-plans") @MatrixParams(keys = "server-type", values = "VPS") @@ -76,7 +76,7 @@ public interface RimuHostingAsyncClient { @ExceptionParser(ParseRimuHostingException.class) @ResponseParser(ParseNewInstanceResponseFromJsonResponse.class) @MapBinder(RimuHostingCreateInstanceBinder.class) - Future createInstance(@MapPayloadParam("name") String name, @MapPayloadParam("imageId") String imageId, @MapPayloadParam("planId") String planId); + Future createServer(@MapPayloadParam("name") String name, @MapPayloadParam("imageId") String imageId, @MapPayloadParam("planId") String planId); @POST @Path("/orders/new-vps") @Produces(MediaType.APPLICATION_JSON) @@ -84,18 +84,18 @@ public interface RimuHostingAsyncClient { @ExceptionParser(ParseRimuHostingException.class) @ResponseParser(ParseNewInstanceResponseFromJsonResponse.class) @MapBinder(RimuHostingCreateInstanceBinder.class) - Future createInstance(@MapPayloadParam("name") String name, @MapPayloadParam("imageId") String imageId, @MapPayloadParam("planId") String planId, @MapPayloadParam("password") String password); + Future createServer(@MapPayloadParam("name") String name, @MapPayloadParam("imageId") String imageId, @MapPayloadParam("planId") String planId, @MapPayloadParam("password") String password); @GET @Path("/orders/order-{id}-blah/vps") @Consumes(MediaType.APPLICATION_JSON) @ResponseParser(ParseInstanceInfoFromJsonResponse.class) - Future getInstanceInfo(@PathParam("id") Long id); + Future getServerInfo(@PathParam("id") Long id); @GET @Path("/orders/order-{id}-blah") @Consumes(MediaType.APPLICATION_JSON) @ResponseParser(ParseInstanceFromJsonResponse.class) @ExceptionParser(ParseRimuHostingException.class) - Future getInstance(@PathParam("id") Long id); + Future getServer(@PathParam("id") Long id); @PUT @Path("/orders/order-{id}-blah/vps/running-state") @Produces(MediaType.APPLICATION_JSON) @@ -103,11 +103,11 @@ public interface RimuHostingAsyncClient { @ResponseParser(ParseInstanceInfoFromJsonResponse.class) @MapBinder(RimuHostingRebootJsonBinder.class) @ExceptionParser(ParseRimuHostingException.class) - Future restartInstance(@PathParam("id") Long id); + Future restartServer(@PathParam("id") Long id); @DELETE @Path("/orders/order-{id}-blah/vps") @Consumes(MediaType.APPLICATION_JSON) @ResponseParser(ParseDestroyResponseFromJsonResponse.class) @ExceptionParser(ParseRimuHostingException.class) - Future> destroyInstance(@PathParam("id") Long id); + Future> destroyServer(@PathParam("id") Long id); } diff --git a/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingClient.java b/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingClient.java index 6319133344..b0d0a5c0f9 100644 --- a/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingClient.java +++ b/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingClient.java @@ -43,17 +43,17 @@ public interface RimuHostingClient { SortedSet getImageList(); - SortedSet getInstanceList(); + SortedSet getServerList(); SortedSet getPricingPlanList(); - NewServerResponse createInstance(String name, String imageId, String planId); + NewServerResponse createServer(String name, String imageId, String planId); - NewServerResponse createInstance(String name, String imageId, String planId, String password); + NewServerResponse createServer(String name, String imageId, String planId, String password); - Server getInstance(Long id); + Server getServer(Long id); - ServerInfo restartInstance(Long id); + ServerInfo restartServer(Long id); - List destroyInstance(Long id); + List destroyServer(Long id); } diff --git a/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingContextBuilder.java b/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingContextBuilder.java index 2e3af564fc..642b41fb78 100644 --- a/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingContextBuilder.java +++ b/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingContextBuilder.java @@ -43,8 +43,7 @@ public class RimuHostingContextBuilder extends RestContextBuilder() { }, new TypeLiteral() { }, props); - checkNotNull(properties.getProperty(RimuHostingConstants.PROPERTY_RIMUHOSTING_USER)); - checkNotNull(properties.getProperty(RimuHostingConstants.PROPERTY_RIMUHOSTING_PASSWORD)); + checkNotNull(properties.getProperty(RimuHostingConstants.PROPERTY_RIMUHOSTING_APIKEY)); } protected void addClientModule(List modules) { diff --git a/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingContextFactory.java b/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingContextFactory.java index 1a142cc664..97f5b3e88d 100644 --- a/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingContextFactory.java +++ b/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingContextFactory.java @@ -47,9 +47,9 @@ import java.util.Properties; */ public class RimuHostingContextFactory { - public static RestContext createContext(String user, String password, + public static RestContext createContext(String apikey, Module... modules) { - return new RimuHostingContextBuilder(new RimuHostingPropertiesBuilder(user, password).build()) + return new RimuHostingContextBuilder(new RimuHostingPropertiesBuilder(apikey).build()) .withModules(modules).buildContext(); } diff --git a/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingPropertiesBuilder.java b/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingPropertiesBuilder.java index ac4193fe6e..d84a202951 100644 --- a/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingPropertiesBuilder.java +++ b/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/RimuHostingPropertiesBuilder.java @@ -47,14 +47,13 @@ public class RimuHostingPropertiesBuilder extends HttpPropertiesBuilder { super(properties); } - public RimuHostingPropertiesBuilder(String id, String secret) { + public RimuHostingPropertiesBuilder(String secret) { super(); - withCredentials(id, secret); + withCredentials(secret); } - public RimuHostingPropertiesBuilder withCredentials(String id, String secret) { - properties.setProperty(PROPERTY_RIMUHOSTING_USER, checkNotNull(id, "user")); - properties.setProperty(PROPERTY_RIMUHOSTING_PASSWORD, checkNotNull(secret, "password")); + public RimuHostingPropertiesBuilder withCredentials(String secret) { + properties.setProperty(PROPERTY_RIMUHOSTING_APIKEY, checkNotNull(secret, "password")); return this; } diff --git a/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/config/RimuHostingContextModule.java b/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/config/RimuHostingContextModule.java index 8581998f5c..2c3cacc552 100644 --- a/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/config/RimuHostingContextModule.java +++ b/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/config/RimuHostingContextModule.java @@ -58,7 +58,7 @@ public class RimuHostingContextModule extends AbstractModule { @Provides @Singleton RestContext provideContext(Closer closer, RimuHostingAsyncClient asyncApi, - RimuHostingClient syncApi, @RimuHosting URI endPoint, @Named(RimuHostingConstants.PROPERTY_RIMUHOSTING_USER) String account) { + RimuHostingClient syncApi, @RimuHosting URI endPoint, @Named(RimuHostingConstants.PROPERTY_RIMUHOSTING_APIKEY) String account) { return new RestContextImpl(closer, asyncApi, syncApi, endPoint, account); } diff --git a/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/config/RimuHostingRestClientModule.java b/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/config/RimuHostingRestClientModule.java index 172739ae00..6fc6877d9d 100644 --- a/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/config/RimuHostingRestClientModule.java +++ b/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/config/RimuHostingRestClientModule.java @@ -58,7 +58,7 @@ public class RimuHostingRestClientModule extends AbstractModule { @Provides @Singleton public RimuHostingAuthentication provideRimuHostingAuthentication( - @Named(RimuHostingConstants.PROPERTY_RIMUHOSTING_PASSWORD) String apikey) + @Named(RimuHostingConstants.PROPERTY_RIMUHOSTING_APIKEY) String apikey) throws UnsupportedEncodingException { return new RimuHostingAuthentication(apikey); } diff --git a/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/reference/RimuHostingConstants.java b/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/reference/RimuHostingConstants.java index 70f02b1c83..6fa3a44d1b 100644 --- a/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/reference/RimuHostingConstants.java +++ b/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/reference/RimuHostingConstants.java @@ -30,6 +30,5 @@ package org.jclouds.rimuhosting.miro.reference; */ public interface RimuHostingConstants { public static final String PROPERTY_RIMUHOSTING_ENDPOINT = "jclouds.rimuhosting.endpoint"; - public static final String PROPERTY_RIMUHOSTING_USER = "jclouds.rimuhosting.user"; - public static final String PROPERTY_RIMUHOSTING_PASSWORD = "jclouds.rimuhosting.password"; + public static final String PROPERTY_RIMUHOSTING_APIKEY = "jclouds.rimuhosting.password"; } diff --git a/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/servers/RimuHostingComputeService.java b/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/servers/RimuHostingComputeService.java index f96664a2cb..d38a962dcf 100644 --- a/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/servers/RimuHostingComputeService.java +++ b/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/servers/RimuHostingComputeService.java @@ -62,7 +62,7 @@ public class RimuHostingComputeService implements ComputeService { @Override public CreateServerResponse createServer(String name, Profile profile, Image image) { - NewServerResponse serverResponse = rhClient.createInstance(name, checkNotNull(imageNameMap + NewServerResponse serverResponse = rhClient.createServer(name, checkNotNull(imageNameMap .get(image), "image not supported: " + image), checkNotNull(profileNameMap .get(profile), "profile not supported: " + profile)); return new RimuHostingCreateServerResponse(serverResponse); @@ -70,7 +70,7 @@ public class RimuHostingComputeService implements ComputeService { public SortedSet listServers() { SortedSet servers = new TreeSet(); - SortedSet rhServers = rhClient.getInstanceList(); + SortedSet rhServers = rhClient.getServerList(); for (Server rhServer : rhServers) { servers.add(new RimuHostingServer(rhServer, rhClient)); } @@ -84,14 +84,16 @@ public class RimuHostingComputeService implements ComputeService { @Override public SortedSet getServerByName(String id) { SortedSet serverSet = new TreeSet(); - for (Server rhServer : rhClient.getInstanceList()) { - serverSet.add(new RimuHostingServer(rhServer, rhClient)); + for (Server rhServer : rhClient.getServerList()) { + if(rhServer.getName().equals(id)){ + serverSet.add(new RimuHostingServer(rhServer, rhClient)); + } } return serverSet; } @Override public void destroyServer(String id) { - rhClient.destroyInstance(new Long(id)); + rhClient.destroyServer(new Long(id)); } } \ No newline at end of file diff --git a/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/servers/RimuHostingCreateServerResponse.java b/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/servers/RimuHostingCreateServerResponse.java index 1bc0ddef30..e7359f0ead 100644 --- a/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/servers/RimuHostingCreateServerResponse.java +++ b/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/servers/RimuHostingCreateServerResponse.java @@ -46,7 +46,7 @@ public class RimuHostingCreateServerResponse extends CreateServerResponseImpl { public RimuHostingCreateServerResponse(NewServerResponse rhServerResponse) { super(rhServerResponse.getServer().getId().toString(), rhServerResponse.getServer().getName(), - ServerState.PENDING,// TODO need a real state! + ServerState.RUNNING,// TODO need a real state! getPublicAddresses(rhServerResponse.getServer()), ImmutableList. of(), 22, LoginType.SSH, new Credentials("root", rhServerResponse.getNewInstanceRequest() .getCreateOptions().getPassword())); diff --git a/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/servers/RimuHostingServer.java b/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/servers/RimuHostingServer.java index 9d13c2174b..f7a5e43d97 100644 --- a/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/servers/RimuHostingServer.java +++ b/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/servers/RimuHostingServer.java @@ -42,7 +42,7 @@ public class RimuHostingServer implements ServerIdentity { } public Boolean destroy() { - rhClient.destroyInstance(rhServer.getId()); + rhClient.destroyServer(rhServer.getId()); return Boolean.TRUE; } diff --git a/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingClientLiveTest.java b/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingClientLiveTest.java index 99966dbe0c..0d03c8994d 100644 --- a/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingClientLiveTest.java +++ b/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingClientLiveTest.java @@ -45,10 +45,9 @@ public class RimuHostingClientLiveTest { @BeforeGroups(groups = {"live"}) public void setupClient() { - String user = checkNotNull(System.getProperty("jclouds.test.user"), "jclouds.test.user"); String password = checkNotNull(System.getProperty("jclouds.test.key"), "jclouds.test.key"); - connection = RimuHostingContextFactory.createContext(user, password, new Log4JLoggingModule()) + connection = RimuHostingContextFactory.createContext(password, new Log4JLoggingModule()) .getApi(); } @@ -78,12 +77,12 @@ public class RimuHostingClientLiveTest { @Test public void testLifeCycle() { //Get the first image, we dont really care what it is in this test. - NewServerResponse serverResponse = connection.createInstance("test.jclouds.org", "lenny", "MIRO1B"); + NewServerResponse serverResponse = connection.createServer("test.jclouds.org", "lenny", "MIRO1B"); Server server = serverResponse.getServer(); //Now we have the server, lets restart it assertNotNull(server.getId()); - ServerInfo serverInfo = connection.restartInstance(server.getId()); - connection.destroyInstance(server.getId()); + ServerInfo serverInfo = connection.restartServer(server.getId()); + connection.destroyServer(server.getId()); //Should be running now. assertEquals(serverInfo.getState(), RunningState.RUNNING); assertEquals(server.getName(),"test.jclouds.org"); diff --git a/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingComputeClient.java b/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingComputeClient.java index 57ca4dbc20..eb4466ad7e 100644 --- a/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingComputeClient.java +++ b/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingComputeClient.java @@ -56,7 +56,7 @@ public class RimuHostingComputeClient { public Long start(String name, String planId, String imageId) { logger.debug(">> instantiating RimuHosting VPS name(%s) plan(%s) image(%s)", name, planId, imageId); - NewServerResponse serverRespone = rhClient.createInstance(name, imageId, planId); + NewServerResponse serverRespone = rhClient.createServer(name, imageId, planId); logger.debug(">> VPS id(%d) started and running.", serverRespone.getServer().getId()); return serverRespone.getServer().getId(); } @@ -64,16 +64,16 @@ public class RimuHostingComputeClient { public void reboot(Long id) { - Server server = rhClient.getInstance(id); + Server server = rhClient.getServer(id); logger.debug(">> rebooting VPS(%d)", server.getId()); - rhClient.restartInstance(id); + rhClient.restartServer(id); logger.debug("<< on VPS(%d)", server.getId()); } public void destroy(Long id) { - Server server = rhClient.getInstance(id); + Server server = rhClient.getServer(id); logger.debug(">> destroy VPS(%d)", server.getId()); - rhClient.destroyInstance(id); + rhClient.destroyServer(id); logger.debug(">> destroyed VPS"); } } \ No newline at end of file diff --git a/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingComputeClientLiveTest.java b/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingComputeClientLiveTest.java index 6c00a96cc2..8d2f1989f1 100644 --- a/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingComputeClientLiveTest.java +++ b/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingComputeClientLiveTest.java @@ -68,7 +68,7 @@ public class RimuHostingComputeClientLiveTest { String planId = "MIRO1B"; id = client.start(serverName, planId, imageId); - Server server = rhClient.getInstance(id); + Server server = rhClient.getServer(id); assertEquals(imageId, server.getImageId()); assertEquals(serverName, server.getName()); assertEquals(new Integer(160), server.getInstanceParameters().getRam()); @@ -82,10 +82,8 @@ public class RimuHostingComputeClientLiveTest { @BeforeGroups(groups = { "live" }) public void setupClient() { - String account = checkNotNull(System.getProperty("jclouds.test.user"), "jclouds.test.user"); String key = checkNotNull(System.getProperty("jclouds.test.key"), "jclouds.test.key"); - Injector injector = new RimuHostingContextBuilder(new RimuHostingPropertiesBuilder( - account, key).relaxSSLHostname().build()).withModules(new Log4JLoggingModule(), + Injector injector = new RimuHostingContextBuilder(new RimuHostingPropertiesBuilder(key).relaxSSLHostname().build()).withModules(new Log4JLoggingModule(), new JschSshClientModule(), new AbstractModule() { @Override diff --git a/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingContextBuilderTest.java b/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingContextBuilderTest.java index 24365f9e29..81c0b81374 100644 --- a/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingContextBuilderTest.java +++ b/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/RimuHostingContextBuilderTest.java @@ -51,16 +51,14 @@ public class RimuHostingContextBuilderTest { RimuHostingContextBuilder builder = newBuilder(); assertEquals(builder.getProperties().getProperty(RimuHostingConstants.PROPERTY_RIMUHOSTING_ENDPOINT), "https://rimuhosting.com/r"); - assertEquals(builder.getProperties().getProperty(RimuHostingConstants.PROPERTY_RIMUHOSTING_USER), - "user"); - assertEquals(builder.getProperties().getProperty(RimuHostingConstants.PROPERTY_RIMUHOSTING_PASSWORD), + assertEquals(builder.getProperties().getProperty(RimuHostingConstants.PROPERTY_RIMUHOSTING_APIKEY), "password"); } public void testBuildContext() { RestContext context = newBuilder().buildContext(); assertEquals(context.getClass(), RestContextImpl.class); - assertEquals(context.getAccount(), "user"); + assertEquals(context.getAccount(), "password"); assertEquals(context.getEndPoint(), URI.create("https://rimuhosting.com/r")); } @@ -80,8 +78,7 @@ public class RimuHostingContextBuilderTest { } private RimuHostingContextBuilder newBuilder() { - RimuHostingContextBuilder builder = new RimuHostingContextBuilder(new RimuHostingPropertiesBuilder( - "user", "password").build()); + RimuHostingContextBuilder builder = new RimuHostingContextBuilder(new RimuHostingPropertiesBuilder("password").build()); return builder; } diff --git a/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/config/RimuHostingContextModuleTest.java b/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/config/RimuHostingContextModuleTest.java index 080a528da9..21de948830 100644 --- a/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/config/RimuHostingContextModuleTest.java +++ b/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/config/RimuHostingContextModuleTest.java @@ -57,11 +57,8 @@ public class RimuHostingContextModuleTest { @Override protected void configure() { bindConstant().annotatedWith( - Jsr330.named(RimuHostingConstants.PROPERTY_RIMUHOSTING_USER)).to( - "user"); - bindConstant().annotatedWith( - Jsr330.named(RimuHostingConstants.PROPERTY_RIMUHOSTING_PASSWORD)).to( - "password"); + Jsr330.named(RimuHostingConstants.PROPERTY_RIMUHOSTING_APIKEY)).to( + "apikey"); bindConstant().annotatedWith( Jsr330.named(RimuHostingConstants.PROPERTY_RIMUHOSTING_ENDPOINT)).to( "http://localhost"); diff --git a/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/servers/RimuHostingComputeServiceLiveTest.java b/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/servers/RimuHostingComputeServiceLiveTest.java index 1f75fc49fe..795627935e 100755 --- a/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/servers/RimuHostingComputeServiceLiveTest.java +++ b/rimuhosting/src/test/java/org/jclouds/rimuhosting/miro/servers/RimuHostingComputeServiceLiveTest.java @@ -50,8 +50,7 @@ public class RimuHostingComputeServiceLiveTest { public void setupClient() { String account = "ddd"; String key = checkNotNull(System.getProperty("jclouds.test.key"), "jclouds.test.key"); - Injector injector = new RimuHostingContextBuilder(new RimuHostingPropertiesBuilder(account, - key).relaxSSLHostname().build()).withModules(new Log4JLoggingModule()) + Injector injector = new RimuHostingContextBuilder(new RimuHostingPropertiesBuilder(key).relaxSSLHostname().build()).withModules(new Log4JLoggingModule()) .buildInjector(); rhClient = injector.getInstance(RimuHostingClient.class); @@ -62,7 +61,7 @@ public class RimuHostingComputeServiceLiveTest { public void testServerCreate() { CreateServerResponse server = rhServerService.createServer("test.com", Profile.SMALLEST, Image.CENTOS_53); - assertNotNull(rhClient.getInstance(Long.valueOf(server.getId()))); + assertNotNull(rhClient.getServer(Long.valueOf(server.getId()))); rhServerService.destroyServer(server.getId()); } } diff --git a/tools/ant-plugin/src/main/java/org/jclouds/tools/ant/ComputeTask.java b/tools/ant-plugin/src/main/java/org/jclouds/tools/ant/ComputeTask.java index 047984a7c8..2327f27a50 100644 --- a/tools/ant-plugin/src/main/java/org/jclouds/tools/ant/ComputeTask.java +++ b/tools/ant-plugin/src/main/java/org/jclouds/tools/ant/ComputeTask.java @@ -218,7 +218,7 @@ public class ComputeTask extends Task { public void setAction(String action) { this.action = action; - } + } public ServerElement getServerElement() { return serverElement;