[jboss-cvs] JBossAS SVN: r68501 - in trunk: testsuite/imports and 13 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Dec 21 06:21:09 EST 2007


Author: alesj
Date: 2007-12-21 06:21:09 -0500 (Fri, 21 Dec 2007)
New Revision: 68501

Added:
   trunk/testsuite/imports/sections/spring.xml
   trunk/testsuite/src/main/org/jboss/test/spring/
   trunk/testsuite/src/main/org/jboss/test/spring/beans/
   trunk/testsuite/src/main/org/jboss/test/spring/beans/Calculator.java
   trunk/testsuite/src/main/org/jboss/test/spring/beans/CalculatorImpl.java
   trunk/testsuite/src/main/org/jboss/test/spring/beans/LogManager.java
   trunk/testsuite/src/main/org/jboss/test/spring/ejb/
   trunk/testsuite/src/main/org/jboss/test/spring/ejb/SpringBeansManager.java
   trunk/testsuite/src/main/org/jboss/test/spring/ejb/SpringBeansManagerImpl.java
   trunk/testsuite/src/main/org/jboss/test/spring/test/
   trunk/testsuite/src/main/org/jboss/test/spring/test/SpringEJBTestCase.java
   trunk/testsuite/src/main/org/jboss/test/spring/test/SpringStandaloneTestCase.java
   trunk/testsuite/src/resources/spring/
   trunk/testsuite/src/resources/spring/ear/
   trunk/testsuite/src/resources/spring/ear/application.xml
   trunk/testsuite/src/resources/spring/ear/jboss-app.xml
   trunk/testsuite/src/resources/spring/ejb/
   trunk/testsuite/src/resources/spring/ejb/META-INF/
   trunk/testsuite/src/resources/spring/ejb/META-INF/ejb-jar.xml
   trunk/testsuite/src/resources/spring/ejb/META-INF/ejb-spring.xml
   trunk/testsuite/src/resources/spring/standalone-spring.xml
   trunk/testsuite/src/resources/test-configs/springdeployer/
Modified:
   trunk/testsuite/build.xml
   trunk/testsuite/imports/server-config.xml
   trunk/testsuite/imports/test-jars.xml
   trunk/tools/etc/buildmagic/modules.ent
Log:
SpringDeployer tests.

Modified: trunk/testsuite/build.xml
===================================================================
--- trunk/testsuite/build.xml	2007-12-21 11:18:36 UTC (rev 68500)
+++ trunk/testsuite/build.xml	2007-12-21 11:21:09 UTC (rev 68501)
@@ -208,6 +208,7 @@
       <path refid="jboss.tomcat.classpath"/>
       <path refid="jboss.varia.classpath"/>
       <path refid="jboss.web.classpath"/>
+      <path refid="jboss.spring.classpath"/>
    </path>
 
    <!-- RMI Stub generation -->
@@ -796,6 +797,12 @@
   <patternset id="profileservice.excludes">
     <exclude name="org/jboss/test/profileservice/test/*TestCase.class"/>
   </patternset>
+  <patternset id="springdeployer.includes">
+    <include name="org/jboss/test/spring/test/*TestCase.class"/>
+  </patternset>
+  <patternset id="springdeployer.excludes">
+    <exclude name="org/jboss/test/spring/test/*TestCase.class"/>
+  </patternset>
 
    <!-- Tests that are currently broken -->
    <patternset id="badtest.excludes">
@@ -848,6 +855,7 @@
       <patternset refid="jbossmq.excludes"/>
       <patternset refid="profileservice.excludes"/>
       <patternset refid="jbossmessaging.excludes"/>
+      <patternset refid="springdeployer.excludes"/>
    </patternset>
 
    <!-- A target that allows for conditional dependency on the compilation and
@@ -869,6 +877,7 @@
       <antcall target="jboss-minimal-tests" />
       <antcall target="jboss-all-config-tests"/>
       <antcall target="tests-profileservice"/>
+      <antcall target="tests-springdeployer"/>
       <antcall target="tests-security-manager"/>
       <antcall target="tests-clustering-all-stacks"/>
    <!--   <antcall target="tomcat-ssl-tests"/>-->
