mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 05:22:22 +00:00
Secret class should be serialization forward compatible with Strnig.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@22381 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
704899683c
commit
8dd9f1bf42
2 files changed
+20
-1
No files matched your search
@@ -71,4 +71,19 @@ public class SecretTest extends TestCase {
|
||||
Object o = Hudson.XSTREAM.fromXML(xml);
|
||||
assertEquals(o,s);
|
||||
}
|
||||
|
||||
public static class Foo {
|
||||
Secret password;
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes sure the serialization form is backward compatible with String.
|
||||
*/
|
||||
public void testCompatibilityFromString() {
|
||||
String tagName = Foo.class.getName().replace("$","-");
|
||||
String xml = "<"+tagName+"><password>secret</password></"+tagName+">";
|
||||
Foo foo = new Foo();
|
||||
Hudson.XSTREAM.fromXML(xml, foo);
|
||||
assertEquals("secret",foo.password.toString());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user