geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r826133 - in /geronimo/server/trunk: plugins/j2ee/geronimo-j2ee/pom.xml plugins/j2ee/geronimo-j2ee/src/test/java/org/apache/geronimo/j2ee/management/Abstract77Test.java pom.xml
Date Sat, 17 Oct 2009 00:02:46 GMT
Author: djencks
Date: Sat Oct 17 00:02:46 2009
New Revision: 826133

URL: http://svn.apache.org/viewvc?rev=826133&view=rev
Log:
first steps..

Modified:
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/pom.xml
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/test/java/org/apache/geronimo/j2ee/management/Abstract77Test.java
    geronimo/server/trunk/pom.xml

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/pom.xml?rev=826133&r1=826132&r2=826133&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/pom.xml (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/pom.xml Sat Oct 17 00:02:46 2009
@@ -45,6 +45,13 @@
             <artifactId>geronimo-management</artifactId>
             <version>${version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.framework</groupId>
+            <artifactId>geronimo-kernel</artifactId>
+            <version>${version}</version>
+            <classifier>tests</classifier>
+            <scope>test</scope>
+        </dependency>
         
     </dependencies>
     

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/test/java/org/apache/geronimo/j2ee/management/Abstract77Test.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/test/java/org/apache/geronimo/j2ee/management/Abstract77Test.java?rev=826133&r1=826132&r2=826133&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/test/java/org/apache/geronimo/j2ee/management/Abstract77Test.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/test/java/org/apache/geronimo/j2ee/management/Abstract77Test.java
Sat Oct 17 00:02:46 2009
@@ -22,6 +22,8 @@
 import java.util.Hashtable;
 import java.util.LinkedHashSet;
 import java.util.Collections;
+import java.util.HashMap;
+
 import javax.management.ObjectName;
 import javax.management.MalformedObjectNameException;
 
@@ -37,6 +39,8 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.KernelFactory;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.config.ConfigurationData;
+import org.apache.geronimo.kernel.osgi.MockBundleContext;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 import org.apache.geronimo.management.J2EEResource;
@@ -47,21 +51,22 @@
 import org.apache.geronimo.management.geronimo.J2EEApplication;
 import org.apache.geronimo.management.geronimo.J2EEServer;
 import org.apache.geronimo.management.geronimo.JVM;
+import org.osgi.framework.BundleContext;
 
 /**
  * @version $Rev$ $Date$
  */
 public abstract class Abstract77Test extends TestCase {
-    protected static final GBeanData SERVER_INFO_DATA = buildGBeanData(new String[] {"role"},
new String[] {"ServerInfo"}, BasicServerInfo.getGBeanInfo());
+    protected static final GBeanData SERVER_INFO_DATA = buildGBeanData(new String[] {"role"},
new String[] {"ServerInfo"}, BasicServerInfo.class);
 
     protected static final String DOMAIN = "geronimo.test";
-    protected static final GBeanData DOMAIN_DATA = buildGBeanData(new String[] {"j2eeType",
"name"}, new String[] {"J2EEDomain", DOMAIN}, J2EEDomainImpl.GBEAN_INFO);
-    protected static final GBeanData SERVER_DATA = buildGBeanData(new String[] {"j2eeType",
"name"}, new String[] {"J2EEServer", "test"}, J2EEServerImpl.GBEAN_INFO);
-    protected static final GBeanData JVM_DATA = buildGBeanData(new String[] {"j2eeType",
"J2EEServer", "name"}, new String[] {"JVM", "test", "JVM"}, JVMImpl.GBEAN_INFO);
+    protected static final GBeanData DOMAIN_DATA = buildGBeanData(new String[] {"j2eeType",
"name"}, new String[] {"J2EEDomain", DOMAIN}, J2EEDomainImpl.class);
+    protected static final GBeanData SERVER_DATA = buildGBeanData(new String[] {"j2eeType",
"name"}, new String[] {"J2EEServer", "test"}, J2EEServerImpl.class);
+    protected static final GBeanData JVM_DATA = buildGBeanData(new String[] {"j2eeType",
"J2EEServer", "name"}, new String[] {"JVM", "test", "JVM"}, JVMImpl.class);
 
     protected Kernel kernel;
 
-    private static GBeanData buildGBeanData(String[] key, String[] value, GBeanInfo info)
{
+    private static GBeanData buildGBeanData(String[] key, String[] value, Class info) {
         AbstractName abstractName = buildAbstractName(key, value);
         return new GBeanData(abstractName, info);
     }
@@ -85,18 +90,17 @@
 
     protected void setUp() throws Exception {
         super.setUp();
-        kernel = KernelFactory.newInstance().createKernel(DOMAIN);
+        BundleContext bundleContext = new MockBundleContext(getClass().getClassLoader(),
"", new HashMap<Artifact, ConfigurationData>(), null);
+        kernel = KernelFactory.newInstance(bundleContext).createKernel(DOMAIN);
         kernel.boot();
 
-        ClassLoader classLoader = getClass().getClassLoader();
-
         // server info
         SERVER_INFO_DATA.setAttribute("baseDirectory", System.getProperty("java.io.tmpdir"));
-        kernel.loadGBean(SERVER_INFO_DATA, classLoader);
+        kernel.loadGBean(SERVER_INFO_DATA, bundleContext);
 
         // domain
         DOMAIN_DATA.setReferencePatterns("Servers", new ReferencePatterns(new AbstractNameQuery(J2EEServer.class.getName())));
-        kernel.loadGBean(DOMAIN_DATA, classLoader);
+        kernel.loadGBean(DOMAIN_DATA, bundleContext);
 
         // server
         SERVER_DATA.setReferencePattern("ServerInfo", SERVER_INFO_DATA.getAbstractName());
@@ -117,10 +121,10 @@
         SERVER_DATA.setReferencePatterns("ResourceAdapterModules", new ReferencePatterns(new
AbstractNameQuery(ResourceAdapterModule.class.getName())));
         SERVER_DATA.setReferencePatterns("WebModules", new ReferencePatterns(new AbstractNameQuery(WebModule.class.getName())));
         // Can't test, there are none of these available
-        kernel.loadGBean(SERVER_DATA, classLoader);
+        kernel.loadGBean(SERVER_DATA, bundleContext);
 
         // JVM
-        kernel.loadGBean(JVM_DATA, classLoader);
+        kernel.loadGBean(JVM_DATA, bundleContext);
 
         // start um
         kernel.startGBean(SERVER_INFO_DATA.getAbstractName());

Modified: geronimo/server/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/pom.xml?rev=826133&r1=826132&r2=826133&view=diff
==============================================================================
--- geronimo/server/trunk/pom.xml (original)
+++ geronimo/server/trunk/pom.xml Sat Oct 17 00:02:46 2009
@@ -2010,6 +2010,20 @@
                     <version>1.0-alpha-1</version>
                 </plugin>
 
+                <plugin>
+                  <groupId>org.apache.felix</groupId>
+                  <artifactId>maven-bundle-plugin</artifactId>
+                  <version>2.0.1</version>
+                  <extensions>true</extensions>
+                  <configuration>
+                    <instructions>
+                      <Implementation-Title>${project.name}</Implementation-Title>
+                      <Implementation-Version>${project.version}</Implementation-Version>
+                      <Bundle-DocURL>${project.url}</Bundle-DocURL>
+                    </instructions>
+                  </configuration>
+                </plugin>
+
                 <!-- INTERNAL -->
 
                 <plugin>
@@ -2130,6 +2144,12 @@
                 </plugin>
             </plugins>
         </pluginManagement>
+        <plugins>
+            <plugin>
+              <groupId>org.apache.felix</groupId>
+              <artifactId>maven-bundle-plugin</artifactId>
+            </plugin>
+        </plugins>
 
     </build>
 



Mime
View raw message