[hornetq-commits] JBoss hornetq SVN: r10547 - in branches/one-offs/Branch_2_2_EAP_JBPAPP_6277: src/main/org/hornetq/ra/inflow and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Apr 20 17:39:58 EDT 2011


Author: clebert.suconic at jboss.com
Date: 2011-04-20 17:39:58 -0400 (Wed, 20 Apr 2011)
New Revision: 10547

Added:
   branches/one-offs/Branch_2_2_EAP_JBPAPP_6277/tests/src/org/hornetq/tests/integration/ra/HornetQActivationTest.java
Modified:
   branches/one-offs/Branch_2_2_EAP_JBPAPP_6277/src/main/org/hornetq/ra/HornetQRAProperties.java
   branches/one-offs/Branch_2_2_EAP_JBPAPP_6277/src/main/org/hornetq/ra/HornetQResourceAdapter.java
   branches/one-offs/Branch_2_2_EAP_JBPAPP_6277/src/main/org/hornetq/ra/Util.java
   branches/one-offs/Branch_2_2_EAP_JBPAPP_6277/src/main/org/hornetq/ra/inflow/HornetQActivationSpec.java
Log:
HORNETQ-670 - Change on the JNDI parameters to ; instead of ,

Modified: branches/one-offs/Branch_2_2_EAP_JBPAPP_6277/src/main/org/hornetq/ra/HornetQRAProperties.java
===================================================================
--- branches/one-offs/Branch_2_2_EAP_JBPAPP_6277/src/main/org/hornetq/ra/HornetQRAProperties.java	2011-04-20 07:27:16 UTC (rev 10546)
+++ branches/one-offs/Branch_2_2_EAP_JBPAPP_6277/src/main/org/hornetq/ra/HornetQRAProperties.java	2011-04-20 21:39:58 UTC (rev 10547)
@@ -61,7 +61,7 @@
 
    private long setupInterval = DEFAULT_SETUP_INTERVAL;
 
-   private Hashtable jndiParams;
+   private Hashtable<?,?> jndiParams;
 
    private boolean useJNDI;
 
@@ -152,13 +152,13 @@
     *
     * @return return the jndi params to use
     */
-   public Hashtable getParsedJndiParams()
+   public Hashtable<?,?> getParsedJndiParams()
    {
       return jndiParams;
    }
 
 
-   public void setParsedJndiParams(Hashtable params)
+   public void setParsedJndiParams(Hashtable<?,?> params)
    {
       jndiParams = params;
    }

Modified: branches/one-offs/Branch_2_2_EAP_JBPAPP_6277/src/main/org/hornetq/ra/HornetQResourceAdapter.java
===================================================================
--- branches/one-offs/Branch_2_2_EAP_JBPAPP_6277/src/main/org/hornetq/ra/HornetQResourceAdapter.java	2011-04-20 07:27:16 UTC (rev 10546)
+++ branches/one-offs/Branch_2_2_EAP_JBPAPP_6277/src/main/org/hornetq/ra/HornetQResourceAdapter.java	2011-04-20 21:39:58 UTC (rev 10547)
@@ -1124,7 +1124,7 @@
       raProperties.setParsedJndiParams(Util.parseHashtableConfig(jndiParams));
    }
 
-   public Hashtable getParsedJndiParams()
+   public Hashtable<?,?> getParsedJndiParams()
    {
       return raProperties.getParsedJndiParams();
    }

Modified: branches/one-offs/Branch_2_2_EAP_JBPAPP_6277/src/main/org/hornetq/ra/Util.java
===================================================================
--- branches/one-offs/Branch_2_2_EAP_JBPAPP_6277/src/main/org/hornetq/ra/Util.java	2011-04-20 07:27:16 UTC (rev 10546)
+++ branches/one-offs/Branch_2_2_EAP_JBPAPP_6277/src/main/org/hornetq/ra/Util.java	2011-04-20 21:39:58 UTC (rev 10547)
@@ -168,16 +168,21 @@
     * @return the object
     * @throws Exception for any error
     */
