diff options
author | Tor Norbye <tnorbye@google.com> | 2014-09-04 13:25:33 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2014-09-04 13:25:33 -0700 |
commit | d245f58efbfc26b13b9b9d5e52e6a83a0d76216c (patch) | |
tree | bca7d49005d81d10c70bc3f547df041c636b4300 /platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java | |
parent | 9cde0e3c015174898df8b8f3672185941fad4786 (diff) | |
parent | c3d3a90f6b4ead083d63e28e6b9fcea93d675678 (diff) | |
download | idea-d245f58efbfc26b13b9b9d5e52e6a83a0d76216c.tar.gz |
Merge remote-tracking branch 'aosp/upstream-master' into merge
Diffstat (limited to 'platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java')
-rw-r--r-- | platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java b/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java index 307fb65e5ef1..ee6e519cb583 100644 --- a/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java +++ b/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java @@ -52,6 +52,7 @@ import com.intellij.util.io.ZipUtil; import com.intellij.util.ui.UIUtil; import junit.framework.AssertionFailedError; import org.jdom.Element; +import org.jdom.JDOMException; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -752,6 +753,18 @@ public class PlatformTestUtil { } } + public static void assertElementEquals(final String expected, final Element actual) { + try { + assertElementsEqual(JDOMUtil.loadDocument(expected).getRootElement(), actual); + } + catch (IOException e) { + throw new AssertionError(e); + } + catch (JDOMException e) { + throw new AssertionError(e); + } + } + public static String printElement(final Element element) throws IOException { final StringWriter writer = new StringWriter(); JDOMUtil.writeElement(element, writer, "\n"); |