Codota Logo
ProtocolMetaData
Code IndexAdd Codota to your IDE (free)

How to use
ProtocolMetaData
in
org.jboss.arquillian.container.spi.client.protocol.metadata

Best Java code snippets using org.jboss.arquillian.container.spi.client.protocol.metadata.ProtocolMetaData (Showing top 20 results out of 540)

Refine searchRefine arrow

  • HTTPContext
  • Common ways to obtain ProtocolMetaData
private void myMethod () {
ProtocolMetaData p =
  • Codota Iconnew ProtocolMetaData()
  • Codota IconObject obj;new ProtocolMetaData().addContext(obj)
  • Codota IconInstance instance;instance.get()
  • Smart code suggestions by Codota
}
origin: org.jboss.arquillian.container/undertow-embedded

public ProtocolMetaData deploy(Archive<?> archive)
    throws DeploymentException {
  HTTPContext httpContext = null;
  
  if(archive instanceof UndertowWebArchive) {
    httpContext = registerDeploymentInfo(archive);
  } else{
    if(archive instanceof UndertowHttpHandlerArchive) {
      httpContext = registerHandler(archive);
    }
  }
  
  return new ProtocolMetaData().addContext(httpContext);
}
origin: org.jboss.arquillian.protocol/arquillian-protocol-modules

private static Collection<HTTPContext> getHTTPContext(ProtocolMetaData protocolMetaData) {
  Collection<HTTPContext> contexts = protocolMetaData.getContexts(HTTPContext.class);
  if (contexts != null && contexts.size() > 0) {
    return contexts;
  } else {
    return Collections.singleton(null); // push non-empty http contexts
  }
}
origin: org.apache.tomee/arquillian-openejb-embedded

  private static ProtocolMetaData newHttpProtocolMetaData(final ServerService ss, final String contextRoot) {
    final HTTPContext httpContext = new HTTPContext(ss.getIP(), ss.getPort());
    httpContext.add(new Servlet("ArquillianServletRunner", contextRoot));
    return new ProtocolMetaData().addContext(httpContext);
  }
}
origin: org.arquillian.cube/arquillian-cube-core