-   public static Object lookup(final Context context, final String name, final Class clazz) throws Exception
+   public static Object lookup(final Context context, final String name, final Class<?> clazz) throws Exception
    {
       return context.lookup(name);
    }
 
-   public static Hashtable parseHashtableConfig(final String config)
+   /** 
+    * Used on parsing JNDI Configuration
+    * @param config
+    * @return
+    */
+   public static Hashtable<?,?> parseHashtableConfig(final String config)
    {
-      Hashtable hashtable = new Hashtable();
+      Hashtable<String,String> hashtable = new Hashtable<String, String>();
 
-      String[] topElements = config.split(",");
+      String[] topElements = config.split(";");
 
       for (String element : topElements)
       {

Modified: branches/one-offs/Branch_2_2_EAP_JBPAPP_6277/src/main/org/hornetq/ra/inflow/HornetQActivationSpec.java
===================================================================
--- branches/one-offs/Branch_2_2_EAP_JBPAPP_6277/src/main/org/hornetq/ra/inflow/HornetQActivationSpec.java	2011-04-20 07:27:16 UTC (rev 10546)
+++ branches/one-offs/Branch_2_2_EAP_JBPAPP_6277/src/main/org/hornetq/ra/inflow/HornetQActivationSpec.java	2011-04-20 21:39:58 UTC (rev 10547)
@@ -176,7 +176,7 @@
       parsedJndiParams = Util.parseHashtableConfig(jndiParams);
    }
 
-   public Hashtable getParsedJndiParams()
+   public Hashtable<?,?> getParsedJndiParams()
    {
       if(parsedJndiParams == null)
       {

Added: branches/one-offs/Branch_2_2_EAP_JBPAPP_6277/tests/src/org/hornetq/tests/integration/ra/HornetQActivationTest.java
===================================================================
--- branches/one-offs/Branch_2_2_EAP_JBPAPP_6277/tests/src/org/hornetq/tests/integration/ra/HornetQActivationTest.java	                        (rev 0)
+++ branches/one-offs/Branch_2_2_EAP_JBPAPP_6277/tests/src/org/hornetq/tests/integration/ra/HornetQActivationTest.java	2011-04-20 21:39:58 UTC (rev 10547)
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2010 Red Hat, Inc.
+ * Red Hat 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.hornetq.tests.integration.ra;
+
+import org.hornetq.ra.HornetQResourceAdapter;
+import org.hornetq.ra.inflow.HornetQActivationSpec;
+import org.hornetq.tests.integration.ra.HornetQRATestBase.MyBootstrapContext;
+import org.hornetq.tests.util.ServiceTestBase;
+
+/**
+ * A HornetQActivationTest
+ *
+ * @author clebertsuconic
+ *
+ *
+ */
+public class HornetQActivationTest extends ServiceTestBase
+{
+
+   // Constants -----------------------------------------------------
+
+   // Attributes ----------------------------------------------------
+
+   // Static --------------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   // Public --------------------------------------------------------
+
+   public void testValidateJNDIParameters() throws Exception
+   {
+      HornetQResourceAdapter qResourceAdapter = new HornetQResourceAdapter();
+      HornetQActivationSpec spec = new HornetQActivationSpec();
+      spec.setResourceAdapter(qResourceAdapter);
+      spec.setUseJNDI(false);
+      spec.setDestinationType("javax.jms.Queue");
+      spec.setJndiParams("a=b;c=d;url=a1,a2,a3");
+      
+      assertEquals("b", spec.getParsedJndiParams().get("a"));
+      assertEquals("d", spec.getParsedJndiParams().get("c"));
+      assertEquals("a1,a2,a3", spec.getParsedJndiParams().get("url"));
+      
+      
+   }
+
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   // Inner classes -------------------------------------------------
+
+}



More information about the hornetq-commits mailing list