-
Notifications
You must be signed in to change notification settings - Fork 370
Implemented Record test and it succeeds in Java 17 environment. #525
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
base: java-17
Are you sure you want to change the base?
Conversation
Updated Added support for accessor methods of records in Added logic to identify records and manage sealed class inheritance in Updated to support bytecode execution of record-related instructions in |
Hi, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in build.gradle
result in only one test being executed; please revert so the existing 1000+ tests are enabled again.
Hey @cyrille-artho I worked on your suggestions. Now, my 'record' implementation doesn't affect other tests and they are enabled. |
Hi, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert src/classes/modules/java.base/jdk/internal/access/SharedSecrets.java
or find the reason why 50 tests now fail; see my comment to your PR.
Hi @cyrille-artho , I identified somethings that why 50 test cases fail. It is due to some missing dependencies in |
|
And failure of 49 test cases happened when I reverted to unmodified |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert the changes to SharedSecrets
, so most of the tests will pass again.
@@ -63,7 +63,7 @@ public class SharedSecrets { | |||
private static JavaObjectInputStreamAccess javaObjectInputStreamAccess; | |||
private static JavaObjectInputFilterAccess javaObjectInputFilterAccess; | |||
private static JavaObjectInputStreamReadString javaObjectInputStreamReadString; | |||
private static JavaSecurityPropertiesAccess javaSecurityPropertiesAccess; | |||
//private static JavaSecurityPropertiesAccess javaSecurityPropertiesAccess; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert these changes, as we need a more complete model class for SharedSecrets
to handle I/O etc.
Hi @cyrille-artho in my latest commit I have done the following modifications: Modified Modified Now, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your PR. It is necessary to use verifyNoPropertyViolation
to run the tests in JPF's VM rather than the host JVM (where they would trivially pass).
See https://github.com/javapathfinder/jpf-core/wiki/Writing-JPF-tests
@@ -27,25 +27,33 @@ public double perimeter() { | |||
|
|||
@Test | |||
public void testRecordCreation() { | |||
if (verifyNoPropertyViolation()) { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The line verifyNoPropertyViolation
is needed to run the unit test in the JPF VM; otherwise, it executes in the normal JVM and passes.
} | ||
|
||
@Test | ||
public void testRecordAccessors() { | ||
if (verifyNoPropertyViolation()) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please undo this change to run the test in JPF.
Hey @cyrille-artho in my new pr, the test case inside BasicRecordTest.java which is recordToString() now passes dynamically. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
Please see my earlier comments; you have to put if (verifyNoPropertyViolation())
back in the tests, or else the tests will run on the regular JVM (where they will pass).
To test the code in JPF's VM, this if
block is needed.
@@ -0,0 +1,3 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this file from the PR, as it is not related to it.
@@ -0,0 +1 @@ | |||
After. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this file (perhaps we should add it to .gitignore
).
@cyrille-artho the tests in the file like |
Yes, some functionality of records is not working yet with JPF. It's therefore OK if some tests fail on branch |
Yes @cyrille-artho I only worked towards recordToString() functionality only till now to make a strong impression for the proposal. I will now continue working towards other record functionality like hashcode. And then move to other functionalities like sealed classes. |
Created RecordTest.java which runs successfully.