aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r1190259 - in /aries/trunk/sandbox/jmx-next: jmx-api/src/main/java/org/osgi/jmx/framework/ jmx-core/src/main/java/org/apache/aries/jmx/agent/ jmx-core/src/main/java/org/apache/aries/jmx/codec/ jmx-core/src/main/java/org/apache/aries/jmx/fra...
Date Fri, 28 Oct 2011 11:46:48 GMT
Author: davidb
Date: Fri Oct 28 11:46:48 2011
New Revision: 1190259

URL: http://svn.apache.org/viewvc?rev=1190259&view=rev
Log:
The beginnings of a BundleRevisionsStateMBean.
Also updated some of the itests to run under OSGi 4.3.

Added:
    aries/trunk/sandbox/jmx-next/jmx-api/src/main/java/org/osgi/jmx/framework/BundleRevisionsStateMBean.java   (with props)
    aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/codec/BundleWiringData.java   (with props)
    aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/framework/BundleRevisionsState.java   (with props)
    aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/framework/BundleRevisionsStateMBeanHandler.java   (with props)
Modified:
    aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/agent/JMXAgentImpl.java
    aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/framework/BundleState.java
    aries/trunk/sandbox/jmx-next/jmx-itests/src/test/java/org/apache/aries/jmx/framework/FrameworkMBeanTest.java
    aries/trunk/sandbox/jmx-next/jmx-itests/src/test/java/org/apache/aries/jmx/framework/PackageStateMBeanTest.java
    aries/trunk/sandbox/jmx-next/jmx-itests/src/test/java/org/apache/aries/jmx/framework/ServiceStateMBeanTest.java
    aries/trunk/sandbox/jmx-next/jmx-itests/src/test/java/org/apache/aries/jmx/permissionadmin/PermissionAdminMBeanTest.java