@@ -926,14 +935,23 @@
    <target name="tests-profileservice" description="Tests with the full featured profile service">
       <create-profileservice-config baseconf="default" conf="profileservice"/>
       <server:start name="profileservice"/>
-      <run-junit junit.patternset="profileservice.includes"
-        junit.configuration="profileservice"/>
+      <run-junit junit.patternset="profileservice.includes" junit.configuration="profileservice"/>
       <server:stop name="profileservice"/>
    </target>
    <target name="profileservice-config" description="Create the full featured profile service config">
       <create-profileservice-config baseconf="default" conf="profileservice"/>
    </target>
 	
+   <target name="tests-springdeployer" description="Tests with the full featured spring deployer">
+      <create-springdeployer-config baseconf="default" conf="springdeployer"/>
+      <server:start name="springdeployer"/>
+      <run-junit junit.patternset="springdeployer.includes" junit.configuration="springdeployer"/>
+      <server:stop name="springdeployer"/>
+   </target>
+   <target name="springdeployer-config" description="Create the full featured spring deployer config">
+      <create-springdeployer-config baseconf="default" conf="springdeployer"/>
+   </target>
+
    <!-- Tests of tomcat needing a ssl connector
    -->
    <target name="tomcat-ssl-tests"

Added: trunk/testsuite/imports/sections/spring.xml
===================================================================
--- trunk/testsuite/imports/sections/spring.xml	                        (rev 0)
+++ trunk/testsuite/imports/sections/spring.xml	2007-12-21 11:21:09 UTC (rev 68501)
@@ -0,0 +1,44 @@
+<project name="tests-spring-jars">
+
+   <target name="_jars-spring">
+
+      <!-- JAR -->
+      <jar destfile="${build.lib}/spring-beans.jar">
+         <fileset dir="${build.classes}">
+            <include name="org/jboss/test/spring/beans/**"/>
+         </fileset>
+      </jar>
+
+      <!-- EJB -->
+      <jar destfile="${build.lib}/spring-ejb.jar">
+         <fileset dir="${build.resources}/spring/ejb">
+            <include name="**/*.xml"/>
+         </fileset>
+         <fileset dir="${build.classes}">
+            <include name="org/jboss/test/spring/ejb/**"/>
+         </fileset>
+      </jar>
+
+      <!-- EAR -->
+      <mkdir dir="${build.lib}/spring-ear.ear"/>
+      <copy todir="${build.lib}/spring-ear.ear">
+         <fileset dir="${build.resources}/spring/ear">
+            <include name="**/*.xml"/>
+         </fileset>
+         <fileset dir="${build.lib}">
+            <include name="spring-ejb.jar" />
+         </fileset>
+      </copy>
+      <mkdir dir="${build.lib}/spring-ear.ear/lib"/>
+      <copy todir="${build.lib}/spring-ear.ear/lib">
+         <fileset dir="${build.lib}">
+            <include name="spring-beans.jar" />
+         </fileset>
+      </copy>
+
+      <!-- SERVICE -->
+      <copy tofile="${build.lib}/standalone-spring.xml" file="${build.resources}/spring/standalone-spring.xml"/>
+
+   </target>
+
+</project>

Modified: trunk/testsuite/imports/server-config.xml
===================================================================
--- trunk/testsuite/imports/server-config.xml	2007-12-21 11:18:36 UTC (rev 68500)
+++ trunk/testsuite/imports/server-config.xml	2007-12-21 11:21:09 UTC (rev 68501)
@@ -704,6 +704,15 @@
          <sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed" />
          <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
       </server>   	
+      <server name="springdeployer" host="${node0}">
+         <jvmarg value="-Xms128m" />
+         <jvmarg value="-Xmx512m" />
+         <jvmarg value="-XX:MaxPermSize=512m" />
+         <jvmarg value="-XX:+HeapDumpOnOutOfMemoryError" />
+         <sysproperty key="java.net.preferIPv4Stack" value="true" />
+         <sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed" />
+         <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
+      </server>
       <server name="jbossmessaging" host="${node0}">
          <jvmarg value="-Xms128m" />
          <jvmarg value="-Xmx512m" />
@@ -908,6 +917,33 @@
       </sequential>
    </macrodef>
 	
