[jboss-cvs] JBossAS SVN: r68062 - in trunk/testsuite: imports/sections and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Dec 8 10:02:53 EST 2007


Author: alesj
Date: 2007-12-08 10:02:53 -0500 (Sat, 08 Dec 2007)
New Revision: 68062

Added:
   trunk/testsuite/imports/sections/seam.xml
   trunk/testsuite/src/main/org/jboss/test/deployers/seam/
   trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/
   trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamBookingExampleTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamExampleTestCase.java
Modified:
   trunk/testsuite/imports/test-jars.xml
Log:
Seam examples test cases.
TODO on seam.xml.

Added: trunk/testsuite/imports/sections/seam.xml
===================================================================
--- trunk/testsuite/imports/sections/seam.xml	                        (rev 0)
+++ trunk/testsuite/imports/sections/seam.xml	2007-12-08 15:02:53 UTC (rev 68062)
@@ -0,0 +1,14 @@
+<project name="tests-seam-jars">
+
+   <property name="repository" value="http://snapshots.jboss.org/maven2/org/jboss/seam/examples/"/>
+
+   <property name="booking_version" value="-2.0.1-SNAPSHOT"/>
+
+   <target name="_jars-seam">
+      <mkdir dir="${build.lib}"/>
+
+      <!-- TODO copy from repository to ${build.lib} -->
+
+   </target>
+
+</project>

Modified: trunk/testsuite/imports/test-jars.xml
===================================================================
--- trunk/testsuite/imports/test-jars.xml	2007-12-08 05:10:48 UTC (rev 68061)
+++ trunk/testsuite/imports/test-jars.xml	2007-12-08 15:02:53 UTC (rev 68062)
@@ -55,6 +55,7 @@
    <import file="sections/readahead.xml"/>
    <import file="sections/retry.xml"/>
 	<import file="sections/scoped.xml"/>
+	<import file="sections/seam.xml"/>
    <import file="sections/security.xml"/>
    <import file="sections/securitymgr.xml"/>
    <import file="sections/securityspi.xml"/>
@@ -77,7 +78,7 @@
    -->
    <target name="jars" description="Builds all jar files."
            depends="compile,
-      _jars-aop,
+        _jars-aop,
         _jars-bank,
         _jars-bank-new,
         _jars-bankiiop,
@@ -136,7 +137,8 @@
         _jars-proxycompiler,
         _jars-readahead,
         _jars-retry,
-      _jars-scoped,
+        _jars-scoped,
+        _jars-seam,
         _jars-security,
         _jars-securitymgr,
         _jars-security-spi,

Added: trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamBookingExampleTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamBookingExampleTestCase.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamBookingExampleTestCase.java	2007-12-08 15:02:53 UTC (rev 68062)
@@ -0,0 +1,42 @@
+/*
+* 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.deployers.seam.test;
+
+import junit.framework.Test;
+
+/**
+ * Test Seam Booking example.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class SeamBookingExampleTestCase extends SeamExampleTestCase
+{
+   public SeamBookingExampleTestCase(String test)
+   {
+      super(test);
+   }
+
+   public static Test suite() throws Exception
+   {
+      return deploy(SeamBookingExampleTestCase.class);
+   }
+}

Added: trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamExampleTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamExampleTestCase.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamExampleTestCase.java	2007-12-08 15:02:53 UTC (rev 68062)
@@ -0,0 +1,96 @@
+/*
+* 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.deployers.seam.test;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.test.deployers.AbstractDeploymentTest;
+import junit.framework.Test;
+
+/**
+ * Test Seam example.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class SeamExampleTestCase extends AbstractDeploymentTest
+{
+   // Example libs
+   public static final String exampleEar = "jboss-seam-%1$s.ear";
+   public static final String exampleJar = "jboss-seam-%1$s.jar";
+   public static final String exampleWar = "jboss-seam-%1$s.war";
+   public static final String exampleDS = "jboss-seam-%1$s-ds.xml";
+   // Seam libs
+   public static final String seamJar = "jboss-seam.jar";
+
+   protected SeamExampleTestCase(String test)
+   {
+      super(test);
+   }
+
+   protected static Test deploy(Class clazz) throws Exception
+   {
+      String name = getExampleName(clazz);
+      String deployments = String.format(exampleDS, name) + "," + String.format(exampleEar, name);
+      return getDeploySetup(clazz, deployments);
+   }
+
+   protected static String getExampleName(Class clazz)
+   {
+      String className = clazz.getSimpleName();
+      int start = "Seam".length();
+      int end = "ExampleTestCase".length();
+      int length = className.length();
+      return className.substring(start, length - end).toLowerCase();
+   }
+
+   protected String getExampleName()
+   {
+      return getExampleName(getClass());
+   }
+
+   protected String getTopLevelDeployment(String exampleName)
+   {
+      return String.format(exampleEar, exampleName);
+   }
+
+   public void testExample() throws Exception
+   {
+      String exampleName = getExampleName();
+      log.info("Testing Seam " + exampleName + " example.");
+      String topLevelDeployment = getTopLevelDeployment(exampleName);
+
+      final Set<String> expected = getExpectedDeployments(topLevelDeployment, exampleName);
+
+      assertDeployed(topLevelDeployment, expected);
+   }
+
+   protected Set<String> getExpectedDeployments(String topLevelDeployment, String exampleName)
+   {
+      final Set<String> expected = new HashSet<String>();
+      expected.add(topLevelDeployment);
+      expected.add(String.format(exampleJar, exampleName));
+      expected.add(String.format(exampleWar, exampleName));
+      expected.add(seamJar);
+      return expected;
+   }
+}




More information about the jboss-cvs-commits mailing list