You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by an...@apache.org on 2015/05/13 17:36:51 UTC

[2/3] incubator-brooklyn git commit: Minor fix on tests

Minor fix on tests


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

Branch: refs/heads/master
Commit: 307693c242695e1bf3c9b8bdddedb330f2af448c
Parents: f32fa3c
Author: Miguel Barrientos <mb...@lcc.uma.es>
Authored: Wed May 6 16:36:04 2015 +0200
Committer: Miguel Barrientos <mb...@lcc.uma.es>
Committed: Wed May 6 16:36:04 2015 +0200

----------------------------------------------------------------------
 .../ReflectiveEntityDriverFactoryTest.java       | 19 +++++++------------
 .../location/basic/PaasLocationTest.java         |  2 --
 2 files changed, 7 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/307693c2/core/src/test/java/brooklyn/entity/drivers/ReflectiveEntityDriverFactoryTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/entity/drivers/ReflectiveEntityDriverFactoryTest.java b/core/src/test/java/brooklyn/entity/drivers/ReflectiveEntityDriverFactoryTest.java
index 5554259..1f71bed 100644
--- a/core/src/test/java/brooklyn/entity/drivers/ReflectiveEntityDriverFactoryTest.java
+++ b/core/src/test/java/brooklyn/entity/drivers/ReflectiveEntityDriverFactoryTest.java
@@ -52,11 +52,6 @@ public class ReflectiveEntityDriverFactoryTest {
     public void tearDown() {
         // nothing to tear down; no management context created
     }
-
-    protected void assertDriverIs(Class<?> clazz) {
-        MyDriver driver = factory.build(entity, sshLocation);
-        assertTrue(driver.getClass().equals(clazz), "driver="+driver+"; should be "+clazz);
-    }
     
     protected void assertDriverIs(Class<?> clazz, Location location) {
         MyDriver driver = factory.build(entity, location);
@@ -65,7 +60,7 @@ public class ReflectiveEntityDriverFactoryTest {
     
     @Test
     public void testInstantiatesSshDriver() throws Exception {
-        assertDriverIs(MySshDriver.class);
+        assertDriverIs(MySshDriver.class, sshLocation);
     }
 
     @Test
@@ -76,40 +71,40 @@ public class ReflectiveEntityDriverFactoryTest {
     @Test
     public void testFullNameMapping() throws Exception {
         factory.addClassFullNameMapping(MyDriver.class.getName(), MyCustomDriver.class.getName());
-        assertDriverIs(MyCustomDriver.class);
+        assertDriverIs(MyCustomDriver.class, sshLocation);
     }
 
     @Test
     public void testFullNameMappingMulti() throws Exception {
         factory.addClassFullNameMapping(MyDriver.class.getName(), "X");
         factory.addClassFullNameMapping(MyDriver.class.getName(), MyCustomDriver.class.getName());
-        assertDriverIs(MyCustomDriver.class);
+        assertDriverIs(MyCustomDriver.class, sshLocation);
     }
 
 
     @Test
     public void testFullNameMappingFailure1() throws Exception {
         factory.addClassFullNameMapping(MyDriver.class.getName()+"X", MyCustomDriver.class.getName());
-        assertDriverIs(MySshDriver.class);
+        assertDriverIs(MySshDriver.class, sshLocation);
     }
 
     @Test
     public void testFullNameMappingFailure2() throws Exception {
         factory.addClassFullNameMapping(MyDriver.class.getName(), MyCustomDriver.class.getName());
         factory.addClassFullNameMapping(MyDriver.class.getName(), "X");
-        assertDriverIs(MySshDriver.class);
+        assertDriverIs(MySshDriver.class, sshLocation);
     }
 
     @Test
     public void testSimpleNameMapping() throws Exception {
         factory.addClassSimpleNameMapping(MyDriver.class.getSimpleName(), MyCustomDriver.class.getSimpleName());
-        assertDriverIs(MyCustomDriver.class);
+        assertDriverIs(MyCustomDriver.class, sshLocation);
     }
 
     @Test
     public void testSimpleNameMappingFailure() throws Exception {
         factory.addClassSimpleNameMapping(MyDriver.class.getSimpleName()+"X", MyCustomDriver.class.getSimpleName());
-        assertDriverIs(MySshDriver.class);
+        assertDriverIs(MySshDriver.class, sshLocation);
     }
     
     public static class MyDriverDependentEntity<D extends EntityDriver> extends AbstractEntity implements DriverDependentEntity<D> {

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/307693c2/core/src/test/java/brooklyn/location/basic/PaasLocationTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/location/basic/PaasLocationTest.java b/core/src/test/java/brooklyn/location/basic/PaasLocationTest.java
index 0fd2591..e9eb457 100644
--- a/core/src/test/java/brooklyn/location/basic/PaasLocationTest.java
+++ b/core/src/test/java/brooklyn/location/basic/PaasLocationTest.java
@@ -19,7 +19,6 @@
 package brooklyn.location.basic;
 
 import brooklyn.location.paas.PaasLocation;
-import brooklyn.management.ManagementContext;
 import brooklyn.test.location.TestPaasLocation;
 import org.testng.Assert;
 import org.testng.annotations.Test;
@@ -27,7 +26,6 @@ import org.testng.annotations.Test;
 public class PaasLocationTest {
 
     private PaasLocation location;
-    private ManagementContext mgmt;
     
     @Test
     public void testProviderName(){