[jboss-cvs] JBossAS SVN: r79837 - in trunk/testsuite: src/main/org/jboss/test/deployers/seam/test and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Oct 21 09:44:35 EDT 2008


Author: alesj
Date: 2008-10-21 09:44:34 -0400 (Tue, 21 Oct 2008)
New Revision: 79837

Added:
   trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamJpaExampleUnitTestCase.java
Modified:
   trunk/testsuite/imports/sections/seam.xml
   trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamExampleTest.java
Log:
Add Seam war example to tests.
Update Seam to 2.1.1-SNAPSHOT which is closer to 2.1.0.GA.

Modified: trunk/testsuite/imports/sections/seam.xml
===================================================================
--- trunk/testsuite/imports/sections/seam.xml	2008-10-21 13:32:13 UTC (rev 79836)
+++ trunk/testsuite/imports/sections/seam.xml	2008-10-21 13:44:34 UTC (rev 79837)
@@ -1,6 +1,6 @@
 <project name="tests-seam-jars" xmlns:artifact="urn:maven-artifact-ant">
 
-   <property name="seam_version" value="2.1.0.BETA1"/>
+   <property name="seam_version" value="2.1.1-SNAPSHOT"/>
 
    <target name="_jars-seam">
    	
@@ -14,6 +14,7 @@
       	  <dependency groupId="org.jboss.seam.examples" artifactId="jboss-seam-dvd" version="${seam_version}" type="ear"/>
       	  <dependency groupId="org.jboss.seam.examples" artifactId="jboss-seam-dvd" version="${seam_version}" type="xml" classifier="ds"/>
       	  <dependency groupId="org.jboss.seam.examples" artifactId="jboss-seam-numberguess" version="${seam_version}" type="ear"/>
+      	  <dependency groupId="org.jboss.seam.examples" artifactId="jboss-seam-jpa" version="${seam_version}" type="war"/>
       	  <remoterepository id="repository.jboss.org" url="http://repository.jboss.org/maven2"/>
       	  <remoterepository id="snapshots.jboss.org" url="http://snapshots.jboss.org/maven2"/>
       </artifact:dependencies>

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamExampleTest.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamExampleTest.java	2008-10-21 13:32:13 UTC (rev 79836)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamExampleTest.java	2008-10-21 13:44:34 UTC (rev 79837)
@@ -47,6 +47,25 @@
    // Seam libs
    public static final String seamJar = "jboss-seam.jar";
 
+   protected enum Type
+   {
+      EAR(exampleEar),
+      JAR(exampleJar),
+      WAR(exampleWar);
+
+      private String format;
+
+      Type(String format)
+      {
+         this.format = format;
+      }
+
+      public String getFormat()
+      {
+         return format;
+      }
+   }
+
    private boolean testExpected;
    private boolean useAuthentification;
    private String username;
@@ -64,8 +83,13 @@
 
    protected static Test deploy(Class clazz, boolean includeDS) throws Exception
    {
+      return deploy(clazz, includeDS, Type.EAR);
+   }
+
+   protected static Test deploy(Class clazz, boolean includeDS, Type type) throws Exception
+   {
       String name = getExampleName(clazz);
-      String deployments = String.format(exampleEar, name);
+      String deployments = String.format(type.getFormat(), name);
       if (includeDS)
          deployments = String.format(exampleDS, name) + "," + deployments;
       return getManagedDeployment(clazz, deployments);
@@ -80,6 +104,17 @@
       return className.substring(start, length - end).toLowerCase();
    }
 
+   /**
+    * Return type.
+    * Use EAR by default.
+    *
+    * @return
+    */
+   protected Type gettType()
+   {
+      return Type.EAR;
+   }
+
    protected String getExampleName()
    {
       return getExampleName(getClass());
@@ -87,7 +122,7 @@
 
    protected String getTopLevelDeployment(String exampleName)
    {
-      return String.format(exampleEar, exampleName);
+      return String.format(gettType().getFormat(), exampleName);
    }
 
    public void testExample() throws Exception
@@ -121,9 +156,19 @@
       return HttpUtils.getBaseURLNoAuth();
    }
 
+   protected String getWebContextFormat()
+   {
+      return simpleName;
+   }
+
+   protected String getWebContextName()
+   {
+      return String.format(getWebContextFormat(), getExampleName());
+   }
+
    protected URL getBaseURL() throws Exception
    {
-      String example = String.format(simpleName, getExampleName());
+      String example = getWebContextName();
       return new URL(getBaseURLString() + example);
    }
 

Copied: trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamJpaExampleUnitTestCase.java (from rev 79796, trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamNumberguessExampleUnitTestCase.java)
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamJpaExampleUnitTestCase.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamJpaExampleUnitTestCase.java	2008-10-21 13:44:34 UTC (rev 79837)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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 Jpa .war example.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class SeamJpaExampleUnitTestCase extends SeamExampleTest
+{
+   public SeamJpaExampleUnitTestCase(String test)
+   {
+      super(test);
+   }
+
+   public static Test suite() throws Exception
+   {
+      return deploy(SeamJpaExampleUnitTestCase.class, false, Type.WAR);
+   }
+
+   protected Type gettType()
+   {
+      return Type.WAR;
+   }
+
+   protected String getWebContextFormat()
+   {
+      return exampleName;
+   }
+}
\ No newline at end of file




More information about the jboss-cvs-commits mailing list