@@ -94,49 +94,4 @@ private static void compareActualVsExpectedObjects(Object value,
9494 value .toString ().equals (expectedValue .toString ()));
9595 }
9696 }
97-
98- /**
99- * Sometimes test completion requires comparison of JSONArray objects that
100- * were produced from a JSONObject, and so unordered. This method is
101- * imperfect since it only compares the array elements and won't catch
102- * JSON syntax errors but at least it does not rely on ordering
103- * <p>
104- * It is expected that the arrays to be compared come from JSONArray
105- * instances which have been rendered by toString(), and whose syntax
106- * chars have been removed.
107- * <p>
108- * TODO: why are we not simply comparing the JSONArrays?
109- * <p>
110- * @param names an array of strings for comparison
111- * @param expectedNames the other array of strings for comparison
112- */
113- public static void compareActualVsExpectedStringArrays (String [] names ,
114- String [] expectedNames ) {
115- assertTrue ("Array lengths should be equal" ,
116- names .length == expectedNames .length );
117- List <String > lNames = new ArrayList <String >(Arrays .asList (names ));
118- for (int i = 0 ; i < expectedNames .length ; ++i ) {
119- String expectedName = expectedNames [i ];
120- assertTrue ("expected to find " +expectedName ,
121- lNames .contains (expectedName ));
122- lNames .remove (expectedName );
123- }
124- }
125-
126- /**
127- * This is stopgap test utility. It is meant to compare strings
128- * of XML, but it does not take ordering into account and should
129- * not be expected to work correctly with complex XML.
130- * @param aXmlStr an XML doc to be compared
131- * @param bXmlStr the other XML doc to be compared
132- */
133- public static void compareXML (String aXmlStr , String bXmlStr ) {
134- // TODO For simple tests this may be adequate, but it won't work for
135- // elements with multiple attributes and possibly other cases as well.
136- // Should use XMLUnit or similar.
137- assertTrue ("expected equal XML strings \n aXmlStr: " +
138- aXmlStr + "\n bXmlStr: " +bXmlStr , aXmlStr .equals (bXmlStr ));
139-
140- }
141-
14297}
0 commit comments