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

test failed locally #25

Closed
BryceLee opened this issue Mar 24, 2020 · 4 comments
Closed

test failed locally #25

BryceLee opened this issue Mar 24, 2020 · 4 comments
Labels
good first issue Good for newcomers

Comments

@BryceLee
Copy link
Contributor

BryceLee commented Mar 24, 2020

Tests in error:
test_fis(com.gxk.jvm.builtin.JavaIoTest)

Test success after deleting the method.(Jvm-core/src/test/java/com.gxk.jvm.builtin.JavaIoTest.test_fis)

@BryceLee BryceLee changed the title 本地开发,简单测试错误 east test failed locally Mar 24, 2020
@BryceLee BryceLee changed the title east test failed locally test failed locally Mar 24, 2020
@guxingke
Copy link
Owner

use mvn package .

jvm-core module with mvn test phase depends on examle/target/example.jar .

@BryceLee
Copy link
Contributor Author

@guxingke can Build Success but I can't.
The reason is the different JDK version:
my version is “1.8.0_121” and java.io.FileInputStream#available() is a native method.
But the author's JDK version is 1.8.192 and java.io.FileInputStream#available() is not a native method.
For making the project clear and small, The project will not adapt this
So the better method of learning this project is that making your environment like these: maven 3.3.9, Jdk 1.8.192 and on the MacOSX.

@BryceLee
Copy link
Contributor Author

BryceLee commented Mar 24, 2020

I download the latest JDK version 1.8.241 , build Success.

@guxingke guxingke added the good first issue Good for newcomers label Mar 24, 2020
@AlienwareHe
Copy link

if you don't want to update jdk, another solution:

Manually doRegister FileInputStream#skip and FileInputStream#available for native methods before jdk1.8.192 in mini JVM. For example:

MetaSpace.registerMethod("java/io/FileInputStream_available_()I", frame -> {
      KObject thisObj = frame.popRef();
      FileInputStream extra = (FileInputStream) thisObj.getExtra();
      try {
        int available = extra.available();
        frame.pushInt(available);
      } catch (IOException e) {
        throw new UnsupportedOperationException();
      }
    });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants