geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r389932 - in /geronimo/branches/1.1/modules: connector/src/test/org/apache/geronimo/connector/ connector/src/test/org/apache/geronimo/connector/outbound/ j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/
Date Thu, 30 Mar 2006 00:00:34 GMT
Author: dain
Date: Wed Mar 29 16:00:32 2006
New Revision: 389932

URL: http://svn.apache.org/viewcvs?rev=389932&view=rev
Log:
Removed last remaining method from NameFactory

Modified:
    geronimo/branches/1.1/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java
    geronimo/branches/1.1/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java
    geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java

Modified: geronimo/branches/1.1/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java?rev=389932&r1=389931&r2=389932&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java
(original)
+++ geronimo/branches/1.1/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java
Wed Mar 29 16:00:32 2006
@@ -21,25 +21,24 @@
 import java.io.ByteArrayOutputStream;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
-import java.util.Map;
 import java.util.HashMap;
-import javax.management.MalformedObjectNameException;
+import java.util.Map;
 
 import junit.framework.TestCase;
 import org.apache.geronimo.connector.mock.MockAdminObject;
 import org.apache.geronimo.connector.mock.MockAdminObjectImpl;
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.kernel.KernelFactory;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.KernelFactory;
 import org.apache.geronimo.kernel.repository.Artifact;
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 386505 $ $Date$
  */
 public class AdminObjectWrapperTest extends TestCase {
 
@@ -53,14 +52,6 @@
         assertTrue(proxy instanceof MockAdminObject);
         MockAdminObject mockAdminObject = ((MockAdminObject) proxy).getSomething();
         assertNotNull(mockAdminObject);
-//        kernel.stopGBean(selfName);
-//        try {
-//            ((MockAdminObject) proxy).getSomething();
-//            fail();
-//        } catch (IllegalStateException ise) {
-//        }
-//        kernel.startGBean(selfName);
-//        ((MockAdminObject) proxy).getSomething();
     }
 
     public void testSerialization() throws Exception {
@@ -80,38 +71,18 @@
         kernel.stopGBean(selfName);
         ObjectInputStream ois2 = new ObjectInputStream(new ByteArrayInputStream(bytes));
         MockAdminObject proxy3 = (MockAdminObject) ois2.readObject();
-//        try {
-//            proxy3.getSomething();
-//            fail();
-//        } catch (IllegalStateException ise) {
-//        }
         kernel.startGBean(selfName);
         proxy3.getSomething();
 
     }
 
-//this should be in ENCConfigBuilder tests.
-//    public void testLocalLookup() throws Exception {
-//        ComponentContextBuilder builder = new ComponentContextBuilder();
-//        ENCConfigBuilder.addResourceEnvRefs(earContext, uri, resEnvRefs, cl, refMap, builder);
-//        GerLocalRefType localRef = GerLocalRefType.Factory.newInstance();
-//        localRef.setRefName("resourceenvref");
-//        localRef.setKernelName(KERNEL_NAME);
-//        localRef.setTargetName(TARGET_NAME);
-//        builder.
-//                addResourceEnvRef("resourceenvref", MockAdminObject.class, localRef);
-//        ReadOnlyContext roc = builder.getContext();
-//        Object o = roc.lookup("env/resourceenvref");
-//        assertNotNull(o);
-//        assertTrue(o instanceof MockAdminObject);
-//    }
-
     protected void setUp() throws Exception {
+        super.setUp();
         J2eeContext j2eeContext = new J2eeContextImpl("test.domain", "geronimo.server", "testapp",
NameFactory.RESOURCE_ADAPTER_MODULE, "testmodule", TARGET_NAME, NameFactory.JMS_RESOURCE);
         kernel = KernelFactory.newInstance().createKernel(j2eeContext.getJ2eeDomainName());
         kernel.boot();
 
-        GBeanData aow = buildGBeanData("name", TARGET_NAME, AdminObjectWrapperGBean.getGBeanInfo(),
NameFactory.JCA_RESOURCE, j2eeContext);
+        GBeanData aow = buildGBeanData("name", TARGET_NAME, AdminObjectWrapperGBean.getGBeanInfo());
         selfName = aow.getAbstractName();
         aow.setAttribute("adminObjectInterface", MockAdminObject.class.getName());
         aow.setAttribute("adminObjectClass", MockAdminObjectImpl.class.getName());
@@ -120,19 +91,20 @@
         kernel.startGBean(selfName);
     }
 
