[arquillian-issues] [JBoss JIRA] (ARQGRA-245) Returning a value from Function<T, V> in WebDriverwait cannot be compiled with JDK7
Jan Papousek (JIRA)
jira-events at lists.jboss.org
Wed Jan 9 04:09:08 EST 2013
[ https://issues.jboss.org/browse/ARQGRA-245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12744288#comment-12744288 ]
Jan Papousek commented on ARQGRA-245:
-------------------------------------
It wasn't Selenium issue, but Graphene issue. I think it has been resolved by ARQGRA-249.
> Returning a value from Function<T,V> in WebDriverwait cannot be compiled with JDK7
> ----------------------------------------------------------------------------------
>
> Key: ARQGRA-245
> URL: https://issues.jboss.org/browse/ARQGRA-245
> Project: Arquillian Graphene
> Issue Type: Bug
> Components: core
> Affects Versions: 2.0.0.Alpha2
> Reporter: Karel Piwko
> Assignee: Jan Papousek
> Fix For: 2.0.0.Alpha3
>
> Attachments: WebElementUntilFunction.java
>
>
> When compiling with JDK7, following error happens:
> {code}
> @FindBy(className = "failed")
> WebElement failedCasesCount;
> @FindBy(className = "passed")
> WebElement passedCasesCount;
> @FindBy(className = "total")
> WebElement totalCasesCount;
> @FindBy(id = "qunit-tests")
> QUnitResultsFragment results;
> private URL pageUrl;
> private long timeout = 60;
> private TimeUnit unit = TimeUnit.SECONDS;
> private int getExecutionResult(WebElement element) {
> if (waitModel().withTimeout(timeout, unit).until(element(element).isPresent())) {
> return Integer.valueOf(element.getText());
> }
> throw new QUnitExecutionException(MessageFormat.format(
> "Unable to execute QUnit tests at {0} within {1}{2}, timeouted.",
> pageUrl, timeout, unit));
> }
> {code}
> {code}
> [WARNING] /home/kpiwko/devel/wfk/wfk-qa/build/drone-qunit-integration/src/main/java/org/jboss/arquillian/drone/qunit/QUnitPage.java:[80,65] [unchecked] unchecked call to <V>until(Function<? super T,V>) as a member of the raw type FluentWait
> [INFO] 1 warning
> [INFO] -------------------------------------------------------------
> [INFO] -------------------------------------------------------------
> [ERROR] COMPILATION ERROR :
> [INFO] -------------------------------------------------------------
> [ERROR]
> V extends Object declared in method <V>until(Function<? super T,V>)
> T extends Object declared in class FluentWait
> /home/kpiwko/devel/wfk/wfk-qa/build/drone-qunit-integration/src/main/java/org/jboss/arquillian/drone/qunit/QUnitPage.java:[80,65] error: incompatible types
> {code}
> Further investigation shows that:
> until() methods comes from Graphene
> withTimeout() comes from WebDriver
> withMessage() comes form WebDriver
> until(String) comes from Graphene and seems to be leftover from Graphene1 migration.
> The problematic part is about setting FLUENT generics to null as this cause ambiguity on JDK7.
> I'd prefer to decouple direct WebDriverWait of Graphene from WebDriverWait of WebDriver and rather use a delegate.
> That way we can create until(long,TimeUnit) or even withMessage(String), withTimeout(long,TimeUnit) methods which will be able to interfere types even on jdk7.
> Marking this issues a critical. There is no workaround how to set dynamically set wait while using Graphene on JDK7.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the arquillian-issues
mailing list