[jboss-cvs] JBossAS SVN: r93947 - branches/Branch_5_x/testsuite/src/main/org/jboss/test/deployers/test.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Sep 23 07:03:21 EDT 2009
Author: emuckenhuber
Date: 2009-09-23 07:03:21 -0400 (Wed, 23 Sep 2009)
New Revision: 93947
Added:
branches/Branch_5_x/testsuite/src/main/org/jboss/test/deployers/test/LegacyDeploymentScannerUnitTestCase.java
Log:
test JBossTools legacy deployment usage.
Added: branches/Branch_5_x/testsuite/src/main/org/jboss/test/deployers/test/LegacyDeploymentScannerUnitTestCase.java
===================================================================
--- branches/Branch_5_x/testsuite/src/main/org/jboss/test/deployers/test/LegacyDeploymentScannerUnitTestCase.java (rev 0)
+++ branches/Branch_5_x/testsuite/src/main/org/jboss/test/deployers/test/LegacyDeploymentScannerUnitTestCase.java 2009-09-23 11:03:21 UTC (rev 93947)
@@ -0,0 +1,108 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test;
+
+import java.net.URL;
+
+import javax.management.ObjectName;
+
+import org.jboss.managed.api.ManagedDeployment;
+import org.jboss.profileservice.spi.NoSuchDeploymentException;
+import org.jboss.profileservice.spi.ProfileKey;
+
+/**
+ * Test the JBossTools legacy DeploymentScanner usage.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class LegacyDeploymentScannerUnitTestCase extends AbstractDeployTestBase
+{
+
+ /** The deployment scanner MBean name. */
+ private static final String DEPLOYMENT_SCANNER_MBEAN = "jboss.deployment:flavor=URL,type=DeploymentScanner";
+
+ /** The scanner profile. */
+ private static final ProfileKey scannerProfile = new ProfileKey("deployment-scanner-profile");
+
+ public LegacyDeploymentScannerUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testDeploy() throws Exception
+ {
+ final ObjectName scanner = new ObjectName(DEPLOYMENT_SCANNER_MBEAN);
+
+ // The deployment
+ URL deployment = getDeployURL(EMTPY_DEPLOYMENT);
+ assertNotNull(EMTPY_DEPLOYMENT, deployment);
+
+ // Suspend
+ invoke(scanner, "stop" , new Object[0], new String[0]);
+ try
+ {
+ // Add the deployment
+ invoke(scanner, "addURL", new Object[] { deployment }, new String[] { URL.class.getName() });
+ }
+ finally
+ {
+ // Resume
+ invoke(scanner, "start" , new Object[0], new String[0]);
+ }
+
+ // Wait for HDScanner
+ Thread.sleep(8000);
+
+ ManagedDeployment managedDeployment = getManagementView().getDeployment(EMTPY_DEPLOYMENT);
+ assertNotNull(managedDeployment);
+
+ // Suspend
+ invoke(scanner, "stop" , new Object[0], new String[0]);
+ try
+ {
+ // Add the deployment
+ invoke(scanner, "removeURL", new Object[] { deployment }, new String[] { URL.class.getName() });
+ }
+ finally
+ {
+ // Resume
+ invoke(scanner, "start" , new Object[0], new String[0]);
+ }
+
+ // Wait for HDScanner
+ Thread.sleep(8000);
+
+ try
+ {
+ managedDeployment = getManagementView().getDeployment(EMTPY_DEPLOYMENT);
+ fail("deployment not undeployed " + managedDeployment);
+ }
+ catch(NoSuchDeploymentException ok)
+ {
+ log.debug("saw NoSuchDeploymentException");
+ }
+
+ }
+
+}
+
More information about the jboss-cvs-commits
mailing list