congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
GrapheneProxy.getProxyForHandler
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: com.github.albfernandez.richfaces/richfaces-build-resources

/**
 * Returns the instance of proxy to thread local context of configuration
 *
 * @return the instance of proxy to thread local context of configuration
 */
public static FundamentalTestConfiguration getProxy() {
  return GrapheneProxy.getProxyForHandler(new GrapheneProxyHandler(TARGET) {
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
      return method.invoke(TARGET.getTarget(), args);
    }
  }, FundamentalTestConfiguration.class);
}
origin: org.richfaces/richfaces-page-fragments

/**
 * Returns the instance of proxy to thread local context of configuration
 *
 * @return the instance of proxy to thread local context of configuration
 */
public static RichFacesPageFragmentsConfiguration getProxy() {
  return GrapheneProxy.getProxyForHandler(new GrapheneProxyHandler(TARGET) {
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
      return method.invoke(TARGET.getTarget(), args);
    }
  }, RichFacesPageFragmentsConfiguration.class);
}
origin: org.jboss.arquillian.graphene/graphene-webdriver-impl

protected <BASE> BASE base(final Annotation[] annotations) {
  final GrapheneProxy.FutureTarget futureTarget = new GrapheneProxy.FutureTarget() {
    @Override
    public Object getTarget() {
      GrapheneContext context = GrapheneContext.getContextFor(ReflectionHelper.getQualifier(annotations));
      return context.getWebDriver(mediatorType);
    }
  };
  GrapheneProxyHandler mediatorHandler = new GrapheneProxyHandler(futureTarget) {
    @Override
    public Object invoke(Object proxy, final Method mediatorMethod, final Object[] mediatorArgs) throws Throwable {
      GrapheneProxyHandler handler = new GrapheneProxyHandler(futureTarget) {
        @Override
        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
          Object mediatorObject = mediatorMethod.invoke(getTarget(), mediatorArgs);
          return method.invoke(mediatorObject, args);
        }
      };
      return GrapheneProxy.getProxyForHandler(handler, mediatorMethod.getReturnType());
    }
  };
  return (BASE) GrapheneProxy.getProxyForHandler(mediatorHandler, WebDriver.class, mediatorType);
}
origin: arquillian/arquillian-graphene

protected <BASE> BASE base(final Annotation[] annotations) {
  final GrapheneProxy.FutureTarget futureTarget = new GrapheneProxy.FutureTarget() {
    @Override
    public Object getTarget() {
      GrapheneContext context = GrapheneContext.getContextFor(ReflectionHelper.getQualifier(annotations));
      return context.getWebDriver(mediatorType);
    }
  };
  GrapheneProxyHandler mediatorHandler = new GrapheneProxyHandler(futureTarget) {
    @Override
    public Object invoke(Object proxy, final Method mediatorMethod, final Object[] mediatorArgs) throws Throwable {
      GrapheneProxyHandler handler = new GrapheneProxyHandler(futureTarget) {
        @Override
        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
          Object mediatorObject = mediatorMethod.invoke(getTarget(), mediatorArgs);
          return method.invoke(mediatorObject, args);
        }
      };
      return GrapheneProxy.getProxyForHandler(handler, mediatorMethod.getReturnType());
    }
  };
  return (BASE) GrapheneProxy.getProxyForHandler(mediatorHandler, WebDriver.class, mediatorType);
}
origin: org.jboss.arquillian.graphene/graphene-webdriver-impl

  @Override
  public Object invoke(Object proxy, final Method mediatorMethod, final Object[] mediatorArgs) throws Throwable {
    GrapheneProxyHandler handler = new GrapheneProxyHandler(futureTarget) {
      @Override
      public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        Object mediatorObject = mediatorMethod.invoke(getTarget(), mediatorArgs);
        return method.invoke(mediatorObject, args);
      }
    };
    return GrapheneProxy.getProxyForHandler(handler, mediatorMethod.getReturnType());
  }
};
origin: arquillian/arquillian-graphene

  @Override
  public Object invoke(Object proxy, final Method mediatorMethod, final Object[] mediatorArgs) throws Throwable {
    GrapheneProxyHandler handler = new GrapheneProxyHandler(futureTarget) {
      @Override
      public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        Object mediatorObject = mediatorMethod.invoke(getTarget(), mediatorArgs);
        return method.invoke(mediatorObject, args);
      }
    };
    return GrapheneProxy.getProxyForHandler(handler, mediatorMethod.getReturnType());
  }
};
origin: org.jboss.arquillian.graphene/graphene-webdriver-impl

