-
Notifications
You must be signed in to change notification settings - Fork 218
/
Collections09Test.java
37 lines (30 loc) · 1.16 KB
/
Collections09Test.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* Copyright (C) 2021 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
* style license a copy of which has been included with this distribution in
* the LICENSE.txt file.
*
* Created on 15. May 2021 by Joerg Schaible
*/
package com.thoughtworks.acceptance;
import java.util.List;
import com.thoughtworks.xstream.core.JVM;
public class Collections09Test extends AbstractAcceptanceTest {
public void testListFromListOf() {
xstream.allowTypes("java.util.CollSer");
final List<String> list = List.of("hi", "bye");
assertBothWays(list, String.format(""//
+ "<java.util.ImmutableCollections_-List%1$d resolves-to=\"java.util.CollSer\" serialization=\"custom\">\n"
+ " <java.util.CollSer>\n"
+ " <default>\n"
+ " <tag>1</tag>\n"
+ " </default>\n"
+ " <int>2</int>\n"
+ " <string>hi</string>\n"
+ " <string>bye</string>\n"
+ " </java.util.CollSer>\n"
+ "</java.util.ImmutableCollections_-List%1$d>", JVM.isVersion(11) ? 12 : 2));
}
}