Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/810#discussion_r140605795
  
    --- Diff: 
rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/BundleAndTypeResourcesTest.java
 ---
    @@ -0,0 +1,1098 @@
    +/*
    + * 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.rest.resources;
    +
    +import static com.google.common.base.Preconditions.checkNotNull;
    +import static org.testng.Assert.assertEquals;
    +import static org.testng.Assert.assertTrue;
    +
    +import java.awt.Image;
    +import java.awt.Toolkit;
    +import java.io.ByteArrayInputStream;
    +import java.io.File;
    +import java.io.FileInputStream;
    +import java.io.FileOutputStream;
    +import java.io.IOException;
    +import java.io.InputStream;
    +import java.net.URI;
    +import java.util.Collection;
    +import java.util.List;
    +import java.util.Map;
    +import java.util.Set;
    +import java.util.jar.JarEntry;
    +import java.util.jar.JarOutputStream;
    +import java.util.zip.ZipEntry;
    +import java.util.zip.ZipOutputStream;
    +
    +import javax.ws.rs.core.GenericType;
    +import javax.ws.rs.core.MediaType;
    +import javax.ws.rs.core.Response;
    +
    +import org.apache.brooklyn.api.entity.Entity;
    +import org.apache.brooklyn.api.objs.BrooklynObject;
    +import org.apache.brooklyn.api.objs.Configurable;
    +import org.apache.brooklyn.api.objs.Identifiable;
    +import org.apache.brooklyn.api.policy.Policy;
    +import org.apache.brooklyn.api.typereg.ManagedBundle;
    +import org.apache.brooklyn.api.typereg.OsgiBundleWithUrl;
    +import org.apache.brooklyn.api.typereg.RegisteredType;
    +import org.apache.brooklyn.core.entity.EntityPredicates;
    +import org.apache.brooklyn.core.mgmt.ha.OsgiManager;
    +import org.apache.brooklyn.core.mgmt.internal.ManagementContextInternal;
    +import org.apache.brooklyn.core.mgmt.osgi.OsgiStandaloneTest;
    +import org.apache.brooklyn.core.test.entity.TestEntity;
    +import org.apache.brooklyn.enricher.stock.Aggregator;
    +import org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy;
    +import org.apache.brooklyn.rest.domain.BundleInstallationRestResult;
    +import org.apache.brooklyn.rest.domain.BundleSummary;
    +import org.apache.brooklyn.rest.domain.TypeDetail;
    +import org.apache.brooklyn.rest.domain.TypeSummary;
    +import org.apache.brooklyn.rest.testing.BrooklynRestResourceTest;
    +import org.apache.brooklyn.test.Asserts;
    +import org.apache.brooklyn.test.support.TestResourceUnavailableException;
    +import org.apache.brooklyn.util.collections.MutableList;
    +import org.apache.brooklyn.util.collections.MutableMap;
    +import org.apache.brooklyn.util.collections.MutableSet;
    +import org.apache.brooklyn.util.core.ResourceUtils;
    +import org.apache.brooklyn.util.core.osgi.BundleMaker;
    +import org.apache.brooklyn.util.javalang.JavaClassNames;
    +import org.apache.brooklyn.util.javalang.Reflections;
    +import org.apache.brooklyn.util.os.Os;
    +import org.apache.brooklyn.util.osgi.OsgiTestResources;
    +import org.apache.brooklyn.util.stream.Streams;
    +import org.apache.http.HttpHeaders;
    +import org.eclipse.jetty.http.HttpStatus;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +import org.testng.Assert;
    +import org.testng.annotations.Test;
    +import org.testng.reporters.Files;
    +
    +import com.google.common.base.Joiner;
    +import com.google.common.collect.ImmutableList;
    +import com.google.common.collect.ImmutableMap;
    +import com.google.common.collect.Iterables;
    +
    +public class BundleAndTypeResourcesTest extends BrooklynRestResourceTest {
    --- End diff --
    
    Great tests!
    
    Class is getting pretty big. Maybe worth splitting into separate classes 
for bundle and type tests (or separating out the invalid jar/bundle/bom tests). 
But leave as-is for now.


---

Reply via email to