diff --git a/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java b/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java index 1d7f88d76b4d..58ac9cbd657a 100644 --- a/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java +++ b/platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java @@ -140,7 +140,7 @@ public class PlatformTestUtil { } @Nullable - protected static String toString(@Nullable Object node, @Nullable Queryable.PrintInfo printInfo) { + private static String toString(@Nullable Object node, @Nullable Queryable.PrintInfo printInfo) { if (node instanceof AbstractTreeNode) { if (printInfo != null) { return ((AbstractTreeNode)node).toTestString(printInfo); @@ -169,7 +169,7 @@ public class PlatformTestUtil { return print(tree, tree.getModel().getRoot(), withSelection, null, nodePrintCondition); } - public static String print(JTree tree, Object root, + private static String print(JTree tree, Object root, boolean withSelection, @Nullable Queryable.PrintInfo printInfo, @Nullable Condition nodePrintCondition) { @@ -181,13 +181,7 @@ public class PlatformTestUtil { return buffer.toString(); } - public static Collection printAsList(JTree tree, boolean withSelection, @Nullable Condition nodePrintCondition) { - return printAsList(tree, tree.getModel().getRoot(), withSelection, null, nodePrintCondition); - } - - private static Collection printAsList(JTree tree, Object root, - boolean withSelection, - @Nullable Queryable.PrintInfo printInfo, + private static Collection printAsList(JTree tree, Object root, boolean withSelection, @Nullable Queryable.PrintInfo printInfo, Condition nodePrintCondition) { Collection strings = new ArrayList<>(); printImpl(tree, root, strings, 0, withSelection, printInfo, nodePrintCondition); @@ -248,7 +242,9 @@ public class PlatformTestUtil { } public static void assertTreeEqualIgnoringNodesOrder(JTree tree, @NonNls String expected) { - assertTreeEqualIgnoringNodesOrder(tree, expected, false); + final Collection actualNodesPresentation = printAsList(tree, tree.getModel().getRoot(), false, null, null); + final List expectedNodes = StringUtil.split(expected, "\n"); + UsefulTestCase.assertSameElements(actualNodesPresentation, expectedNodes); } public static void assertTreeEqual(JTree tree, String expected, boolean checkSelected) { @@ -256,12 +252,6 @@ public class PlatformTestUtil { Assert.assertEquals(expected, treeStringPresentation); } - public static void assertTreeEqualIgnoringNodesOrder(JTree tree, String expected, boolean checkSelected) { - final Collection actualNodesPresentation = printAsList(tree, checkSelected, null); - final List expectedNodes = StringUtil.split(expected, "\n"); - UsefulTestCase.assertSameElements(actualNodesPresentation, expectedNodes); - } - @TestOnly public static void waitForAlarm(final int delay) throws InterruptedException { Application app = ApplicationManager.getApplication();