Added: aries/trunk/sandbox/jmx-next/jmx-api/src/main/java/org/osgi/jmx/framework/BundleRevisionsStateMBean.java
URL: http://svn.apache.org/viewvc/aries/trunk/sandbox/jmx-next/jmx-api/src/main/java/org/osgi/jmx/framework/BundleRevisionsStateMBean.java?rev=1190259&view=auto
==============================================================================
--- aries/trunk/sandbox/jmx-next/jmx-api/src/main/java/org/osgi/jmx/framework/BundleRevisionsStateMBean.java (added)
+++ aries/trunk/sandbox/jmx-next/jmx-api/src/main/java/org/osgi/jmx/framework/BundleRevisionsStateMBean.java Fri Oct 28 11:46:48 2011
@@ -0,0 +1,305 @@
+/*
+ * Copyright (c) OSGi Alliance (2010, 2011). All Rights Reserved.
+ *
+ * Licensed 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.osgi.jmx.framework;
+
+import java.io.IOException;
+
+import javax.management.openmbean.ArrayType;
+import javax.management.openmbean.CompositeData;
+import javax.management.openmbean.CompositeType;
+import javax.management.openmbean.SimpleType;
+import javax.management.openmbean.TabularType;
+
+import org.osgi.jmx.Item;
+import org.osgi.jmx.JmxConstants;
+
+/**
+ * This MBean represents the bundle wiring state.
+ *
+ * Note that not all information from the BundleWiring Java API is provided.
+ *
+ * Particularly, the limitations are:
+ *  - Cannot retrieve references to resources (e.g. class) of a particular bundle wiring.
+ */
+public interface BundleRevisionsStateMBean {
+    /*
+     * The Object Name for a Bundle Revisions MBean.
+     */
+    String OBJECTNAME = JmxConstants.OSGI_CORE
+        + ":type=wiringState,version=1.0";
+
+    /*
+     * Namespaces
+     *
+     */
+    String BUNDLE_NAMESPACE = "osgi.wiring.bundle";
+    String HOST_NAMESPACE = "osgi.wiring.host";
+    String PACKAGE_NAMESPACE = "osgi.wiring.package";
+
+    /*
+     * Items, CompositeData, TabularData, ArrayTypes
+     *
+     */
+    String KEY = "Key";
+    Item KEY_ITEM = new Item(KEY, "The directive key", SimpleType.STRING);
+
+    String VALUE = "Value";
+    Item VALUE_ITEM = new Item(VALUE, "The directive value",
+            SimpleType.STRING);
+
+    CompositeType DIRECTIVE_TYPE = Item.compositeType("DIRECTIVE",
+            "Describes a directive of a capability or requirement",
+            KEY_ITEM, VALUE_ITEM);
+    TabularType DIRECTIVES_TYPE = Item.tabularType("DIRECTIVES",
+            "Describes the directives of a capability or requirement",
+            DIRECTIVE_TYPE, KEY
+            );
+
+    String DIRECTIVES = "Directives";
+    Item DIRECTIVES_ITEM = new Item(DIRECTIVES,
+            "The directives of a capability or requirement",
+            DIRECTIVES_TYPE);
+
+    // REVIEW should we reuse from JmxConstants here or create our own?
+    TabularType ATTRIBUTES_TYPE = Item.tabularType("ATTRIBUTES",
+            "Describes attributes of a capability or requirement",
+            JmxConstants.PROPERTY_TYPE, JmxConstants.KEY
+            );
+    String ATTRIBUTES = "Attributes";
+    Item ATTRIBUTES_ITEM = new Item(ATTRIBUTES,
+            "The attributes of a capability or requirement",
+            ATTRIBUTES_TYPE);
+
+    String NAMESPACE = "Namespace";
+    Item NAMESPACE_ITEM = new Item(NAMESPACE,
+            "The namespace of a capability or requirement",
+            SimpleType.STRING);
+
+    CompositeType BUNDLE_REQUIREMENT_TYPE =
+        Item.compositeType("BUNDLE_REQUIREMENT",
+                "Describes the live wired requirements of a bundle",
+                ATTRIBUTES_ITEM, DIRECTIVES_ITEM, NAMESPACE_ITEM);
+
+    CompositeType BUNDLE_CAPABILITY_TYPE =
+        Item.compositeType("BUNDLE_CAPABILITY",
+                "Describes the live wired capabilities of a bundle",
+                ATTRIBUTES_ITEM, DIRECTIVES_ITEM, NAMESPACE_ITEM);
+
+    String PROVIDER_BUNDLE_ID = "ProviderBundleId";
+    Item PROVIDER_BUNDLE_ID_ITEM = new Item(PROVIDER_BUNDLE_ID,
+            "The identifier of the bundle that is the provider of the capability",
+            SimpleType.LONG);
+
+    String REQUIRER_BUNDLE_ID = "RequirerBundleId";
+    Item REQUIRER_BUNDLE_ID_ITEM = new Item(REQUIRER_BUNDLE_ID,
+            "The identifier of the bundle that is the requirer of the requirement",
+            SimpleType.LONG);
+
+    String BUNDLE_REQUIREMENT = "BundleRequirement";
+    Item BUNDLE_REQUIREMENT_ITEM = new Item(BUNDLE_REQUIREMENT,
+            "The wired requirements of a bundle",
+            BUNDLE_REQUIREMENT_TYPE);
+
+    String BUNDLE_CAPABILITY = "BundleCapability";
+    Item BUNDLE_CAPABILITY_ITEM = new Item(BUNDLE_CAPABILITY,
+            "The wired capabilities of a bundle",
+            BUNDLE_CAPABILITY_TYPE);
+
+    String PROVIDER_BUNDLE_REVISION_ID = "ProviderBundleRevisionId";
+    Item PROVIDER_BUNDLE_REVISION_ID_ITEM = new Item(PROVIDER_BUNDLE_REVISION_ID,
+            "A local id for the bundle revision that is the provider of the capability",
+            SimpleType.STRING);
+
+    String REQUIRER_BUNDLE_REVISION_ID = "RequirerBundleRevisionId";
+    Item REQUIRER_BUNDLE_REVISION_ID_ITEM =  new Item(REQUIRER_BUNDLE_REVISION_ID,
+            "A local id for the bundle revision that is the requirer of the requirement",
+            SimpleType.STRING);
+
+    /**
+     * Describes the live association between a provider of
+     *  a capability and a requirer of the corresponding requirement.
+     */
+    CompositeType BUNDLE_WIRE_TYPE =
+        Item.compositeType("BUNDLE_WIRE",
+                "Describes the live association between a provider and a requirer",
+                BUNDLE_REQUIREMENT_ITEM,
+                BUNDLE_CAPABILITY_ITEM,
+                PROVIDER_BUNDLE_ID_ITEM,
+                PROVIDER_BUNDLE_REVISION_ID_ITEM,
+                REQUIRER_BUNDLE_ID_ITEM,
+                REQUIRER_BUNDLE_REVISION_ID_ITEM
+                );
+    ArrayType BUNDLE_WIRES_TYPE_ARRAY =
+        Item.arrayType(1, BUNDLE_WIRE_TYPE);
+
+    String BUNDLE_REVISION_ID = "BundleRevisionId";
+    Item BUNDLE_REVISION_ID_ITEM = new Item(BUNDLE_REVISION_ID,
+            "The local identifier of the bundle revision",
+            SimpleType.STRING);
+
+    String BUNDLE_WIRES_TYPE = "BundleWiresType";
+    Item BUNDLE_WIRES_TYPE_ARRAY_ITEM = new Item(BUNDLE_WIRES_TYPE,
+            "The bundle wires of a bundle revision",
+            BUNDLE_WIRES_TYPE_ARRAY);
+
+    String BUNDLE_ID = "BundleId";
+    Item BUNDLE_ID_ITEM = new Item(BUNDLE_ID,
+            "The bundle identifier of the bundle revision",
+            SimpleType.LONG);
+
+    ArrayType REQUIREMENT_TYPE_ARRAY =
+        Item.arrayType(1, BUNDLE_REQUIREMENT_TYPE);
+    ArrayType CAPABILITY_TYPE_ARRAY =
+        Item.arrayType(1, BUNDLE_CAPABILITY_TYPE);
+
+    String REQUIREMENTS = "Requirements";
+    Item REQUIREMENTS_ITEM = new Item(REQUIREMENTS,
+            "The bundle requirements of a bundle revision wiring",
+            REQUIREMENT_TYPE_ARRAY);
+
+    String CAPABILITIES = "Capabilities";
+    Item CAPABILITIES_ITEM = new Item(CAPABILITIES,
+            "The bundle capabilities of a bundle revision wiring",
+            CAPABILITY_TYPE_ARRAY);
+
+    CompositeType BUNDLE_WIRING_TYPE =
+        Item.compositeType("BUNDLE_WIRING",
+                "Describes the runtime association between a provider and a requirer",
+                BUNDLE_ID_ITEM,               /* Long */
+                BUNDLE_REVISION_ID_ITEM,      /* Long (local scope) */
+                REQUIREMENTS_ITEM,            /* REQUIREMENT_TYPE [] */
+                CAPABILITIES_ITEM,            /* CAPABILITIES_TYPE [] */
+                BUNDLE_WIRES_TYPE_ARRAY_ITEM  /* BUNLDE_WIRE_TYPE [] */
+                );
+    ArrayType BUNDLE_WIRING_TYPE_ARRAY =
+        Item.arrayType(1, BUNDLE_WIRING_TYPE);
+
+    ArrayType REVISIONS_REQUIREMENT_TYPE_ARRAY =
+        Item.arrayType(2, BUNDLE_REQUIREMENT_TYPE);
+
+    ArrayType REVISIONS_CAPABILITY_TYPE_ARRAY =
+        Item.arrayType(2, BUNDLE_CAPABILITY_TYPE);
+
+
+    /**
+     * Returns the requirements for the current bundle revision.
+     * The ArrayType is typed by the {@link #REQUIREMENT_TYPE_ARRAY}.
+     *
+     * @param bundleId
+     * @param namespace
+     * @return the declared requirements for the current revision of <code>bundleId</code>
+     * and <code>namespace</code>
+     *
+     */
+    ArrayType getCurrentRevisionDeclaredRequirements(long bundleId,
+            String namespace) throws IOException;
+
+    /**
+     * Returns the capabilities for the current bundle revision.
+     * The ArrayType is typed by the {@link #CAPABILITY_TYPE_ARRAY}
+     *
+     * @param bundleId
+     * @param namespace
+     * @return the declared capabilities for the current revision of <code>bundleId</code>
+     * and <code>namespace</code>
+     */
+    ArrayType getCurrentRevisionDeclaredCapabilities(long bundleId,
+            String namespace) throws IOException;
+
+    /**
+     * Returns the bundle wiring for the current bundle revision.
+     * The ArrayType is typed by the {@link #BUNDLE_WIRING_TYPE}
+     *
+     * @param bundleId
+     * @param namespace
+     * @return the wires for the current revision of <code>bundleId</code>
+     * and <code>namespace</code>
+     */
+    CompositeData getCurrentWiring(long bundleId, String namespace) throws IOException;
+    CompositeData getCurrentWiringClosure(long rootBundleId) throws IOException;
+
+    /**
+     * Returns the requirements for all revisions of the bundle.
+     * The ArrayType is typed by the {@link #REVISIONS_REQUIREMENT_TYPE_ARRAY}.
+     * The requirements are in no particular order, and may change in
+     *  subsequent calls to this operation.
+     *
+     * @param bundleId
+     * @param namespace
+     * @param inUse
+     * @return the declared requirements for all revisions of <code>bundleId</code>
+     *
+     */
+    ArrayType getRevisionsDeclaredRequirements(long bundleId,
+            String namespace, boolean inUse) throws IOException;
+
+    /**
+     * Returns the capabilities for all revisions of the bundle.
+     * The ArrayType is typed by the {@link #REVISIONS_CAPABILITY_TYPE_ARRAY}
+     * The capabilities are in no particular order, and may change in
+     *  subsequent calls to this operation.
+     *
+     * @param bundleId
+     * @param namespace
+     * @param inUse
+     * @return the declared capabilities for all revisions of <code>bundleId</code>
+     */
+    ArrayType getRevisionsDeclaredCapabilities(long bundleId,
+            String namespace, boolean inUse) throws IOException;
+
+    /**
+     * Returns the bundle wirings for all revisions of the bundle.
+     * The ArrayType is typed by the {@link #BUNDLE_WIRING_TYPE_ARRAY}
+     * The bundle wirings are in no particular order, and may
+     *  change in subsequent calls to this operations.
+     *
+     * @param bundleId
+     * @param namespace
+     * @return the wires for all revisions of <code>bundleId</code>
+     */
+    ArrayType getRevisionsWiring(long bundleId, String namespace) throws IOException;
+
+    /**
+     * Returns a closure of all bundle wirings linked by their
+     *  bundle wires, starting at <code>rootBundleId</code>.
+     * The ArrayType is typed by the {@link #BUNDLE_WIRING_TYPE_ARRAY}
+     * The bundle wirings are in no particular order, and may
+     *  change in subsequent calls to this operation. Furthermore,
+     * the bundle wiring IDs are local and cannot be reused across invocations.
+     *
+     * @param rootBundleId
+     * @param namespace
+     * @return a closure of bundle wirings linked together by wires.
+     */
+    ArrayType getWiringClosure(long rootBundleId, String namespace) throws IOException;
+
+    /**
+     * Returns true if capability provided by <code>provider</code> matches
+     *  with the requirement being required by <code>requirer</code>.
+     * The <code>provider</code>'s CompositeType is typed by the
+     *  {@link #BUNDLE_CAPABILITY_TYPE}
+     * The <code>requirer</code>'s CompositeType is typed by the
+     *  {@link #BUNDLE_REQUIREMENT_TYPE}
+     *
+     * REVIEW This method would have worked better should the requirements and
+     *  capabilities have an ID
+     *
+     * @param requirer bundle id of the bundle requirer
+     * @param provider bundle id of the bundle provider
+     * @return true if capability matches with requirement.
+     */
+    boolean matches(CompositeType provider, CompositeType requirer) throws IOException;
+}
\ No newline at end of file