protected <T> T createWrapper(GrapheneContext grapheneContext, final Class<T> type, final WebElement element)
  throws Exception {
  T wrapper = GrapheneProxy.getProxyForHandler(
    GrapheneContextualHandler.forFuture(grapheneContext, new GrapheneProxy.FutureTarget() {
      @Override
      public Object getTarget() {
        try {
          return instantiate(type, element);
        } catch (Exception e) {
          throw new IllegalStateException("Can't instantiate the " + type, e);
        }
      }
    }), type);
  return wrapper;
}
origin: arquillian/arquillian-graphene

protected <T> T createWrapper(GrapheneContext grapheneContext, final Class<T> type, final WebElement element)
  throws Exception {
  T wrapper = GrapheneProxy.getProxyForHandler(
    GrapheneContextualHandler.forFuture(grapheneContext, new GrapheneProxy.FutureTarget() {
      @Override
      public Object getTarget() {
        try {
          return instantiate(type, element);
        } catch (Exception e) {
          throw new IllegalStateException("Can't instantiate the " + type, e);
        }
      }
    }), type);
  return wrapper;
}
origin: org.jboss.arquillian.graphene/graphene-webdriver-impl

@SuppressWarnings("unchecked")
protected <T> List<T> createWrappers(GrapheneContext grapheneContext, final Class<T> type, final List<WebElement> elements) {
  List<T> wrapper = GrapheneProxy.getProxyForHandler(
    GrapheneContextualHandler.forFuture(grapheneContext, new GrapheneProxy.FutureTarget() {
      @Override
      public Object getTarget() {
        try {
          List<T> target = new ArrayList<T>();
          for (WebElement element : elements) {
            target.add((T) instantiate(type, element));
          }
          return target;
        } catch (Exception e) {
          throw new IllegalStateException("Can't instantiate the " + type, e);
        }
      }
    }), List.class);
  return wrapper;
}
origin: arquillian/arquillian-graphene

@SuppressWarnings("unchecked")
protected <T> List<T> createWrappers(GrapheneContext grapheneContext, final Class<T> type, final List<WebElement> elements) {
  List<T> wrapper = GrapheneProxy.getProxyForHandler(
    GrapheneContextualHandler.forFuture(grapheneContext, new GrapheneProxy.FutureTarget() {
      @Override
      public Object getTarget() {
        try {
          List<T> target = new ArrayList<T>();
          for (WebElement element : elements) {
            target.add((T) instantiate(type, element));
          }
          return target;
        } catch (Exception e) {
          throw new IllegalStateException("Can't instantiate the " + type, e);
        }
      }
    }), List.class);
  return wrapper;
}
origin: arquillian/arquillian-graphene

@Override
public WebDriver getWebDriver(Class<?>... interfaces) {
  GrapheneContext context = getContext(false);
  if (context == null) {
    return GrapheneProxy.getProxyForHandler(handler, WebDriver.class, interfaces);
  } else if (GrapheneProxyUtil.isProxy(context.getWebDriver())) {
    Class<?> superclass = context.getWebDriver().getClass().getSuperclass();
    if (superclass != null && !GrapheneProxyUtil.isProxy(superclass) && WebDriver.class.isAssignableFrom(superclass)) {
      return GrapheneProxy.getProxyForHandler(handler, context.getWebDriver().getClass().getSuperclass(), interfaces);
    } else {
      return GrapheneProxy.getProxyForHandler(handler, WebDriver.class, interfaces);
    }
  } else {
    return GrapheneProxy.getProxyForHandler(handler, context.getWebDriver().getClass(), interfaces);
  }
}
origin: org.jboss.arquillian.graphene/graphene-webdriver-impl

@Override
public WebDriver getWebDriver(Class<?>... interfaces) {
  GrapheneContext context = getContext(false);
  if (context == null) {
    return GrapheneProxy.getProxyForHandler(handler, WebDriver.class, interfaces);
  } else if (GrapheneProxyUtil.isProxy(context.getWebDriver())) {
    Class<?> superclass = context.getWebDriver().getClass().getSuperclass();
    if (superclass != null && !GrapheneProxyUtil.isProxy(superclass) && WebDriver.class.isAssignableFrom(superclass)) {
      return GrapheneProxy.getProxyForHandler(handler, context.getWebDriver().getClass().getSuperclass(), interfaces);
    } else {
      return GrapheneProxy.getProxyForHandler(handler, WebDriver.class, interfaces);
    }
  } else {
    return GrapheneProxy.getProxyForHandler(handler, context.getWebDriver().getClass(), interfaces);
  }
}
origin: org.jboss.arquillian.graphene/graphene-webdriver-impl

