Issue 112: update taskparser for hosting.com

git-svn-id: http://jclouds.googlecode.com/svn/trunk@2445 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
adrian.f.cole 2009-12-16 06:17:58 +00:00
parent f9e5839134
commit 54e1ddbda0
3 changed files with 65 additions and 5 deletions

View File

@ -68,13 +68,17 @@ public class TasksListImpl implements TasksList {
} }
}); });
this.tasksByOwner = Multimaps.index(tasks, new Function<Task, URI>() { this.tasksByOwner = Multimaps.index(Iterables.filter(tasks, new Predicate<Task>() {
public URI apply(Task in) { @Override
public boolean apply(Task input) {
return in.getOwner().getLocation(); return input.getOwner() != null;
} }
}), new Function<Task, URI>() {
public URI apply(Task in) {
return in.getOwner().getLocation();
}
}); });
} }

View File

@ -0,0 +1,56 @@
/**
*
* Copyright (C) 2009 Cloud Conscious, LLC. <info@cloudconscious.com>
*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* ====================================================================
*/
package org.jclouds.vcloud.hostingdotcom;
import static com.google.common.base.Preconditions.checkNotNull;
import org.jclouds.logging.log4j.config.Log4JLoggingModule;
import org.jclouds.ssh.jsch.config.JschSshClientModule;
import org.jclouds.vcloud.VCloudClientLiveTest;
import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test;
import com.google.inject.Injector;
/**
* Tests behavior of {@code HostingDotComVCloudClient}
*
* @author Adrian Cole
*/
@Test(groups = "live", sequential = true, testName = "vcloud.HostingDotComVCloudClientLiveTest")
public class HostingDotComVCloudClientLiveTest extends VCloudClientLiveTest {
@BeforeGroups(groups = { "live" })
@Override
public void setupClient() {
account = checkNotNull(System.getProperty("jclouds.test.user"), "jclouds.test.user");
String key = checkNotNull(System.getProperty("jclouds.test.key"), "jclouds.test.key");
Injector injector = new HostingDotComVCloudContextBuilder(
new HostingDotComVCloudPropertiesBuilder(account, key).relaxSSLHostname().build())
.withModules(new Log4JLoggingModule(), new JschSshClientModule()).buildInjector();
connection = injector.getInstance(HostingDotComVCloudClient.class);
}
}

View File

@ -130,7 +130,7 @@
<category name="org.jclouds.vcloud.hostingdotcom.HostingDotComVCloudComputeClient"> <category name="org.jclouds.vcloud.hostingdotcom.compute.HostingDotComVCloudComputeClient">
<priority value="TRACE" /> <priority value="TRACE" />
<appender-ref ref="ASYNCVCLOUD" /> <appender-ref ref="ASYNCVCLOUD" />
</category> </category>