congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
GrapheneProxy.getProxyForFutureTarget
Code IndexAdd Tabnine to your IDE (free)

How to use
getProxyForFutureTarget
method
in
org.jboss.arquillian.graphene.proxy.GrapheneProxy

Best Java code snippets using org.jboss.arquillian.graphene.proxy.GrapheneProxy.getProxyForFutureTarget (Showing top 7 results out of 315)

origin: arquillian/arquillian-graphene

protected final <T> List<T> createPageFragmentList(final Class<T> clazz, final SearchContext searchContext, final By rootBy) {
  GrapheneContext grapheneContext = ((GrapheneProxyInstance) searchContext).getGrapheneContext();
  List<T> result = GrapheneProxy.getProxyForFutureTarget(grapheneContext, new FutureTarget() {
    @Override
    public Object getTarget() {
      List<WebElement> elements = searchContext.findElements(rootBy);
      List<T> fragments = new ArrayList<T>();
      for (int i = 0; i < elements.size(); i++) {
        fragments.add(createPageFragment(clazz, WebElementUtils.findElementLazily(rootBy, searchContext, i)));
      }
      return fragments;
    }
  }, List.class);
  return result;
}
origin: org.jboss.arquillian.graphene/graphene-webdriver-impl

protected final <T> List<T> createPageFragmentList(final Class<T> clazz, final SearchContext searchContext, final By rootBy) {
  GrapheneContext grapheneContext = ((GrapheneProxyInstance) searchContext).getGrapheneContext();
  List<T> result = GrapheneProxy.getProxyForFutureTarget(grapheneContext, new FutureTarget() {
    @Override
    public Object getTarget() {
      List<WebElement> elements = searchContext.findElements(rootBy);
      List<T> fragments = new ArrayList<T>();
      for (int i = 0; i < elements.size(); i++) {
        fragments.add(createPageFragment(clazz, WebElementUtils.findElementLazily(rootBy, searchContext, i)));
      }
      return fragments;
    }
  }, List.class);
  return result;
}
origin: org.jboss.arquillian.graphene/graphene-webdriver-impl

if (baseType != null && !baseType.isInterface() && Modifier.isFinal(baseType.getModifiers())) {
  if (additionalInterfaces.length > 0) {
    return GrapheneProxy.getProxyForFutureTarget(context, futureTarget, additionalInterfaces[0], additionalInterfaces);
  } else {
    throw new IllegalStateException("Can't create a proxy for " + baseType
origin: arquillian/arquillian-graphene

if (baseType != null && !baseType.isInterface() && Modifier.isFinal(baseType.getModifiers())) {
  if (additionalInterfaces.length > 0) {
    return GrapheneProxy.getProxyForFutureTarget(context, futureTarget, additionalInterfaces[0], additionalInterfaces);
  } else {
    throw new IllegalStateException("Can't create a proxy for " + baseType
origin: org.jboss.arquillian.graphene/graphene-webdriver-impl

protected static WebElement findElement(GrapheneContext context, final GrapheneProxy.FutureTarget target) {
  final WebElement element = GrapheneProxy.getProxyForFutureTarget(context, target, WebElement.class, INTERFACES_PROXY_SHOULD_IMPLEMENT);
  final GrapheneProxyInstance elementProxy = (GrapheneProxyInstance) element;
  InterceptorBuilder b = new InterceptorBuilder();
  b.interceptInvocation(WrapsElement.class, new WrapsElementInterceptor(elementProxy)).getWrappedElement();
  elementProxy.registerInterceptor(b.build());
  elementProxy.registerInterceptor(new StaleElementInterceptor());
  elementProxy.registerInterceptor(new SearchContextInterceptor());
  return element;
}
origin: arquillian/arquillian-graphene

protected static WebElement findElement(GrapheneContext context, final GrapheneProxy.FutureTarget target) {
  final WebElement element = GrapheneProxy.getProxyForFutureTarget(context, target, WebElement.class, INTERFACES_PROXY_SHOULD_IMPLEMENT);
  final GrapheneProxyInstance elementProxy = (GrapheneProxyInstance) element;
  InterceptorBuilder b = new InterceptorBuilder();
  b.interceptInvocation(WrapsElement.class, new WrapsElementInterceptor(elementProxy)).getWrappedElement();
  elementProxy.registerInterceptor(b.build());
  elementProxy.registerInterceptor(new StaleElementInterceptor());
  elementProxy.registerInterceptor(new SearchContextInterceptor());
  return element;
}
origin: arquillian/arquillian-graphene

@Test
public void when_proxy_is_created_then_no_constructor_is_called() {
  // having
  FutureTarget target = new FutureTarget() {
    @Override
    public Object getTarget() {
      throw new ExpectedException();
    }
  };
  // when
  TestingDriver driver = GrapheneProxy.<TestingDriver>getProxyForFutureTarget(null, target, TestingDriver.class);
  try {
    driver.quit();
    fail("exception should be thrown because of FutureTarget definition");
  } catch (ExpectedException e) {
    // expected
  }
  // verify
  assertFalse(TestingDriver.contructorInvoked);
}
org.jboss.arquillian.graphene.proxyGrapheneProxygetProxyForFutureTarget

Javadoc

Wraps the given future target instance in the proxy.

Future target can be computed dynamically for each invocation of proxy.

In this case interfaces which should the proxy implement needs to be provided.

The list of any classes can be provided, the list of interfaces will be automatically computed.

Popular methods of GrapheneProxy

  • getProxyForHandler
  • isProxyInstance
    Returns whether given object is instance of context proxy.
  • getProxyForTarget
    Wraps the given target instance in the proxy. The list of interfaces which should be implemented
  • getProxyForTargetWithInterfaces
    Wraps the given target instance in the proxy. The list of interfaces which should be implemented
  • createProxy
    Uses given proxy factory to create new proxy for given implementation class or interfaces with the

Popular in Java

  • Making http requests using okhttp
  • onCreateOptionsMenu (Activity)
  • onRequestPermissionsResult (Fragment)
  • setScale (BigDecimal)
  • Menu (java.awt)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now