+   <macrodef name="create-springdeployer-config"
+      description="Create a configuration with the springdeployer">
+      <attribute name="conf"/>
+   	<attribute name="baseconf"/>
+      <sequential>
+         <delete dir="${jboss.dist}/server/@{conf}" failonerror="false"/>
+         <echo message="creating @{conf} config, jboss.dist=${jboss.dist}"/>
+         <copy todir="${jboss.dist}/server/@{conf}">
+            <fileset dir="${jboss.dist}/server/@{baseconf}">
+            <include name="conf/**"/>
+            <include name="lib/**"/>
+            <include name="deploy/**"/>
+            <include name="deployers/**"/>
+         </fileset>
+         </copy>
+      	 <copy file="${project.root}/spring-int/output/lib/jboss-spring.deployer" 
+      	 	tofile="${jboss.dist}/server/@{conf}/deployers/jboss-spring.deployer" overwrite="true"/>
+         <!-- Overwrite any config content with that from the
+         resources/test-configs/@{conf}
+         -->
+         <echo message="Overwriting config descriptors" />
+         <copy todir="${jboss.dist}/server/@{conf}" overwrite="true" failonerror="false">
+            <fileset dir="${build.resources}/test-configs/@{conf}" />
+         </copy>
+      </sequential>
+   </macrodef>
+
    <target name="modify-farming">
        <echo message="reducing the farm deployment scan time in ${file_}"/>
        <replaceregexp file="${file_}" byline="false" flags="is"

Modified: trunk/testsuite/imports/test-jars.xml
===================================================================
--- trunk/testsuite/imports/test-jars.xml	2007-12-21 11:18:36 UTC (rev 68500)
+++ trunk/testsuite/imports/test-jars.xml	2007-12-21 11:21:09 UTC (rev 68501)
@@ -61,6 +61,7 @@
    <import file="sections/securitymgr.xml"/>
    <import file="sections/securityspi.xml"/>
    <import file="sections/session.xml"/>
+   <import file="sections/spring.xml"/>
    <import file="sections/testbean.xml"/>
    <import file="sections/threading.xml"/>
    <import file="sections/timer.xml"/>
@@ -144,6 +145,7 @@
         _jars-securitymgr,
         _jars-security-spi,
         _jars-session,
+        _jars-spring,
         _jars-testbean,
         _jars-testbeancluster,
         _jars-threading,

Added: trunk/testsuite/src/main/org/jboss/test/spring/beans/Calculator.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/spring/beans/Calculator.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/spring/beans/Calculator.java	2007-12-21 11:21:09 UTC (rev 68501)
@@ -0,0 +1,32 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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.spring.beans;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface Calculator
+{
+   int add(int a, int b);
+
+   int multiply(int a, int b);
+}

Added: trunk/testsuite/src/main/org/jboss/test/spring/beans/CalculatorImpl.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/spring/beans/CalculatorImpl.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/spring/beans/CalculatorImpl.java	2007-12-21 11:21:09 UTC (rev 68501)
@@ -0,0 +1,38 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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.spring.beans;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class CalculatorImpl implements Calculator
+{
+   public int add(int a, int b)
+   {
+      return a + b;
+   }
+
+   public int multiply(int a, int b)
+   {
+      return a * b;
+   }
+}

Added: trunk/testsuite/src/main/org/jboss/test/spring/beans/LogManager.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/spring/beans/LogManager.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/spring/beans/LogManager.java	2007-12-21 11:21:09 UTC (rev 68501)
@@ -0,0 +1,37 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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.spring.beans;
+
+import org.jboss.logging.Logger;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class LogManager
+{
+   private Logger log = Logger.getLogger(getClass());
+
+   public void log(String msg)
+   {
+      log.info("LM: " + msg);            
+   }
+}

Added: trunk/testsuite/src/main/org/jboss/test/spring/ejb/SpringBeansManager.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/spring/ejb/SpringBeansManager.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/spring/ejb/SpringBeansManager.java	2007-12-21 11:21:09 UTC (rev 68501)
@@ -0,0 +1,33 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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.spring.ejb;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface SpringBeansManager
+{
+   int add(int a, int b);
+   int multipy(int a, int b);
+
+   void log(String msg);
+}

