-
Notifications
You must be signed in to change notification settings - Fork 228
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
PowerMockito & x-stream: handle multi part e-mail #13
Comments
Sorry for the delay, I was offline. Hmm. The Java specification requires that an Externalizable type has a public default constructor (see Javadoc of Externalizable):
Funny, that Oracle does not follow its specification with ActivationDataFlavor. Actually you're the first one who unmarshals this type 😏 I'll investigate ... |
Even better: Java IO fails also to deserialize an ActivationDataFlavor too:
|
Nice... Guess I should open a bug on the JDK then. |
Thanks for the quick fix! I also raised a bug @ Oracle, but that will take some time since I'm not a paying customer. It's currently pending review, I'll update this issue with the actual bug as soon as it is accepted. |
I'm trying to use this snapshot version, but it seems that the security permissions added to 1.4.7 are enabled per default on 1.5.0-SNAPSHOT? Is there an easy / quick way to turn those off? Since now I'm getting a lot of com.thoughtworks.xstream.security.ForbiddenClassException |
You should activate the security stuff also for 1.4.x. I am able to feed an XML into XStream wiping your hard disk (depends on the access rights of the Java process though). See http://x-stream.github.io/security.html and use a WildcardTypePermission for your types in production or an AnyTypePermission for tests without any limit. |
I said I would update this issue as soon as the bug was accepted... Unfortunately I didn't see the feedback from Oracle (or I didn't get it at all) when they accepted the bug, but here it is: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8139190 Now I need to find how I get them to fix it. Guess I should submit the patch myself. There is one other case that is not following the "spec" from Externalizable: https://docs.oracle.com/javase/8/docs/api/javax/management/loading/PrivateMLet.html |
I'm trying to write a unit test for an e-mail service I'm working on. It uses an enum and I'm trying to extend that enum in order to see how the code deals with a new enum value.
I'm trying to use powermockito for it and this uses x-stream on the background. First I ran into an java 8 issue, that is fixed in 1.4.8, so I updated x-stream to 1.4.8 to get around that one. But now I'm running into something that I'm not able to fix with just a library upgrade. The debug information from xstream is:
The text was updated successfully, but these errors were encountered: