diff --git a/vcloud/core/src/main/java/org/jclouds/vcloud/domain/internal/TasksListImpl.java b/vcloud/core/src/main/java/org/jclouds/vcloud/domain/internal/TasksListImpl.java index 0cb22fad21..382d2a2dc3 100644 --- a/vcloud/core/src/main/java/org/jclouds/vcloud/domain/internal/TasksListImpl.java +++ b/vcloud/core/src/main/java/org/jclouds/vcloud/domain/internal/TasksListImpl.java @@ -68,13 +68,17 @@ public class TasksListImpl implements TasksList { } }); - this.tasksByOwner = Multimaps.index(tasks, new Function() { + this.tasksByOwner = Multimaps.index(Iterables.filter(tasks, new Predicate() { - public URI apply(Task in) { - - return in.getOwner().getLocation(); + @Override + public boolean apply(Task input) { + return input.getOwner() != null; } + }), new Function() { + public URI apply(Task in) { + return in.getOwner().getLocation(); + } }); } diff --git a/vcloud/hostingdotcom/src/test/java/org/jclouds/vcloud/hostingdotcom/HostingDotComVCloudClientLiveTest.java b/vcloud/hostingdotcom/src/test/java/org/jclouds/vcloud/hostingdotcom/HostingDotComVCloudClientLiveTest.java new file mode 100644 index 0000000000..73013e3d05 --- /dev/null +++ b/vcloud/hostingdotcom/src/test/java/org/jclouds/vcloud/hostingdotcom/HostingDotComVCloudClientLiveTest.java @@ -0,0 +1,56 @@ +/** + * + * Copyright (C) 2009 Cloud Conscious, LLC. + * + * ==================================================================== + * 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); + } + +} diff --git a/vcloud/hostingdotcom/src/test/resources/log4j.xml b/vcloud/hostingdotcom/src/test/resources/log4j.xml index e6caf35848..91713b73f9 100755 --- a/vcloud/hostingdotcom/src/test/resources/log4j.xml +++ b/vcloud/hostingdotcom/src/test/resources/log4j.xml @@ -130,7 +130,7 @@ - +