better diagnostics

This commit is contained in:
Dmitry Avdeev
2012-09-25 21:09:41 +04:00
parent b57dec18ce
commit 66dce2e94b
2 changed files with 8 additions and 4 deletions
@@ -263,16 +263,20 @@ public class InspectionProfileTest extends LightIdeaTestCase {
}
public static int countInitializedTools(Profile foo) {
int i = 0;
return getInitializedTools(foo).size();
}
public static List<InspectionProfileEntry> getInitializedTools(Profile foo) {
List<InspectionProfileEntry> initialized = new ArrayList<InspectionProfileEntry>();
List<ScopeToolState> tools = ((InspectionProfileImpl)foo).getAllTools();
for (ScopeToolState tool : tools) {
InspectionProfileEntry entry = tool.getTool();
assertTrue(entry instanceof InspectionToolWrapper);
if (entry.isInitialized()) {
i++;
initialized.add(entry);
}
}
return i;
return initialized;
}
private static LocalInspectionToolWrapper createTool(String s) {
@@ -44,7 +44,7 @@ public class SingleInspectionProfilePanelTest extends LightIdeaTestCase {
SingleInspectionProfilePanel panel = new SingleInspectionProfilePanel(profileManager, PROFILE, model);
panel.setVisible(true);
panel.reset();
assertEquals(0, InspectionProfileTest.countInitializedTools(model));
assertEquals(InspectionProfileTest.getInitializedTools(model).toString(), 0, InspectionProfileTest.countInitializedTools(model));
LocalInspectionToolWrapper wrapper = (LocalInspectionToolWrapper)model.getInspectionTool(myInspection.getShortName());
assert wrapper != null;