Open GoogleCodeExporter opened 8 years ago
Try to use @PowerMockIgnore("javax.security.auth.*")
Original comment by johan.ha...@gmail.com
on 31 Oct 2011 at 7:18
Thank you for the quick replying. But after adding @PowerMockIgnore, I got:
JUnit version 4.8.2
.java.security.NoSuchAlgorithmException: DES SecretKeyFactory not available
at javax.crypto.SecretKeyFactory.<init>(DashoA13*..)
at javax.crypto.SecretKeyFactory.getInstance(DashoA13*..)
at powerMockTest.EncryptUsage.<init>(EncryptUsage.java:11)
at powerMockTest.TestEncryptedFileUtil.constructorTest(TestEncryptedFileUtil.java:20)
...
Original comment by xinweic...@gmail.com
on 31 Oct 2011 at 11:21
since I do test the encryption part, the defer loading of security package
doesn't help here.
Knowing nothing about what's inside powermock, I still tried to debug its code
until reach the calling to javaassit's (3.15-GA) CtClass.toBytecode for the
class javax.security.auth.x500.X500Principal. The following
ClassLoader.defineClass failed with ClassFormatError, and actually before that,
calling CtClass.toClass failed with the same error. The byte[] are correct, and
the separate test of javaassit's CtClass has no problem.
Then I stopped. Johan, please help take a look. Thank you very much.
Original comment by xinweic...@gmail.com
on 3 Nov 2011 at 5:29
I appreciate your help in trying to figure things out, I know it's not always
easy. Unfortunately I don't have the time needed to investigate such complex
things. I'm maintaining PowerMock totally in my spare time and it takes a great
amount time as it is. Sorry :/
Original comment by johan.ha...@gmail.com
on 3 Nov 2011 at 7:59
[deleted comment]
I had the same issue with PomerMockRunner and the same error:
XYZ SecretKeyFactory not available
adding
@PowerMockIgnore( {..... , "javax.crypto.*" })
solved the issue for me, and the SecretKeyFactory.getInstance() starting
working for me.
Original comment by com...@gmail.com
on 26 Sep 2012 at 9:50
Thanks for sharing
Original comment by johan.ha...@gmail.com
on 27 Sep 2012 at 6:08
Original issue reported on code.google.com by
xinweic...@gmail.com
on 28 Oct 2011 at 9:54