[jboss-cvs] JBossAS SVN: r81729 - in trunk/testsuite/src: resources/test-configs/profileservice/deploy and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Nov 27 08:27:02 EST 2008


Author: emuckenhuber
Date: 2008-11-27 08:27:02 -0500 (Thu, 27 Nov 2008)
New Revision: 81729

Added:
   trunk/testsuite/src/resources/test-configs/profileservice/deploy/ignored.war.bak/
   trunk/testsuite/src/resources/test-configs/profileservice/deploy/ignored.war.bak/WEB-INF/
   trunk/testsuite/src/resources/test-configs/profileservice/deploy/ignored.war.bak/WEB-INF/web.xml
Modified:
   trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
Log:
JBAS-6147, JBAS-5883: simple test.

Modified: trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java	2008-11-27 13:24:24 UTC (rev 81728)
+++ trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java	2008-11-27 13:27:02 UTC (rev 81729)
@@ -21,8 +21,9 @@
  */
 package org.jboss.test.profileservice.test;
 
-import java.io.Serializable;
 import java.lang.annotation.Annotation;
+import java.net.URI;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -49,7 +50,6 @@
 import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
 import org.jboss.managed.api.annotation.ManagementProperty;
 import org.jboss.managed.api.annotation.ViewUse;
-import org.jboss.metatype.api.types.CompositeMetaType;
 import org.jboss.metatype.api.types.GenericMetaType;
 import org.jboss.metatype.api.types.MetaType;
 import org.jboss.metatype.api.types.SimpleMetaType;
@@ -62,6 +62,7 @@
 import org.jboss.profileservice.spi.NoSuchProfileException;
 import org.jboss.profileservice.spi.ProfileKey;
 import org.jboss.profileservice.spi.ProfileService;
+import org.jboss.virtual.VFS;
 
 /** Test of using ProfileService
 
@@ -81,6 +82,9 @@
 
       suite.addTest(new ProfileServiceUnitTestCase("testProfileKeys"));
       suite.addTest(new ProfileServiceUnitTestCase("testDeploymentNames"));
+      suite.addTest(new ProfileServiceUnitTestCase("testIgnoredDeploymentNames"));
+      suite.addTest(new ProfileServiceUnitTestCase("testUnifiedDeploymentNames"));
+      
       suite.addTest(new ProfileServiceUnitTestCase("testTemplateNames"));
       suite.addTest(new ProfileServiceUnitTestCase("testNoSuchProfileException"));
       // JMS
@@ -193,6 +197,41 @@
       }
       assertEquals("There are missing names: "+missingNames + ", available: " + simpleNames, 0, missingNames.size());
    }
+   
+   /**
+    * Test that ignored deployments are not deployed.
+    * e.g. ignore.war.bak in the deploy dir
+    * 
+    * @throws Exception
+    */
+   public void testIgnoredDeploymentNames() throws Exception
+   {
+      ManagementView mgtView = getManagementView();
+      Set<String> names = mgtView.getDeploymentNames();
+      for(String name : names)
+      {
+         if(name.endsWith(".bak"))
+            fail("deployment should be ignored: " + name);
+      }
+   }
+   
+   /**
+    * The deployment names should be a fully qualified URL/URI
+    * 
+    * @throws Exception
+    */
+   public void testUnifiedDeploymentNames() throws Exception
+   {
+      ManagementView mgtView = getManagementView();
+      Set<String> names = mgtView.getDeploymentNames();
+      for(String name : names)
+      {
+         URL url = new URL(name);
+         URI uri = new URI(name);
+         VFS.getRoot(uri);
+         VFS.getRoot(url);
+      }
+   }
 
    public void testTemplateNames()
       throws Exception

Added: trunk/testsuite/src/resources/test-configs/profileservice/deploy/ignored.war.bak/WEB-INF/web.xml
===================================================================
--- trunk/testsuite/src/resources/test-configs/profileservice/deploy/ignored.war.bak/WEB-INF/web.xml	                        (rev 0)
+++ trunk/testsuite/src/resources/test-configs/profileservice/deploy/ignored.war.bak/WEB-INF/web.xml	2008-11-27 13:27:02 UTC (rev 81729)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!DOCTYPE web-app
+    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+    "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+  <display-name>Ignored</display-name>
+  <description>
+     This deployment should be ignored.
+  </description>
+
+</web-app>
\ No newline at end of file




More information about the jboss-cvs-commits mailing list