[jboss-cvs] JBossAS SVN: r68431 - trunk/testsuite/src/main/org/jboss/test/deployers/seam/test.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Dec 19 15:04:43 EST 2007


Author: alesj
Date: 2007-12-19 15:04:43 -0500 (Wed, 19 Dec 2007)
New Revision: 68431

Added:
   trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamExampleTest.java
Removed:
   trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamExampleTestCase.java
Modified:
   trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamBookingExampleTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamDvdExampleTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamNumberguessExampleTestCase.java
Log:
Renaming to simple Test, since *TestCase is picked up by tests.

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamBookingExampleTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamBookingExampleTestCase.java	2007-12-19 19:52:14 UTC (rev 68430)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamBookingExampleTestCase.java	2007-12-19 20:04:43 UTC (rev 68431)
@@ -28,7 +28,7 @@
  *
  * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
  */
-public class SeamBookingExampleTestCase extends SeamExampleTestCase
+public class SeamBookingExampleTestCase extends SeamExampleTest
 {
    public SeamBookingExampleTestCase(String test)
    {

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamDvdExampleTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamDvdExampleTestCase.java	2007-12-19 19:52:14 UTC (rev 68430)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamDvdExampleTestCase.java	2007-12-19 20:04:43 UTC (rev 68431)
@@ -28,7 +28,7 @@
  *
  * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
  */
-public class SeamDvdExampleTestCase extends SeamExampleTestCase
+public class SeamDvdExampleTestCase extends SeamExampleTest
 {
    public SeamDvdExampleTestCase(String test)
    {

Copied: trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamExampleTest.java (from rev 68425, trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamExampleTestCase.java)
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamExampleTest.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamExampleTest.java	2007-12-19 20:04:43 UTC (rev 68431)
@@ -0,0 +1,159 @@
+/*
+* 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 java.net.URL;
+
+import junit.framework.Test;
+import org.jboss.test.deployers.AbstractDeploymentTest;
+import org.jboss.test.util.web.HttpUtils;
+
+/**
+ * Test Seam example.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class SeamExampleTest extends AbstractDeploymentTest
+{
+   // Example libs
+   public static final String JBoss = "jboss-";
+   public static final String simpleName = "seam-%1$s";
+   public static final String exampleName = JBoss + simpleName;
+   public static final String exampleEar = exampleName + ".ear";
+   public static final String exampleJar = exampleName + ".jar";
+   public static final String exampleWar = exampleName + ".war";
+   public static final String exampleDS = exampleName + "-ds.xml";
+   // Seam libs
+   public static final String seamJar = "jboss-seam.jar";
+
+   private boolean testExpected;
+   private boolean useAuthentification;
+   private String username;
+   private String password;
+
+   protected SeamExampleTest(String test)
+   {
+      super(test);
+   }
+
+   protected static Test deploy(Class clazz) throws Exception
+   {
+      return deploy(clazz, true);
+   }
+
+   protected static Test deploy(Class clazz, boolean includeDS) throws Exception
+   {
+      String name = getExampleName(clazz);
+      String deployments = String.format(exampleEar, name);
+      if (includeDS)
+         deployments = String.format(exampleDS, name) + "," + deployments;
+      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);
+
+      assertTrue(isDeployed(topLevelDeployment));
+
+      if (testExpected)
+      {
+         final Set<String> expected = getExpectedDeployments(topLevelDeployment, exampleName);
+         assertDeployed(topLevelDeployment, expected);
+      }
+
+      URL testURL = getBaseURL();
+      log.info("Accessing test URL: " + testURL);
+      HttpUtils.accessURL(testURL);
+   }
+
+   protected String getBaseURLString()
+   {
+      if (useAuthentification)
+      {
+         if (username != null && password != null)
+            return HttpUtils.getBaseURL(username, password);
+         else
+            return HttpUtils.getBaseURL();
+      }
+      return HttpUtils.getBaseURLNoAuth();
+   }
+
+   protected URL getBaseURL() throws Exception
+   {
+      String example = String.format(simpleName, getExampleName());
+      return new URL(getBaseURLString() + example);
+   }
+
+   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;
+   }
+
+   public void setTestExpected(boolean testExpected)
+   {
+      this.testExpected = testExpected;
+   }
+
+   public void setUseAuthentification(boolean useAuthentification)
+   {
+      this.useAuthentification = useAuthentification;
+   }
+
+   public void setUsername(String username)
+   {
+      this.username = username;
+   }
+
+   public void setPassword(String password)
+   {
+      this.password = password;
+   }
+}

Deleted: trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamExampleTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamExampleTestCase.java	2007-12-19 19:52:14 UTC (rev 68430)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamExampleTestCase.java	2007-12-19 20:04:43 UTC (rev 68431)
@@ -1,159 +0,0 @@
-/*
-* 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 java.net.URL;
-
-import junit.framework.Test;
-import org.jboss.test.deployers.AbstractDeploymentTest;
-import org.jboss.test.util.web.HttpUtils;
-
-/**
- * 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 JBoss = "jboss-";
-   public static final String simpleName = "seam-%1$s";
-   public static final String exampleName = JBoss + simpleName;
-   public static final String exampleEar = exampleName + ".ear";
-   public static final String exampleJar = exampleName + ".jar";
-   public static final String exampleWar = exampleName + ".war";
-   public static final String exampleDS = exampleName + "-ds.xml";
-   // Seam libs
-   public static final String seamJar = "jboss-seam.jar";
-
-   private boolean testExpected;
-   private boolean useAuthentification;
-   private String username;
-   private String password;
-
-   protected SeamExampleTestCase(String test)
-   {
-      super(test);
-   }
-
-   protected static Test deploy(Class clazz) throws Exception
-   {
-      return deploy(clazz, true);
-   }
-
-   protected static Test deploy(Class clazz, boolean includeDS) throws Exception
-   {
-      String name = getExampleName(clazz);
-      String deployments = String.format(exampleEar, name);
-      if (includeDS)
-         deployments = String.format(exampleDS, name) + "," + deployments;
-      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);
-
-      assertTrue(isDeployed(topLevelDeployment));
-
-      if (testExpected)
-      {
-         final Set<String> expected = getExpectedDeployments(topLevelDeployment, exampleName);
-         assertDeployed(topLevelDeployment, expected);
-      }
-
-      URL testURL = getBaseURL();
-      log.info("Accessing test URL: " + testURL);
-      HttpUtils.accessURL(testURL);
-   }
-
-   protected String getBaseURLString()
-   {
-      if (useAuthentification)
-      {
-         if (username != null && password != null)
-            return HttpUtils.getBaseURL(username, password);
-         else
-            return HttpUtils.getBaseURL();
-      }
-      return HttpUtils.getBaseURLNoAuth();
-   }
-
-   protected URL getBaseURL() throws Exception
-   {
-      String example = String.format(simpleName, getExampleName());
-      return new URL(getBaseURLString() + example);
-   }
-
-   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;
-   }
-
-   public void setTestExpected(boolean testExpected)
-   {
-      this.testExpected = testExpected;
-   }
-
-   public void setUseAuthentification(boolean useAuthentification)
-   {
-      this.useAuthentification = useAuthentification;
-   }
-
-   public void setUsername(String username)
-   {
-      this.username = username;
-   }
-
-   public void setPassword(String password)
-   {
-      this.password = password;
-   }
-}

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamNumberguessExampleTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamNumberguessExampleTestCase.java	2007-12-19 19:52:14 UTC (rev 68430)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamNumberguessExampleTestCase.java	2007-12-19 20:04:43 UTC (rev 68431)
@@ -28,7 +28,7 @@
  *
  * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
  */
-public class SeamNumberguessExampleTestCase extends SeamExampleTestCase
+public class SeamNumberguessExampleTestCase extends SeamExampleTest
 {
    public SeamNumberguessExampleTestCase(String test)
    {




More information about the jboss-cvs-commits mailing list