brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Entitlements
Date Tue, 20 Jan 2015 10:04:27 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/414#discussion_r23212416
  
    --- Diff: core/src/test/java/brooklyn/management/entitlement/AcmeEntitlementManagerTest.java
---
    @@ -21,132 +21,38 @@
     import java.net.URI;
     
     import org.testng.Assert;
    -import org.testng.annotations.AfterMethod;
    -import org.testng.annotations.BeforeMethod;
     import org.testng.annotations.Test;
     
    -import com.google.common.collect.ImmutableList;
    -
    -import brooklyn.config.BrooklynProperties;
    -import brooklyn.entity.Application;
    -import brooklyn.entity.basic.ApplicationBuilder;
    -import brooklyn.entity.basic.BasicApplication;
    -import brooklyn.entity.basic.Entities;
    -import brooklyn.entity.proxying.EntitySpec;
    -import brooklyn.location.Location;
    -import brooklyn.management.ManagementContext;
     import brooklyn.management.entitlement.Entitlements.EntityAndItem;
    -import brooklyn.test.entity.LocalManagementContextForTests;
    -import brooklyn.util.config.ConfigBag;
    -import brooklyn.util.exceptions.Exceptions;
    -
    -public class AcmeEntitlementManagerTest {
     
    -    ManagementContext mgmt;
    -    Application app;
    -    ConfigBag configBag;
    -    
    -    public void setup(ConfigBag cfg) {
    -        mgmt = new LocalManagementContextForTests(BrooklynProperties.Factory.newEmpty().addFrom(cfg));
    -        app = ApplicationBuilder.newManagedApp(EntitySpec.create(BasicApplication.class),
mgmt);
    -    }
    +public class AcmeEntitlementManagerTest extends AcmeEntitlementManagerTestFixture {
     
    -    @BeforeMethod(alwaysRun=true)
    -    public void init() {
    -        Entitlements.clearEntitlementContext();
    -        configBag = ConfigBag.newInstance();
    +    protected void addGlobalConfig() {
             configBag.put(Entitlements.GLOBAL_ENTITLEMENT_MANAGER, AcmeEntitlementManager.class.getName());
         }
     
    -    @AfterMethod(alwaysRun=true)
    -    public void tearDown() {
    -        Entitlements.clearEntitlementContext();
    -        if (app != null) Entities.destroyAll(app.getManagementContext());
    -        if (mgmt != null) Entities.destroyAll(mgmt);
    -        app = null;
    -        mgmt = null;
    +    @Test
    +    public void testAnonUserHasAllPermissions() {
    +        checkUserHasAllPermissions("anon");
    --- End diff --
    
    Why does "anon" have all permissions? I don't see "anon" defined in `AcmeEntitlementManager`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message