Skip to content

Commit e0f87c6

Browse files
committed
trying to reproduce #366
1 parent 4f3c165 commit e0f87c6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/test/java/com/fasterxml/jackson/databind/node/TestObjectNode.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,4 +290,23 @@ public void testFailOnDupKeys() throws Exception
290290
verifyException(e, "duplicate field 'a'");
291291
}
292292
}
293+
294+
public void testEqualityWrtOrder() throws Exception
295+
{
296+
ObjectNode ob1 = MAPPER.createObjectNode();
297+
ObjectNode ob2 = MAPPER.createObjectNode();
298+
299+
// same contents, different insertion order; should not matter
300+
301+
ob1.put("a", 1);
302+
ob1.put("b", 2);
303+
ob1.put("c", 3);
304+
305+
ob2.put("b", 2);
306+
ob2.put("c", 3);
307+
ob2.put("a", 1);
308+
309+
assertTrue(ob1.equals(ob2));
310+
assertTrue(ob2.equals(ob1));
311+
}
293312
}

0 commit comments

Comments
 (0)