Override setupContext and tearDownContext to avoid ordering issues when running live tests

This commit is contained in:
Ignasi Barrera 2012-10-30 17:13:09 +01:00
parent 6b257340eb
commit 98787ecc00
3 changed files with 16 additions and 8 deletions

View File

@ -37,8 +37,10 @@ public class AccountLiveTest extends BaseAbiquoLiveApiTest {
private Enterprise enterprise; private Enterprise enterprise;
@BeforeClass(groups = "live") @BeforeClass(groups = { "integration", "live" })
public void setup() { @Override
public void setupContext() {
super.setupContext();
enterprise = view.getAdministrationService().getCurrentEnterprise(); enterprise = view.getAdministrationService().getCurrentEnterprise();
} }

View File

@ -58,8 +58,10 @@ public class VirtualApplianceLiveTest extends BaseAbiquoLiveApiTest {
private MonitoringService monitoringService; private MonitoringService monitoringService;
@BeforeClass(groups = "live") @BeforeClass(groups = { "integration", "live" })
public void setup() { @Override
public void setupContext() {
super.setupContext();
monitoringService = view.getMonitoringService(); monitoringService = view.getMonitoringService();
vdc = getLast(view.getCloudService().listVirtualDatacenters()); vdc = getLast(view.getCloudService().listVirtualDatacenters());
vmt = templateBySize().min(vdc.listAvailableTemplates()); vmt = templateBySize().min(vdc.listAvailableTemplates());

View File

@ -67,8 +67,10 @@ public class VirtualMachineLiveTest extends BaseAbiquoLiveApiTest {
private MonitoringService monitoringService; private MonitoringService monitoringService;
@BeforeClass(groups = "live") @BeforeClass(groups = { "integration", "live" })
public void setup() { @Override
public void setupContext() {
super.setupContext();
monitoringService = view.getMonitoringService(); monitoringService = view.getMonitoringService();
vdc = getLast(view.getCloudService().listVirtualDatacenters()); vdc = getLast(view.getCloudService().listVirtualDatacenters());
vmt = templateBySize().min(vdc.listAvailableTemplates()); vmt = templateBySize().min(vdc.listAvailableTemplates());
@ -78,9 +80,11 @@ public class VirtualMachineLiveTest extends BaseAbiquoLiveApiTest {
assertNotNull(vapp.getId()); assertNotNull(vapp.getId());
} }
@AfterClass(groups = "live") @AfterClass(groups = { "integration", "live" })
public void tearDown() { @Override
protected void tearDownContext() {
vapp.delete(); vapp.delete();
super.tearDownContext();
} }
@Test @Test