return getProxyForHandler(handler, baseType, additionalInterfaces);
origin: arquillian/arquillian-graphene

return getProxyForHandler(handler, baseType, additionalInterfaces);
origin: org.jboss.arquillian.graphene/graphene-webdriver-impl

public static List<WebElement> findElementsLazily(final GrapheneContext context, final By by, final GrapheneProxy.FutureTarget searchContextFuture) {
  List<WebElement> elements = GrapheneProxy.getProxyForHandler(GrapheneContextualHandler.forFuture(context, new GrapheneProxy.FutureTarget() {
    @Override
    public Object getTarget() {
      List<WebElement> result = new ArrayList<WebElement>();
      List<WebElement> elements = dropProxyAndFindElements(by, (SearchContext) searchContextFuture.getTarget());
      if ((by instanceof ByIdOrName) && (elements.isEmpty())) {
        LOGGER.log(Level.WARNING, EMPTY_FIND_BY_WARNING);
      }
      for (int i = 0; i < elements.size(); i++) {
        WebElement foundElement = findElementLazily(context, by, searchContextFuture, i);
        if (foundElement != null) {
          result.add(foundElement);
        }
      }
      return result;
    }
  }), List.class);
  GrapheneProxyInstance proxy = (GrapheneProxyInstance) elements;
  proxy.registerInterceptor(new StaleElementInterceptor());
  return elements;
}
origin: arquillian/arquillian-graphene

public static List<WebElement> findElementsLazily(final GrapheneContext context, final By by, final GrapheneProxy.FutureTarget searchContextFuture) {
  List<WebElement> elements = GrapheneProxy.getProxyForHandler(GrapheneContextualHandler.forFuture(context, new GrapheneProxy.FutureTarget() {
    @Override
    public Object getTarget() {
      List<WebElement> result = new ArrayList<WebElement>();
      List<WebElement> elements = dropProxyAndFindElements(by, (SearchContext) searchContextFuture.getTarget());
      if ((by instanceof ByIdOrName) && (elements.isEmpty())) {
        LOGGER.log(Level.WARNING, EMPTY_FIND_BY_WARNING);
      }
      for (int i = 0; i < elements.size(); i++) {
        WebElement foundElement = findElementLazily(context, by, searchContextFuture, i);
        if (foundElement != null) {
          result.add(foundElement);
        }
      }
      return result;
    }
  }), List.class);
  GrapheneProxyInstance proxy = (GrapheneProxyInstance) elements;
  proxy.registerInterceptor(new StaleElementInterceptor());
  return elements;
}
origin: arquillian/arquillian-graphene

public static <P> P setupPage(GrapheneContext context, SearchContext searchContext, Class<?> pageClass) throws Exception{
  P page = (P) instantiate(pageClass);
  P proxy = GrapheneProxy.getProxyForHandler(GrapheneContextualHandler.forTarget(context, page), pageClass);
  enrichRecursively(searchContext, page);
  enrichRecursively(searchContext, proxy); // because of possibility of direct access to attributes from test class
  return proxy;
}
origin: org.jboss.arquillian.graphene/graphene-webdriver-impl

public static <P> P setupPage(GrapheneContext context, SearchContext searchContext, Class<?> pageClass) throws Exception{
  P page = (P) instantiate(pageClass);
  P proxy = GrapheneProxy.getProxyForHandler(GrapheneContextualHandler.forTarget(context, page), pageClass);
  enrichRecursively(searchContext, page);
  enrichRecursively(searchContext, proxy); // because of possibility of direct access to attributes from test class
  return proxy;
}
origin: arquillian/arquillian-graphene

T proxy = GrapheneProxy.getProxyForHandler(GrapheneContextualHandler.forTarget(grapheneContext, pageFragment),
  clazz);
origin: org.jboss.arquillian.graphene/graphene-webdriver-impl

T proxy = GrapheneProxy.getProxyForHandler(GrapheneContextualHandler.forTarget(grapheneContext, pageFragment),
  clazz);
org.jboss.arquillian.graphene.proxyGrapheneProxygetProxyForHandler

Popular methods of GrapheneProxy

  • isProxyInstance
    Returns whether given object is instance of context proxy.
  • getProxyForFutureTarget
    Wraps the given future target instance in the proxy. Future target can be computed dynamically fo
  • 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
  • addToBackStack (FragmentTransaction)
  • getApplicationContext (Context)
  • onCreateOptionsMenu (Activity)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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