You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by sj...@apache.org on 2017/03/13 11:38:17 UTC
[1/3] brooklyn-server git commit: Fix Entitlements Integration tests
Repository: brooklyn-server
Updated Branches:
refs/heads/master ea18d9ab0 -> f218966fe
Fix Entitlements Integration tests
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/09f8332f
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/09f8332f
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/09f8332f
Branch: refs/heads/master
Commit: 09f8332fe5c496e7194ff59e2c77bc0870a2fe74
Parents: 2fe2ba0
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Tue Mar 7 19:22:12 2017 +0200
Committer: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Committed: Tue Mar 7 23:30:41 2017 +0200
----------------------------------------------------------------------
.../rest/entitlement/AbstractRestApiEntitlementsTest.java | 7 +++++++
1 file changed, 7 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/09f8332f/rest/rest-server/src/test/java/org/apache/brooklyn/rest/entitlement/AbstractRestApiEntitlementsTest.java
----------------------------------------------------------------------
diff --git a/rest/rest-server/src/test/java/org/apache/brooklyn/rest/entitlement/AbstractRestApiEntitlementsTest.java b/rest/rest-server/src/test/java/org/apache/brooklyn/rest/entitlement/AbstractRestApiEntitlementsTest.java
index 7e11474..67b0e8b 100644
--- a/rest/rest-server/src/test/java/org/apache/brooklyn/rest/entitlement/AbstractRestApiEntitlementsTest.java
+++ b/rest/rest-server/src/test/java/org/apache/brooklyn/rest/entitlement/AbstractRestApiEntitlementsTest.java
@@ -19,6 +19,7 @@
package org.apache.brooklyn.rest.entitlement;
import static org.testng.Assert.assertEquals;
+
import java.net.URI;
import org.apache.brooklyn.api.entity.EntitySpec;
@@ -30,6 +31,7 @@ import org.apache.brooklyn.core.mgmt.entitlement.PerUserEntitlementManager;
import org.apache.brooklyn.core.test.entity.LocalManagementContextForTests;
import org.apache.brooklyn.core.test.entity.TestApplication;
import org.apache.brooklyn.core.test.entity.TestEntity;
+import org.apache.brooklyn.rest.BrooklynRestApiLauncher;
import org.apache.brooklyn.rest.BrooklynRestApiLauncherTestFixture;
import org.apache.brooklyn.rest.BrooklynWebConfig;
import org.apache.brooklyn.util.http.HttpTool;
@@ -72,6 +74,11 @@ public abstract class AbstractRestApiEntitlementsTest extends BrooklynRestApiLau
.start());
}
+ @Override
+ protected BrooklynRestApiLauncher baseLauncher() {
+ return BrooklynRestApiLauncher.launcher();
+ }
+
@AfterMethod(alwaysRun=true)
public void tearDown() throws Exception {
if (mgmt != null) Entities.destroyAll(mgmt);
[2/3] brooklyn-server git commit: Revert "Make BailOutJcloudsLocation
logic a bit simpler"
Posted by sj...@apache.org.
Revert "Make BailOutJcloudsLocation logic a bit simpler"
This reverts commit ac9d9e990077b50b64ee89bcd60e4caf84489693.
The BailOutException thrown in the location is wrapped in
multiple levels of exceptions, the last one being ExecutionException
due to the "future.get()" call. The catch clause in the test
doesn't acticate for this reason (no matching exception there)
so the test fails.
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/3cef8968
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/3cef8968
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/3cef8968
Branch: refs/heads/master
Commit: 3cef8968f7fa1c743955c916a5f550113ee1cfe4
Parents: 09f8332
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Tue Mar 7 23:44:14 2017 +0200
Committer: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Committed: Tue Mar 7 23:44:14 2017 +0200
----------------------------------------------------------------------
.../location/jclouds/BailOutJcloudsLocation.java | 12 +++++-------
.../lifecycle/MachineLifecycleEffectorTasksTest.java | 11 ++++++++---
2 files changed, 13 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/3cef8968/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/BailOutJcloudsLocation.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/BailOutJcloudsLocation.java b/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/BailOutJcloudsLocation.java
index fa0a18a..d824c8e 100644
--- a/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/BailOutJcloudsLocation.java
+++ b/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/BailOutJcloudsLocation.java
@@ -22,6 +22,7 @@ package org.apache.brooklyn.location.jclouds;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
+
import javax.annotation.Nullable;
import org.apache.brooklyn.api.location.LocationSpec;
@@ -48,6 +49,9 @@ import com.google.common.reflect.TypeToken;
public class BailOutJcloudsLocation extends JcloudsLocation {
+ public static final String ERROR_MESSAGE = "early termination for test";
+ public static final RuntimeException BAIL_OUT_FOR_TESTING = new RuntimeException(ERROR_MESSAGE);
+
// Don't care which image; not actually provisioning
private static final String US_EAST_IMAGE_ID = "us-east-1/ami-7d7bfc14";
@@ -78,7 +82,7 @@ public class BailOutJcloudsLocation extends JcloudsLocation {
if (Boolean.TRUE.equals(getConfig(BUILD_TEMPLATE))) {
template = super.buildTemplate(computeService, config, customizers);
}
- throw new BailOutException("early termination for test");
+ throw new RuntimeException(BAIL_OUT_FOR_TESTING);
}
public Template getTemplate() {
@@ -188,10 +192,4 @@ public class BailOutJcloudsLocation extends JcloudsLocation {
return newBailOutJcloudsLocation(mgmt, allConfig);
}
- public static class BailOutException extends RuntimeException {
- public BailOutException(String message) {
- super(message);
- }
- }
-
}
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/3cef8968/software/base/src/test/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasksTest.java
----------------------------------------------------------------------
diff --git a/software/base/src/test/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasksTest.java b/software/base/src/test/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasksTest.java
index a89d493..4d51db0 100644
--- a/software/base/src/test/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasksTest.java
+++ b/software/base/src/test/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasksTest.java
@@ -44,6 +44,7 @@ import org.apache.brooklyn.location.jclouds.BailOutJcloudsLocation;
import org.apache.brooklyn.test.Asserts;
import org.apache.brooklyn.util.core.task.TaskInternal;
import org.apache.brooklyn.util.core.task.ValueResolver;
+import org.apache.brooklyn.util.exceptions.Exceptions;
import org.apache.brooklyn.util.time.Duration;
import org.apache.brooklyn.util.time.Time;
import org.testng.annotations.DataProvider;
@@ -107,9 +108,13 @@ public class MachineLifecycleEffectorTasksTest {
try {
triggerEntity.sensors().set(ready, true);
task.get(Duration.THIRTY_SECONDS);
- Asserts.shouldHaveFailedPreviously("BailOutJcloudsLocation should have thrown");
- } catch (BailOutJcloudsLocation.BailOutException t) {
- // expected
+ } catch (Throwable t) {
+ Exceptions.propagateIfFatal(t);
+ if ((t.toString().contains(BailOutJcloudsLocation.ERROR_MESSAGE))) {
+ // expected - BailOut location throws - just swallow
+ } else {
+ Exceptions.propagate(t);
+ }
} finally {
Entities.destroyAll(app.getManagementContext());
}
[3/3] brooklyn-server git commit: This closes #582
Posted by sj...@apache.org.
This closes #582
Fix Integration tests
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/f218966f
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/f218966f
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/f218966f
Branch: refs/heads/master
Commit: f218966fef0f7964df4e2e6ce873df7243f309e4
Parents: ea18d9a 3cef896
Author: Sam Corbett <sa...@cloudsoftcorp.com>
Authored: Mon Mar 13 11:30:33 2017 +0000
Committer: Sam Corbett <sa...@cloudsoftcorp.com>
Committed: Mon Mar 13 11:30:33 2017 +0000
----------------------------------------------------------------------
.../location/jclouds/BailOutJcloudsLocation.java | 12 +++++-------
.../entitlement/AbstractRestApiEntitlementsTest.java | 7 +++++++
.../lifecycle/MachineLifecycleEffectorTasksTest.java | 11 ++++++++---
3 files changed, 20 insertions(+), 10 deletions(-)
----------------------------------------------------------------------