Only select networks with isDefault(true) for tests

This commit is contained in:
Andrei Savu 2012-03-15 14:15:50 +02:00
parent ffec085287
commit b1ba624707
1 changed files with 2 additions and 1 deletions

View File

@ -25,6 +25,7 @@ import static com.google.common.collect.Iterables.get;
import static com.google.common.collect.Iterables.getFirst; import static com.google.common.collect.Iterables.getFirst;
import static com.google.common.collect.Iterables.getOnlyElement; import static com.google.common.collect.Iterables.getOnlyElement;
import static com.google.common.collect.Sets.filter; import static com.google.common.collect.Sets.filter;
import static org.jclouds.cloudstack.options.ListNetworksOptions.Builder.isDefault;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue; import static org.testng.Assert.assertTrue;
@ -88,7 +89,7 @@ public class VirtualMachineClientLiveTest extends BaseCloudStackClientLiveTest {
public static VirtualMachine createVirtualMachine(CloudStackClient client, Long defaultTemplate, public static VirtualMachine createVirtualMachine(CloudStackClient client, Long defaultTemplate,
RetryablePredicate<Long> jobComplete, RetryablePredicate<VirtualMachine> virtualMachineRunning) { RetryablePredicate<Long> jobComplete, RetryablePredicate<VirtualMachine> virtualMachineRunning) {
Set<Network> networks = client.getNetworkClient().listNetworks(); Set<Network> networks = client.getNetworkClient().listNetworks(isDefault(true));
if (networks.size() > 0) { if (networks.size() > 0) {
Network network = get(networks, 0); Network network = get(networks, 0);
return createVirtualMachineInNetwork(network, return createVirtualMachineInNetwork(network,