Author: clebert.suconic(a)jboss.com
Date: 2011-04-20 17:40:26 -0400 (Wed, 20 Apr 2011)
New Revision: 10548
Added:
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/ra/HornetQActivationTest.java
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/ra/HornetQRAProperties.java
branches/Branch_2_2_EAP/src/main/org/hornetq/ra/HornetQResourceAdapter.java
branches/Branch_2_2_EAP/src/main/org/hornetq/ra/Util.java
branches/Branch_2_2_EAP/src/main/org/hornetq/ra/inflow/HornetQActivationSpec.java
Log:
HORNETQ-670 - Change on the JNDI parameters to ; instead of ,
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/ra/HornetQRAProperties.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/ra/HornetQRAProperties.java 2011-04-20
21:39:58 UTC (rev 10547)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/ra/HornetQRAProperties.java 2011-04-20
21:40:26 UTC (rev 10548)
@@ -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/Branch_2_2_EAP/src/main/org/hornetq/ra/HornetQResourceAdapter.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/ra/HornetQResourceAdapter.java 2011-04-20
21:39:58 UTC (rev 10547)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/ra/HornetQResourceAdapter.java 2011-04-20
21:40:26 UTC (rev 10548)
@@ -1124,7 +1124,7 @@
raProperties.setParsedJndiParams(Util.parseHashtableConfig(jndiParams));
}
- public Hashtable getParsedJndiParams()
+ public Hashtable<?,?> getParsedJndiParams()
{
return raProperties.getParsedJndiParams();
}
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/ra/Util.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/ra/Util.java 2011-04-20 21:39:58 UTC (rev
10547)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/ra/Util.java 2011-04-20 21:40:26 UTC (rev
10548)
@@ -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/Branch_2_2_EAP/src/main/org/hornetq/ra/inflow/HornetQActivationSpec.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/ra/inflow/HornetQActivationSpec.java 2011-04-20
21:39:58 UTC (rev 10547)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/ra/inflow/HornetQActivationSpec.java 2011-04-20
21:40:26 UTC (rev 10548)
@@ -176,7 +176,7 @@
parsedJndiParams = Util.parseHashtableConfig(jndiParams);
}
- public Hashtable getParsedJndiParams()
+ public Hashtable<?,?> getParsedJndiParams()
{
if(parsedJndiParams == null)
{
Added:
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/ra/HornetQActivationTest.java
===================================================================
---
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/ra/HornetQActivationTest.java
(rev 0)
+++
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/ra/HornetQActivationTest.java 2011-04-20
21:40:26 UTC (rev 10548)
@@ -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 -------------------------------------------------
+
+}