[jboss-cvs] JBossAS SVN: r73681 - in trunk/testsuite: src/main/org/jboss/test/jca/mbean and 5 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon May 26 10:10:36 EDT 2008
Author: adrian at jboss.org
Date: 2008-05-26 10:10:36 -0400 (Mon, 26 May 2008)
New Revision: 73681
Added:
trunk/testsuite/src/main/org/jboss/test/jca/mbean/Scoped.java
trunk/testsuite/src/main/org/jboss/test/jca/mbean/ScopedMBean.java
trunk/testsuite/src/main/org/jboss/test/jca/test/ScopedRARUnitTestCase.java
trunk/testsuite/src/resources/jca/scoped/
trunk/testsuite/src/resources/jca/scoped/ear/
trunk/testsuite/src/resources/jca/scoped/ear/META-INF/
trunk/testsuite/src/resources/jca/scoped/ear/META-INF/application.xml
trunk/testsuite/src/resources/jca/scoped/ear/META-INF/jboss-app.xml
trunk/testsuite/src/resources/jca/scoped/scoped-adapter-ds.xml
Modified:
trunk/testsuite/imports/sections/jca.xml
Log:
[JBAS-5547] - Write a test deploying a rar in scoped ear and used by a -ds.xml
Modified: trunk/testsuite/imports/sections/jca.xml
===================================================================
--- trunk/testsuite/imports/sections/jca.xml 2008-05-26 09:34:50 UTC (rev 73680)
+++ trunk/testsuite/imports/sections/jca.xml 2008-05-26 14:10:36 UTC (rev 73681)
@@ -276,6 +276,26 @@
<patternset refid="jboss.test.set"/>
</zipfileset>
</jar>
+
+ <!-- test a scoped rar -->
+ <jar destfile="${build.lib}/testscopedrar.ear">
+
+ <fileset dir="${build.lib}">
+ <include name="jbosstestadapter.rar"/>
+ </fileset>
+ <metainf dir="${build.resources}/jca/scoped/ear/META-INF">
+ <include name="*.xml"/>
+ </metainf>
+ </jar>
+ <jar destfile="${build.lib}/testscopedrar.jar">
+
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/jca/mbean/Scoped*"/>
+ </fileset>
+ <metainf dir="${build.resources}/jca/scoped">
+ <include name="scoped-adapter-ds.xml"/>
+ </metainf>
+ </jar>
</target>
<!-- jca property test -->
Added: trunk/testsuite/src/main/org/jboss/test/jca/mbean/Scoped.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jca/mbean/Scoped.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/jca/mbean/Scoped.java 2008-05-26 14:10:36 UTC (rev 73681)
@@ -0,0 +1,53 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt 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.mbean;
+
+import javax.naming.InitialContext;
+
+import org.jboss.system.ServiceMBeanSupport;
+import org.jboss.test.jca.adapter.TestManagedConnectionFactory;
+import org.jboss.test.util.Debug;
+
+/**
+ * Scoped.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class Scoped extends ServiceMBeanSupport implements ScopedMBean
+{
+ @Override
+ protected void startService() throws Exception
+ {
+ InitialContext ctx = new InitialContext();
+ Object obj = ctx.lookup("java:/ScopedCF");
+ if (obj instanceof TestManagedConnectionFactory == false)
+ {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("Expected ");
+ Debug.displayClassInfo(TestManagedConnectionFactory.class, buffer);
+ buffer.append("Got ");
+ Debug.displayClassInfo(obj.getClass(), buffer);
+ throw new RuntimeException(buffer.toString());
+ }
+ }
+}
Added: trunk/testsuite/src/main/org/jboss/test/jca/mbean/ScopedMBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jca/mbean/ScopedMBean.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/jca/mbean/ScopedMBean.java 2008-05-26 14:10:36 UTC (rev 73681)
@@ -0,0 +1,34 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt 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.mbean;
+
+import org.jboss.system.ServiceMBean;
+
+/**
+ * ScopedMBean.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public interface ScopedMBean extends ServiceMBean
+{
+}
Added: trunk/testsuite/src/main/org/jboss/test/jca/test/ScopedRARUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jca/test/ScopedRARUnitTestCase.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/jca/test/ScopedRARUnitTestCase.java 2008-05-26 14:10:36 UTC (rev 73681)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.system.ServiceMBean;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * ScopedRARUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ScopedRARUnitTestCase extends JBossTestCase
+{
+
+ public ScopedRARUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testScopedRAR() throws Exception
+ {
+ deploy("testscopedrar.ear");
+ try
+ {
+ deploy("testscopedrar.jar");
+ try
+ {
+ ObjectName name = new ObjectName("jboss.test:test=Scoped");
+ int state = (Integer) getServer().getAttribute(name, "State");
+ assertEquals(ServiceMBean.STARTED, state);
+ }
+ finally
+ {
+ undeploy("testscopedrar.jar");
+ }
+ }
+ finally
+ {
+ undeploy("testscopedrar.ear");
+ }
+
+ }
+}
Added: trunk/testsuite/src/resources/jca/scoped/ear/META-INF/application.xml
===================================================================
--- trunk/testsuite/src/resources/jca/scoped/ear/META-INF/application.xml (rev 0)
+++ trunk/testsuite/src/resources/jca/scoped/ear/META-INF/application.xml 2008-05-26 14:10:36 UTC (rev 73681)
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<application version="1.4"
+ 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/application_1_4.xsd"
+>
+
+ <display-name>Scoped EAR Deployment Test</display-name>
+
+ <module><ejb>jbosstestadapter.rar</ejb></module>
+
+</application>
+
Added: trunk/testsuite/src/resources/jca/scoped/ear/META-INF/jboss-app.xml
===================================================================
--- trunk/testsuite/src/resources/jca/scoped/ear/META-INF/jboss-app.xml (rev 0)
+++ trunk/testsuite/src/resources/jca/scoped/ear/META-INF/jboss-app.xml 2008-05-26 14:10:36 UTC (rev 73681)
@@ -0,0 +1,12 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<!DOCTYPE jboss-app
+ PUBLIC "-//JBoss//DTD J2EE Application 1.4//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd"
+>
+
+<jboss-app>
+
+ <loader-repository>jboss.test:loader=scoped</loader-repository>
+
+</jboss-app>
Added: trunk/testsuite/src/resources/jca/scoped/scoped-adapter-ds.xml
===================================================================
--- trunk/testsuite/src/resources/jca/scoped/scoped-adapter-ds.xml (rev 0)
+++ trunk/testsuite/src/resources/jca/scoped/scoped-adapter-ds.xml 2008-05-26 14:10:36 UTC (rev 73681)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<connection-factories>
+
+ <loader-repository>jboss.test:loader=scoped</loader-repository>
+
+ <tx-connection-factory>
+
+ <jndi-name>ScopedCF</jndi-name>
+
+ <xa-transaction/>
+
+ <rar-name>testscopedrar.ear#jbosstestadapter.rar</rar-name>
+ <connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
+
+ <config-property name="IntegerProperty" type="java.lang.Integer">2</config-property>
+ <config-property name="BooleanProperty" type="java.lang.Boolean">false</config-property>
+ <config-property name="DoubleProperty" type="java.lang.Double">5.5</config-property>
+ <config-property name="UrlProperty" type="java.net.URL">http://www.jboss.org</config-property>
+
+ </tx-connection-factory>
+
+ <mbean code="org.jboss.test.jca.mbean.Scoped"
+ name="jboss.test:test=Scoped">
+ <depends>jboss.jca:service=ConnectionFactoryBinding,name=ScopedCF</depends>
+ </mbean>
+
+</connection-factories>
More information about the jboss-cvs-commits
mailing list