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;
@BeforeClass(groups = "live")
public void setup() {
@BeforeClass(groups = { "integration", "live" })
@Override
public void setupContext() {
super.setupContext();
enterprise = view.getAdministrationService().getCurrentEnterprise();
}

View File

@ -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());

View File

@ -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