org.jboss.arquillian.container.test.spi.command.CommandCallback Java Examples

The following examples show how to use org.jboss.arquillian.container.test.spi.command.CommandCallback. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FurnaceProtocol.java    From furnace with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public ContainerMethodExecutor getExecutor(FurnaceProtocolConfiguration protocolConfiguration,
         ProtocolMetaData metaData, CommandCallback callback)
{
   if (metaData == null)
   {
      return new ContainerMethodExecutor()
      {
         @Override
         public TestResult invoke(TestMethodExecutor arg0)
         {
            return TestResult.skipped();
         }
      };
   }

   Collection<FurnaceHolder> contexts = 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 FurnaceTestMethodExecutor(protocolConfiguration, contexts.iterator().next());
}
 
Example #2
Source File: DaemonProtocol.java    From thorntail with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * @see org.jboss.arquillian.container.test.spi.client.protocol.Protocol#getExecutor(org.jboss.arquillian.container.test.spi.client.protocol.ProtocolConfiguration,
 * org.jboss.arquillian.container.spi.client.protocol.metadata.ProtocolMetaData,
 * org.jboss.arquillian.container.test.spi.command.CommandCallback)
 */
@Override
public ContainerMethodExecutor getExecutor(final DaemonProtocolConfiguration protocolConfiguration,
                                           final ProtocolMetaData metaData, final CommandCallback callback) {
    final Collection<DeploymentContext> contexts = metaData.getContexts(DeploymentContext.class);
    assert contexts.size() == 1 : "Should be exactly one deployment context";
    final DeploymentContext context = contexts.iterator().next();
    return new DaemonMethodExecutor(context);
}
 
Example #3
Source File: DaemonProtocol.java    From ARCHIVE-wildfly-swarm with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * @see org.jboss.arquillian.container.test.spi.client.protocol.Protocol#getExecutor(org.jboss.arquillian.container.test.spi.client.protocol.ProtocolConfiguration,
 * org.jboss.arquillian.container.spi.client.protocol.metadata.ProtocolMetaData,
 * org.jboss.arquillian.container.test.spi.command.CommandCallback)
 */
@Override
public ContainerMethodExecutor getExecutor(final DaemonProtocolConfiguration protocolConfiguration,
                                           final ProtocolMetaData metaData, final CommandCallback callback) {
    final Collection<DeploymentContext> contexts = metaData.getContexts(DeploymentContext.class);
    assert contexts.size() == 1 : "Should be exactly one deployment context";
    final DeploymentContext context = contexts.iterator().next();
    return new DaemonMethodExecutor(context);
}
 
Example #4
Source File: QuarkusProtocol.java    From quarkus with Apache License 2.0 4 votes vote down vote up
@Override
public ContainerMethodExecutor getExecutor(QuarkusProtocolConfiguration protocolConfiguration, ProtocolMetaData metaData,
        CommandCallback callback) {
    return injector.get().inject(new QuarkusMethodExecutor());
}