brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [1/2] brooklyn-server git commit: Fix tests expecting specific Brooklyn version
Date Thu, 14 Jul 2016 16:49:50 GMT
Repository: brooklyn-server
Updated Branches:
  refs/heads/master c4d505551 -> af4963537


Fix tests expecting specific Brooklyn version


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

Branch: refs/heads/master
Commit: 2bffc6f0f68b72fb6243f40ad9677df3637aa3e9
Parents: c4d5055
Author: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Authored: Thu Jul 14 19:47:46 2016 +0300
Committer: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Committed: Thu Jul 14 19:48:23 2016 +0300

----------------------------------------------------------------------
 .../util/core/ClassLoaderUtilsTest.java         | 31 +++++++++++++++-----
 1 file changed, 23 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/2bffc6f0/core/src/test/java/org/apache/brooklyn/util/core/ClassLoaderUtilsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/util/core/ClassLoaderUtilsTest.java b/core/src/test/java/org/apache/brooklyn/util/core/ClassLoaderUtilsTest.java
index 7ede563..11b5641 100644
--- a/core/src/test/java/org/apache/brooklyn/util/core/ClassLoaderUtilsTest.java
+++ b/core/src/test/java/org/apache/brooklyn/util/core/ClassLoaderUtilsTest.java
@@ -21,6 +21,7 @@ package org.apache.brooklyn.util.core;
 import static com.google.common.base.Preconditions.checkNotNull;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNotNull;
 import static org.testng.Assert.assertNull;
 import static org.testng.Assert.assertTrue;
 
@@ -219,14 +220,28 @@ public class ClassLoaderUtilsTest {
                 "org.apache.brooklyn.api",
                 OsgiUtils.toOsgiVersion(BrooklynVersion.get()),
                 Entity.class.getName());
-        new ClassLoaderUtils(this, mgmt).loadClass(
-                "org.apache.brooklyn.api",
-                "0.10.0-SNAPSHOT",
-                Entity.class.getName());
-        new ClassLoaderUtils(this, mgmt).loadClass(
-                "org.apache.brooklyn.api",
-                "0.10.0.SNAPSHOT",
-                Entity.class.getName());
+        try {
+            new ClassLoaderUtils(this, mgmt).loadClass(
+                    "org.apache.brooklyn.api",
+                    "100.100.100-alpha-version_wth.tags",
+                    Entity.class.getName());
+            Asserts.shouldHaveFailedPreviously();
+        } catch (Exception e) {
+            IllegalStateException nested = Exceptions.getFirstThrowableOfType(e, IllegalStateException.class);
+            assertNotNull(nested);
+            Asserts.expectedFailureContains(nested, "not found to load");
+        }
+        try {
+            new ClassLoaderUtils(this, mgmt).loadClass(
+                    "org.apache.brooklyn.api",
+                    "100.100.100-SNAPSHOT",
+                    Entity.class.getName());
+            Asserts.shouldHaveFailedPreviously();
+        } catch (Exception e) {
+            IllegalStateException nested = Exceptions.getFirstThrowableOfType(e, IllegalStateException.class);
+            assertNotNull(nested);
+            Asserts.expectedFailureContains(nested, "not found to load");
+        }
     }
     
     private Bundle installBundle(ManagementContext mgmt, String bundleUrl) throws Exception
{


Mime
View raw message