ProtocolMetaData updatedMetaData = new ProtocolMetaData();
boolean updated = false;
    return;
  for (Object contextObj : originalMetaData.getContexts()) {
    if (contextObj instanceof HTTPContext) {
      HTTPContext context = (HTTPContext) contextObj;
      String ip = context.getHost();
      int port = context.getPort();
      final PortAddress mappedPort = portBindings.getMappedAddress(port);
      final String bindingIp;
        HTTPContext newContext = new HTTPContext(ip, port);
        for (Servlet servlet : context.getServlets()) {
          newContext.add(servlet);
        updatedMetaData.addContext(newContext);
      updatedMetaData.addContext(contextObj);
origin: arquillian/arquillian-core

@Test
public void shouldBeAbleToInjectBaseContextURLQualified() throws Exception {
  URLBaseContextClassQualified test = execute(
    URLBaseContextClassQualified.class,
    ProtocolMetaData.class,
    new ProtocolMetaData()
      .addContext(new HTTPContext("TEST-Y", 8080)),
    new ProtocolMetaData()
      .addContext(new HTTPContext("TEST-X", 8080)));
  Assert.assertEquals("http://TEST-X:8080", test.url.toExternalForm());
}
origin: oracle/helidon

return new ProtocolMetaData();
origin: org.apache.tomee/arquillian-openejb-embedded

    for (final ServletInfo servletInfo : webapp.servlets) {
      if (http == null) {
        http = HTTPContext.class.cast(metaData.getContexts().iterator().next());
        http.add(new Servlet(servletInfo.servletName, webapp.contextRoot));
          http = HTTPContext.class.cast(metaData.getContexts().iterator().next());
        http.add(new Servlet(path.substring(path.lastIndexOf('!') + 2).replace(".class", "").replace("/", "."), webapp.contextRoot));
return new ProtocolMetaData();
origin: arquillian/arquillian-core

  return null;
if (metaData.hasContext(HTTPContext.class)) {
  HTTPContext context = null;
  if (targets != null) {
    context = locateNamedHttpContext(metaData, targets.value());
  } else {
    context = metaData.getContexts(HTTPContext.class).iterator().next();
    Servlet servlet = context.getServletByName(resource.value().getSimpleName());
    if (servlet == null) {
      servlet = context.getServletByName(resource.value().getName());
  else if (allInSameContext(context.getServlets())) {
    return toURL(context.getServlets().get(0));
  } else {
origin: arquillian/continuous-enterprise-development

private URI locateAuthURI(ProtocolMetaData data) {
  Collection<HTTPContext> contexts = data.getContexts(HTTPContext.class);
  if(contexts == null || contexts.size() == 0 || contexts.size() > 1) {
    throw new RuntimeException("Could not determine auth URL: " + contexts);
  }
  HTTPContext context = contexts.iterator().next();
  return URI.create(context.getServlets().get(0).getBaseURI()+ "auth");
}
origin: arquillian/arquillian-core

private HTTPContext locateNamedHttpContext(ProtocolMetaData metaData, String value) {
  for (HTTPContext context : metaData.getContexts(HTTPContext.class)) {
    if (value.equals(context.getName())) {
      return context;
    }
  }
  throw new IllegalArgumentException(
    "Could not find named context " + value + " in metadata. " +
      "Please verify your @" + TargetsContainer.class.getName() + " definition");
}
origin: arquillian/arquillian-extension-rest

protected URI getBaseURL() {
  HTTPContext context = metaDataInst.get().getContext(HTTPContext.class);
  if (allInSameContext(context.getServlets())) {
    return context.getServlets().get(0).getBaseURI();
  }
  throw new IllegalStateException("No baseURL found in HTTPContext");
}
origin: org.jboss.arquillian.extension/arquillian-extension-byteman

HTTPContext httpContext = pmd.getContext(HTTPContext.class);
if (httpContext != null) {
  return httpContext.getHost();
RMIContext rmiContext = pmd.getContext(RMIContext.class);
if (rmiContext != null) {
  return rmiContext.getIp();
JMXContext jmxContext = pmd.getContext(JMXContext.class);
if (jmxContext != null) {
  try {
origin: arquillian/arquillian-core

  @Override
  public ContainerMethodExecutor getExecutor(T config, ProtocolMetaData metaData, CommandCallback callback) {
    if (metaData.hasContext(JMXContext.class)) {
      MBeanServerConnection mbeanServer = metaData.getContext(JMXContext.class).getConnection();

      Map<String, String> protocolProps = new HashMap<String, String>();
      try {
        BeanInfo beanInfo = Introspector.getBeanInfo(config.getClass());
        for (PropertyDescriptor propertyDescriptor : beanInfo.getPropertyDescriptors()) {
          String key = propertyDescriptor.getName();
          Object value = propertyDescriptor.getReadMethod().invoke(config);
          if (value != null) {
            protocolProps.put(key, "" + value);
          }
        }
      } catch (Exception ex) {
        throw new IllegalStateException("Cannot obtain protocol config");
      }
      return new JMXMethodExecutor(mbeanServer, callback, JMXTestRunnerMBean.OBJECT_NAME, protocolProps);
    } else {
      throw new IllegalStateException(
        "No " + JMXContext.class.getName() + " was found in " + ProtocolMetaData.class.getName() +
          ". The JMX Protocol can not be used without a connection, " +
          "please verify your protocol configuration or contact the DeployableContainer developer");
    }
  }
}
origin: org.apache.openejb/arquillian-openejb-embedded-4

  public static ProtocolMetaData protocolMetaData(final AppInfo info) {
    final org.apache.openejb.server.ServiceManager smp = org.apache.openejb.server.ServiceManager.get();
    if (smp != null && SimpleServiceManager.class.isInstance(smp)) {
      final ServerService[] daemons = SimpleServiceManager.class.cast(smp).getDaemons();
      for (final ServerService ss : daemons) {
        if ("httpejbd".equals(ss.getName())) {
          final HTTPContext httpContext = new HTTPContext(ss.getIP(), ss.getPort());
          httpContext.add(new Servlet("ArquillianServletRunner", info.appId));
          return new ProtocolMetaData().addContext(httpContext);
        }
      }
    }
    return null;
  }
}
origin: arquillian/arquillian-cube

ProtocolMetaData updatedMetaData = new ProtocolMetaData();
boolean updated = false;
    return;
  for (Object contextObj : originalMetaData.getContexts()) {
    if (contextObj instanceof HTTPContext) {
      HTTPContext context = (HTTPContext) contextObj;
      String ip = context.getHost();
      int port = context.getPort();
      final PortAddress mappedPort = portBindings.getMappedAddress(port);
      final String bindingIp;
        HTTPContext newContext = new HTTPContext(ip, port);
        for (Servlet servlet : context.getServlets()) {
          newContext.add(servlet);
        updatedMetaData.addContext(newContext);
      updatedMetaData.addContext(contextObj);
origin: org.jboss.arquillian.container/arquillian-container-test-impl-base

@Test
public void shouldBeAbleToInjectBaseContextURLQualified() throws Exception {
  URLBaseContextClassQualified test = execute(
    URLBaseContextClassQualified.class,
    ProtocolMetaData.class,
    new ProtocolMetaData()
      .addContext(new HTTPContext("TEST-Y", 8080)),
    new ProtocolMetaData()
      .addContext(new HTTPContext("TEST-X", 8080)));
  Assert.assertEquals("http://TEST-X:8080", test.url.toExternalForm());
}
origin: org.arquillian.container/arquillian-droidium-container

@Override
public ProtocolMetaData deploy(Archive<?> archive) throws DeploymentException {
  androidDeploy.fire(new AndroidDeploy(archive));
  return new ProtocolMetaData();
}
origin: org.jboss.arquillian.container/arquillian-container-test-impl-base

  return null;
if (metaData.hasContext(HTTPContext.class)) {
  HTTPContext context = null;
  if (targets != null) {
    context = locateNamedHttpContext(metaData, targets.value());
  } else {
    context = metaData.getContexts(HTTPContext.class).iterator().next();
    Servlet servlet = context.getServletByName(resource.value().getSimpleName());
    if (servlet == null) {
      servlet = context.getServletByName(resource.value().getName());
  else if (allInSameContext(context.getServlets())) {
    return toURL(context.getServlets().get(0));
  } else {
origin: org.jboss.arquillian.container/arquillian-container-test-impl-base

private HTTPContext locateNamedHttpContext(ProtocolMetaData metaData, String value) {
  for (HTTPContext context : metaData.getContexts(HTTPContext.class)) {
    if (value.equals(context.getName())) {
      return context;
    }
  }
  throw new IllegalArgumentException(
    "Could not find named context " + value + " in metadata. " +
      "Please verify your @" + TargetsContainer.class.getName() + " definition");
}
origin: arquillian/arquillian-core

@Test(expected = IllegalArgumentException.class)
public void shouldThrowExceptionOnUnKnownTargetInDeployment() throws Exception {
  execute(
    URLBaseContextClassQualifiedTargetedMissing.class,
    ProtocolMetaData.class,
    new ProtocolMetaData()
      .addContext(new HTTPContext("TEST-Y", 8080)
        .add(new Servlet(URLServletContextClass.class.getSimpleName(), "/test-Y"))),
    new ProtocolMetaData()
      .addContext(new HTTPContext("TEST-X", 8080)
        .add(new Servlet(URLServletContextClass.class.getSimpleName(), "/test-X"))));
}
org.jboss.arquillian.container.spi.client.protocol.metadataProtocolMetaData

Javadoc

ProtocolMetaData

Most used methods

  • <init>
  • addContext
  • getContexts
  • getContext
  • hasContext
  • toString

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (Timer)
  • getSystemService (Context)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Hashtable (java.util)
    Hashtable is a synchronized implementation of Map. All optional operations are supported.Neither key
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now