Package org.jboss.arquillian.graphene.proxy.GrapheneProxy

Examples of org.jboss.arquillian.graphene.proxy.GrapheneProxy.FutureTarget


public class TestGrapheneProxyInstantiation {

    @Test
    public void when_proxy_is_created_then_no_constructor_is_called() {
        // having
        FutureTarget target = new FutureTarget() {

            @Override
            public Object getTarget() {
                throw new ExpectedException();
            }
View Full Code Here


    protected final boolean isPageFragmentClass(Class<?> clazz) {
        return !clazz.isInterface() && !Modifier.isFinal(clazz.getModifiers()) && !Modifier.isInterface(clazz.getModifiers());
    }

    protected final <T> List<T> createPageFragmentList(final Class<T> clazz, final SearchContext searchContext, final By rootBy) {
        List<T> result = GrapheneProxy.getProxyForFutureTarget(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++) {
View Full Code Here

* @author <a href="mailto:jpapouse@redhat.com">Jan Papousek</a>
*/
public abstract class AbstractWebElementEnricher extends AbstractSearchContextEnricher {

    protected final WebElement createWebElement(final By by, final SearchContext searchContext) {
        return createWebElement(new FutureTarget() {
            @Override
            public Object getTarget() {
                return searchContext.findElement(by);
            }
        });
View Full Code Here

            }
        });
    }

    protected final WebElement createWebElement(final By by, final SearchContext searchContext, final int indexInList) {
        return createWebElement(new FutureTarget() {
            @Override
            public Object getTarget() {
                return searchContext.findElements(by).get(indexInList);
            }
        });
View Full Code Here

        return element;
    }

    public List<WebElement> createWebElements(final By by, final SearchContext searchContext) {
        return GrapheneProxy.getProxyForFutureTarget(new FutureTarget() {
            @Override
            public Object getTarget() {
                List<WebElement> result = new ArrayList<WebElement>();
                List<WebElement> elements = searchContext.findElements(by);
                for (int i = 0; i < elements.size(); i++) {
View Full Code Here

                @Override
                public Object intercept(final InvocationContext context) throws Throwable {
                    final Method method = context.getMethod();
                    if (method.getDeclaringClass() == mediatorType) {
                        return GrapheneProxy.getProxyForFutureTarget(new FutureTarget() {
                            public Object getTarget() {
                                try {
                                    M unwrappedBase = ((GrapheneProxyInstance) base).unwrap();
                                    return method.invoke(unwrappedBase, context.getArguments());
                                } catch (Exception e) {
View Full Code Here

        }
    }

    protected final <T> List<T> createPageFragmentList(final Class<T> clazz, final SearchContext searchContext, final By rootBy) {
        GrapheneContext grapheneContext = ((GrapheneProxyInstance) searchContext).getContext();
        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++) {
View Full Code Here

            return ReflectionHelper.hasConstructor(clazz, outerClass);
        }
    }

    protected final <T> List<T> createPageFragmentList(final Class<T> clazz, final SearchContext searchContext, final By rootBy) {
        List<T> result = GrapheneProxy.getProxyForFutureTarget(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++) {
View Full Code Here

                @Override
                public Object intercept(final InvocationContext context) throws Throwable {
                    final Method method = context.getMethod();
                    if (method.getDeclaringClass() == mediatorType) {
                        return GrapheneProxy.getProxyForFutureTarget(new FutureTarget() {
                            public Object getTarget() {
                                try {
                                    M unwrappedBase = ((GrapheneProxyInstance) base).unwrap();
                                    return method.invoke(unwrappedBase, context.getArguments());
                                } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.jboss.arquillian.graphene.proxy.GrapheneProxy.FutureTarget

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.