You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by dr...@apache.org on 2017/11/15 12:13:05 UTC

[1/3] brooklyn-server git commit: test that REST resources in java are included in osgi and web.xml

Repository: brooklyn-server
Updated Branches:
  refs/heads/master 445b4b4dc -> 3b897d6ae


test that REST resources in java are included in osgi and web.xml

osgi passes with recent fix.  web.xml to be fixed in next.
(though maybe we should delete web.xml, as noted here.)


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

Branch: refs/heads/master
Commit: c9d7625bbf8ffcaac7c9489b35be1b15b5899e79
Parents: 410ec8c
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Tue Nov 14 10:59:11 2017 +0000
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Tue Nov 14 11:01:21 2017 +0000

----------------------------------------------------------------------
 .../rest/ResourcesInstalledEverywhereTest.java  | 57 ++++++++++++++++++++
 1 file changed, 57 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/c9d7625b/rest/rest-server/src/test/java/org/apache/brooklyn/rest/ResourcesInstalledEverywhereTest.java
----------------------------------------------------------------------
diff --git a/rest/rest-server/src/test/java/org/apache/brooklyn/rest/ResourcesInstalledEverywhereTest.java b/rest/rest-server/src/test/java/org/apache/brooklyn/rest/ResourcesInstalledEverywhereTest.java
new file mode 100644
index 0000000..fa5bc3e
--- /dev/null
+++ b/rest/rest-server/src/test/java/org/apache/brooklyn/rest/ResourcesInstalledEverywhereTest.java
@@ -0,0 +1,57 @@
+/*
+ * 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;
+
+import java.util.List;
+
+import org.apache.brooklyn.util.collections.MutableList;
+import org.apache.brooklyn.util.core.ResourceUtils;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+@Test
+public class ResourcesInstalledEverywhereTest {
+
+    public void testResourcesInBlueprintServiceXml() {
+        // from brooklyn-rest-resources
+        assertAllClassesListedAtUrl(ResourceUtils.create(this), "classpath://OSGI-INF/blueprint/service.xml", BrooklynRestApi.getBrooklynRestResources() );
+    }
+
+    public void testResourcesInWebXml() {
+        // in this project
+        // TODO not sure this is used? possibly we should delete as part of karaf bias.
+        // (we already have the java and the karaf blueprint ... maybe we could even get rid of the java
+        // but i think it's used a lot in dev)
+        assertAllClassesListedAtUrl(ResourceUtils.create(this), "classpath://WEB-INF/web.xml", BrooklynRestApi.getBrooklynRestResources() );
+    }
+    
+    private static void assertAllClassesListedAtUrl(ResourceUtils loader, String url, Iterable<?> resourceClasses) {
+        String text = loader.getResourceAsString(url);
+        List<String> missingClasses = MutableList.of();
+        for (Object c: resourceClasses) {
+            if (c instanceof Class) c = ((Class<?>)c).getName();
+            else c = c.getClass().getName();
+            
+            if (text.indexOf(c.toString())==-1) missingClasses.add(c.toString());
+        }
+        
+        if (!missingClasses.isEmpty())
+            Assert.fail("Missing entries at "+url+": "+missingClasses);
+    }
+}


[3/3] brooklyn-server git commit: This closes #896

Posted by dr...@apache.org.
This closes #896


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/3b897d6a
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/3b897d6a
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/3b897d6a

Branch: refs/heads/master
Commit: 3b897d6ae633c4e531078feacc48ae23d12ce8dc
Parents: 445b4b4 503955b
Author: Duncan Godwin <dr...@googlemail.com>
Authored: Wed Nov 15 12:12:59 2017 +0000
Committer: Duncan Godwin <dr...@googlemail.com>
Committed: Wed Nov 15 12:12:59 2017 +0000

----------------------------------------------------------------------
 .../rest-server/src/main/webapp/WEB-INF/web.xml |  3 ++
 .../rest/ResourcesInstalledEverywhereTest.java  | 57 ++++++++++++++++++++
 2 files changed, 60 insertions(+)
----------------------------------------------------------------------



[2/3] brooklyn-server git commit: add missing resources to web.xml, so test passes

Posted by dr...@apache.org.
add missing resources to web.xml, so test passes


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/503955b9
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/503955b9
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/503955b9

Branch: refs/heads/master
Commit: 503955b9952c35ea2d2f034b467403e4db7a74c9
Parents: c9d7625
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Tue Nov 14 11:01:25 2017 +0000
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Tue Nov 14 11:01:25 2017 +0000

----------------------------------------------------------------------
 rest/rest-server/src/main/webapp/WEB-INF/web.xml | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/503955b9/rest/rest-server/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/rest/rest-server/src/main/webapp/WEB-INF/web.xml b/rest/rest-server/src/main/webapp/WEB-INF/web.xml
index c4f9223..3cebb1a 100644
--- a/rest/rest-server/src/main/webapp/WEB-INF/web.xml
+++ b/rest/rest-server/src/main/webapp/WEB-INF/web.xml
@@ -50,16 +50,19 @@
                 org.apache.brooklyn.rest.resources.AdjunctResource,
                 org.apache.brooklyn.rest.resources.ApidocResource,
                 org.apache.brooklyn.rest.resources.ApplicationResource,
+                org.apache.brooklyn.rest.resources.BundleResource,
                 org.apache.brooklyn.rest.resources.CatalogResource,
                 org.apache.brooklyn.rest.resources.EffectorResource,
                 org.apache.brooklyn.rest.resources.EntityConfigResource,
                 org.apache.brooklyn.rest.resources.EntityResource,
                 org.apache.brooklyn.rest.resources.LocationResource,
+                org.apache.brooklyn.rest.resources.LogoutResource,
                 org.apache.brooklyn.rest.resources.PolicyConfigResource,
                 org.apache.brooklyn.rest.resources.PolicyResource,
                 org.apache.brooklyn.rest.resources.ScriptResource,
                 org.apache.brooklyn.rest.resources.SensorResource,
                 org.apache.brooklyn.rest.resources.ServerResource,
+                org.apache.brooklyn.rest.resources.TypeResource,
                 org.apache.brooklyn.rest.resources.UsageResource,
             </param-value>
         </init-param>