[jboss-cvs] JBossAS SVN: r111379 - in projects/jboss-deployers/trunk/deployers-impl/src: test/java/org/jboss/test/deployers/main and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon May 16 09:05:46 EDT 2011


Author: alesj
Date: 2011-05-16 09:05:46 -0400 (Mon, 16 May 2011)
New Revision: 111379

Added:
   projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/main/support/MarkerDeployer.java
   projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/main/test/DynamicDeployerUsageTestCase.java
Modified:
   projects/jboss-deployers/trunk/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/SortedDeployers.java
   projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/main/DeployersMainTestSuite.java
Log:
[JBDEPLOY-274]; fix remove deployer eq. check.


Modified: projects/jboss-deployers/trunk/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/SortedDeployers.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/SortedDeployers.java	2011-05-16 12:36:40 UTC (rev 111378)
+++ projects/jboss-deployers/trunk/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/SortedDeployers.java	2011-05-16 13:05:46 UTC (rev 111379)
@@ -1,7 +1,5 @@
 package org.jboss.deployers.plugins.sort;
 
-import org.jboss.deployers.spi.deployer.Deployer;
-
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -10,6 +8,8 @@
 import java.util.Map;
 import java.util.Set;
 
+import org.jboss.deployers.spi.deployer.Deployer;
+
 /**
  * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
  * @version $Revision: 1 $
@@ -136,7 +136,7 @@
       int esize = entries.size();
       for (int i = 0; i < esize; i++)
       {
-         if (entries.get(0).deployer == d)
+         if (entries.get(0).deployer.equals(d))
          {
             removed = entries.get(0);
             removeAt(i);

Modified: projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/main/DeployersMainTestSuite.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/main/DeployersMainTestSuite.java	2011-05-16 12:36:40 UTC (rev 111378)
+++ projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/main/DeployersMainTestSuite.java	2011-05-16 13:05:46 UTC (rev 111379)
@@ -24,10 +24,11 @@
 import junit.framework.Test;
 import junit.framework.TestSuite;
 import junit.textui.TestRunner;
+import org.jboss.test.deployers.main.test.CycleCheckCompleteTestCase;
 import org.jboss.test.deployers.main.test.DeployerCheckCompleteTestCase;
+import org.jboss.test.deployers.main.test.DeployerIncompleteDeploymentsTestCase;
 import org.jboss.test.deployers.main.test.DeployerSingleDeploymentTestCase;
-import org.jboss.test.deployers.main.test.DeployerIncompleteDeploymentsTestCase;
-import org.jboss.test.deployers.main.test.CycleCheckCompleteTestCase;
+import org.jboss.test.deployers.main.test.DynamicDeployerUsageTestCase;
 
 /**
  * Deployers Main Test Suite.
@@ -49,6 +50,7 @@
       suite.addTest(DeployerCheckCompleteTestCase.suite());
       suite.addTest(DeployerIncompleteDeploymentsTestCase.suite());
       suite.addTest(CycleCheckCompleteTestCase.suite());
+      suite.addTest(DynamicDeployerUsageTestCase.suite());
 
       return suite;
    }

Added: projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/main/support/MarkerDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/main/support/MarkerDeployer.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/main/support/MarkerDeployer.java	2011-05-16 13:05:46 UTC (rev 111379)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright $today.year Red Hat Inc. and/or its affiliates and other
+* contributors as indicated by the @author tags. All rights reserved.
+* 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.main.support;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.helpers.AbstractDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class MarkerDeployer extends AbstractDeployer
+{
+   public DeploymentUnit unit;
+
+   public void deploy(DeploymentUnit unit) throws DeploymentException
+   {
+   }
+
+   @Override
+   public void undeploy(DeploymentUnit unit)
+   {
+      this.unit = unit;
+   }
+}

Copied: projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/main/test/DynamicDeployerUsageTestCase.java (from rev 110967, projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/main/test/DeployerIncompleteDeploymentsTestCase.java)
===================================================================
--- projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/main/test/DynamicDeployerUsageTestCase.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/main/test/DynamicDeployerUsageTestCase.java	2011-05-16 13:05:46 UTC (rev 111379)
@@ -0,0 +1,57 @@
+/*
+* 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.main.test;
+
+import junit.framework.Test;
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.test.deployers.AbstractDeployerTest;
+import org.jboss.test.deployers.main.support.MarkerDeployer;
+
+/**
+ * Test dynamic adding / removing of deployer.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class DynamicDeployerUsageTestCase extends AbstractDeployerTest
+{
+   public DynamicDeployerUsageTestCase(String name)
+   {
+      super(name);
+   }
+
+   public static Test suite()
+   {
+      return suite(DynamicDeployerUsageTestCase.class);
+   }
+
+   public void testAddRemove() throws Exception
+   {
+      MarkerDeployer md = new MarkerDeployer();
+      DeployerClient main = createMainDeployer(md);
+      Deployment deployment = createSimpleDeployment("test");
+      main.deploy(deployment);
+      removeDeployer(main, md);
+      main.undeploy(deployment);
+      assertNull(md.unit);
+   }
+}



More information about the jboss-cvs-commits mailing list