summaryrefslogtreecommitdiff
path: root/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2014-09-04 13:24:04 -0700
committerTor Norbye <tnorbye@google.com>2014-09-04 13:24:04 -0700
commitc3d3a90f6b4ead083d63e28e6b9fcea93d675678 (patch)
treefc0dcd722b6d445468dbe7dad13b4c11781b1cbe /platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java
parent1aa2e09bdbd413eacb677e9fa4b50630530d0656 (diff)
downloadidea-c3d3a90f6b4ead083d63e28e6b9fcea93d675678.tar.gz
Snapshot idea/138.1980 from git://git.jetbrains.org/idea/community.git
Change-Id: Ib567c9c152d770212a7a3db20fbf591c210920bd
Diffstat (limited to 'platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java')
-rw-r--r--platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java13
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");