Package org.jboss.arquillian.spi

Examples of org.jboss.arquillian.spi.DeploymentException


   public ContainerMethodExecutor deploy(Context context, Archive<?> archive) throws DeploymentException
   {
      if (deploymentManager == null)
      {
         throw new DeploymentException("Could not deploy since deployment manager was not loaded");
      }

      TargetModuleID moduleInfo = null;
      try {
         PROGRESS_BARRIER.reset();
         resetModuleStatus();
         ProgressObject progress = deploymentManager.distribute(
               deploymentManager.getTargets(), moduleTypeMapper.getModuleType(archive),
               archive.as(ZipExporter.class).exportZip(), null);
         progress.addProgressListener(new JSR88DeploymentListener(this, progress.getResultTargetModuleIDs(), CommandType.DISTRIBUTE));
         waitForModuleToStart();
         // QUESTION when is getResultTargetModuleIDs() > 0?
         moduleInfo =  progress.getResultTargetModuleIDs()[0];
         context.add(TargetModuleID.class, moduleInfo);
      }
      catch (Exception e)
      {
         throw new DeploymentException("Could not deploy archive", e);
      }

      if (moduleInfo == null || moduleInfo.getModuleID() == null)
      {
         throw new DeploymentException("Could not determine module id, likely because module did not deploy");
      }

      try
      {
         // FIXME pass moduleId to ServletMethodExecutor since we can't guarantee anymore it's /test
View Full Code Here


         return;
      }

      if (deploymentManager == null)
      {
         throw new DeploymentException("Could not undeploy since deployment manager was not loaded");
      }
     
      try
      {
         PROGRESS_BARRIER.reset();
         TargetModuleID moduleInfo = context.get(TargetModuleID.class);
         if (moduleInfo == null || moduleInfo.getModuleID() == null)
         {
            log.log(Level.INFO, "Skipping undeploy since module ID could not be determined");
            return;
         }
        
         TargetModuleID[] availableModuleIDs = deploymentManager.getAvailableModules(
               moduleTypeMapper.getModuleType(archive), getDeploymentManager().getTargets());
         TargetModuleID moduleInfoMatch = null;
         for (TargetModuleID candidate : availableModuleIDs)
         {
            if (candidate.getModuleID().equals(moduleInfo.getModuleID()))
            {
               moduleInfoMatch = candidate;
               break;
            }
         }

         if (moduleInfoMatch != null)
         {
            TargetModuleID[] targetModuleIDs = { moduleInfoMatch };
            ProgressObject progress = deploymentManager.undeploy(targetModuleIDs);
            progress.addProgressListener(new JSR88DeploymentListener(this, targetModuleIDs, CommandType.UNDEPLOY));
            waitForModuleToUndeploy();
         }
         else
         {
            resetModuleStatus();
            log.info("Undeploy skipped since could not locate module in list of deployed modules");
         }
      }
      catch (Exception e)
      {
         throw new DeploymentException("Could not undeploy module", e);
      }
   }
View Full Code Here

         wctx.start();
         context.add(WebAppContext.class, wctx);
      }
      catch (Exception e)
      {
         throw new DeploymentException("Could not deploy " + archive.getName(), e);
      }

      try
      {
         return new ServletMethodExecutor(
View Full Code Here

            DeploymentAction deployAction = builder.getLastAction();
            executeDeploymentPlan(plan, deployAction,archive);

            return getContainerMethodExecutor(context);
        } catch (Exception e) {
            throw new DeploymentException("Could not deploy to container", e);
        }
    }
View Full Code Here

            DeploymentAction deployAction = builder.getLastAction();
            executeDeploymentPlan(plan, deployAction,archive);

            return getContainerMethodExecutor(context);
        } catch (Exception e) {
            throw new DeploymentException("Could not deploy to container", e);
        }
    }
View Full Code Here

                     "/")
               );
      }
      catch (Exception e)
      {
         throw new DeploymentException("Could not deploy to container", e);
      }
   }
View Full Code Here

      {
         context.get(JBossASEmbeddedServer.class).undeploy(archive);
      }
      catch (Exception e)
      {
         throw new DeploymentException("Could not undeploy from container", e);
      }
   }
View Full Code Here

         context.get(ShrinkWrapDeployer.class).deploy(archive);
      }
      catch (org.jboss.deployers.spi.DeploymentException e)
      {
         // Translate the exception and wrap
         throw new DeploymentException("Encountered error while deploying " + archive.toString(), e);
      }

      // Return
      return new LocalMethodExecutor();
   }
View Full Code Here

         context.get(ShrinkWrapDeployer.class).undeploy(archive);
      }
      catch (org.jboss.deployers.spi.DeploymentException e)
      {
         // Translate the exception and wrap
         throw new DeploymentException("Encountered error while undeploying " + archive.toString(), e);
      }

   }
View Full Code Here

      {
         server.deploy(file);
      }
      catch (Exception e)
      {
         throw new DeploymentException("Could not deploy " + deploymentName, e);
      }
      try
      {
         return new ServletMethodExecutor(new URL(server.getHttpUrl().toExternalForm() + "/"));
      }
View Full Code Here

TOP

Related Classes of org.jboss.arquillian.spi.DeploymentException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.