Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7FC67200CD9 for ; Wed, 19 Jul 2017 18:25:38 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7E54A169545; Wed, 19 Jul 2017 16:25:38 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4446D169529 for ; Wed, 19 Jul 2017 18:25:37 +0200 (CEST) Received: (qmail 36047 invoked by uid 500); 19 Jul 2017 16:25:36 -0000 Mailing-List: contact commits-help@brooklyn.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.apache.org Delivered-To: mailing list commits@brooklyn.apache.org Received: (qmail 35407 invoked by uid 99); 19 Jul 2017 16:25:35 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Jul 2017 16:25:35 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DBB2DF5EBF; Wed, 19 Jul 2017 16:25:32 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: geomacy@apache.org To: commits@brooklyn.apache.org Date: Wed, 19 Jul 2017 16:25:46 -0000 Message-Id: <288fb456b4814ab4959feacbb5fb42fe@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [16/39] brooklyn-server git commit: remove osgi deprecation, disable, and transform tests archived-at: Wed, 19 Jul 2017 16:25:38 -0000 remove osgi deprecation, disable, and transform tests these are no longer supported; need to think through how to address Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/580c00da Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/580c00da Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/580c00da Branch: refs/heads/master Commit: 580c00da07e6956b911ec48e2626540805702f83 Parents: 02cfe50 Author: Alex Heneveld Authored: Fri Jun 30 09:54:11 2017 +0100 Committer: Alex Heneveld Committed: Fri Jun 30 14:08:25 2017 +0100 ---------------------------------------------------------------------- .../brooklyn/catalog/CatalogYamlRebindTest.java | 93 ++++---------------- 1 file changed, 16 insertions(+), 77 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/580c00da/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlRebindTest.java ---------------------------------------------------------------------- diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlRebindTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlRebindTest.java index a962dbe..d8cd514 100644 --- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlRebindTest.java +++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlRebindTest.java @@ -51,7 +51,6 @@ import org.apache.brooklyn.entity.stock.BasicEntity; import org.apache.brooklyn.test.Asserts; import org.apache.brooklyn.test.support.TestResourceUnavailableException; import org.apache.brooklyn.util.exceptions.Exceptions; -import org.apache.brooklyn.util.osgi.OsgiTestResources; import org.apache.brooklyn.util.text.Strings; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; @@ -70,12 +69,10 @@ public class CatalogYamlRebindTest extends AbstractYamlRebindTest { // - config/attribute cannot be instantiated (e.g. because class no longer on classpath) // - entity file corrupt - private static final String OSGI_BUNDLE_SYMBOLID_NAME_FULL = OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_SYMBOLIC_NAME_FULL; - private static final String OSGI_BUNDLE_URL = OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_URL; - private static final String OSGI_SIMPLE_ENTITY_TYPE = OsgiTestResources.BROOKLYN_TEST_OSGI_ENTITIES_SIMPLE_ENTITY; - private static final String OSGI_SIMPLE_POLICY_TYPE = OsgiTestResources.BROOKLYN_TEST_OSGI_ENTITIES_SIMPLE_POLICY; - private static final String OSGI_SIMPLE_EFFECTOR_TYPE = OsgiTestResources.BROOKLYN_TEST_OSGI_ENTITIES_SIMPLE_EFFECTOR; - + // Since 0.12.0 OSGi reads from bundles so many of the things this used to test are no longer supported; + // deprecation and disablement will have to be done on a bundle-wide basis + // and transforms will have to be done by forcibly replacing a bundle or another "upgrade" mechanism + enum RebindWithCatalogTestMode { NO_OP, STRIP_DEPRECATION_AND_ENABLEMENT_FROM_CATALOG_ITEM, @@ -87,8 +84,6 @@ public class CatalogYamlRebindTest extends AbstractYamlRebindTest { enum OsgiMode { NONE, - LIBRARY, - PREFIX } private Boolean defaultEnablementOfFeatureAutoFixatalogRefOnRebind; @@ -111,27 +106,19 @@ public class CatalogYamlRebindTest extends AbstractYamlRebindTest { @Override protected boolean useOsgi() { - return true; + return false; } @DataProvider public Object[][] dataProvider() { return new Object[][] { {RebindWithCatalogTestMode.NO_OP, OsgiMode.NONE}, - {RebindWithCatalogTestMode.NO_OP, OsgiMode.LIBRARY}, - {RebindWithCatalogTestMode.NO_OP, OsgiMode.PREFIX}, {RebindWithCatalogTestMode.STRIP_DEPRECATION_AND_ENABLEMENT_FROM_CATALOG_ITEM, OsgiMode.NONE}, - {RebindWithCatalogTestMode.STRIP_DEPRECATION_AND_ENABLEMENT_FROM_CATALOG_ITEM, OsgiMode.LIBRARY}, - {RebindWithCatalogTestMode.STRIP_DEPRECATION_AND_ENABLEMENT_FROM_CATALOG_ITEM, OsgiMode.PREFIX}, {RebindWithCatalogTestMode.DEPRECATE_CATALOG, OsgiMode.NONE}, - {RebindWithCatalogTestMode.DEPRECATE_CATALOG, OsgiMode.LIBRARY}, - {RebindWithCatalogTestMode.DEPRECATE_CATALOG, OsgiMode.PREFIX}, {RebindWithCatalogTestMode.DISABLE_CATALOG, OsgiMode.NONE}, - {RebindWithCatalogTestMode.DISABLE_CATALOG, OsgiMode.LIBRARY}, - {RebindWithCatalogTestMode.DISABLE_CATALOG, OsgiMode.PREFIX}, // For DELETE_CATALOG, see https://issues.apache.org/jira/browse/BROOKLYN-149. // Deletes the catalog item before rebind, but the referenced types are still on the @@ -143,8 +130,6 @@ public class CatalogYamlRebindTest extends AbstractYamlRebindTest { // Upgrades the catalog item before rebind, deleting the old version. // Will automatically upgrade. Test will enable "FEATURE_AUTO_FIX_CATALOG_REF_ON_REBIND" {RebindWithCatalogTestMode.REPLACE_CATALOG_WITH_NEWER_VERSION, OsgiMode.NONE}, - {RebindWithCatalogTestMode.REPLACE_CATALOG_WITH_NEWER_VERSION, OsgiMode.LIBRARY}, - {RebindWithCatalogTestMode.REPLACE_CATALOG_WITH_NEWER_VERSION, OsgiMode.PREFIX}, }; } @@ -216,63 +201,17 @@ public class CatalogYamlRebindTest extends AbstractYamlRebindTest { String appSymbolicName = "my.catalog.app.id.load"; String appVersion = "0.1.0"; - String appCatalogFormat; - if (osgiMode == OsgiMode.LIBRARY) { - appCatalogFormat = Joiner.on("\n").join( - "brooklyn.catalog:", - " id: " + appSymbolicName, - " version: %s", - " itemType: entity", - " libraries:", - " - url: " + OSGI_BUNDLE_URL, - " item:", - " type: " + OSGI_SIMPLE_ENTITY_TYPE, - " brooklyn.enrichers:", - " - type: " + TestEnricher.class.getName(), - " brooklyn.policies:", - " - type: " + OSGI_SIMPLE_POLICY_TYPE, - " brooklyn.initializers:", - " - type: " + OSGI_SIMPLE_EFFECTOR_TYPE); - } else if (osgiMode == OsgiMode.PREFIX) { - // This catalog item is just meant to load the bundle in the OSGi environment. Its content is irrelevant. - String libraryItem = Joiner.on("\n").join( - "brooklyn.catalog:", - " id: dummy", - " version: %s", - " itemType: entity", - " libraries:", - " - url: " + OSGI_BUNDLE_URL, - " item: " + BasicEntity.class.getName()); - addCatalogItems(String.format(libraryItem, appVersion)); - - // Use bundle prefixes here, pointing to the bundle already loaded above - appCatalogFormat = Joiner.on("\n").join( - "brooklyn.catalog:", - " id: " + appSymbolicName, - " version: %s", - " itemType: entity", - " item:", - " type: " + OSGI_BUNDLE_SYMBOLID_NAME_FULL + ":" + OSGI_SIMPLE_ENTITY_TYPE, - " brooklyn.enrichers:", - " - type: " + TestEnricher.class.getName(), - " brooklyn.policies:", - " - type: " + OSGI_BUNDLE_SYMBOLID_NAME_FULL + ":" + OSGI_SIMPLE_POLICY_TYPE, - " brooklyn.initializers:", - " - type: " + OSGI_BUNDLE_SYMBOLID_NAME_FULL + ":" + OSGI_SIMPLE_EFFECTOR_TYPE); - } else { - appCatalogFormat = Joiner.on("\n").join( - "brooklyn.catalog:", - " id: " + appSymbolicName, - " version: %s", - " itemType: entity", - " item:", - " type: " + BasicEntity.class.getName(), - " brooklyn.enrichers:", - " - type: " + TestEnricher.class.getName(), - " brooklyn.policies:", - " - type: " + TestPolicy.class.getName()); - } - + String appCatalogFormat = Joiner.on("\n").join( + "brooklyn.catalog:", + " id: " + appSymbolicName, + " version: %s", + " itemType: entity", + " item:", + " type: " + BasicEntity.class.getName(), + " brooklyn.enrichers:", + " - type: " + TestEnricher.class.getName(), + " brooklyn.policies:", + " - type: " + TestPolicy.class.getName()); String locSymbolicName = "my.catalog.loc.id.load"; String locVersion = "1.0.0";