From c233ae709e6d4c6da2296fc366e37de290935090 Mon Sep 17 00:00:00 2001 From: "John J. Aylward" Date: Thu, 27 Apr 2017 12:52:02 -0400 Subject: [PATCH] comment out second unreliable test --- src/test/java/org/json/junit/JSONMLTest.java | 43 ++++++++++---------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/src/test/java/org/json/junit/JSONMLTest.java b/src/test/java/org/json/junit/JSONMLTest.java index df5244d..8ece8e5 100644 --- a/src/test/java/org/json/junit/JSONMLTest.java +++ b/src/test/java/org/json/junit/JSONMLTest.java @@ -762,29 +762,30 @@ public class JSONMLTest { assertEquals("original JSON does not equal the new JSON",originalJson, newJson); } - /** - * Test texts taken from jsonml.org. Currently our implementation FAILS this conversion but shouldn't. - * Technically JsonML should be able to transform any valid xhtml document, but ours only supports - * standard XML entities, not HTML entities. - */ - @Test - public void testAttributeConversionReversabilityHTML() { - final String originalXml = "
#5D28D1Example text here
#AF44EF127310656
#AAD034 © 
"; - final String expectedJsonString = "[\"table\",{\"class\" : \"MyTable\",\"style\" : \"background-color:yellow\"},[\"tr\",[\"td\",{\"class\" : \"MyTD\",\"style\" : \"border:1px solid black\"},\"#550758\"],[\"td\",{\"class\" : \"MyTD\",\"style\" : \"background-color:red\"},\"Example text here\"]],[\"tr\",[\"td\",{\"class\" : \"MyTD\",\"style\" : \"border:1px solid black\"},\"#993101\"],[\"td\",{\"class\" : \"MyTD\",\"style\" : \"background-color:green\"},\"127624015\"]],[\"tr\",[\"td\",{\"class\" : \"MyTD\",\"style\" : \"border:1px solid black\"},\"#E33D87\"],[\"td\",{\"class\" : \"MyTD\",\"style\" : \"background-color:blue\"},\"\u00A0\",[\"span\",{ \"style\" : \"background-color:maroon\" },\"\u00A9\"],\"\u00A0\"]]]"; - final JSONArray json = JSONML.toJSONArray(originalXml,true); - final String actualJsonString = json.toString(); - - final String reverseXml = JSONML.toString(json); - assertNotEquals(originalXml, reverseXml); - - assertNotEquals(expectedJsonString, actualJsonString); - } - -// this test does not pass for the following reasons: +// these tests do not pass for the following reasons: // 1. Our XML parser does not handle generic HTML entities, only valid XML entities. Hence   -// or other HTML specific entities would fail on reversability +// or other HTML specific entities would fail on reversability // 2. Our JSON implementation for storing the XML attributes uses the standard unordered map. -// This means that can not be reversed reliably. +// This means that can not be reversed reliably. +// +// /** +// * Test texts taken from jsonml.org. Currently our implementation FAILS this conversion but shouldn't. +// * Technically JsonML should be able to transform any valid xhtml document, but ours only supports +// * standard XML entities, not HTML entities. +// */ +// @Test +// public void testAttributeConversionReversabilityHTML() { +// final String originalXml = "
#5D28D1Example text here
#AF44EF127310656
#AAD034 © 
"; +// final String expectedJsonString = "[\"table\",{\"class\" : \"MyTable\",\"style\" : \"background-color:yellow\"},[\"tr\",[\"td\",{\"class\" : \"MyTD\",\"style\" : \"border:1px solid black\"},\"#550758\"],[\"td\",{\"class\" : \"MyTD\",\"style\" : \"background-color:red\"},\"Example text here\"]],[\"tr\",[\"td\",{\"class\" : \"MyTD\",\"style\" : \"border:1px solid black\"},\"#993101\"],[\"td\",{\"class\" : \"MyTD\",\"style\" : \"background-color:green\"},\"127624015\"]],[\"tr\",[\"td\",{\"class\" : \"MyTD\",\"style\" : \"border:1px solid black\"},\"#E33D87\"],[\"td\",{\"class\" : \"MyTD\",\"style\" : \"background-color:blue\"},\"\u00A0\",[\"span\",{ \"style\" : \"background-color:maroon\" },\"\u00A9\"],\"\u00A0\"]]]"; +// final JSONArray json = JSONML.toJSONArray(originalXml,true); +// final String actualJsonString = json.toString(); +// +// final String reverseXml = JSONML.toString(json); +// assertNotEquals(originalXml, reverseXml); +// +// assertNotEquals(expectedJsonString, actualJsonString); +// } +// // /** // * Test texts taken from jsonml.org but modified to have XML entities only. // */