brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From drigod...@apache.org
Subject [1/2] brooklyn-server git commit: BROOKLYN-479: add test for byon error message
Date Tue, 23 May 2017 17:44:02 GMT
Repository: brooklyn-server
Updated Branches:
  refs/heads/master a4d76b146 -> 757a38cc4


BROOKLYN-479: add test for byon error message

Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/e1ab2a4b
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/e1ab2a4b
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/e1ab2a4b

Branch: refs/heads/master
Commit: e1ab2a4b0ab842982cfafaba0b32c969266e88ca
Parents: 6287271
Author: Aled Sage <aled.sage@gmail.com>
Authored: Tue May 23 16:07:26 2017 +0100
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Tue May 23 16:07:26 2017 +0100

----------------------------------------------------------------------
 .../camp/brooklyn/ByonLocationsYamlTest.java       | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/e1ab2a4b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ByonLocationsYamlTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ByonLocationsYamlTest.java
b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ByonLocationsYamlTest.java
index a2ddf43..79efd74 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ByonLocationsYamlTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ByonLocationsYamlTest.java
@@ -38,6 +38,7 @@ import org.apache.brooklyn.location.byon.FixedListMachineProvisioningLocation;
 import org.apache.brooklyn.location.ssh.SshMachineLocation;
 import org.apache.brooklyn.location.winrm.WinRmMachineLocation;
 import org.apache.brooklyn.test.Asserts;
+import org.apache.brooklyn.util.exceptions.Exceptions;
 import org.apache.brooklyn.util.net.UserAndHostAndPort;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -253,6 +254,22 @@ public class ByonLocationsYamlTest extends AbstractYamlTest {
         assertNull(machine.config().get(CloudLocationConfig.INBOUND_PORTS));
     }
 
+    // See https://issues.apache.org/jira/browse/BROOKLYN-479
+    @Test
+    public void testByonSpecWithNoConfig() throws Exception {
+        String yaml = Joiner.on("\n").join(
+                "location: byon",
+                "services:",
+                "- serviceType: org.apache.brooklyn.entity.stock.BasicApplication");
+        
+        try {
+            Entity app = createStartWaitAndLogApplication(yaml);
+            Asserts.shouldHaveFailedPreviously("app="+app);
+        } catch (Exception e) {
+            Asserts.expectedFailureContains(e, "Invalid location", "byon", "at least one
host must be defined");
+        }
+    }
+    
     private void assertMachine(SshMachineLocation machine, UserAndHostAndPort conn, Map<String,
?> config) {
         assertEquals(machine.getAddress().getHostAddress(), conn.getHostAndPort().getHostText());
         assertEquals(machine.getPort(), conn.getHostAndPort().getPort());


Mime
View raw message