From 98787ecc0096052fcefa575e54e7c7d6e3ffed16 Mon Sep 17 00:00:00 2001 From: Ignasi Barrera Date: Tue, 30 Oct 2012 17:13:09 +0100 Subject: [PATCH] Override setupContext and tearDownContext to avoid ordering issues when running live tests --- .../jclouds/abiquo/domain/cloud/AccountLiveTest.java | 6 ++++-- .../domain/cloud/VirtualApplianceLiveTest.java | 6 ++++-- .../abiquo/domain/cloud/VirtualMachineLiveTest.java | 12 ++++++++---- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/labs/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/AccountLiveTest.java b/labs/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/AccountLiveTest.java index 8e9fe40f88..ca0ea4d8d6 100644 --- a/labs/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/AccountLiveTest.java +++ b/labs/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/AccountLiveTest.java @@ -37,8 +37,10 @@ public class AccountLiveTest extends BaseAbiquoLiveApiTest { private Enterprise enterprise; - @BeforeClass(groups = "live") - public void setup() { + @BeforeClass(groups = { "integration", "live" }) + @Override + public void setupContext() { + super.setupContext(); enterprise = view.getAdministrationService().getCurrentEnterprise(); } diff --git a/labs/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualApplianceLiveTest.java b/labs/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualApplianceLiveTest.java index 2ae0f75c19..ceb776974b 100644 --- a/labs/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualApplianceLiveTest.java +++ b/labs/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualApplianceLiveTest.java @@ -58,8 +58,10 @@ public class VirtualApplianceLiveTest extends BaseAbiquoLiveApiTest { private MonitoringService monitoringService; - @BeforeClass(groups = "live") - public void setup() { + @BeforeClass(groups = { "integration", "live" }) + @Override + public void setupContext() { + super.setupContext(); monitoringService = view.getMonitoringService(); vdc = getLast(view.getCloudService().listVirtualDatacenters()); vmt = templateBySize().min(vdc.listAvailableTemplates()); diff --git a/labs/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineLiveTest.java b/labs/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineLiveTest.java index c28589c345..5a5d9a39d2 100644 --- a/labs/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineLiveTest.java +++ b/labs/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineLiveTest.java @@ -67,8 +67,10 @@ public class VirtualMachineLiveTest extends BaseAbiquoLiveApiTest { private MonitoringService monitoringService; - @BeforeClass(groups = "live") - public void setup() { + @BeforeClass(groups = { "integration", "live" }) + @Override + public void setupContext() { + super.setupContext(); monitoringService = view.getMonitoringService(); vdc = getLast(view.getCloudService().listVirtualDatacenters()); vmt = templateBySize().min(vdc.listAvailableTemplates()); @@ -78,9 +80,11 @@ public class VirtualMachineLiveTest extends BaseAbiquoLiveApiTest { assertNotNull(vapp.getId()); } - @AfterClass(groups = "live") - public void tearDown() { + @AfterClass(groups = { "integration", "live" }) + @Override + protected void tearDownContext() { vapp.delete(); + super.tearDownContext(); } @Test