Issue 59: Improve test to dump unsorted JavaBean properties
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index fd19336..526cf59 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -7,7 +7,7 @@
</properties>
<body>
<release version="1.8-SNAPSHOT" date="in Mercurial" description="Performance improvement">
- <action dev="py4fun" type="update" issue="60">
+ <action dev="py4fun" type="update" issue="59">
Simplify the way how the order of JavaBean properties is specified. Introduce
PropertyUtils.createPropertySet() method to be overridden when a specific order
is expected (2010-11-23)
diff --git a/src/test/java/org/yaml/snakeyaml/issues/issue60/CustomOrderTest.java b/src/test/java/org/yaml/snakeyaml/issues/issue60/CustomOrderTest.java
index 9abe748..49cd0d3 100644
--- a/src/test/java/org/yaml/snakeyaml/issues/issue60/CustomOrderTest.java
+++ b/src/test/java/org/yaml/snakeyaml/issues/issue60/CustomOrderTest.java
@@ -32,6 +32,7 @@
import org.yaml.snakeyaml.introspector.PropertyUtils;
import org.yaml.snakeyaml.representer.Representer;
+//issue 59
public class CustomOrderTest extends TestCase {
public void testReversedOrder() {
@@ -59,16 +60,16 @@
Yaml yaml = new Yaml(repr);
String output = yaml.dump(getBean());
// System.out.println(output);
- assertEquals(Util.getLocalResource("issues/issue60-3.yaml"), output);
+ assertEquals(Util.getLocalResource("issues/issue59-2.yaml"), output);
}
private class UnsortedPropertyUtils extends PropertyUtils {
@Override
protected Set<Property> createPropertySet(Class<? extends Object> type, BeanAccess bAccess)
throws IntrospectionException {
- Set<Property> result = new LinkedHashSet<Property>(getPropertiesMap(type, bAccess)
- .values());
- result.remove(result.iterator().next());// drop 'empty' property
+ Set<Property> result = new LinkedHashSet<Property>(getPropertiesMap(type,
+ BeanAccess.FIELD).values());
+ result.remove(result.iterator().next());// drop 'listInt' property
return result;
}
}
diff --git a/src/test/resources/issues/issue60-3.yaml b/src/test/resources/issues/issue59-2.yaml
similarity index 82%
rename from src/test/resources/issues/issue60-3.yaml
rename to src/test/resources/issues/issue59-2.yaml
index ba0806f..801d910 100644
--- a/src/test/resources/issues/issue60-3.yaml
+++ b/src/test/resources/issues/issue59-2.yaml
@@ -1,7 +1,7 @@
!!org.yaml.snakeyaml.issues.issue60.SkipBean
-listDate: null
-listInt: [null, 1, 2, 3]
listStr: [bar, null, foo, null]
+listDate: null
+empty: []
map: {}
-number: null
text: foo
+number: null
\ No newline at end of file