Propchange: aries/trunk/sandbox/jmx-next/jmx-api/src/main/java/org/osgi/jmx/framework/BundleRevisionsStateMBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/agent/JMXAgentImpl.java
URL: http://svn.apache.org/viewvc/aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/agent/JMXAgentImpl.java?rev=1190259&r1=1190258&r2=1190259&view=diff
==============================================================================
--- aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/agent/JMXAgentImpl.java (original)
+++ aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/agent/JMXAgentImpl.java Fri Oct 28 11:46:48 2011
@@ -35,6 +35,7 @@ import org.apache.aries.jmx.Logger;
 import org.apache.aries.jmx.MBeanHandler;
 import org.apache.aries.jmx.MBeanServiceTracker;
 import org.apache.aries.jmx.cm.ConfigurationAdminMBeanHandler;
+import org.apache.aries.jmx.framework.BundleRevisionsStateMBeanHandler;
 import org.apache.aries.jmx.framework.BundleStateMBeanHandler;
 import org.apache.aries.jmx.framework.FrameworkMBeanHandler;
 import org.apache.aries.jmx.framework.PackageStateMBeanHandler;
@@ -50,9 +51,9 @@ import org.osgi.util.tracker.ServiceTrac
  * <p>
  * Represent agent for MBeanServers registered in ServiceRegistry. Providing registration and unregistration methods.
  * </p>
