You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2016/09/28 14:43:58 UTC
[1/2] brooklyn-server git commit: Fix
LocalhostMachineProvisioningLocationTest
Repository: brooklyn-server
Updated Branches:
refs/heads/master d9e4bac32 -> 15429e209
Fix LocalhostMachineProvisioningLocationTest
Use @BeforeMethod rather than @BeforeClass for test setup/teardown
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/448c1590
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/448c1590
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/448c1590
Branch: refs/heads/master
Commit: 448c15901369e916242a9b8c26359d825137a40f
Parents: d9e4bac
Author: Aled Sage <al...@gmail.com>
Authored: Wed Sep 28 12:09:03 2016 +0100
Committer: Aled Sage <al...@gmail.com>
Committed: Wed Sep 28 12:09:03 2016 +0100
----------------------------------------------------------------------
...ocalhostMachineProvisioningLocationTest.java | 49 +++++++++-----------
1 file changed, 22 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/448c1590/core/src/test/java/org/apache/brooklyn/location/localhost/LocalhostMachineProvisioningLocationTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/location/localhost/LocalhostMachineProvisioningLocationTest.java b/core/src/test/java/org/apache/brooklyn/location/localhost/LocalhostMachineProvisioningLocationTest.java
index 3a2b860..e9a4dab 100644
--- a/core/src/test/java/org/apache/brooklyn/location/localhost/LocalhostMachineProvisioningLocationTest.java
+++ b/core/src/test/java/org/apache/brooklyn/location/localhost/LocalhostMachineProvisioningLocationTest.java
@@ -24,47 +24,42 @@ import static org.testng.Assert.fail;
import java.net.ServerSocket;
-import org.apache.brooklyn.util.collections.MutableMap;
-import org.apache.brooklyn.util.net.Networking;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.Assert;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
import org.apache.brooklyn.api.location.LocationSpec;
import org.apache.brooklyn.api.location.MachineProvisioningLocation;
import org.apache.brooklyn.api.location.NoMachinesAvailableException;
import org.apache.brooklyn.api.location.PortRange;
-import org.apache.brooklyn.core.entity.Entities;
import org.apache.brooklyn.core.location.PortRanges;
import org.apache.brooklyn.core.location.geo.HostGeoInfo;
-import org.apache.brooklyn.core.mgmt.internal.LocalManagementContext;
-import org.apache.brooklyn.core.test.entity.LocalManagementContextForTests;
-import org.apache.brooklyn.location.localhost.LocalhostMachineProvisioningLocation;
+import org.apache.brooklyn.core.test.BrooklynMgmtUnitTestSupport;
import org.apache.brooklyn.location.ssh.SshMachineLocation;
+import org.apache.brooklyn.util.collections.MutableMap;
+import org.apache.brooklyn.util.net.Networking;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
-public class LocalhostMachineProvisioningLocationTest {
+public class LocalhostMachineProvisioningLocationTest extends BrooklynMgmtUnitTestSupport {
private static final Logger log = LoggerFactory.getLogger(LocalhostMachineProvisioningLocationTest.class);
- private LocalManagementContext mgmt;
-
- @BeforeMethod
- @AfterClass
- protected void clearStatics() {
+ @BeforeMethod(alwaysRun=true)
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
LocalhostMachineProvisioningLocation.clearStaticData();
}
- @BeforeClass
- protected void setup() {
- mgmt = LocalManagementContextForTests.newInstance();
- }
-
- @AfterClass
- protected void teardown() {
- Entities.destroyAll(mgmt);
+ @AfterMethod(alwaysRun=true)
+ @Override
+ public void tearDown() throws Exception {
+ try {
+ super.tearDown();
+ } finally {
+ LocalhostMachineProvisioningLocation.clearStaticData();
+ }
}
protected LocalhostMachineProvisioningLocation newLocalhostProvisioner() {
[2/2] brooklyn-server git commit: This closes #357
Posted by he...@apache.org.
This closes #357
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/15429e20
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/15429e20
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/15429e20
Branch: refs/heads/master
Commit: 15429e20903cad5840cf955573827b466aa3faa3
Parents: d9e4bac 448c159
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Wed Sep 28 15:43:49 2016 +0100
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Wed Sep 28 15:43:49 2016 +0100
----------------------------------------------------------------------
...ocalhostMachineProvisioningLocationTest.java | 49 +++++++++-----------
1 file changed, 22 insertions(+), 27 deletions(-)
----------------------------------------------------------------------