Multibit-Legacy / multibit

Deprecated Bitcoin Wallet
https://multibit.org
MIT License
455 stars 392 forks source link

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project multibit: There are test failures. #816

Closed FabioNevesRezende closed 2 years ago

FabioNevesRezende commented 2 years ago

trying to build as described in readme failing with the following error message:


Tests in error: 
  testEncryptOpenSSLDecryptJava(org.multibit.crypto.KeyCrypterOpenSSLTest): Could not decrypt input string

Tests run: 138, Failures: 1, Errors: 1, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  03:37 min
[INFO] Finished at: 2021-08-30T18:06:05-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project multibit: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/fabio/Downloads/pacotes/multibit-0.5.19/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

in KeyCrypterOpenSSLTest.txt:

$ cat target/surefire-reports/org.multibit.crypto.KeyCrypterOpenSSLTest.txt
// lots of nonprintable characters followed by stack trace:

at junit.framework.Assert.assertEquals(Assert.java:81)
        at junit.framework.Assert.assertEquals(Assert.java:87)
        at org.multibit.crypto.KeyCrypterOpenSSLTest.testEncryptJavaDecryptOpenSSL(KeyCrypterOpenSSLTest.java:174)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at junit.framework.TestCase.runTest(TestCase.java:168)
        at junit.framework.TestCase.runBare(TestCase.java:134)
        at junit.framework.TestResult$1.protect(TestResult.java:110)
        at junit.framework.TestResult.runProtected(TestResult.java:128)
        at junit.framework.TestResult.run(TestResult.java:113)
        at junit.framework.TestCase.run(TestCase.java:124)
        at junit.framework.TestSuite.runTest(TestSuite.java:243)
        at junit.framework.TestSuite.run(TestSuite.java:238)
        at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
        at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
        at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

testEncryptOpenSSLDecryptJava(org.multibit.crypto.KeyCrypterOpenSSLTest)  Time elapsed: 0 sec  <<< ERROR!
com.google.bitcoin.crypto.KeyCrypterException: Could not decrypt input string
        at org.multibit.crypto.KeyCrypterOpenSSL.decrypt(KeyCrypterOpenSSL.java:226)
        at org.multibit.crypto.KeyCrypterOpenSSLTest.testEncryptOpenSSLDecryptJava(KeyCrypterOpenSSLTest.java:220)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at junit.framework.TestCase.runTest(TestCase.java:168)
        at junit.framework.TestCase.runBare(TestCase.java:134)
        at junit.framework.TestResult$1.protect(TestResult.java:110)
        at junit.framework.TestResult.runProtected(TestResult.java:128)
        at junit.framework.TestResult.run(TestResult.java:113)
        at junit.framework.TestCase.run(TestCase.java:124)
        at junit.framework.TestSuite.runTest(TestSuite.java:243)
        at junit.framework.TestSuite.run(TestSuite.java:238)
        at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
        at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
        at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: com.google.bitcoin.crypto.KeyCrypterException: Could not decrypt input string
        at org.multibit.crypto.KeyCrypterOpenSSL.decrypt(KeyCrypterOpenSSL.java:262)
        at org.multibit.crypto.KeyCrypterOpenSSL.decrypt(KeyCrypterOpenSSL.java:222)
        ... 26 more
Caused by: org.spongycastle.crypto.InvalidCipherTextException: pad block corrupted
        at org.spongycastle.crypto.paddings.PKCS7Padding.padCount(PKCS7Padding.java:63)
        at org.spongycastle.crypto.paddings.PaddedBufferedBlockCipher.doFinal(PaddedBufferedBlockCipher.java:286)
        at org.multibit.crypto.KeyCrypterOpenSSL.decrypt(KeyCrypterOpenSSL.java:258)
        ... 27 more
FabioNevesRezende commented 2 years ago

the output of mvn clean install, I just changed the

17:33:54.962 [main] ERROR c.g.bitcoin.core.AbstractBlockChain - Failed to verify block:  com.google.bitcoin.core.VerificationException: Hash is higher than target: d78f4ebbf19f690d4a3f53837a9956dbb617c6720ccf02aee97f58a25f386f13 vs 7fffff0000000000000000000000000000000000000000000000000000000000
     at com.google.bitcoin.core.Block.checkProofOfWork(Block.java:652) ~[bitcoinj-0.11.2-MB-ALICE.jar:na]
     at com.google.bitcoin.core.Block.verifyHeader(Block.java:772) ~[bitcoinj-0.11.2-MB-ALICE.jar:na]
     at com.google.bitcoin.core.AbstractBlockChain.add(AbstractBlockChain.java:374) ~[bitcoinj-0.11.2-MB-ALICE.jar:na]
     at com.google.bitcoin.core.AbstractBlockChain.add(AbstractBlockChain.java:252) ~[bitcoinj-0.11.2-MB-ALICE.jar:na]
     at com.google.bitcoin.core.MultiBitBlockChainTest.merkleRoots(MultiBitBlockChainTest.java:121) ~[test-classes/:na]
     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
     at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
     at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) ~[junit-4.8.2.jar:na]
     at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) ~[junit-4.8.2.jar:na]
     at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) ~[junit-4.8.2.jar:na]
     at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) ~[junit-4.8.2.jar:na]
     at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) ~[junit-4.8.2.jar:na]
     at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79) ~[junit-4.8.2.jar:na]
     at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71) ~[junit-4.8.2.jar:na]
     at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) ~[junit-4.8.2.jar:na]
     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) ~[junit-4.8.2.jar:na]
     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) ~[junit-4.8.2.jar:na]
     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) ~[junit-4.8.2.jar:na]
     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) ~[junit-4.8.2.jar:na]
     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) ~[junit-4.8.2.jar:na]
     at org.junit.runners.ParentRunner.run(ParentRunner.java:236) ~[junit-4.8.2.jar:na]
     at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252) ~[na:na]
     at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141) ~[na:na]
     at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112) ~[na:na]
     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
     at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
     at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) ~[surefire-api-2.12.4.jar:2.12.4]
     at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) ~[surefire-booter-2.12.4.jar:2.12.4]
     at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) ~[surefire-booter-2.12.4.jar:2.12.4]
     at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115) ~[surefire-booter-2.12.4.jar:2.12.4]
     at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75) ~[surefire-booter-2.12.4.jar:2.12.4]

17:33:54.963 [main] ERROR c.g.bitcoin.core.AbstractBlockChain - d78f4ebbf19f690d4a3f53837a9956dbb617c6720ccf02aee97f58a25f386f13 
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.186 sec

Results :

Failed tests:   testEncryptJavaDecryptOpenSSL(org.multibit.crypto.KeyCrypterOpenSSLTest): null expected:<[0 The quick brown fox jumps over the lazy dog. 01234567890 !@#$%^&*()-=[]{};':|`~,./<>?1 The quick brown fox jumps over the lazy dog. 01234567890 !@#$%^&*()-=[]{};':...................and repeated this a lot of times, trimmed....................> but was:<[�WչTP�f?/���;�'��e#��|��(..)

Tests in error: 
  testEncryptOpenSSLDecryptJava(org.multibit.crypto.KeyCrypterOpenSSLTest): Could not decrypt input string

Tests run: 138, Failures: 1, Errors: 1, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:59 min
[INFO] Finished at: 2021-08-31T17:33:56-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project multibit: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/user/Downloads/pacotes/multibit-0.5.19/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
FabioNevesRezende commented 2 years ago

Solved by adding the flag -md md5 to the openssl tests in KeyCrypterOpenSSLTest