- * 
+ *
  * @see JMXAgent
- * 
+ *
  * @version $Rev$ $Date$
  */
 public class JMXAgentImpl implements JMXAgent {
@@ -72,7 +73,7 @@ public class JMXAgentImpl implements JMX
 
     /**
      * Constructs new JMXAgent.
-     * 
+     *
      * @param logger @see org.apache.aries.jmx.Logger
      */
     public JMXAgentImpl(Logger logger) {
@@ -93,6 +94,9 @@ public class JMXAgentImpl implements JMX
         MBeanHandler bundleStateHandler = new BundleStateMBeanHandler(bc, logger);
         bundleStateHandler.open();
         mbeansHandlers.add(bundleStateHandler);
+        MBeanHandler revisionsStateHandler = new BundleRevisionsStateMBeanHandler(bc, logger);
+        revisionsStateHandler.open();
+        mbeansHandlers.add(revisionsStateHandler);
         MBeanHandler serviceStateHandler = new ServiceStateMBeanHandler(bc, logger);
         serviceStateHandler.open();
         mbeansHandlers.add(serviceStateHandler);
@@ -167,7 +171,7 @@ public class JMXAgentImpl implements JMX
                logger.log(LogService.LOG_ERROR, "Name of objectname can't be null ", e);
             } catch (Exception e) {
                logger.log(LogService.LOG_ERROR, "Cannot unregister MBean: " + mBeanHandler, e);
-            } 
+            }
         }
     }
 
@@ -263,7 +267,7 @@ public class JMXAgentImpl implements JMX
 
     /**
      * Gets all MBeanServers from MBeanServiceTracker.
-     * 
+     *
      * @return array of MBean servers.
      */
     private Object[] getMBeanServers() {

Added: aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/codec/BundleWiringData.java
URL: http://svn.apache.org/viewvc/aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/codec/BundleWiringData.java?rev=1190259&view=auto
==============================================================================
--- aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/codec/BundleWiringData.java (added)
+++ aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/codec/BundleWiringData.java Fri Oct 28 11:46:48 2011
@@ -0,0 +1,50 @@
+/**
+ *  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.aries.jmx.codec;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.management.openmbean.CompositeData;
+import javax.management.openmbean.CompositeDataSupport;
+import javax.management.openmbean.OpenDataException;
+
+import org.osgi.jmx.framework.BundleRevisionsStateMBean;
+
+public class BundleWiringData {
+
+    private final long bundleId;
+
+    public BundleWiringData(long bundleId) {
+        this.bundleId = bundleId;
+    }
+
+    public CompositeData toCompositeData() {
+        Map<String, Object> items = new HashMap<String, Object>();
+        items.put(BundleRevisionsStateMBean.BUNDLE_ID, bundleId);
+        items.put(BundleRevisionsStateMBean.BUNDLE_REVISION_ID, null);
+        items.put(BundleRevisionsStateMBean.REQUIREMENTS, null);
+        items.put(BundleRevisionsStateMBean.CAPABILITIES, null);
+        items.put(BundleRevisionsStateMBean.BUNDLE_WIRES_TYPE, null);
+
+        try {
+            return new CompositeDataSupport(BundleRevisionsStateMBean.BUNDLE_WIRING_TYPE, items);
+        } catch (OpenDataException e) {
+            throw new IllegalStateException("Can't create CompositeData" + e);
+        }
+    }
+}

Propchange: aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/codec/BundleWiringData.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/framework/BundleRevisionsState.java
URL: http://svn.apache.org/viewvc/aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/framework/BundleRevisionsState.java?rev=1190259&view=auto
==============================================================================
--- aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/framework/BundleRevisionsState.java (added)
+++ aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/framework/BundleRevisionsState.java Fri Oct 28 11:46:48 2011
@@ -0,0 +1,120 @@
+/**
+ *  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.aries.jmx.framework;
+
+import java.io.IOException;
+
+import javax.management.openmbean.ArrayType;
+import javax.management.openmbean.CompositeData;
+import javax.management.openmbean.CompositeType;
+
+import org.apache.aries.jmx.Logger;
+import org.apache.aries.jmx.codec.BundleWiringData;
+import org.apache.aries.jmx.util.FrameworkUtils;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.wiring.BundleRevision;
+import org.osgi.jmx.framework.BundleRevisionsStateMBean;
+
+public class BundleRevisionsState implements BundleRevisionsStateMBean {
+    private final BundleContext bundleContext;
+    private final Logger logger;
+
+
+    public BundleRevisionsState(BundleContext bundleContext, Logger logger) {
+        this.bundleContext = bundleContext;
+        this.logger = logger;
+    }
+
+    /* (non-Javadoc)
+     * @see org.osgi.jmx.framework.BundleRevisionsStateMBean#getCurrentRevisionDeclaredRequirements(long, java.lang.String)
+     */
+    public ArrayType getCurrentRevisionDeclaredRequirements(long bundleId, String namespace) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.osgi.jmx.framework.BundleRevisionsStateMBean#getCurrentRevisionDeclaredCapabilities(long, java.lang.String)
+     */
+    public ArrayType getCurrentRevisionDeclaredCapabilities(long bundleId, String namespace) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.osgi.jmx.framework.BundleRevisionsStateMBean#getCurrentWiring(long, java.lang.String)
+     */
+    public CompositeData getCurrentWiring(long bundleId, String namespace) throws IOException {
+        Bundle bundle = FrameworkUtils.resolveBundle(bundleContext, bundleId);
+        BundleRevision currentRevision = bundle.adapt(BundleRevision.class);
+
+        System.out.println("******** getCurrentWiring: " + bundle);
+        BundleWiringData data = new BundleWiringData(bundle.getBundleId());
+        CompositeData compositeData = data.toCompositeData();
+        System.out.println("######## " + compositeData);
+        return compositeData;
+    }
+
+    /* (non-Javadoc)
+     * @see org.osgi.jmx.framework.BundleRevisionsStateMBean#getCurrentWiringClosure(long)
+     */
+    public CompositeData getCurrentWiringClosure(long rootBundleId) throws IOException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.osgi.jmx.framework.BundleRevisionsStateMBean#getRevisionsDeclaredRequirements(long, java.lang.String, boolean)
+     */
+    public ArrayType getRevisionsDeclaredRequirements(long bundleId, String namespace, boolean inUse) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.osgi.jmx.framework.BundleRevisionsStateMBean#getRevisionsDeclaredCapabilities(long, java.lang.String, boolean)
+     */
+    public ArrayType getRevisionsDeclaredCapabilities(long bundleId, String namespace, boolean inUse) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.osgi.jmx.framework.BundleRevisionsStateMBean#getRevisionsWiring(long, java.lang.String)
+     */
+    public ArrayType getRevisionsWiring(long bundleId, String namespace) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.osgi.jmx.framework.BundleRevisionsStateMBean#getWiringClosure(long, java.lang.String)
+     */
+    public ArrayType getWiringClosure(long rootBundleId, String namespace) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.osgi.jmx.framework.BundleRevisionsStateMBean#matches(javax.management.openmbean.CompositeType, javax.management.openmbean.CompositeType)
+     */
+    public boolean matches(CompositeType provider, CompositeType requirer) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+}

