Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jboss.forge.arquillian.protocol;
 
 
 import  org.jboss.arquillian.container.spi.client.protocol.ProtocolDescription;
 import  org.jboss.arquillian.container.spi.client.protocol.metadata.ProtocolMetaData;
 import  org.jboss.arquillian.container.test.spi.ContainerMethodExecutor;
 import  org.jboss.arquillian.container.test.spi.client.deployment.DeploymentPackager;
 import  org.jboss.arquillian.container.test.spi.client.protocol.Protocol;
import  org.jboss.arquillian.container.test.spi.command.CommandCallback;
import  org.jboss.arquillian.test.spi.TestMethodExecutor;
import  org.jboss.arquillian.test.spi.TestResult;
import  org.jboss.arquillian.test.spi.TestResult.Status;

Author(s):
Lincoln Baxter, III
public class ForgeProtocol implements Protocol<ForgeProtocolConfiguration>
   @Override
   {
      return ForgeProtocolConfiguration.class;
   }
   @Override
   public ProtocolDescription getDescription()
   {
      return new ForgeProtocolDescription();
   }
   @Override
   public DeploymentPackager getPackager()
   {
      return new ForgeDeploymentPackager();
   }
   @Override
   public ContainerMethodExecutor getExecutor(ForgeProtocolConfiguration protocolConfiguration,
            ProtocolMetaData metaData, CommandCallback callback)
   {
      if (metaData == null)
      {
         return new ContainerMethodExecutor()
         {
            @Override
            public TestResult invoke(TestMethodExecutor arg0)
            {
               return new TestResult(Status.SKIPPED);
            }
         };
      }
      Collection<FurnaceHoldercontexts = metaData.getContexts(FurnaceHolder.class);
      if (contexts.size() == 0)
      {
         throw new IllegalArgumentException(
                  "No " + Furnace.class.getName() + " found in " + ProtocolMetaData.class.getName() + ". " +
                           "Furnace protocol can not be used");
      }
      return new ForgeTestMethodExecutor(protocolConfigurationcontexts.iterator().next());
   }
New to GrepCode? Check out our FAQ X