rh-openjdk / CryptoTest

Complete example of java crypto API
MIT License
3 stars 9 forks source link

Added KEMTests #51

Closed zzambers closed 1 year ago

zzambers commented 1 year ago

Adds tests class for KEM added in JDK21. Reflection is used for KEM classes, so that class is buildable on older JDKs.

judovana commented 1 year ago

the * @requires jdk.version.major >= 21 is fixing the older jk issu, so I would vote for not using reflection.

zzambers commented 1 year ago

@judovana problem is that *Tests are listed in @build of other tests (CryptoTest.java TestServices.java). I don't know a way to make building of these files conditional in jtreg based on jdk version. Also Makefile would have to be updated not to build this file on older jdks....

judovana commented 1 year ago

The makefile can be improved easily, and CryptoTest.java,TestServices.java may call it by reflection? Moreoer braisntorming...

zzambers commented 1 year ago

Reflection still needs this test class to be built on jdk 21. We would need to make build conditional somehow by jtreg. (but I don't know how) Makefile is doable.

zzambers commented 1 year ago

To do it without jtreg support on runtime, we would need to invoke java compiler from java (in CryptoTest.java, TestServices.java), than get it (KEMTests) on classpath of running VM somehow and only then call it by reflection (reflection is already used to get list of *Tests classes as far as I know).

judovana commented 1 year ago

gosh :) Nope:) nvm.. you looked deeper then my eyball. /me shutting up

pls, merge. ty!