Propchange: aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/framework/BundleRevisionsState.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/framework/BundleRevisionsStateMBeanHandler.java
URL: http://svn.apache.org/viewvc/aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/framework/BundleRevisionsStateMBeanHandler.java?rev=1190259&view=auto
==============================================================================
--- aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/framework/BundleRevisionsStateMBeanHandler.java (added)
+++ aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/framework/BundleRevisionsStateMBeanHandler.java Fri Oct 28 11:46:48 2011
@@ -0,0 +1,76 @@
+/**
+ *  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.aries.jmx.framework;
+
+import javax.management.NotCompliantMBeanException;
+import javax.management.StandardMBean;
+
+import org.apache.aries.jmx.Logger;
+import org.apache.aries.jmx.MBeanHandler;
+import org.apache.aries.jmx.util.shared.RegistrableStandardEmitterMBean;
+import org.osgi.framework.BundleContext;
+import org.osgi.jmx.framework.BundleRevisionsStateMBean;
+import org.osgi.service.log.LogService;
+
+public class BundleRevisionsStateMBeanHandler implements MBeanHandler {
+    private final String name;
+    private final BundleContext bundleContext;
+    private final Logger logger;
+
+    private StandardMBean mbean;
+    private BundleRevisionsState revisionsStateMBean;
+
+    public BundleRevisionsStateMBeanHandler(BundleContext bundleContext, Logger logger) {
+        this.bundleContext = bundleContext;
+        this.logger = logger;
+        this.name = BundleRevisionsStateMBean.OBJECTNAME;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.aries.jmx.MBeanHandler#open()
+     */
+    public void open() {
+        revisionsStateMBean = new BundleRevisionsState(bundleContext, logger);
+        try {
+            mbean = new RegistrableStandardEmitterMBean(revisionsStateMBean, BundleRevisionsStateMBean.class);
+        } catch (NotCompliantMBeanException e) {
+            logger.log(LogService.LOG_ERROR, "Failed to instantiate MBean for " + BundleRevisionsStateMBean.class.getName(), e);
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.aries.jmx.MBeanHandler#getMbean()
+     */
+    public StandardMBean getMbean() {
+        return mbean;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.aries.jmx.MBeanHandler#close()
+     */
+    public void close() {
+        // not used
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.aries.jmx.MBeanHandler#getName()
+     */
+    public String getName() {
+        return name;
+    }
+}

Propchange: aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/framework/BundleRevisionsStateMBeanHandler.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/framework/BundleState.java
URL: http://svn.apache.org/viewvc/aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/framework/BundleState.java?rev=1190259&r1=1190258&r2=1190259&view=diff
==============================================================================
--- aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/framework/BundleState.java (original)
+++ aries/trunk/sandbox/jmx-next/jmx-core/src/main/java/org/apache/aries/jmx/framework/BundleState.java Fri Oct 28 11:46:48 2011
@@ -69,7 +69,7 @@ import org.osgi.service.startlevel.Start
 
 /**
  * Implementation of <code>BundleStateMBean</code> which emits JMX <code>Notification</code> on <code>Bundle</code>
- * state changes
+ * state changes.
  *
  * @version $Rev$ $Date$
  */

Modified: aries/trunk/sandbox/jmx-next/jmx-itests/src/test/java/org/apache/aries/jmx/framework/FrameworkMBeanTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/sandbox/jmx-next/jmx-itests/src/test/java/org/apache/aries/jmx/framework/FrameworkMBeanTest.java?rev=1190259&r1=1190258&r2=1190259&view=diff
==============================================================================
--- aries/trunk/sandbox/jmx-next/jmx-itests/src/test/java/org/apache/aries/jmx/framework/FrameworkMBeanTest.java (original)
+++ aries/trunk/sandbox/jmx-next/jmx-itests/src/test/java/org/apache/aries/jmx/framework/FrameworkMBeanTest.java Fri Oct 28 11:46:48 2011
@@ -16,13 +16,14 @@
  */
 package org.apache.aries.jmx.framework;
 
+import static org.apache.aries.itest.ExtraOptions.mavenBundle;
+import static org.apache.aries.itest.ExtraOptions.paxLogging;
+import static org.apache.aries.itest.ExtraOptions.testOptions;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import static org.apache.aries.itest.ExtraOptions.*;
-
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -37,18 +38,20 @@ import org.apache.aries.jmx.codec.BatchA
 import org.junit.Test;
 import org.ops4j.pax.exam.CoreOptions;
 import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.container.def.PaxRunnerOptions;
 import org.ops4j.pax.exam.junit.Configuration;
 import org.osgi.jmx.framework.FrameworkMBean;
 
 /**
  * @version $Rev$ $Date$
  */
-public class FrameworkMBeanTest extends AbstractIntegrationTest {    
+public class FrameworkMBeanTest extends AbstractIntegrationTest {
 
     @Configuration
     public static Option[] configuration() {
         return testOptions(
-            CoreOptions.equinox(),
+            PaxRunnerOptions.rawPaxRunnerOption("config", "classpath:ss-runner.properties"),
+            CoreOptions.equinox().version("3.7.0.v20110613"),
             paxLogging("INFO"),
 
             mavenBundle("org.apache.aries.jmx", "org.apache.aries.jmx"),
@@ -62,38 +65,38 @@ public class FrameworkMBeanTest extends 
     public void doSetUp() throws Exception {
         waitForMBean(new ObjectName(FrameworkMBean.OBJECTNAME));
     }
-    
+
     @Test
     public void testMBeanInterface() throws IOException {
         FrameworkMBean framework = getMBean(FrameworkMBean.OBJECTNAME, FrameworkMBean.class);
         assertNotNull(framework);
-        
+
         long[] bundleIds = new long[]{1,2};
         int[] newlevels = new int[]{1,1};
         CompositeData compData = framework.setBundleStartLevels(bundleIds, newlevels);
         assertNotNull(compData);
-        
+
         BatchActionResult batch2 = BatchActionResult.from(compData);
         assertNotNull(batch2.getCompleted());
         assertTrue(batch2.isSuccess());
         assertNull(batch2.getError());
         assertNull(batch2.getRemainingItems());
-                
+
         File file = File.createTempFile("bundletest", ".jar");
-        file.deleteOnExit();        
+        file.deleteOnExit();
         Manifest man = new Manifest();
         man.getMainAttributes().putValue("Manifest-Version", "1.0");
         JarOutputStream jaros = new JarOutputStream(new FileOutputStream(file), man);
         jaros.flush();
         jaros.close();
-        
+
         long bundleId = 0;
         try {
             bundleId = framework.installBundleFromURL(file.getAbsolutePath(), file.toURI().toString());
         } catch (Exception e) {
             fail("Installation of test bundle shouldn't fail");
         }
-        
+
         try{
             framework.uninstallBundle(bundleId);
         } catch (Exception e) {

Modified: aries/trunk/sandbox/jmx-next/jmx-itests/src/test/java/org/apache/aries/jmx/framework/PackageStateMBeanTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/sandbox/jmx-next/jmx-itests/src/test/java/org/apache/aries/jmx/framework/PackageStateMBeanTest.java?rev=1190259&r1=1190258&r2=1190259&view=diff
==============================================================================
--- aries/trunk/sandbox/jmx-next/jmx-itests/src/test/java/org/apache/aries/jmx/framework/PackageStateMBeanTest.java (original)
+++ aries/trunk/sandbox/jmx-next/jmx-itests/src/test/java/org/apache/aries/jmx/framework/PackageStateMBeanTest.java Fri Oct 28 11:46:48 2011
@@ -16,12 +16,14 @@
  */
 package org.apache.aries.jmx.framework;
 
+import static org.apache.aries.itest.ExtraOptions.mavenBundle;
+import static org.apache.aries.itest.ExtraOptions.paxLogging;
+import static org.apache.aries.itest.ExtraOptions.testOptions;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
-import static org.apache.aries.itest.ExtraOptions.*;
 
 import java.io.IOException;
 import java.util.Collection;
@@ -33,12 +35,13 @@ import org.apache.aries.jmx.AbstractInte
 import org.junit.Test;
 import org.ops4j.pax.exam.CoreOptions;
 import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.container.def.PaxRunnerOptions;
 import org.ops4j.pax.exam.junit.Configuration;
 import org.osgi.jmx.framework.PackageStateMBean;
 
 /**
- * 
- * 
+ *
+ *
  * @version $Rev$ $Date$
  */
 public class PackageStateMBeanTest extends AbstractIntegrationTest {
@@ -46,7 +49,8 @@ public class PackageStateMBeanTest exten
     @Configuration
     public static Option[] configuration() {
         return testOptions(
-            CoreOptions.equinox(), 
+            PaxRunnerOptions.rawPaxRunnerOption("config", "classpath:ss-runner.properties"),
+            CoreOptions.equinox().version("3.7.0.v20110613"),
             paxLogging("INFO"),
             mavenBundle("org.apache.aries.jmx", "org.apache.aries.jmx"),
             mavenBundle("org.apache.aries.jmx", "org.apache.aries.jmx.api"),
@@ -63,7 +67,7 @@ public class PackageStateMBeanTest exten
     public void testMBeanInterface() throws IOException {
         PackageStateMBean packagaState = getMBean(PackageStateMBean.OBJECTNAME, PackageStateMBean.class);
         assertNotNull(packagaState);
-        
+
         long[] exportingBundles = packagaState.getExportingBundles("org.osgi.jmx.framework", "1.5.0");
         assertNotNull(exportingBundles);
         assertTrue("Should find a bundle exporting org.osgi.jmx.framework", exportingBundles.length > 0);

Modified: aries/trunk/sandbox/jmx-next/jmx-itests/src/test/java/org/apache/aries/jmx/framework/ServiceStateMBeanTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/sandbox/jmx-next/jmx-itests/src/test/java/org/apache/aries/jmx/framework/ServiceStateMBeanTest.java?rev=1190259&r1=1190258&r2=1190259&view=diff
==============================================================================
--- aries/trunk/sandbox/jmx-next/jmx-itests/src/test/java/org/apache/aries/jmx/framework/ServiceStateMBeanTest.java (original)
+++ aries/trunk/sandbox/jmx-next/jmx-itests/src/test/java/org/apache/aries/jmx/framework/ServiceStateMBeanTest.java Fri Oct 28 11:46:48 2011
@@ -16,6 +16,9 @@
  */
 package org.apache.aries.jmx.framework;
 
+import static org.apache.aries.itest.ExtraOptions.mavenBundle;
+import static org.apache.aries.itest.ExtraOptions.paxLogging;
+import static org.apache.aries.itest.ExtraOptions.testOptions;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
@@ -24,7 +27,6 @@ import static org.ops4j.pax.exam.CoreOpt
 import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.modifyBundle;
 import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.newBundle;
 import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.withBnd;
-import static org.apache.aries.itest.ExtraOptions.*;
 
 import java.io.InputStream;
 import java.util.ArrayList;
@@ -44,6 +46,7 @@ import org.junit.Test;
 import org.ops4j.pax.exam.CoreOptions;
 import org.ops4j.pax.exam.Customizer;
 import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.container.def.PaxRunnerOptions;
 import org.ops4j.pax.exam.junit.Configuration;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
@@ -54,7 +57,7 @@ import org.osgi.service.cm.ManagedServic
 import org.osgi.service.cm.ManagedServiceFactory;
 
 /**
- * 
+ *
  *
  * @version $Rev$ $Date$
  */
@@ -63,16 +66,17 @@ public class ServiceStateMBeanTest exten
     @Configuration
     public static Option[] configuration() {
         return testOptions(
-                        CoreOptions.equinox(),
+                        PaxRunnerOptions.rawPaxRunnerOption("config", "classpath:ss-runner.properties"),
+                        CoreOptions.equinox().version("3.7.0.v20110613"),
                         paxLogging("INFO"),
-                        
+
                         mavenBundle("org.apache.felix", "org.apache.felix.configadmin"),
                         mavenBundle("org.osgi", "org.osgi.compendium"),
                         mavenBundle("org.apache.aries.jmx", "org.apache.aries.jmx"),
                         mavenBundle("org.apache.aries.jmx", "org.apache.aries.jmx.api"),
                         mavenBundle("org.apache.aries.jmx", "org.apache.aries.jmx.whiteboard"),
                         mavenBundle("org.apache.aries", "org.apache.aries.util"),
-                        
+
                         new Customizer() {
                             public InputStream customizeTestProbe(InputStream testProbe) throws Exception {
                                 return modifyBundle(testProbe)
@@ -112,92 +116,92 @@ public class ServiceStateMBeanTest exten
 //                              waitForFrameworkStartup()
                         );
     }
-    
+
     @Override
     public void doSetUp() throws Exception {
         waitForMBean(new ObjectName(ServiceStateMBean.OBJECTNAME));
-    }    
-    
+    }
+
     @Test
     public void testMBeanInterface() throws Exception {
-        
+
         ServiceStateMBean mbean = getMBean(ServiceStateMBean.OBJECTNAME, ServiceStateMBean.class);
         assertNotNull(mbean);
-        
+
         //get bundles
-        
+
         Bundle a = context().getBundleByName("org.apache.aries.jmx.test.bundlea");
         assertNotNull(a);
-        
+
         Bundle b = context().getBundleByName("org.apache.aries.jmx.test.bundleb");
         assertNotNull(b);
-        
+
         // get services
-        
+
         ServiceReference refA = bundleContext.getServiceReference(InterfaceA.class.getName());
         assertNotNull(refA);
         long serviceAId = (Long) refA.getProperty(Constants.SERVICE_ID);
         assertTrue(serviceAId > -1);
-        
+
         ServiceReference refB = bundleContext.getServiceReference(InterfaceB.class.getName());
         assertNotNull(refB);
         long serviceBId = (Long) refB.getProperty(Constants.SERVICE_ID);
         assertTrue(serviceBId > -1);
-        
+
         ServiceReference[] refs = bundleContext.getServiceReferences(ManagedServiceFactory.class.getName(), "(" + Constants.SERVICE_PID + "=jmx.test.B.factory)");
         assertNotNull(refs);
         assertEquals(1, refs.length);
         ServiceReference msf = refs[0];
 
-        
+
         // getBundleIdentifier
-        
+
         assertEquals(a.getBundleId(), mbean.getBundleIdentifier(serviceAId));
-        
+
         //getObjectClass
-        
+
         String[] objectClass = mbean.getObjectClass(serviceAId);
         assertEquals(2, objectClass.length);
         List<String> classNames = Arrays.asList(objectClass);
         assertTrue(classNames.contains(InterfaceA.class.getName()));
         assertTrue(classNames.contains(ManagedService.class.getName()));
-        
+
         // getProperties
-        
+
         TabularData serviceProperties = mbean.getProperties(serviceBId);
         assertNotNull(serviceProperties);
         assertEquals(JmxConstants.PROPERTIES_TYPE, serviceProperties.getTabularType());
         assertTrue(serviceProperties.values().size() > 1);
-        assertEquals("org.apache.aries.jmx.test.ServiceB", 
+        assertEquals("org.apache.aries.jmx.test.ServiceB",
                 PropertyData.from(serviceProperties.get(new Object[] { Constants.SERVICE_PID })).getValue());
-        
+
         // getUsingBundles
-        
+
         long[] usingBundles = mbean.getUsingBundles(serviceBId);
         assertEquals(1, usingBundles.length);
         assertEquals(a.getBundleId(), usingBundles[0]);
-        
+
         // listServices
-        
+
         TabularData allServices = mbean.listServices();
         assertNotNull(allServices);
         assertEquals(bundleContext.getAllServiceReferences(null, null).length, allServices.values().size());
-        
+
         // notifications
-        
+
         final List<Notification> received = new ArrayList<Notification>();
-      
+
         mbeanServer.addNotificationListener(new ObjectName(ServiceStateMBean.OBJECTNAME), new NotificationListener() {
             public void handleNotification(Notification notification, Object handback) {
                received.add(notification);
             }
         }, null, null);
-        
-      
+
+
         assertNotNull(refB);
         assertNotNull(msf);
         b.stop();
-        refB = bundleContext.getServiceReference(InterfaceB.class.getName()); 
+        refB = bundleContext.getServiceReference(InterfaceB.class.getName());
         refs = bundleContext.getServiceReferences(ManagedServiceFactory.class.getName(), "(" + Constants.SERVICE_PID + "=jmx.test.B.factory)");
         assertNull(refs);
         assertNull(refB);
@@ -207,15 +211,15 @@ public class ServiceStateMBeanTest exten
         assertNotNull(refB);
         assertNotNull(refs);
         assertEquals(1, refs.length);
-        
+
         int i = 0;
         while (received.size() < 4 && i < 3) {
             Thread.sleep(1000);
             i++;
         }
-        
+
         assertEquals(4, received.size());
-            
+
     }
 
 }

Modified: aries/trunk/sandbox/jmx-next/jmx-itests/src/test/java/org/apache/aries/jmx/permissionadmin/PermissionAdminMBeanTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/sandbox/jmx-next/jmx-itests/src/test/java/org/apache/aries/jmx/permissionadmin/PermissionAdminMBeanTest.java?rev=1190259&r1=1190258&r2=1190259&view=diff
==============================================================================
--- aries/trunk/sandbox/jmx-next/jmx-itests/src/test/java/org/apache/aries/jmx/permissionadmin/PermissionAdminMBeanTest.java (original)
+++ aries/trunk/sandbox/jmx-next/jmx-itests/src/test/java/org/apache/aries/jmx/permissionadmin/PermissionAdminMBeanTest.java Fri Oct 28 11:46:48 2011
@@ -16,12 +16,14 @@
  */
 package org.apache.aries.jmx.permissionadmin;
 
+import static org.apache.aries.itest.ExtraOptions.mavenBundle;
+import static org.apache.aries.itest.ExtraOptions.paxLogging;
+import static org.apache.aries.itest.ExtraOptions.testOptions;
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.ops4j.pax.exam.CoreOptions.provision;
 import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.newBundle;
 import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.withBnd;
-import static org.apache.aries.itest.ExtraOptions.*;
 
 import java.io.IOException;
 
@@ -31,6 +33,7 @@ import org.apache.aries.jmx.AbstractInte
 import org.junit.Test;
 import org.ops4j.pax.exam.CoreOptions;
 import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.container.def.PaxRunnerOptions;
 import org.ops4j.pax.exam.junit.Configuration;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
@@ -40,16 +43,17 @@ import org.osgi.service.permissionadmin.
 import org.osgi.service.permissionadmin.PermissionInfo;
 
 /**
- * 
+ *
  *
  * @version $Rev$ $Date$
  */
 public class PermissionAdminMBeanTest extends AbstractIntegrationTest {
-    
+
     @Configuration
     public static Option[] configuration() {
         return testOptions(
-            CoreOptions.equinox(),
+            PaxRunnerOptions.rawPaxRunnerOption("config", "classpath:ss-runner.properties"),
+            CoreOptions.equinox().version("3.7.0.v20110613"),
             paxLogging("INFO"),
             mavenBundle("org.apache.aries.jmx", "org.apache.aries.jmx"),
             mavenBundle("org.apache.aries.jmx", "org.apache.aries.jmx.api"),
@@ -71,7 +75,7 @@ public class PermissionAdminMBeanTest ex
 //                     waitForFrameworkStartup()
         );
     }
-    
+
     @Override
     public void doSetUp() throws Exception {
         waitForMBean(new ObjectName(PermissionAdminMBean.OBJECTNAME));
@@ -95,39 +99,39 @@ public class PermissionAdminMBeanTest ex
         String[] encoded = toEncodedPerm(permissions);
         String[] mBeanDefPermissions = mBean.listDefaultPermissions();
         assertArrayEquals(encoded, mBeanDefPermissions);
-        
+
         Bundle a = context().getBundleByName("org.apache.aries.jmx.test.bundlea");
         assertNotNull(a);
-        
+
         String location = a.getLocation();
-        
+
         PermissionInfo bundleaPerm = new PermissionInfo("ServicePermission", "ServiceA", "GET");
         mBean.setPermissions(location, new String[]{bundleaPerm.getEncoded()});
-        
+
         String[] serviceBundleaPerm = toEncodedPerm(permAdminService.getPermissions(location));
         String[] mBeanBundleaPerm = mBean.getPermissions(location);
         assertNotNull(mBeanBundleaPerm);
         assertArrayEquals(serviceBundleaPerm, mBeanBundleaPerm);
-        
+
         PermissionInfo defaultPerm = new PermissionInfo("AllPermission", "*", "GET");
         mBean.setDefaultPermissions(new String[]{defaultPerm.getEncoded()});
-        
+
         String[] serviceDefaultPerm = toEncodedPerm(permAdminService.getDefaultPermissions());
         String[] mBeanDefaultPerm = mBean.listDefaultPermissions();
         assertNotNull(mBeanDefaultPerm);
         assertArrayEquals(serviceDefaultPerm, mBeanDefaultPerm);
     }
-    
+
     private String[] toEncodedPerm(PermissionInfo[] permissions){
         assertNotNull(permissions);
         String[] encoded = new String[permissions.length];
         for (int i = 0; i < permissions.length; i++) {
             PermissionInfo info = permissions[i];
             encoded[i] = info.getEncoded();
-        }       
+        }
         return encoded;
     }
-    
+
     private <S> S getService(Class<S> serviceInterface){
         ServiceReference ref =  bundleContext.getServiceReference(serviceInterface.getName());
         if(ref != null){
@@ -135,7 +139,7 @@ public class PermissionAdminMBeanTest ex
             if(service != null){
                 return (S)service;
             }
-        }     
+        }
         return null;
     }
 }
\ No newline at end of file



Mime
View raw message