-    private GBeanData buildGBeanData(String key, String value, GBeanInfo info, String type,
J2eeContext j2eeContext) throws MalformedObjectNameException {
-        AbstractName abstractName = buildAbstractName(key, value, info, type, j2eeContext);
+    private GBeanData buildGBeanData(String key, String value, GBeanInfo info) {
+        AbstractName abstractName = buildAbstractName(key, value);
         return new GBeanData(abstractName, info);
     }
 
-    private AbstractName buildAbstractName(String key, String value, GBeanInfo info, String
type, J2eeContext j2eeContext) throws MalformedObjectNameException {
+    private AbstractName buildAbstractName(String key, String value) {
         Map names = new HashMap();
         names.put(key, value);
-        return new AbstractName(new Artifact("test", "foo", "1", "car"), names, NameFactory.getComponentName(null,
null, null, type, null, null, value, j2eeContext));
+        return new AbstractName(new Artifact("test", "foo", "1", "car"), names);
     }
 
     protected void tearDown() throws Exception {
         kernel.stopGBean(selfName);
         kernel.shutdown();
+        super.tearDown();
     }
 }

Modified: geronimo/branches/1.1/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java?rev=389932&r1=389931&r2=389932&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java
(original)
+++ geronimo/branches/1.1/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java
Wed Mar 29 16:00:32 2006
@@ -17,6 +17,16 @@
 
 package org.apache.geronimo.connector.outbound;
 
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+import javax.resource.cci.Connection;
+import javax.resource.cci.ConnectionFactory;
+
 import junit.framework.TestCase;
 import org.apache.geronimo.connector.mock.ConnectionFactoryExtension;
 import org.apache.geronimo.connector.mock.MockConnection;
@@ -29,33 +39,17 @@
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
-import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelFactory;
 import org.apache.geronimo.kernel.repository.Artifact;
 
-import javax.management.MalformedObjectNameException;
-import javax.resource.cci.Connection;
-import javax.resource.cci.ConnectionFactory;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 386505 $ $Date$
  */
 public class ManagedConnectionFactoryWrapperTest extends TestCase {
 
     private Kernel kernel;
     private AbstractName managedConnectionFactoryName;
-    private AbstractName ctcName;
-    private AbstractName cmfName;
     private static final String KERNEL_NAME = "testKernel";
     private static final String TARGET_NAME = "testCFName";
 
@@ -107,28 +101,28 @@
     }
 
     protected void setUp() throws Exception {
+        super.setUp();
         kernel = KernelFactory.newInstance().createKernel(KERNEL_NAME);
         kernel.boot();
         ClassLoader cl = MockConnectionTrackingCoordinator.class.getClassLoader();
-        J2eeContext j2eeContext = new J2eeContextImpl("test.domain", "geronimo", "testapplication",
"noModuleType", "testmodule", TARGET_NAME, NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
 
-        GBeanData ctc = buildGBeanData("name", "ConnectionTrackingCoordinator", MockConnectionTrackingCoordinator.getGBeanInfo(),
"ConnectionTrackingCoordinator", j2eeContext);
-        ctcName = ctc.getAbstractName();
+        GBeanData ctc = buildGBeanData("name", "ConnectionTrackingCoordinator", MockConnectionTrackingCoordinator.getGBeanInfo());
+        AbstractName ctcName = ctc.getAbstractName();
         kernel.loadGBean(ctc, cl);
 
-        GBeanData cmf = buildGBeanData("name", "ConnectionManagerContainer", GenericConnectionManagerGBean.getGBeanInfo(),
"ConnectionManagerContainer", j2eeContext);
-        cmfName = cmf.getAbstractName();
+        GBeanData cmf = buildGBeanData("name", "ConnectionManagerContainer", GenericConnectionManagerGBean.getGBeanInfo());
+        AbstractName cmfName = cmf.getAbstractName();
         cmf.setAttribute("transactionSupport", NoTransactions.INSTANCE);
         cmf.setAttribute("pooling", new NoPool());
         cmf.setReferencePattern("ConnectionTracker", ctcName);
         kernel.loadGBean(cmf, cl);
 
 
-        GBeanData mcfw = buildGBeanData("name", TARGET_NAME, ManagedConnectionFactoryWrapperGBean.getGBeanInfo(),
NameFactory.JCA_RESOURCE, j2eeContext);
+        GBeanData mcfw = buildGBeanData("name", TARGET_NAME, ManagedConnectionFactoryWrapperGBean.getGBeanInfo());
         managedConnectionFactoryName = mcfw.getAbstractName();
         mcfw.setAttribute("managedConnectionFactoryClass", MockManagedConnectionFactory.class.getName());
         mcfw.setAttribute("connectionFactoryInterface", ConnectionFactory.class.getName());
-        mcfw.setAttribute("implementedInterfaces", new String[] {Serializable.class.getName(),
ConnectionFactoryExtension.class.getName()});
+        mcfw.setAttribute("implementedInterfaces", new String[]{Serializable.class.getName(),
ConnectionFactoryExtension.class.getName()});
         mcfw.setAttribute("connectionFactoryImplClass", MockConnectionFactory.class.getName());
         mcfw.setAttribute("connectionInterface", Connection.class.getName());
         mcfw.setAttribute("connectionImplClass", MockConnection.class.getName());
@@ -141,21 +135,22 @@
         kernel.startGBean(cmfName);
         kernel.startGBean(managedConnectionFactoryName);
     }
-    private GBeanData buildGBeanData(String key, String value, GBeanInfo info, String type,
J2eeContext j2eeContext) throws MalformedObjectNameException {
-        AbstractName abstractName = buildAbstractName(key, value, info, type, j2eeContext);
+    private GBeanData buildGBeanData(String key, String value, GBeanInfo info) {
+        AbstractName abstractName = buildAbstractName(key, value);
         return new GBeanData(abstractName, info);
     }
 
-    private AbstractName buildAbstractName(String key, String value, GBeanInfo info, String
type, J2eeContext j2eeContext) throws MalformedObjectNameException {
+    private AbstractName buildAbstractName(String key, String value) {
         Map names = new HashMap();
         names.put(key, value);
-        return new AbstractName(new Artifact("test", "foo", "1", "car"), names, NameFactory.getComponentName(null,
null, null, type, null, null, value, j2eeContext));
+        return new AbstractName(new Artifact("test", "foo", "1", "car"), names);
     }
 
 
     protected void tearDown() throws Exception {
         kernel.stopGBean(managedConnectionFactoryName);
         kernel.shutdown();
+        super.tearDown();
     }
 
     public static class MockConnectionTrackingCoordinator implements ConnectionTracker {

Modified: geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java?rev=389932&r1=389931&r2=389932&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java
(original)
+++ geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java
Wed Mar 29 16:00:32 2006
@@ -16,11 +16,6 @@
  */
 package org.apache.geronimo.j2ee.j2eeobjectnames;
 
-import java.util.Properties;
-
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-
 /**
  * @version $Rev:385692 $ $Date$
  */
@@ -113,30 +108,4 @@
     public static final String CORBA_TSS = "CORBATSS";
     public static final String WEB_SERVICE_LINK = "WSLink";
     public static final String KEY_GENERATOR = "KeyGenerator";
-
-
-    /**
-     *
-     * @deprecated
-     * @param j2eeDomainName
-     * @param j2eeServerName
-     * @param j2eeApplicationName
-     * @param j2eeModuleType
-     * @param j2eeModuleName
-     * @param j2eeName
-     * @param j2eeType
-     * @param context
-     * @return
-     * @throws MalformedObjectNameException
-     */
-    public static ObjectName getComponentName(String j2eeDomainName, String j2eeServerName,
String j2eeApplicationName, String j2eeModuleType, String j2eeModuleName, String j2eeName,
String j2eeType, J2eeContext context) throws MalformedObjectNameException {
-        Properties props = new Properties();
-        props.put(J2EE_TYPE, context.getJ2eeType(j2eeType));
-        props.put(J2EE_SERVER, context.getJ2eeServerName(j2eeServerName));
-        props.put(J2EE_APPLICATION, context.getJ2eeApplicationName(j2eeApplicationName));
-        props.put(context.getJ2eeModuleType(j2eeModuleType), context.getJ2eeModuleName(j2eeModuleName));
-        props.put(J2EE_NAME, context.getJ2eeName(j2eeName));
-        return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
-    }
-
 }



Mime
View raw message