aledsage commented on a change in pull request #1010: BROOKLYN-605 rebind fails 
for historic state
URL: https://github.com/apache/brooklyn-server/pull/1010#discussion_r248244616
 
 

 ##########
 File path: 
core/src/test/java/org/apache/brooklyn/core/typereg/CatalogUpgradesGetBundleUpgradedIfNecessaryTest.java
 ##########
 @@ -0,0 +1,246 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.core.typereg;
+
+import com.google.common.base.Supplier;
+import com.google.common.collect.ImmutableListMultimap;
+import com.google.common.collect.ImmutableMap;
+import org.apache.brooklyn.api.mgmt.ManagementContext;
+import org.apache.brooklyn.api.typereg.BrooklynTypeRegistry;
+import org.apache.brooklyn.api.typereg.ManagedBundle;
+import org.apache.brooklyn.api.typereg.RegisteredType;
+import org.apache.brooklyn.core.mgmt.ha.OsgiManager;
+import org.apache.brooklyn.core.mgmt.internal.ManagementContextInternal;
+import org.apache.brooklyn.util.guava.Maybe;
+import org.apache.brooklyn.util.osgi.VersionedName;
+import org.assertj.core.api.WithAssertions;
+import org.mockito.Mockito;
+import org.osgi.framework.Bundle;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import java.util.*;
+
+import static org.apache.brooklyn.core.typereg.BundleTestUtil.newMockBundle;
+import static org.apache.brooklyn.core.typereg.BundleUpgradeParser.*;
+import static org.mockito.BDDMockito.given;
+import static org.mockito.Mockito.mock;
+
+public class CatalogUpgradesGetBundleUpgradedIfNecessaryTest implements 
WithAssertions {
+
+    private final ManagementContextInternal managementContext = 
mock(ManagementContextInternal.class);
+    private final OsgiManager osgiManager = mock(OsgiManager.class);
+    private final ManagedBundle managedBundle = mock(ManagedBundle.class);
+    private final BasicBrooklynTypeRegistry typeRegistry = 
mock(BasicBrooklynTypeRegistry.class);
+
+    private final String originalName = createAName("original", "1.0.0");
+    private final String updatedName = createAName("updated", "2.0.0");
+    private final VersionedName originalVersionedName = 
VersionedName.fromString(originalName);
+    private final VersionedName updatedVersionedName = 
VersionedName.fromString(updatedName);
+    private final VersionRangedName originalVersionRangedName =
+            VersionRangedName.fromString(originalName, true);
+
+    private CatalogUpgrades.Builder catalogUpgradesBuilder;
+
+    @BeforeMethod
 
 Review comment:
   Preference for `@BeforeMethod(alwaysRun=true)`. Otherwise if someone ever 
marks a test as `groups="Integration"` or some such then the setUp method would 
not be called.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to