Examples of PageFragmentInitializationException


Examples of org.jboss.arquillian.graphene.enricher.exception.PageFragmentInitializationException

                try {
                    if (field.getType().isAssignableFrom(List.class) && isPageFragmentClass(getListType(field))) {
                        setupPageFragmentList(searchContext, target, field);
                    }
                } catch (ClassNotFoundException e) {
                    throw new PageFragmentInitializationException(e.getMessage(), e);
                }
            }
        }
    }
View Full Code Here

Examples of org.jboss.arquillian.graphene.enricher.exception.PageFragmentInitializationException

    protected final <T> T createPageFragment(Class<T> clazz, WebElement root) {
        try {
            T pageFragment = instantiate(clazz);
            List<Field> roots = ReflectionHelper.getFieldsWithAnnotation(clazz, Root.class);
            if (roots.size() > 1) {
                throw new PageFragmentInitializationException("The Page Fragment " + NEW_LINE + pageFragment.getClass()
                    + NEW_LINE + " can not have more than one field annotated with Root annotation!"
                    + "Your fields with @Root annotation: " + roots + NEW_LINE);
            }
            if (roots.size() == 1) {
                setValue(roots.get(0), pageFragment, root);
            }
            enrichRecursively(root, pageFragment);
            return pageFragment;
        } catch (NoSuchMethodException ex) {
            throw new PageFragmentInitializationException(" Check whether declared Page Fragment has no argument constructor!",
                ex);
        } catch (IllegalAccessException ex) {
            throw new PageFragmentInitializationException(
                " Check whether declared Page Fragment has public no argument constructor!", ex);
        } catch (InstantiationException ex) {
            throw new PageFragmentInitializationException(
                " Check whether you did not declare Page Fragment with abstract type!", ex);
        } catch (Exception ex) {
            throw new PageFragmentInitializationException(ex);
        }
    }
View Full Code Here

Examples of org.jboss.arquillian.graphene.enricher.exception.PageFragmentInitializationException

    protected final void setupPageFragmentList(SearchContext searchContext, Object target, Field field)
        throws ClassNotFoundException {
        By rootBy = FindByUtilities.getCorrectBy(field);
        if (rootBy == null) {
            throw new PageFragmentInitializationException("Your declaration of Page Fragment in test "
                + field.getDeclaringClass().getName() + " is annotated with @FindBy without any "
                + "parameters, in other words without reference to root of the particular Page Fragment on the page!"
                + NEW_LINE);
        }
        List<?> pageFragments = createPageFragmentList(getListType(field), searchContext, rootBy);
View Full Code Here

Examples of org.jboss.arquillian.graphene.enricher.exception.PageFragmentInitializationException

    }

    protected final void setupPageFragment(SearchContext searchContext, Object target, Field field) {
        By rootBy = FindByUtilities.getCorrectBy(field);
        if (rootBy == null) {
            throw new PageFragmentInitializationException("Your declaration of Page Fragment in test "
                + field.getDeclaringClass().getName() + " is annotated with @FindBy without any "
                + "parameters, in other words without reference to root of the particular Page Fragment on the page!"
                + NEW_LINE);
        }
        WebElement root = createWebElement(rootBy, searchContext);
View Full Code Here

Examples of org.jboss.arquillian.graphene.enricher.exception.PageFragmentInitializationException

                try {
                    if (field.getType().isAssignableFrom(List.class) && isPageFragmentClass(getListType(field), target)) {
                        setupPageFragmentList(localSearchContext, target, field);
                    }
                } catch (ClassNotFoundException e) {
                    throw new PageFragmentInitializationException(e.getMessage(), e);
                }
            }
        }
    }
View Full Code Here

Examples of org.jboss.arquillian.graphene.enricher.exception.PageFragmentInitializationException

        try {
            GrapheneContext grapheneContext = ((GrapheneProxyInstance) root).getContext();
            T pageFragment = null;

            if (Modifier.isFinal(clazz.getModifiers())) {
                throw new PageFragmentInitializationException("Page Fragment must not be final class. It is, your "
                    + clazz + ", declared in: " + clazz);
            }

            if (isAboutToDelegateToWebElement(clazz)) {
                pageFragment = createProxyDelegatingToRoot(root, clazz);
            } else {
                pageFragment = instantiate(clazz);
            }
            List<Field> roots = new LinkedList<Field>();
            roots.addAll(ReflectionHelper.getFieldsWithAnnotation(clazz, Root.class));
            if (roots.size() > 1) {
                throw new PageFragmentInitializationException("The Page Fragment " + NEW_LINE + pageFragment.getClass()
                    + NEW_LINE + " can not have more than one field annotated with Root annotation!"
                    + "Your fields with @Root annotation: " + roots + NEW_LINE);
            }
            if (roots.size() == 1) {
                setValue(roots.get(0), pageFragment, root);
            }
            enrichRecursively(root, pageFragment);
            T proxy = GrapheneProxy.getProxyForHandler(GrapheneContextualHandler.forTarget(grapheneContext, pageFragment),
                clazz);
            enrichRecursively(root, proxy); // because of possibility of direct access to attributes from test class
            return proxy;
        } catch (NoSuchMethodException ex) {
            throw new PageFragmentInitializationException(" Check whether declared Page Fragment has no argument constructor!",
                ex);
        } catch (IllegalAccessException ex) {
            throw new PageFragmentInitializationException(
                " Check whether declared Page Fragment has public no argument constructor!", ex);
        } catch (InstantiationException ex) {
            throw new PageFragmentInitializationException(
                " Check whether you did not declare Page Fragment with abstract type!", ex);
        } catch (Exception ex) {
            throw new PageFragmentInitializationException(ex);
        }
    }
View Full Code Here

Examples of org.jboss.arquillian.graphene.enricher.exception.PageFragmentInitializationException

                try {
                    if (field.getType().isAssignableFrom(List.class) && isPageFragmentClass(getListType(field))) {
                        setupPageFragmentList(searchContext, target, field);
                    }
                } catch (ClassNotFoundException e) {
                    throw new PageFragmentInitializationException(e.getMessage(), e);
                }
            }
        }
    }
View Full Code Here

Examples of org.jboss.arquillian.graphene.enricher.exception.PageFragmentInitializationException

    public static final <T> T createPageFragment(Class<T> clazz, WebElement root) {
        try {
            T pageFragment = instantiate(clazz);
            List<Field> roots = ReflectionHelper.getFieldsWithAnnotation(clazz, Root.class);
            if (roots.size() > 1) {
                throw new PageFragmentInitializationException("The Page Fragment " + NEW_LINE + pageFragment.getClass()
                        + NEW_LINE + " can not have more than one field annotated with Root annotation!"
                        + "Your fields with @Root annotation: " + roots + NEW_LINE);
            }
            if (roots.size() == 1) {
                setValue(roots.get(0), pageFragment, root);
            }
            enrichRecursively(root, pageFragment);
            return pageFragment;
        } catch (NoSuchMethodException ex) {
            throw new PageFragmentInitializationException(" Check whether declared Page Fragment has no argument constructor!",
                    ex);
        } catch (IllegalAccessException ex) {
            throw new PageFragmentInitializationException(
                    " Check whether declared Page Fragment has public no argument constructor!", ex);
        } catch (InstantiationException ex) {
            throw new PageFragmentInitializationException(
                    " Check whether you did not declare Page Fragment with abstract type!", ex);
        } catch (Exception ex) {
            throw new PageFragmentInitializationException(ex);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.