Added: trunk/testsuite/src/main/org/jboss/test/spring/ejb/SpringBeansManagerImpl.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/spring/ejb/SpringBeansManagerImpl.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/spring/ejb/SpringBeansManagerImpl.java	2007-12-21 11:21:09 UTC (rev 68501)
@@ -0,0 +1,70 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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.spring.ejb;
+
+import javax.ejb.Stateless;
+import javax.ejb.Remote;
+import javax.interceptor.Interceptors;
+
+import org.jboss.spring.callback.SpringLifecycleInterceptor;
+import org.jboss.annotation.spring.Spring;
+import org.jboss.test.spring.beans.Calculator;
+import org.jboss.test.spring.beans.LogManager;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Stateless
+ at Remote({SpringBeansManager.class})
+ at Interceptors(SpringLifecycleInterceptor.class)
+public class SpringBeansManagerImpl implements SpringBeansManager
+{
+   @Spring(jndiName = "ejb")
+   private Calculator calculator;
+
+   @Spring(jndiName = "ejb", bean = "logManager")
+   private LogManager logManager;
+
+   public int add(int a, int b)
+   {
+      if (calculator == null)
+         throw new IllegalArgumentException("Null calculator.");
+
+      return calculator.add(a, b);
+   }
+
+   public int multipy(int a, int b)
+   {
+      if (calculator == null)
+         throw new IllegalArgumentException("Null calculator.");
+
+      return calculator.multiply(a, b);
+   }
+
+   public void log(String msg)
+   {
+      if (logManager == null)
+         throw new IllegalArgumentException("Null log manager.");
+
+      logManager.log(msg);
+   }
+}

Added: trunk/testsuite/src/main/org/jboss/test/spring/test/SpringEJBTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/spring/test/SpringEJBTestCase.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/spring/test/SpringEJBTestCase.java	2007-12-21 11:21:09 UTC (rev 68501)
@@ -0,0 +1,65 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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.spring.test;
+
+import java.util.Hashtable;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.rmi.PortableRemoteObject;
+
+import org.jboss.test.JBossTestCase;
+import org.jboss.test.spring.ejb.SpringBeansManager;
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class SpringEJBTestCase extends JBossTestCase
+{
+   public SpringEJBTestCase(String name)
+   {
+      super(name);
+   }
+
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(SpringEJBTestCase.class, "spring-ear.ear");
+   }
+
+   public void testEar() throws Exception
+   {
+      Hashtable<String, String> env = new Hashtable<String, String>();
+      env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
+      env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
+      env.put(Context.PROVIDER_URL, "jnp://localhost:1099");
+      InitialContext ctx = new InitialContext(env);
+      String ejbName = "spring-ear/" + SpringBeansManager.class.getSimpleName() + "Impl/remote";
+      log.info("Excuting lookup: " + ejbName);
+      Object result = ctx.lookup(ejbName);
+      assertNotNull(result);
+      SpringBeansManager manager = (SpringBeansManager)PortableRemoteObject.narrow(result, SpringBeansManager.class);
+      log.info("SpringBeansManager: " + manager);
+      assertEquals(3, manager.add(1, 2));
+      assertEquals(10, manager.multipy(2, 5));
+      manager.log("Some log");
+   }
+}

Added: trunk/testsuite/src/main/org/jboss/test/spring/test/SpringStandaloneTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/spring/test/SpringStandaloneTestCase.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/spring/test/SpringStandaloneTestCase.java	2007-12-21 11:21:09 UTC (rev 68501)
@@ -0,0 +1,68 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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.spring.test;
+
+import java.net.URL;
+import javax.management.MBeanServerConnection;
+
+import junit.framework.Test;
+import org.jboss.deployment.MainDeployerMBean;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class SpringStandaloneTestCase extends JBossTestCase
+{
+   public SpringStandaloneTestCase(String name)
+   {
+      super(name);
+   }
+
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(SpringStandaloneTestCase.class, "standalone-spring.xml");
+   }
+
+   protected <T> T invokeMainDeployer(String methodName, Object[] args, String[] sig, Class<T> clazz) throws Exception
+   {
+      if (clazz == null)
+         throw new IllegalArgumentException("Null class.");
+
+      MBeanServerConnection server = getServer();
+      Object result = server.invoke(MainDeployerMBean.OBJECT_NAME, methodName, args, sig);
+      return clazz.cast(result);
+   }
+
+   protected boolean isDeployed(String deployment) throws Exception
+   {
+      URL deployURL = getDeployURL(deployment);
+      String[] sig = {URL.class.getName()};
+      Object[] args = {deployURL};
+      return invokeMainDeployer("isDeployed", args, sig, Boolean.class);
+   }
+
+   public void testStandalone() throws Exception
+   {
+      assertTrue(isDeployed("standalone-spring.xml"));
+   }
+}

