Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix el issue 194 #1159

Closed
wants to merge 2 commits into from
Closed

Conversation

markt-asf
Copy link
Contributor

Fixes Issue
jakartaee/expression-language#194

Related Issue(s)
None

Describe the change
There are two parts to this PR

  • fix 2 tests that weren't testing what was intended to be tested (both old and new tests should pass on a specification compliant implementation)
  • add one additional test to expand the test coverage in this area

Additional context
None

CC @alwin-joseph @anajosep @arjantijms @cesarhernandezgt @dblevins @m0mus @edbratt @gurunrao @jansupol @jgallimore @kazumura @kwsutter @LanceAndersen @bhatpmk @RohitKumarJain @shighbar @gthoman @brideck @OndroMih @dmatej
@starksm64 @scottmarlow

The third (elp2) and fourth (elp3) tests weren't testing what was
intended.
The result from this test may be unexpected. See the note in the block
comment just above the test.
@alwin-joseph
Copy link
Contributor

alwin-joseph commented Apr 20, 2023

I tried testing this in local by copying the changes in this PR manually over #1164. I was getting below when run with glassfish 7.

java.lang.Exception: jakarta.el.ELException: Problems calling function 'testPredicateLong'
        at com.sun.ts.tests.el.spec.coercion.ELClientIT.elCoerceLambdaExpressionToFunctionalInterfaceTest(ELClientIT.java:1856)
Caused by: jakarta.el.ELException: Problems calling function 'testPredicateLong'
        at com.sun.ts.tests.el.spec.coercion.ELClientIT.elCoerceLambdaExpressionToFunctionalInterfaceTest(ELClientIT.java:1837)
Caused by: jakarta.el.ELException: java.lang.ClassCastException: class java.lang.String cannot be cast to class java.lang.Long (java.lang.String and java.lang.Long are in module java.base of loader 'bootstrap')
        at com.sun.ts.tests.el.spec.coercion.ELClientIT.testPredicateLong(ELClientIT.java:1884)
        at com.sun.ts.tests.el.spec.coercion.ELClientIT.elCoerceLambdaExpressionToFunctionalInterfaceTest(ELClientIT.java:1837)
Caused by: java.lang.ClassCastException: class java.lang.String cannot be cast to class java.lang.Long (java.lang.String and java.lang.Long are in module java.base of loader 'bootstrap')
        at com.sun.ts.tests.el.spec.coercion.ELClientIT.testPredicateLong(ELClientIT.java:1884)
        at com.sun.ts.tests.el.spec.coercion.ELClientIT.elCoerceLambdaExpressionToFunctionalInterfaceTest(ELClientIT.java:1837)

Not sure if I did anything wrong. Can you help confirm if this change works for other implementations or need any other change to pass (or applicable only for EL 6.0?)

@markt-asf
Copy link
Contributor Author

This change is intended for EL 6.0 / Jakarta 11 onwards since it changes what is being tested. Compatible Jakarta EE 10 implementations should pass the updated tests but it is possible that they do not.

@markt-asf
Copy link
Contributor Author

To update this, I am running the EL tests from the refactored branch against Tomcat and I am seeing test failures. I'm not sure what the root cause is yet.

@alwin-joseph
Copy link
Contributor

To update this, I am running the EL tests from the refactored branch against Tomcat and I am seeing test failures. I'm not sure what the root cause is yet.

Based on my run with Glassfish8 (jakarta.el-api.version 6.0.0-M1) ELClientIT.elCoerceLambdaExpressionToFunctionalInterfaceTest is the only failure with below exception. Do you see any other failures ?

java.lang.Exception: jakarta.el.ELException: Problems calling function 'testPredicateLong'
        at com.sun.ts.tests.el.spec.coercion.ELClientIT.elCoerceLambdaExpressionToFunctionalInterfaceTest(ELClientIT.java:1856)
Caused by: jakarta.el.ELException: Problems calling function 'testPredicateLong'
        at com.sun.ts.tests.el.spec.coercion.ELClientIT.elCoerceLambdaExpressionToFunctionalInterfaceTest(ELClientIT.java:1837)
Caused by: jakarta.el.ELException: java.lang.ClassCastException: class java.lang.String cannot be cast to class java.lang.Long (java.lang.String and java.lang.Long are in module java.base of loader 'bootstrap')
        at com.sun.ts.tests.el.spec.coercion.ELClientIT.testPredicateLong(ELClientIT.java:1884)
        at com.sun.ts.tests.el.spec.coercion.ELClientIT.elCoerceLambdaExpressionToFunctionalInterfaceTest(ELClientIT.java:1837)
Caused by: java.lang.ClassCastException: class java.lang.String cannot be cast to class java.lang.Long (java.lang.String and java.lang.Long are in module java.base of loader 'bootstrap')
        at com.sun.ts.tests.el.spec.coercion.ELClientIT.testPredicateLong(ELClientIT.java:1884)
        at com.sun.ts.tests.el.spec.coercion.ELClientIT.elCoerceLambdaExpressionToFunctionalInterfaceTest(ELClientIT.java:1837)

@markt-asf
Copy link
Contributor Author

Yes, that is the failure. Assuming that a further PR is going to be required, do you want it against master or tckrefactor?

@markt-asf
Copy link
Contributor Author

And on the subject of tckrefactor, are there any plans to move the EL TCK to the EL project?

@alwin-joseph
Copy link
Contributor

Yes, that is the failure. Assuming that a further PR is going to be required, do you want it against master or tckrefactor?

New PR against tckrefactor will be convenient.

The current plan is to stage a new refactored EL TCK from tckrefactor branch for EE11.

@markt-asf
Copy link
Contributor Author

ACK. Expect some new PRs shortly. I think this one can be closed unless you need to keep it open for any reason.

@alwin-joseph
Copy link
Contributor

And on the subject of tckrefactor, are there any plans to move the EL TCK to the EL project?

There are no plans as of now, but after the refactoring it should be easier to move the standalone EL sources to a different repository. The same EL tests are also run as part of platform TCK in servlet & JSP containers , we have not found the right approach to refactor such runs yet. Until that IMHO it would be apt to keep these tests in this repository.

ACK. Expect some new PRs shortly. I think this one can be closed unless you need to keep it open for any reason.

Thanks! Yes, this PR can be closed.

@markt-asf
Copy link
Contributor Author

Remaining work completed via #1215

@markt-asf markt-asf closed this Jan 11, 2024
@markt-asf markt-asf deleted the fix-el-issue-194 branch January 15, 2024 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants