[jboss-cvs] JBossAS SVN: r97314 - in branches/JBPAPP_4_2_0_GA_CP/testsuite: src/main/org/jboss/test/jca and 5 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Dec 2 13:46:41 EST 2009
Author: jesper.pedersen
Date: 2009-12-02 13:46:41 -0500 (Wed, 02 Dec 2009)
New Revision: 97314
Added:
branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/primitive/
branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/primitive/AdminObject.java
branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/primitive/Connection.java
branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/primitive/ConnectionFactory.java
branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/primitive/ManagedConnection.java
branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/primitive/TestConnectionFactory.java
branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/primitive/TestResourceAdapter.java
branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/test/PrimitiveUnitTestCase.java
branches/JBPAPP_4_2_0_GA_CP/testsuite/src/resources/jca/primitive/
branches/JBPAPP_4_2_0_GA_CP/testsuite/src/resources/jca/primitive/META-INF/
branches/JBPAPP_4_2_0_GA_CP/testsuite/src/resources/jca/primitive/META-INF/ra.xml
branches/JBPAPP_4_2_0_GA_CP/testsuite/src/resources/jca/primitive/jcaprimitive-ds.xml
Modified:
branches/JBPAPP_4_2_0_GA_CP/testsuite/imports/sections/jca.xml
Log:
[JBPAPP-2810] Support primitive types for config-properties
Modified: branches/JBPAPP_4_2_0_GA_CP/testsuite/imports/sections/jca.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/imports/sections/jca.xml 2009-12-02 18:46:11 UTC (rev 97313)
+++ branches/JBPAPP_4_2_0_GA_CP/testsuite/imports/sections/jca.xml 2009-12-02 18:46:41 UTC (rev 97314)
@@ -302,5 +302,26 @@
<include name="testjcaprops-upper-good.jar"/>
</fileset>
</jar>
+
+ <!-- Primitive properties -->
+ <jar destfile="${build.lib}/jcaprimitive.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/jca/primitive/**"/>
+ </fileset>
+ </jar>
+ <jar destfile="${build.lib}/jcaprimitive.rar">
+ <fileset dir="${build.lib}">
+ <include name="jcaprimitive.jar"/>
+ </fileset>
+ <fileset dir="${build.resources}/jca/primitive">
+ <include name="META-INF/ra.xml"/>
+ </fileset>
+ </jar>
+ <copy todir="${build.lib}" filtering="no">
+ <fileset dir="${build.resources}/jca/primitive">
+ <include name="jcaprimitive-ds.xml"/>
+ </fileset>
+ </copy>
+
</target>
</project>
Added: branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/primitive/AdminObject.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/primitive/AdminObject.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/primitive/AdminObject.java 2009-12-02 18:46:41 UTC (rev 97314)
@@ -0,0 +1,96 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.jca.primitive;
+
+import java.io.Serializable;
+
+import javax.jms.JMSException;
+
+public class AdminObject implements javax.jms.Queue, Serializable
+{
+ private static final long serialVersionUID = 1L;
+
+ private int someIntProperty;
+
+ private Integer someIntegerObjectProperty;
+
+ private boolean someBooleanProperty;
+
+ private Boolean someBooleanObjectProperty;
+
+ public int getSomeIntProperty()
+ {
+ return someIntProperty;
+ }
+
+ public void setSomeIntProperty(int someIntProperty)
+ {
+ this.someIntProperty = someIntProperty;
+ }
+
+ public Integer getSomeIntegerObjectProperty()
+ {
+ return someIntegerObjectProperty;
+ }
+
+ public void setSomeIntegerObjectProperty(Integer someIntegerObjectProperty)
+ {
+ this.someIntegerObjectProperty = someIntegerObjectProperty;
+ }
+
+ public boolean isSomeBooleanProperty()
+ {
+ return someBooleanProperty;
+ }
+
+ public void setSomeBooleanProperty(boolean someBooleanProperty)
+ {
+ this.someBooleanProperty = someBooleanProperty;
+ }
+
+ public Boolean getSomeBooleanObjectProperty()
+ {
+ return someBooleanObjectProperty;
+ }
+
+ public void setSomeBooleanObjectProperty(Boolean someBooleanObjectProperty)
+ {
+ this.someBooleanObjectProperty = someBooleanObjectProperty;
+ }
+
+ public String getQueueName() throws JMSException
+ {
+ return null;
+ }
+
+ @Override
+ public String toString()
+ {
+ StringBuilder sb = new StringBuilder();
+ sb.append("#======= TEST AdminObject ========#").append("\n");
+ sb.append("Integer Primitive: " + someIntProperty).append("\n");
+ sb.append("Integer Object: " + someIntegerObjectProperty).append("\n");
+ sb.append("Boolean Primitive: " + someBooleanProperty).append("\n");
+ sb.append("Boolean Object: " + someBooleanObjectProperty).append("\n");
+ return sb.toString();
+ }
+}
Added: branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/primitive/Connection.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/primitive/Connection.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/primitive/Connection.java 2009-12-02 18:46:41 UTC (rev 97314)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.jca.primitive;
+
+import javax.jms.ConnectionConsumer;
+import javax.jms.ConnectionMetaData;
+import javax.jms.Destination;
+import javax.jms.ExceptionListener;
+import javax.jms.JMSException;
+import javax.jms.ServerSessionPool;
+import javax.jms.Session;
+import javax.jms.Topic;
+
+public class Connection implements javax.jms.Connection
+{
+
+ public void close() throws JMSException
+ {
+ }
+
+ public ConnectionConsumer createConnectionConsumer(Destination destination, String messageSelector,
+ ServerSessionPool sessionPool, int maxMessages) throws JMSException
+ {
+ return null;
+ }
+
+ public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String subscriptionName,
+ String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
+ {
+ return null;
+ }
+
+ public Session createSession(boolean transacted, int acknowledgeMode) throws JMSException
+ {
+ return null;
+ }
+
+ public String getClientID() throws JMSException
+ {
+ return null;
+ }
+
+ public ExceptionListener getExceptionListener() throws JMSException
+ {
+ return null;
+ }
+
+ public ConnectionMetaData getMetaData() throws JMSException
+ {
+ return null;
+ }
+
+ public void setClientID(String clientID) throws JMSException
+ {
+ }
+
+ public void setExceptionListener(ExceptionListener listener) throws JMSException
+ {
+ }
+
+ public void start() throws JMSException
+ {
+ }
+
+ public void stop() throws JMSException
+ {
+ }
+}
Added: branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/primitive/ConnectionFactory.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/primitive/ConnectionFactory.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/primitive/ConnectionFactory.java 2009-12-02 18:46:41 UTC (rev 97314)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.jca.primitive;
+
+import javax.jms.Connection;
+import javax.jms.JMSException;
+
+public class ConnectionFactory implements javax.jms.ConnectionFactory
+{
+
+ public Connection createConnection() throws JMSException
+ {
+ return new org.jboss.test.jca.primitive.Connection();
+ }
+
+ public Connection createConnection(String userName, String password) throws JMSException
+ {
+ return null;
+ }
+}
Added: branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/primitive/ManagedConnection.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/primitive/ManagedConnection.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/primitive/ManagedConnection.java 2009-12-02 18:46:41 UTC (rev 97314)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.jca.primitive;
+
+import java.io.PrintWriter;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionEventListener;
+import javax.resource.spi.ConnectionRequestInfo;
+import javax.resource.spi.LocalTransaction;
+import javax.resource.spi.ManagedConnectionMetaData;
+import javax.security.auth.Subject;
+import javax.transaction.xa.XAResource;
+
+public class ManagedConnection implements javax.resource.spi.ManagedConnection
+{
+
+ public void addConnectionEventListener(ConnectionEventListener listener)
+ {
+ }
+
+ public void associateConnection(Object connection) throws ResourceException
+ {
+ }
+
+ public void cleanup() throws ResourceException
+ {
+ }
+
+ public void destroy() throws ResourceException
+ {
+ }
+
+ public Object getConnection(Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException
+ {
+ return null;
+ }
+
+ public LocalTransaction getLocalTransaction() throws ResourceException
+ {
+ return null;
+ }
+
+ public PrintWriter getLogWriter() throws ResourceException
+ {
+ return null;
+ }
+
+ public ManagedConnectionMetaData getMetaData() throws ResourceException
+ {
+ return null;
+ }
+
+ public XAResource getXAResource() throws ResourceException
+ {
+ return null;
+ }
+
+ public void removeConnectionEventListener(ConnectionEventListener listener)
+ {
+ }
+
+ public void setLogWriter(PrintWriter out) throws ResourceException
+ {
+ }
+}
Added: branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/primitive/TestConnectionFactory.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/primitive/TestConnectionFactory.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/primitive/TestConnectionFactory.java 2009-12-02 18:46:41 UTC (rev 97314)
@@ -0,0 +1,118 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.jca.primitive;
+
+import java.io.PrintWriter;
+import java.util.Set;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionManager;
+import javax.resource.spi.ConnectionRequestInfo;
+import javax.resource.spi.ManagedConnection;
+import javax.resource.spi.ManagedConnectionFactory;
+import javax.security.auth.Subject;
+
+public class TestConnectionFactory implements ManagedConnectionFactory
+{
+ private static final long serialVersionUID = 1L;
+
+ private int someIntProperty;
+
+ private Integer someIntegerObjectProperty;
+
+ private boolean someBooleanProperty;
+
+ private Boolean someBooleanObjectProperty;
+
+ public Object createConnectionFactory() throws ResourceException
+ {
+ return null;
+ }
+
+ public Object createConnectionFactory(ConnectionManager cxManager) throws ResourceException
+ {
+ return new ConnectionFactory();
+ }
+
+ public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo cxRequestInfo)
+ throws ResourceException
+ {
+ return new org.jboss.test.jca.primitive.ManagedConnection();
+ }
+
+ public PrintWriter getLogWriter() throws ResourceException
+ {
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ public ManagedConnection matchManagedConnections(Set connectionSet, Subject subject,
+ ConnectionRequestInfo cxRequestInfo) throws ResourceException
+ {
+ return null;
+ }
+
+ public void setLogWriter(PrintWriter out) throws ResourceException
+ {
+
+ }
+
+ public int getSomeIntProperty()
+ {
+ return someIntProperty;
+ }
+
+ public void setSomeIntProperty(int someIntProperty)
+ {
+ this.someIntProperty = someIntProperty;
+ }
+
+ public Integer getSomeIntegerObjectProperty()
+ {
+ return someIntegerObjectProperty;
+ }
+
+ public void setSomeIntegerObjectProperty(Integer someIntegerObjectProperty)
+ {
+ this.someIntegerObjectProperty = someIntegerObjectProperty;
+ }
+
+ public boolean isSomeBooleanProperty()
+ {
+ return someBooleanProperty;
+ }
+
+ public void setSomeBooleanProperty(boolean someBooleanProperty)
+ {
+ this.someBooleanProperty = someBooleanProperty;
+ }
+
+ public Boolean getSomeBooleanObjectProperty()
+ {
+ return someBooleanObjectProperty;
+ }
+
+ public void setSomeBooleanObjectProperty(Boolean someBooleanObjectProperty)
+ {
+ this.someBooleanObjectProperty = someBooleanObjectProperty;
+ }
+}
Added: branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/primitive/TestResourceAdapter.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/primitive/TestResourceAdapter.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/primitive/TestResourceAdapter.java 2009-12-02 18:46:41 UTC (rev 97314)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.jca.primitive;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ActivationSpec;
+import javax.resource.spi.BootstrapContext;
+import javax.resource.spi.ResourceAdapter;
+import javax.resource.spi.ResourceAdapterInternalException;
+import javax.resource.spi.endpoint.MessageEndpointFactory;
+import javax.transaction.xa.XAResource;
+
+public class TestResourceAdapter implements ResourceAdapter
+{
+ private int someIntProperty;
+ private Integer someIntegerObjectProperty;
+ private boolean someBooleanProperty;
+ private Boolean someBooleanObjectProperty;
+
+ public void endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec spec) throws ResourceException
+ {
+ }
+
+ public void endpointDeactivation(MessageEndpointFactory endpointFactory, ActivationSpec spec)
+ {
+ }
+
+ public XAResource[] getXAResources(ActivationSpec[] specs) throws ResourceException
+ {
+ return null;
+ }
+
+ public void start(BootstrapContext ctx) throws ResourceAdapterInternalException
+ {
+ }
+
+ public void stop()
+ {
+ }
+
+ public int getSomeIntProperty()
+ {
+ return someIntProperty;
+ }
+
+ public void setSomeIntProperty(int someIntProperty)
+ {
+ this.someIntProperty = someIntProperty;
+ }
+
+ public Integer getSomeIntegerObjectProperty()
+ {
+ return someIntegerObjectProperty;
+ }
+
+ public void setSomeIntegerObjectProperty(Integer someIntegerObjectProperty)
+ {
+ this.someIntegerObjectProperty = someIntegerObjectProperty;
+ }
+
+ public boolean isSomeBooleanProperty()
+ {
+ return someBooleanProperty;
+ }
+
+ public void setSomeBooleanProperty(boolean someBooleanProperty)
+ {
+ this.someBooleanProperty = someBooleanProperty;
+ }
+
+ public Boolean getSomeBooleanObjectProperty()
+ {
+ return someBooleanObjectProperty;
+ }
+
+ public void setSomeBooleanObjectProperty(Boolean someBooleanObjectProperty)
+ {
+ this.someBooleanObjectProperty = someBooleanObjectProperty;
+ }
+}
Added: branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/test/PrimitiveUnitTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/test/PrimitiveUnitTestCase.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jca/test/PrimitiveUnitTestCase.java 2009-12-02 18:46:41 UTC (rev 97314)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.jca.test;
+
+import javax.management.ObjectName;
+
+import org.jboss.resource.metadata.ConfigPropertyMetaData;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * Test case for resource adapters with primitive config-property definitions
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ * @version $Revision: $
+ */
+
+public class PrimitiveUnitTestCase extends JBossTestCase
+{
+
+ public PrimitiveUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testRA() throws Exception
+ {
+ ObjectName raName = new ObjectName("jboss.jca:name='jcaprimitive.rar',service=RARDeployment");
+ deploy("jcaprimitive.rar");
+ try
+ {
+ deploy("jcaprimitive-ds.xml");
+ try
+ {
+ assertTrue("RA should be registered", getServer().isRegistered(raName));
+ assertTrue("someIntegerObjectProperty should be 1, is " + getAttribute(raName, "someIntegerObjectProperty"),
+ new Integer(1).equals(getAttribute(raName, "someIntegerObjectProperty")));
+ assertTrue("someIntProperty should be 1, is " + getAttribute(raName, "someIntProperty"),
+ new Integer(1).equals(getAttribute(raName, "someIntProperty")));
+ assertTrue("someBooleanObjectProperty should be TRUE, is " + getAttribute(raName, "someBooleanObjectProperty"),
+ Boolean.TRUE.equals(getAttribute(raName, "someBooleanObjectProperty")));
+ assertTrue("someBooleanProperty should be TRUE, is " + getAttribute(raName, "someBooleanProperty"),
+ Boolean.TRUE.equals(getAttribute(raName, "someBooleanProperty")));
+ }
+ finally
+ {
+ undeploy("jcaprimitive-ds.xml");
+ }
+ }
+ finally
+ {
+ undeploy("jcaprimitive.rar");
+ }
+ }
+
+ private Object getAttribute(ObjectName raName, String attrName) throws Exception
+ {
+ ConfigPropertyMetaData cpmd = (ConfigPropertyMetaData)getServer().getAttribute(raName, attrName);
+ if ("java.lang.Integer".equals(cpmd.getType()))
+ {
+ return Integer.valueOf(cpmd.getValue());
+ }
+ else if ("java.lang.Boolean".equals(cpmd.getType()))
+ {
+ return Boolean.valueOf(cpmd.getValue());
+ }
+ return cpmd.getValue();
+ }
+}
Added: branches/JBPAPP_4_2_0_GA_CP/testsuite/src/resources/jca/primitive/META-INF/ra.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/resources/jca/primitive/META-INF/ra.xml (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/testsuite/src/resources/jca/primitive/META-INF/ra.xml 2009-12-02 18:46:41 UTC (rev 97314)
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<connector id="IMSTM" version="1.5"
+ xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd">
+ <display-name>Test Resource Adapter</display-name>
+ <vendor-name>Test</vendor-name>
+ <eis-type>TEST</eis-type>
+ <resourceadapter-version>1.0</resourceadapter-version>
+ <license>
+ <description>
+ </description>
+ <license-required>false</license-required>
+ </license>
+ <resourceadapter>
+ <resourceadapter-class>org.jboss.test.jca.primitive.TestResourceAdapter</resourceadapter-class>
+ <config-property>
+ <config-property-name>someIntProperty</config-property-name>
+ <config-property-type>java.lang.Integer</config-property-type>
+ <config-property-value>1</config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>someIntegerObjectProperty</config-property-name>
+ <config-property-type>java.lang.Integer</config-property-type>
+ <config-property-value>1</config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>someBooleanProperty</config-property-name>
+ <config-property-type>java.lang.Boolean</config-property-type>
+ <config-property-value>true</config-property-value>
+ </config-property>
+
+ <config-property>
+ <config-property-name>someBooleanObjectProperty</config-property-name>
+ <config-property-type>java.lang.Boolean</config-property-type>
+ <config-property-value>true</config-property-value>
+ </config-property>
+
+ <!-- Outbound -->
+
+ <outbound-resourceadapter>
+
+ <connection-definition>
+ <managedconnectionfactory-class>org.jboss.test.jca.primitive.TestConnectionFactory</managedconnectionfactory-class>
+
+ <config-property>
+ <description>Some Primitive int Property</description>
+ <config-property-name>someIntProperty</config-property-name>
+ <config-property-type>java.lang.Integer</config-property-type>
+ </config-property>
+
+ <config-property>
+ <description>Some Object Integer Property</description>
+ <config-property-name>someIntegerObjectProperty</config-property-name>
+ <config-property-type>java.lang.Integer</config-property-type>
+ </config-property>
+
+ <config-property>
+ <description>Some Primitive boolean Property</description>
+ <config-property-name>someBooleanProperty</config-property-name>
+ <config-property-type>java.lang.Boolean</config-property-type>
+ </config-property>
+
+ <config-property>
+ <description>Some Object Boolean Property</description>
+ <config-property-name>someBooleanObjectProperty</config-property-name>
+ <config-property-type>java.lang.Boolean</config-property-type>
+ </config-property>
+
+ <connectionfactory-interface>javax.jms.ConnectionFactory</connectionfactory-interface>
+ <connectionfactory-impl-class>org.jboss.test.jca.primitive.ConnectionFactory</connectionfactory-impl-class>
+ <connection-interface>javax.jms.Connection</connection-interface>
+ <connection-impl-class>org.jboss.test.jca.primitive.Connection</connection-impl-class>
+
+ </connection-definition>
+
+ <transaction-support>XATransaction</transaction-support>
+
+ <authentication-mechanism>
+ <description>User name and password supported</description>
+ <authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
+ <credential-interface>
+ javax.resource.spi.security.PasswordCredential</credential-interface>
+ </authentication-mechanism>
+ <reauthentication-support>true</reauthentication-support>
+ </outbound-resourceadapter>
+
+ <adminobject>
+ <adminobject-interface>javax.jms.Queue</adminobject-interface>
+ <adminobject-class>org.jboss.test.jca.primitive.AdminObject</adminobject-class>
+ <config-property>
+ <description>Some Primitive int Property</description>
+ <config-property-name>someIntProperty</config-property-name>
+ <config-property-type>java.lang.Integer</config-property-type>
+ </config-property>
+
+ <config-property>
+ <description>Some Object Integer Property</description>
+ <config-property-name>someIntegerObjectProperty</config-property-name>
+ <config-property-type>java.lang.Integer</config-property-type>
+ </config-property>
+
+ <config-property>
+ <description>Some Primitive boolean Property</description>
+ <config-property-name>someBooleanProperty</config-property-name>
+ <config-property-type>java.lang.Boolean</config-property-type>
+ </config-property>
+
+ <config-property>
+ <description>Some Object Boolean Property</description>
+ <config-property-name>someBooleanObjectProperty</config-property-name>
+ <config-property-type>java.lang.Boolean</config-property-type>
+ </config-property>
+ </adminobject>
+ </resourceadapter>
+</connector>
Added: branches/JBPAPP_4_2_0_GA_CP/testsuite/src/resources/jca/primitive/jcaprimitive-ds.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/resources/jca/primitive/jcaprimitive-ds.xml (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/testsuite/src/resources/jca/primitive/jcaprimitive-ds.xml 2009-12-02 18:46:41 UTC (rev 97314)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<connection-factories>
+
+ <no-tx-connection-factory>
+ <jndi-name>JCAPrimitive</jndi-name>
+ <rar-name>jcaprimitive.rar</rar-name>
+ <connection-definition>javax.jms.ConnectionFactory</connection-definition>
+ <max-pool-size>10</max-pool-size>
+ </no-tx-connection-factory>
+
+</connection-factories>
More information about the jboss-cvs-commits
mailing list