Added: trunk/testsuite/src/resources/spring/ear/application.xml
===================================================================
--- trunk/testsuite/src/resources/spring/ear/application.xml	                        (rev 0)
+++ trunk/testsuite/src/resources/spring/ear/application.xml	2007-12-21 11:21:09 UTC (rev 68501)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<application
+      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"
+      version="1.4">
+
+   <display-name>JBoss Spring Test</display-name>
+
+   <module><ejb>spring-ejb.jar</ejb></module>
+
+</application>

Added: trunk/testsuite/src/resources/spring/ear/jboss-app.xml
===================================================================
--- trunk/testsuite/src/resources/spring/ear/jboss-app.xml	                        (rev 0)
+++ trunk/testsuite/src/resources/spring/ear/jboss-app.xml	2007-12-21 11:21:09 UTC (rev 68501)
@@ -0,0 +1,9 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<!DOCTYPE jboss-app
+  PUBLIC  "-//JBoss//DTD J2EE Application 1.5//EN"
+          "http://www.jboss.org/j2ee/dtd/jboss-app_5_0.dtd"
+>
+
+<jboss-app>
+</jboss-app>

Added: trunk/testsuite/src/resources/spring/ejb/META-INF/ejb-jar.xml
===================================================================
--- trunk/testsuite/src/resources/spring/ejb/META-INF/ejb-jar.xml	                        (rev 0)
+++ trunk/testsuite/src/resources/spring/ejb/META-INF/ejb-jar.xml	2007-12-21 11:21:09 UTC (rev 68501)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar
+        xmlns="http://java.sun.com/xml/ns/javaee"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+                            http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
+        version="3.0">
+   <description>JBoss Spring integration</description>
+   <display-name>JBoss Spring integration</display-name>
+</ejb-jar>

Added: trunk/testsuite/src/resources/spring/ejb/META-INF/ejb-spring.xml
===================================================================
--- trunk/testsuite/src/resources/spring/ejb/META-INF/ejb-spring.xml	                        (rev 0)
+++ trunk/testsuite/src/resources/spring/ejb/META-INF/ejb-spring.xml	2007-12-21 11:21:09 UTC (rev 68501)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
+
+<beans>
+
+   <bean id="calculator" class="org.jboss.test.spring.beans.CalculatorImpl"/>
+
+   <bean id="logManager" class="org.jboss.test.spring.beans.LogManager"/>
+
+</beans>

Added: trunk/testsuite/src/resources/spring/standalone-spring.xml
===================================================================
--- trunk/testsuite/src/resources/spring/standalone-spring.xml	                        (rev 0)
+++ trunk/testsuite/src/resources/spring/standalone-spring.xml	2007-12-21 11:21:09 UTC (rev 68501)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
+
+<beans>
+   <bean id="tester" class="org.jboss.hibernate.session.HibernateContext"/>
+</beans>

Modified: trunk/tools/etc/buildmagic/modules.ent
===================================================================
--- trunk/tools/etc/buildmagic/modules.ent	2007-12-21 11:18:36 UTC (rev 68500)
+++ trunk/tools/etc/buildmagic/modules.ent	2007-12-21 11:21:09 UTC (rev 68501)
@@ -170,6 +170,9 @@
 <!-- Spring -->
 <property name="jboss.spring.root" value="${project.root}/spring-int/output"/>
 <property name="jboss.spring.lib" value="${jboss.spring.root}/lib"/>
+<path id="jboss.spring.classpath">
+  <pathelement path="${jboss.spring.lib}/jboss-spring.jar"/>
+</path>
 
 <!-- System -->
 <property name="jboss.system.root" value="${project.root}/system/output"/>




More information about the jboss-cvs-commits mailing list