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"); }
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"); }
private HTTPContext locateHTTPContext(Method method, Collection<HTTPContext> contexts) { TargetsContainer targetContainer = method.getAnnotation(TargetsContainer.class); if (targetContainer != null) { String targetName = targetContainer.value(); for (HTTPContext context : contexts) { if (targetName.equals(context.getName())) { return context; } } throw new IllegalArgumentException("Could not determin HTTPContext from ProtocolMetadata for target: " + targetName + ". Verify that the given target name in @" + TargetsContainer.class.getSimpleName() + " match a name returned by the deployment container"); } return contexts.toArray(new HTTPContext[] {})[0]; }
protected HTTPContext locateHTTPContext(Method method) { TargetsContainer targetContainer = method.getAnnotation(TargetsContainer.class); if (targetContainer != null) { String targetName = targetContainer.value(); for (HTTPContext context : contexts) { if (targetName.equals(context.getName())) { return context; } } throw new IllegalArgumentException("Could not determin HTTPContext from ProtocolMetadata for target: " + targetName + ". Verify that the given target name in @" + TargetsContainer.class.getSimpleName() + " match a name returned by the deployment container"); } return contexts.toArray(new HTTPContext[] {})[0]; } }
private HTTPContext locateHTTPContext(Method method, Collection<HTTPContext> contexts) { TargetsContainer targetContainer = method.getAnnotation(TargetsContainer.class); if (targetContainer != null) { String targetName = targetContainer.value(); for (HTTPContext context : contexts) { if (targetName.equals(context.getName())) { return context; } } throw new IllegalArgumentException("Could not determin HTTPContext from ProtocolMetadata for target: " + targetName + ". Verify that the given target name in @" + TargetsContainer.class.getSimpleName() + " match a name returned by the deployment container"); } return contexts.toArray(new HTTPContext[] {})[0]; }
protected HTTPContext locateHTTPContext(Method method) { TargetsContainer targetContainer = method.getAnnotation(TargetsContainer.class); if (targetContainer != null) { String targetName = targetContainer.value(); for (HTTPContext context : contexts) { if (targetName.equals(context.getName())) { return context; } } throw new IllegalArgumentException("Could not determin HTTPContext from ProtocolMetadata for target: " + targetName + ". Verify that the given target name in @" + TargetsContainer.class.getSimpleName() + " match a name returned by the deployment container"); } return contexts.toArray(new HTTPContext[] {})[0]; } }
private HTTPContext locateHTTPContext(Method method, Collection<HTTPContext> contexts) { TargetsContainer targetContainer = method.getAnnotation(TargetsContainer.class); if (targetContainer != null) { String targetName = targetContainer.value(); for (HTTPContext context : contexts) { if (targetName.equals(context.getName())) { return context; } } throw new IllegalArgumentException( "Could not determin HTTPContext from ProtocolMetadata for target: " + targetName + ". Verify that the given target name in @" + TargetsContainer.class.getSimpleName() + " match a name returned by the deployment container"); } return contexts.toArray(new HTTPContext[] {})[0]; }
@Override protected HTTPContext locateHTTPContext(Method method) { HTTPContext previous = null; if (httpContexts != null && httpContexts.size() > 0) { previous = super.locateHTTPContext(method); } final ModuleContext mc = locateModuleContext(method); HTTPContext context; if (previous == null) { context = new HTTPContext(mc.getHost(), mc.getPort()); addArquillianServlet(context); } else { context = new HTTPContext(previous.getName(), mc.getHost(), mc.getPort()); boolean foundArqServlet = false; for (Servlet servlet : previous.getServlets()) { if (foundArqServlet == false && ServletMethodExecutor.ARQUILLIAN_SERVLET_NAME.equals(servlet.getName())) { foundArqServlet = true; } context.add(servlet); } if (foundArqServlet == false) { addArquillianServlet(context); } } return context; }