diff options
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"); |